@@ -51,6 +51,7 @@
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
+#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
#define __DADDR_T_TYPE __S32_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
@@ -161,6 +161,7 @@ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
__STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t;
+__STD_TYPE __SNSECONDS_T_TYPE __snseconds_t; /* Signed count of nanoseconds. */
__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */
@@ -51,6 +51,7 @@
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
+#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
#define __DADDR_T_TYPE __S32_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
@@ -50,6 +50,7 @@
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS_T_TYPE __S64_TYPE
#define __SUSECONDS64_T_TYPE __S64_TYPE
+#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
#define __DADDR_T_TYPE __S32_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
@@ -64,6 +64,7 @@
#define __CLOCK_T_TYPE __SLONGWORD_TYPE
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
+#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
#define __DADDR_T_TYPE __S32_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
@@ -51,6 +51,7 @@
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
+#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
#define __DADDR_T_TYPE __S32_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
@@ -51,6 +51,7 @@
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS_T_TYPE __S32_TYPE
#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
+#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
#define __DADDR_T_TYPE __S32_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
@@ -65,6 +65,7 @@
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE
#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
+#define __SNSECONDS_T_TYPE __SYSCALL_SLONG_TYPE
#define __DADDR_T_TYPE __S32_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
Based on the existing suseconds_t type, with the difference that __snseconds_t should be long when possible. The timespec(3) structure uses long for tv_nsec, except if __x86_64__ && __ILP32__, in which case it uses long long. Add __snseconds_t to allow simplifying the definition of struct timespec. Link: linux-man <https://lore.kernel.org/linux-man/ec1dcc655184f6cdaae40ff8b7970b750434e4ef.1638123425.git.nabijaczleweli@nabijaczleweli.xyz/T/> Link: glibc <https://sourceware.org/pipermail/libc-alpha/2021-December/133702.html> Cc: наб <nabijaczleweli@nabijaczleweli.xyz> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Zack Weinberg <zackw@panix.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Cc: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com> Cc: H.J. Lu <hjl.tools@gmail.com> Cc: Joseph Myers <joseph@codesourcery.com> Cc: Rich Felker <dalias@libc.org> Cc: Andreas Schwab <schwab@linux-m68k.org> Cc: Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> --- bits/typesizes.h | 1 + posix/bits/types.h | 1 + sysdeps/mach/hurd/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/alpha/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/generic/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/s390/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/sparc/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/x86/bits/typesizes.h | 1 + 8 files changed, 8 insertions(+)