@@ -143,3 +143,76 @@
*/
#define __ASSUME_CLONE_DEFAULT 1
+
+/* This flag indicates support for Linux kernel syscalls, which are able
+ to handle 64 bit time ABI. It is defined for architectures which use
+ unsuffixed time related, 64 bit syscalls (and define __WORDSIZE == 64
+ __SYSCALL_WORDSIZE == 64) as well as ones gaining it with new syscalls
+ added to Linux kernel version 5.1 (listed below).
+
+ To be more specific - this flag focuses on higer level of abstraction,
+ which indicates the system's ability to support 64 bit time.
+
+ In the other words this flag indicates availability of specific 64 bit
+ time supporting interfaces (syscalls in this case) from Linux kernel.
+
+ As an example - the syscall to set clock (clock_settime) - if the
+ __ASSUME_TIME64_SYSCALLS is defined, it indicates that 64 bit time can
+ be set in the system.
+
+ On systems with __WORDSIZE == 64 the __NR_clock_settime syscall is used
+ to achieve this goal. Contrary, systems with __WORDSIZE == 32 do use the
+ new __NR_clock_settime64 syscall (with suffix) available from Linux
+ version 5.1.
+
+ The __ASSUME_TIME64_SYSCALLS is defined for:
+
+ 1. Systems which use syscalls with unsuffixed names (like clock_settime)
+ to provid 64 bit time support (__WORDSIZE == 64).
+
+ 2. For 'x32' architecture, which is a special case in respect to 64 bit
+ time support (it has __WORDSIZE == 32 but __TIMESIZE == 64)
+
+ For point 1 and 2, defined __ASSUME_TIME64_SYSCALL means, that the
+ syscall semantics are identical for both the old syscall (on systems
+ where __WORDSIZE or _SYSCALL_WORDSIZE is 64) and for the new one (if
+ ever defined from listed below v5.1 subset), so that no code will
+ ever have to handle the two syscalls differently.
+
+ 3. Systems with __WORDSIZE == 32, which gain 64 bit time support with
+ new set of syscalls added to Linux kernel 5.1.
+
+ List of new syscalls added to v5.1. kernel (they accept data based on
+ struct timespec and timeval with 64 bit tv_sec) consistent with
+ __ASSUME_TIME64_SYSCALLS flag definition:
+
+ clock_gettime64
+ clock_settime64
+ clock_adjtime64
+ clock_getres_time64
+ clock_nanosleep_time64
+ timer_gettime64
+ timer_settime64
+ timerfd_gettime64
+ timerfd_settime64
+ utimensat_time64
+ pselect6_time64
+ ppoll_time64
+ mq_timedsend_time64
+ mq_timedreceive_time64
+ rt_sigtimedwait_time64
+ futex_time64
+ sched_rr_get_interval_time64
+
+ Listed above syscalls have counterparts (with unsuffixed syscalls names)
+ already providing 64 bit time support on systems with __WORDSIZE == 64 or
+ __SYSCALL_WORDSIZE == 64 since the oldest supported by glibc Linux kernel
+ (v3.2). */
+
+#include <bits/wordsize.h>
+#if (__WORDSIZE == 64 \
+ || (__WORDSIZE == 32 \
+ && (__LINUX_KERNEL_VERSION >= 0x050100 \
+ || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64))))
+# define __ASSUME_TIME64_SYSCALLS 1
+#endif