9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3head / time.h.3head
blob261e30bbc2edbb2684bdefcb09cc158a2bae4aa1
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
44 .\" Portions Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
45 .\" Copyright 2016 Joyent, Inc.
46 .\"
47 .TH TIME.H 3HEAD "Feb 5, 2008"
48 .SH NAME
49 time.h, time \- time types
50 .SH SYNOPSIS
51 .LP
52 .nf
53 #include <\fBtime.h\fR>
54 .fi
56 .SH DESCRIPTION
57 .LP
58 The <\fBtime.h\fR> header declares the structure \fBtm\fR, which includes the
59 following members:
60 .sp
61 .in +2
62 .nf
63 int tm_sec     /* seconds [0,60] */
64 int tm_min     /* minutes [0,59] */
65 int tm_hour    /* hour [0,23] */
66 int tm_mday    /* day of month [1,31] */
67 int tm_mon     /* month of year [0,11] */
68 int tm_year    /* years since 1900 */
69 int tm_wday    /* day of week [0,6] (Sunday =0) */
70 int tm_yday    /* day of year [0,365] */
71 int tm_isdst   /* daylight savings flag */
72 .fi
73 .in -2
75 .sp
76 .LP
77 The value of \fBtm_isdst\fR is positive if Daylight Saving Time is in effect, 0
78 if Daylight Saving Time is not in effect, and negative if the information is
79 not available.
80 .sp
81 .LP
82 The <\fBtime.h\fR> header defines the following symbolic names:
83 .sp
84 .ne 2
85 .na
86 \fB\fBNULL\fR\fR
87 .ad
88 .RS 28n
89 Null pointer constant.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fBCLOCKS_PER_SEC\fR\fR
96 .ad
97 .RS 28n
98 A number used to convert the value returned by the \fBclock()\fR function into
99 seconds. See \fBclock\fR(3C).
103 .ne 2
105 \fB\fBCLOCK_PROCESS_CPUTIME_ID\fR\fR
107 .RS 28n
108 The identifier of the CPU-time clock associated with the process making a
109 \fBclock()\fR or \fBtimer*()\fR function call.
113 .ne 2
115 \fB\fBCLOCK_THREAD_CPUTIME_ID\fR\fR
117 .RS 28n
118 The identifier of the CPU-time clock associated with the thread making a
119 \fBclock()\fR or \fBtimer*()\fR function call.
124 The <\fBtime.h\fR> header declares the \fBtimespec\fR structure, which has the
125 following members:
127 .in +2
129 time_t tv_sec     /* seconds */
130 long   tv_nsec     /* nanoseconds */
132 .in -2
136 The <\fBtime.h\fR> header declares the \fBitimerspec\fR structure, which has
137 the following members:
139 .in +2
141 struct timespec it_interval     /* timer period */
142 struct timespec it_value     /* timer expiration */
144 .in -2
148 The following manifest constants are defined:
150 .ne 2
152 \fB\fBCLOCK_REALTIME\fR\fR
154 .RS 19n
155 The identifier of the system-wide realtime clock.
159 .ne 2
161 \fB\fBTIMER_ABSTIME\fR\fR
163 .RS 19n
164 Flag indicating time is absolute. For functions taking timer objects, this
165 refers to the clock associated with the timer.
169 .ne 2
171 \fB\fBCLOCK_MONOTONIC\fR\fR
173 .RS 19n
174 The identifier for the system-wide monotonic clock, which is defined as a clock
175 whose value cannot be set with \fBclock_settime()\fR and that cannot have
176 backward clock jumps. The maximum possible clock jump is
177 implementation-defined. See \fBclock_settime\fR(3C).
181 .ne 2
183 \fB\fBTIME_UTC\fR\fR
185 .RS 19n
186 The identifier for the system-wide realtime clock with no time zone
187 translation. Used in \fBtimespec_get\fR().
192 The \fBclock_t\fR, \fBsize_t\fR, \fBtime_t\fR, \fBclockid_t\fR, and
193 \fBtimer_t\fR types are defined as described in <\fBsys/types.h\fR>. See
194 \fBtypes.h\fR(3HEAD).
197 Although the value of \fBCLOCKS_PER_SEC\fR is required to be 1 million on all
198 standard-conforming systems, it can be variable on other systems, and it should
199 not be assumed that \fBCLOCKS_PER_SEC\fR is a compile-time constant.
202 The <\fBtime.h\fR> header provides a declaration for \fBgetdate_err\fR.
205 The following are declared as variables:
207 .in +2
209 extern int daylight;
210 extern long timezone;
211 extern char *tzname[];
213 .in -2
217 Inclusion of the <\fBtime.h\fR> header can make visible all symbols from the
218 <\fBsignal.h\fR> header.
219 .SH USAGE
221 The range [0,60] for \fBtm_sec\fR allows for the occasional leap second.
224 \fBtm_year\fR is a signed value; therefore, years before 1900 can be
225 represented.
228 To obtain the number of clock ticks per second returned by the \fBtimes()\fR
229 function, applications should call \fBsysconf(_SC_CLK_TCK)\fR. See
230 \fBtimes\fR(2) and \fBsysconf\fR(3C).
231 .SH ATTRIBUTES
233 See \fBattributes\fR(5) for descriptions of the following attributes:
238 box;
239 c | c
240 l | l .
241 ATTRIBUTE TYPE  ATTRIBUTE VALUE
243 Interface Stability     Committed
245 Standard        See \fBstandards\fR(5).
248 .SH SEE ALSO
250 \fBtime\fR(2), \fButime\fR(2), \fBclock\fR(3C), \fBctime\fR(3C),
251 \fBdifftime\fR(3C), \fBgetdate\fR(3C), \fBmktime\fR(3C),
252 \fBstrftime\fR(3C), \fBstrptime\fR(3C), \fBtypes.h\fR(3HEAD),
253 \fBclock_settime\fR(3C), \fBnanosleep\fR(3C), \fBtimer_create\fR(3C),
254 \fBtimer_delete\fR(3C), \fBtimer_settime\fR(3C), \fBtimespec_get\fR(3C),
255 \fBattributes\fR(5), \fBstandards\fR(5)