Debian Codegraph @

upstream/debian-trixie/man3/timespec.3type

raw
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 timespec 3type 2024-05-02 "Linux man-pages 6.9.1"
8 .SH NAME
9 timespec \- time in seconds and nanoseconds
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc )
13 .SH SYNOPSIS
14 .EX
15 .B #include <time.h>
16 .P
17 .B struct timespec {
18 .BR " time_t tv_sec;" " /* Seconds */"
19 .RB " /* ... */" " tv_nsec;" \
20 " /* Nanoseconds [" 0 ", " 999\[aq]999\[aq]999 "] */"
21 .B };
22 .EE
23 .SH DESCRIPTION
24 Describes times in seconds and nanoseconds.
25 .P
26 .I tv_nsec
27 is of an implementation-defined signed type
28 capable of holding the specified range.
29 Under glibc, this is usually
30 .IR long ,
31 and
32 .I long long
33 on X32.
34 It can be safely down-cast to any concrete 32-bit integer type for processing.
35 .SH VERSIONS
36 Prior to C23,
37 .I tv_nsec
38 was
39 .IR long .
40 .SH STANDARDS
41 C11, POSIX.1-2008.
42 .SH HISTORY
43 POSIX.1-2001.
44 .SH NOTES
45 The following headers also provide this type:
46 .IR <aio.h> ,
47 .IR <mqueue.h> ,
48 .IR <sched.h> ,
49 .IR <signal.h> ,
50 .IR <sys/select.h> ,
51 and
52 .IR <sys/stat.h> .
53 .SH SEE ALSO
54 .BR clock_gettime (2),
55 .BR clock_nanosleep (2),
56 .BR nanosleep (2),
57 .BR timerfd_gettime (2),
58 .BR timer_gettime (2),
59 .BR time_t (3type),
60 .BR timeval (3type)