History

y2038: add 64-bit time_t syscalls to all 32-bit architectures

This adds 21 new system calls on each ABI that has 32-bit time_t today. All of these have the exact same semantics as their existing counterparts, and the new ones all have macro names that end in 'time64' for clarification. This gets us to the point of being able to safely use a C library that has 64-bit time_t in user space. There are still a couple of loose ends to tie up in various areas of the code, but this is the big one, and should be entirely uncontroversial at this point. In particular, there are four system calls (getitimer, setitimer, waitid, and getrusage) that don't have a 64-bit counterpart yet, but these can all be safely implemented in the C library by wrapping around the existing system calls because the 32-bit time_t they pass only counts elapsed time, not time since the epoch. They will be dealt with later.

Arnd Bergmann committed 7 years ago

Commit 48166e61 parent d33c57719 files · +374 −2Browse files

Showing the changes to include/uapi (1 of 19 files). Show all

Unified · Split

include/uapi/asm-generic/unistd.h+43−1
@@ -741,9 +741,51 @@ __SYSCALL(__NR_rseq, sys_rseq) · 740 unmodified lines
741741 #define __NR_kexec_file_load 294
742742 __SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
743743 /* 295 through 402 are unassigned to sync up with generic numbers, don't use */
744+#if __BITS_PER_LONG == 32
745+#define __NR_clock_gettime64 403
746+__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)
747+#define __NR_clock_settime64 404
748+__SYSCALL(__NR_clock_settime64, sys_clock_settime)
749+#define __NR_clock_adjtime64 405
750+__SYSCALL(__NR_clock_adjtime64, sys_clock_adjtime)
751+#define __NR_clock_getres_time64 406
752+__SYSCALL(__NR_clock_getres_time64, sys_clock_getres)
753+#define __NR_clock_nanosleep_time64 407
754+__SYSCALL(__NR_clock_nanosleep_time64, sys_clock_nanosleep)
755+#define __NR_timer_gettime64 408
756+__SYSCALL(__NR_timer_gettime64, sys_timer_gettime)
757+#define __NR_timer_settime64 409
758+__SYSCALL(__NR_timer_settime64, sys_timer_settime)
759+#define __NR_timerfd_gettime64 410
760+__SYSCALL(__NR_timerfd_gettime64, sys_timerfd_gettime)
761+#define __NR_timerfd_settime64 411
762+__SYSCALL(__NR_timerfd_settime64, sys_timerfd_settime)
763+#define __NR_utimensat_time64 412
764+__SYSCALL(__NR_utimensat_time64, sys_utimensat)
765+#define __NR_pselect6_time64 413
766+__SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64)
767+#define __NR_ppoll_time64 414
768+__SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64)
769+#define __NR_io_pgetevents_time64 416
770+__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents)
771+#define __NR_recvmmsg_time64 417
772+__SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64)
773+#define __NR_mq_timedsend_time64 418
774+__SYSCALL(__NR_mq_timedsend_time64, sys_mq_timedsend)
775+#define __NR_mq_timedreceive_time64 419
776+__SYSCALL(__NR_mq_timedreceive_time64, sys_mq_timedreceive)
777+#define __NR_semtimedop_time64 420
778+__SYSCALL(__NR_semtimedop_time64, sys_semtimedop)
779+#define __NR_rt_sigtimedwait_time64 421
780+__SC_COMP(__NR_rt_sigtimedwait_time64, sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time64)
781+#define __NR_futex_time64 422
782+__SYSCALL(__NR_futex_time64, sys_futex)
783+#define __NR_sched_rr_get_interval_time64 423
784+__SYSCALL(__NR_sched_rr_get_interval_time64, sys_sched_rr_get_interval)
785+#endif
744786
745787 #undef __NR_syscalls
746−#define __NR_syscalls 295
788+#define __NR_syscalls 424
747789
748790 /*
749791 * 32 bit systems traditionally used different

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t