]>
Commit | Line | Data |
---|---|---|
c5434ec8 AC |
1 | .\" Copyright (c) 2020-2022 by Alejandro Colomar <colomar.6.4.3@gmail.com> |
2 | .\" and Copyright (c) 2020 by Michael Kerrisk <mtk.manpages@gmail.com> | |
3 | .\" | |
4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft | |
5 | .\" | |
6 | .\" | |
7 | .TH TIME_T 3type 2022-07-20 Linux "Linux Programmer's Manual" | |
8 | .SH NAME | |
9 | time_t, suseconds_t, useconds_t \- integer time | |
10 | .SH LIBRARY | |
11 | Standard C library | |
12 | .RI ( libc ) | |
13 | .SH SYNOPSIS | |
14 | .nf | |
15 | .B #include <time.h> | |
16 | .PP | |
17 | .BR typedef " /* ... */ " time_t; | |
18 | .PP | |
19 | .B #include <sys/types.h> | |
20 | .PP | |
21 | .BR typedef " /* ... */ " suseconds_t; | |
22 | .BR typedef " /* ... */ " useconds_t; | |
23 | .fi | |
24 | .SH DESCRIPTION | |
25 | .TP | |
26 | .I time_t | |
27 | Used for time in seconds. | |
28 | According to POSIX, | |
29 | it shall be an integer type. | |
30 | .\" In POSIX.1-2001, the type was specified as being either an integer | |
31 | .\" type or a real-floating type. However, existing implementations | |
32 | .\" used an integer type, and POSIX.1-2008 tightened the specification | |
33 | .\" to reflect this. | |
34 | .TP | |
35 | .I suseconds_t | |
36 | Used for time in microseconds. | |
37 | According to POSIX, | |
38 | it shall be a signed integer type | |
39 | capable of storing values al least in the range | |
40 | .RB [ \-1 , | |
41 | .BR 1000000 ]. | |
42 | .TP | |
43 | .I useconds_t | |
44 | Used for time in microseconds. | |
45 | According to POSIX, | |
46 | it shall be an unsigned integer type | |
47 | capable of storing values al least in the range | |
48 | .RB [ 0 , | |
49 | .BR 1000000 ]. | |
50 | .PP | |
51 | According to POSIX, | |
52 | the implementation shall support one or more programming environments | |
53 | where the width of | |
54 | .I suseconds_t | |
55 | and | |
56 | .I useconds_t | |
57 | is no greater than the width of the type | |
58 | .IR long . | |
59 | .SH VERSIONS | |
60 | .TP | |
61 | .I time_t | |
62 | .I <sched.h> | |
63 | defines | |
64 | .I time_t | |
65 | since POSIX.1-2008. | |
66 | .TP | |
67 | .I suseconds_t | |
68 | POSIX.1-2001 defined | |
69 | .I useconds_t | |
70 | in | |
71 | .I <unistd.h> | |
72 | too. | |
73 | .SH CONFORMING TO | |
74 | .PD 0 | |
75 | .IR time_t : | |
76 | C99 and later. | |
77 | POSIX.1-2001 and later. | |
78 | .PP | |
79 | .IR suseconds_t : | |
80 | POSIX.1-2001 and later. | |
81 | .PP | |
82 | .IR useconds_t : | |
83 | POSIX.1-2001 and later. | |
84 | .PD | |
85 | .SH NOTES | |
86 | .TP | |
87 | .I time_t | |
88 | The following headers also provide | |
89 | .IR time_t : | |
90 | .IR <sched.h> , | |
91 | .IR <sys/msg.h> , | |
92 | .IR <sys/select.h> , | |
93 | .IR <sys/sem.h> , | |
94 | .IR <sys/shm.h> , | |
95 | .IR <sys/stat.h> , | |
96 | .IR <sys/time.h> , | |
97 | .IR <sys/types.h> , | |
98 | and | |
99 | .IR <utime.h> . | |
100 | .TP | |
101 | .I suseconds_t | |
102 | The following headers also provide | |
103 | .IR suseconds_t : | |
104 | .I <sys/select.h> | |
105 | and | |
106 | .IR <sys/time.h> . | |
107 | .SH SEE ALSO | |
108 | .BR stime (2), | |
109 | .BR time (2), | |
110 | .BR ctime (3), | |
111 | .BR difftime (3), | |
112 | .BR usleep (3), | |
113 | .BR timeval (3type) |