Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
y2038: Introduce __ASSUME_TIME64_SYSCALLS define
This define indicates if the Linux kernel provides interfaces (syscalls) to support 64 bit time. * sysdeps/unix/sysv/linux/kernel-features.h: (__ASSUME_TIME64_SYSCALLS): Define. --- Changes for v8: - Be more specific about the "current" and "present" description of archs with 64 bit time support. - Check if eligible 64 bit time related syscalls are defined for 3.2 kernel Changes for v7: - Move the flag description from commit message to in-code comment. - Check if relevant syscalls were defined in v3.2 (oldest glibc supported kernel). - New syscalls, added to v5.1, like semtimedop_time64, which need extra code for handling, shall be excluded from __ASSUME_TIME64_SYSCALLS and would receive new flag - e.g. __ASSUME_SEMTIMEDOP_TIME64 Changes for v6: - Change the logical meaning of __ASSUME_TIME64_SYSCALLS - now it indicates if the system supports the 64 bit time ABI (if for both __WORDSIZE==64 and __WORDSIZE==32 systems equally functional syscalls are provided). - Update commit description Changes for v5: - Rewrite the in-code comment (x32 description more precise) - Change patch description (for x32) Changes for v4: - Exclude this patch from the clock_settime64 patch series - Rewrite the in-code comment - Change patch description Changes for v3: - Provide more detailed and verbose description - Change name to __ASSUME_TIME64_SYSCALLS - Undefine __ASSUME_TIME64_SYSCALLS on x32 Changes for v2: - New patch Syscall's ABI compatibility checking: Assumptions: - syscall ABI change require changing the name - like __NR_epoll_create and __NR_epoll_create1 - once added syscall with a name (e.g. __NR_epoll_create) will have thes same interface (ABI) 0. List of 64 bit archs to be checked (there is no need to check 32 bit archs as they will use a separate set of syscalls from v5.1 Linux kernel): aarch64 (arm64) alpha ia64 mips (n64 and n32 syscall ABIs) powerpc (64-bit syscall ABI) riscv (64-bit syscall ABI) s390 (64-bit syscall ABI) sparc (64-bit syscall ABI) x86_64 (classic and x32 syscall ABIs) 1. Code to check if syscalls are defined since v3.2 kernel export syscalls_table="\ clock_gettime clock_settime clock_adjtime \ clock_getres clock_nanosleep timer_gettime \ timer_settime timerfd_gettime timerfd_settime \ utimensat pselect6 ppoll io_pgetevents recvmmsg \ mq_timedsend mq_timedreceive rt_sigtimedwait futex \ sched_rr_get_interval" for syscall in ${syscalls_table} ; do echo -n "syscall: ${syscall} -> "; \ grep -rnIw "__NR_${syscall}" | grep ^arch/ | \ grep -vE "mn10300|avr32|cris|m32r|frv|blackfin|xtensa|h8300|vdso|m68k\ |sh|microblaze" | \ wc -l; done Excluded syscalls (needs to be re-checked when syscall is converted to 64 bit): - recvmmsg - up to v4.3 is not defined for s390 (64 bit) (the sys_socketcall) is used instead - io_pgetevents - is not defined at all for 3.2 kernel archs Each file from the above script has been examined to look for any #if or comment (grep -C1) for the relevant syscall. 2. Architectures (ports) supported by current glibc (SHA1: 48c3c12), but added to Linux after v3.2 (for those the oldest supported kernel by glibc is the version with which it has been added): (New, 32 bit ports - nios2, csky, hppa are excluded as they gain 64 bit time support from v5.1 onwards) Relevant 64 bit new ports: aarch64 (arm64), riscv - the __ASSUME_TIME64_SYSCALLS set of syscalls is defined for them. To sum up: ========== - We need to exclude recvmmsg and io_pgetevents from __ASSUME_TIME64_SYSCALLS - Other syscalls were available since 3.2
- Loading branch information