| 1 |
.\" Copyright (c) 2020-2022 by Alejandro Colomar <[email protected]> |
| 2 |
.\" and Copyright (c) 2020 by Michael Kerrisk <[email protected]> |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 5 |
.\" |
| 6 |
.\" |
| 7 |
.TH time_t 3type 2024-05-02 "Linux man-pages 6.9.1" |
| 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 |
.P |
| 17 |
.BR typedef " /* ... */ " time_t; |
| 18 |
.P |
| 19 |
.B #include <sys/types.h> |
| 20 |
.P |
| 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 is 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 |
It is a signed integer type |
| 38 |
capable of storing values at least in the range |
| 39 |
.RB [ \-1 , |
| 40 |
.BR 1000000 ]. |
| 41 |
.TP |
| 42 |
.I useconds_t |
| 43 |
Used for time in microseconds. |
| 44 |
It is an unsigned integer type |
| 45 |
capable of storing values at least in the range |
| 46 |
.RB [ 0 , |
| 47 |
.BR 1000000 ]. |
| 48 |
.SH STANDARDS |
| 49 |
.TP |
| 50 |
.I time_t |
| 51 |
C11, POSIX.1-2008. |
| 52 |
.TP |
| 53 |
.I suseconds_t |
| 54 |
.TQ |
| 55 |
.I useconds_t |
| 56 |
POSIX.1-2008. |
| 57 |
.PD |
| 58 |
.SH HISTORY |
| 59 |
.TP |
| 60 |
.I time_t |
| 61 |
C89, POSIX.1-2001. |
| 62 |
.TP |
| 63 |
.I suseconds_t |
| 64 |
.TQ |
| 65 |
.I useconds_t |
| 66 |
POSIX.1-2001. |
| 67 |
.P |
| 68 |
.I <sched.h> |
| 69 |
defines |
| 70 |
.I time_t |
| 71 |
since POSIX.1-2008. |
| 72 |
.P |
| 73 |
POSIX.1-2001 defined |
| 74 |
.I useconds_t |
| 75 |
in |
| 76 |
.I <unistd.h> |
| 77 |
too. |
| 78 |
.SH NOTES |
| 79 |
On some architectures, |
| 80 |
the width of |
| 81 |
.I time_t |
| 82 |
can be controlled with the feature test macro |
| 83 |
.BR _TIME_BITS . |
| 84 |
See |
| 85 |
.BR feature_test_macros (7). |
| 86 |
.P |
| 87 |
The following headers also provide |
| 88 |
.IR time_t : |
| 89 |
.IR <sched.h> , |
| 90 |
.IR <sys/msg.h> , |
| 91 |
.IR <sys/select.h> , |
| 92 |
.IR <sys/sem.h> , |
| 93 |
.IR <sys/shm.h> , |
| 94 |
.IR <sys/stat.h> , |
| 95 |
.IR <sys/time.h> , |
| 96 |
.IR <sys/types.h> , |
| 97 |
and |
| 98 |
.IR <utime.h> . |
| 99 |
.P |
| 100 |
The following headers also provide |
| 101 |
.IR suseconds_t : |
| 102 |
.I <sys/select.h> |
| 103 |
and |
| 104 |
.IR <sys/time.h> . |
| 105 |
.SH SEE ALSO |
| 106 |
.BR stime (2), |
| 107 |
.BR time (2), |
| 108 |
.BR ctime (3), |
| 109 |
.BR difftime (3), |
| 110 |
.BR usleep (3), |
| 111 |
.BR timeval (3type) |