diff options
| author | Alejandro Colomar <alx.manpages@gmail.com> | 2022-07-21 15:33:38 +0200 |
|---|---|---|
| committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-07-21 15:33:55 +0200 |
| commit | 8042eca2fb8edc41c20c225cce6bfae143e055ed (patch) | |
| tree | d853dde61efdcd5ced71386ac7d6084c088aab44 /man3 | |
| parent | 3316dc71809dcc815703d93cb046c34c23881a97 (diff) | |
| download | man-pages-8042eca2fb8edc41c20c225cce6bfae143e055ed.tar.gz | |
timespec.3type, system_data_types.7: Move timespec to a separate page
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'man3')
| -rw-r--r-- | man3/timespec.3type | 75 |
1 files changed, 74 insertions, 1 deletions
diff --git a/man3/timespec.3type b/man3/timespec.3type index db50c0f091..000206d97e 100644 --- a/man3/timespec.3type +++ b/man3/timespec.3type @@ -1 +1,74 @@ -.so man7/system_data_types.7 +.\" Copyright (c) 2020-2022 by Alejandro Colomar <colomar.6.4.3@gmail.com> +.\" and Copyright (c) 2020 by Michael Kerrisk <mtk.manpages@gmail.com> +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.\" +.TH TIMESPEC 3type 2022-07-21 Linux "Linux Programmer's Manual" +.SH NAME +timespec \- time in seconds and nanoseconds +.SH LIBRARY +Standard C library +.RI ( libc ) +.SH SYNOPSIS +.nf +.B #include <time.h> +.PP +.B struct timespec { +.BR " time_t tv_sec;" " /* Seconds */" +.BR " long tv_usec;" " /* Nanoseconds [" 0 ", " 999999999 "] */" +.B }; +.fi +.SH DESCRIPTION +Describes times in seconds and nanoseconds. +.SH CONFORMING TO +C11 and later; +POSIX.1-2001 and later. +.SH NOTES +The following headers also provide this type: +.IR <aio.h> , +.IR <mqueue.h> , +.IR <sched.h> , +.IR <signal.h> , +.IR <sys/select.h> , +and +.IR <sys/stat.h> . +.SH BUGS +Under glibc, +.I tv_nsec +is the +.I syscall +long, +though this affects only fringe architectures like X32, +which is ILP32, but uses the LP64 AMD64 syscall ABI. +In reality, the field ends up being defined as: +.PP +.in +4n +.EX +#if __x86_64__ && __ILP32__ /* == x32 */ + long long tv_nsec; +#else + long tv_nsec; +#endif +.EE +.in +.PP +This is a long-stansing and long-enshrined glibc bug +.UR https://sourceware.org/bugzilla/show_bug.cgi?id=16437 +.I #16437 +.UE , +and an incompatible extension to the standards; +however, as even a 32-bit +.I long +can hold the entire +.I tv_nsec +range, +it's always safe to forcibly down-cast it to the standard type. +.SH SEE ALSO +.BR clock_gettime (2), +.BR clock_nanosleep (2), +.BR nanosleep (2), +.BR timerfd_gettime (2), +.BR timer_gettime (2), +.BR time_t (3type), +.BR timeval (3type) |
