History

Merge tag 'y2038-new-syscalls' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground into timers/2038

Pull y2038 - time64 system calls from Arnd Bergmann: This series finally gets us to the point of having system calls with 64-bit time_t on all architectures, after a long time of incremental preparation patches. There was actually one conversion that I missed during the summer, i.e. Deepa's timex series, which I now updated based the 5.0-rc1 changes and review comments. The following system calls are now added on all 32-bit architectures using the same system call numbers: 403 clock_gettime64 404 clock_settime64 405 clock_adjtime64 406 clock_getres_time64 407 clock_nanosleep_time64 408 timer_gettime64 409 timer_settime64 410 timerfd_gettime64 411 timerfd_settime64 412 utimensat_time64 413 pselect6_time64 414 ppoll_time64 416 io_pgetevents_time64 417 recvmmsg_time64 418 mq_timedsend_time64 419 mq_timedreceiv_time64 420 semtimedop_time64 421 rt_sigtimedwait_time64 422 futex_time64 423 sched_rr_get_interval_time64 Each one of these corresponds directly to an existing system call that includes a 'struct timespec' argument, or a structure containing a timespec or (in case of clock_adjtime) timeval. Not included here are new versions of getitimer/setitimer and getrusage/waitid, which are planned for the future but only needed to make a consistent API rather than for correct operation beyond y2038. These four system calls are based on 'timeval', and it has not been finally decided what the replacement kernel interface will use instead. So far, I have done a lot of build testing across most architectures, which has found a number of bugs. Runtime testing so far included testing LTP on 32-bit ARM with the existing system calls, to ensure we do not regress for existing binaries, and a test with a 32-bit x86 build of LTP against a modified version of the musl C library that has been adapted to the new system call interface [3]. This library can be used for testing on all architectures supported by musl-1.1.21, but it is not how the support is getting integrated into the official musl release. Official musl support is planned but will require more invasive changes to the library.

Thomas Gleixner committed 7 years ago

Commit 41ea3912 parents fd659cc 48166e665 files · +1263 −713Browse files

Showing the changes to include/uapi/linux (2 of 65 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/time.h +0 −4
  2. include/uapi/linux/timex.h +39 −0
include/uapi/linux/time.h+0−4
@@ -42,19 +42,15 @@ struct itimerval { · 41 unmodified lines
42 struct timeval it_value; /* current value */42 struct timeval it_value; /* current value */
43};43};
44 44
45#ifndef __kernel_timespec
46struct __kernel_timespec {45struct __kernel_timespec {
47 __kernel_time64_t tv_sec; /* seconds */46 __kernel_time64_t tv_sec; /* seconds */
48 long long tv_nsec; /* nanoseconds */47 long long tv_nsec; /* nanoseconds */
49};48};
50#endif
51 49
52#ifndef __kernel_itimerspec
53struct __kernel_itimerspec {50struct __kernel_itimerspec {
54 struct __kernel_timespec it_interval; /* timer period */51 struct __kernel_timespec it_interval; /* timer period */
55 struct __kernel_timespec it_value; /* timer expiration */52 struct __kernel_timespec it_value; /* timer expiration */
56};53};
57#endif
58 54
59/*55/*
60 * legacy timeval structure, only embedded in structures that56 * legacy timeval structure, only embedded in structures that
include/uapi/linux/timex.h+39−0
@@ -92,6 +92,45 @@ struct timex { · 91 unmodified lines
92 int :32; int :32; int :32;92 int :32; int :32; int :32;
93};93};
94 94
95struct __kernel_timex_timeval {
96 __kernel_time64_t tv_sec;
97 long long tv_usec;
98};
99
100struct __kernel_timex {
101 unsigned int modes; /* mode selector */
102 int :32; /* pad */
103 long long offset; /* time offset (usec) */
104 long long freq; /* frequency offset (scaled ppm) */
105 long long maxerror;/* maximum error (usec) */
106 long long esterror;/* estimated error (usec) */
107 int status; /* clock command/status */
108 int :32; /* pad */
109 long long constant;/* pll time constant */
110 long long precision;/* clock precision (usec) (read only) */
111 long long tolerance;/* clock frequency tolerance (ppm)
112 * (read only)
113 */
114 struct __kernel_timex_timeval time; /* (read only, except for ADJ_SETOFFSET) */
115 long long tick; /* (modified) usecs between clock ticks */
116
117 long long ppsfreq;/* pps frequency (scaled ppm) (ro) */
118 long long jitter; /* pps jitter (us) (ro) */
119 int shift; /* interval duration (s) (shift) (ro) */
120 int :32; /* pad */
121 long long stabil; /* pps stability (scaled ppm) (ro) */
122 long long jitcnt; /* jitter limit exceeded (ro) */
123 long long calcnt; /* calibration intervals (ro) */
124 long long errcnt; /* calibration errors (ro) */
125 long long stbcnt; /* stability limit exceeded (ro) */
126
127 int tai; /* TAI offset (ro) */
128
129 int :32; int :32; int :32; int :32;
130 int :32; int :32; int :32; int :32;
131 int :32; int :32; int :32;
132};
133
95/*134/*
96 * Mode codes (timex.mode)135 * Mode codes (timex.mode)
97 */136 */

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