aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-24Y2038: add _TIME_BITS supportaaribaud/y2038Albert ARIBAUD (3ADEV)
This makes all previously defined Y2038-proof API types, functions and implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so that 64-bit architectures are unaffected). Note: it is assumed that the API is consistent, i.e. for each API type which is enabled here, all API functions which depend on this type are enabled and mapped to Y2038-proof implementations.
2018-10-24Y2038: add function __pmap_rmtcall64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __clntudp_bufcreate64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __clntudp_create64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function select64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function pselect64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add struct __timex64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __ntp_gettimex64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __ntp_gettime64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add struct __ntp_timeval64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __getrusage64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add functions using futexesAlbert ARIBAUD (3ADEV)
This creates 64-bit time versions of the following APIs: - pthread_rwlock_timedrdlock - pthread_rwlock_timedwrlock - pthread_mutex_timedlock - pthread_cond_timedwait - sem_timedwait - aio_suspend It also creates 64-bit time versions of the following functions or macros: - lll_timedlock_elision - lll_timedlock - __lll_timedlock_wait - futex_reltimed_wait_cancelable - lll_futex_timed_wait - __pthread_cond_wait_common - futex_abstimed_wait_cancelable - lll_futex_timed_wait_bitset - do_aio_misc_wait - AIO_MISC_WAIT - __new_sem_wait_slow - do_futex_wait - __pthread_rwlock_wrlock_full - __pthread_rwlock_rdlock_full - futex_abstimed_wait
2018-10-24Y2038: add function __setitimer64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __getitimer64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add struct __itimerval64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __utime64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __adjtime64, __adjtimex64 and __ntp_adjtime64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __nanosleep64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __sched_rr_get_interval64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __msgctl64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __mq_timedsend_time64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __mq_timedreceiv_time64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __utimes64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __stime64Albert ARIBAUD (3ADEV)
This implementation uses __settimeofday64. Therefore, on a system where current time-of-day is 32 bits, this implementation will fail for dates beyond Y2038.
2018-10-24Y2038: add function __time64Albert ARIBAUD (3ADEV)
This provides a generic Posix implementation based on calling __gettimeofday64().
2018-10-24Y2038: add function __settimeofday64Albert ARIBAUD (3ADEV)
Implementing a 64-bit settimeofday requires adding a new file to build under time/ and we cannot name that new file 'settimeofday.c' or it will break the 32-bit settimeofday file symbol, so we call it 'settimeofday64.c'.
2018-10-24Y2038: add function __gettimeofday64Albert ARIBAUD (3ADEV)
Implementing a 64-bit settimeofday requires adding a new file to build under time/ and we cannot name that new file 'settimeofday.c' or it will break the 32-bit settimeofday symbol, so we call it 'settimeofday64.c'.
2018-10-24Y2038: add function __fstatat64_time64 (and __fxstatat_time64)Albert ARIBAUD (3ADEV)
These implementations just use the existing syscalls and convert from kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.
2018-10-24Y2038: add function __lstat64_time64 (and __lxstat64_time64)Albert ARIBAUD (3ADEV)
These implementations just use the existing syscalls and convert from kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.
2018-10-24Y2038: add function __stat64_time64 (and __xstat64_time64)Albert ARIBAUD (3ADEV)
These implementations just use the existing syscalls and convert from kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.
2018-10-24Y2038: add function __fstat64_time64 (and __fxstat64_time64)Albert ARIBAUD (3ADEV)
These implementations just use the existing syscalls and convert from kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.
2018-10-24Y2038: add struct __stat64_t64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __timerfd_settime64Albert ARIBAUD (3ADEV)
For Linux this uses the 32-bit time syscal, so it converts syscall input from 64-bit time into 32-bit time and syscall output from 32-bit time to 64-bit time.
2018-10-24Y2038: add function __timerfd_gettime64Albert ARIBAUD (3ADEV)
For Linux this uses the 32-bit time syscall so it converts the syscall output from 32-bit time to 64-bit time.
2018-10-24Y2038: add function __timer_settime64Albert ARIBAUD (3ADEV)
For Linux this uses a 32-bit syscall, so it converts the syscall input from 64-bit time into 32-bit time, and the syscall output from 32-bit time into 64-bit time.
2018-10-24Y2038: add function __timer_gettime64Albert ARIBAUD (3ADEV)
For Linux this uses the 32-bit time syscall, so it converts the syscall output into 64-bit time.
2018-10-24Y2038: add struct __itimerspec64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __lutimes64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __futimes64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add struct __timeval64Albert ARIBAUD (3ADEV)
Also, provide static inline functions and macros for checking and converting between 32-bit and 64-bit timevals.
2018-10-24Y2038: add function __sigtimedwait_time64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __futimens64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __utimensat_time64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __timespec_get64Albert ARIBAUD (3ADEV)
2018-10-24Y2038: add function __clock_nanosleep64Albert ARIBAUD (3ADEV)
Linux does not provide a 64-bit-time clock_nanosleep syscall, so __clock_nanosleep64 is a wrapper calling __clock_nanosleep, with one conversion before the call and possibly one after. Note: There is no point in implementing __clock_nanosleep64 directly around the 32-bit-time syscall and making __clock_nanosleep a wrapper around __clock_nanosleep64, because __clock_nanosleep64 would still need one or two conversions, and __clock_nanosleep would now also need those, adding a cost of 2 to 4 conversions in the worst case.
2018-10-24Y2038: add function __clock_getres_time64Albert ARIBAUD (3ADEV)
* include/time.h (__clock_getres_time64): Add. * sysdeps/posix/clock_getres.c (hp_timing_getres): Use struct __timespec64. * sysdeps/posix/clock_getres.c (realtime_getres): Likewise. * sysdeps/posix/clock_getres.c (__clock_getres_time64): Add. * sysdeps/posix/clock_getres.c Use SYSDEP_GETRES64. * sysdeps/posix/clock_getres.c Use SYSDEP_GETRES_CPU64. * sysdeps/posix/clock_getres.c (__clock_getres): Use __clock_getres_time64. * sysdeps/unix/sysv/linux/clock_getres.c (SYSCALL_GETRES32): Add. * sysdeps/unix/sysv/linux/clock_getres.c (SYSCALL_GETRES64): Likewise. * sysdeps/unix/sysv/linux/clock_getres.c (SYSDEP_GETRES64): Likewise. * sysdeps/unix/sysv/linux/clock_getres.c (SYSDEP_GETRES_CPU64): Likewise.
2018-10-24Y2038: add function __clock_settime64Albert ARIBAUD (3ADEV)
* include/time.h (__clock_settime64): Add. * sysdeps/unix/clock_settime.c (__clock_settime64): Add. * sysdeps/unix/sysv/linux/clock_settime.c (DO_CLOCK_SETTIME_32): Add. * sysdeps/unix/sysv/linux/clock_settime.c (DO_CLOCK_SETTIME_64): Add. * sysdeps/unix/sysv/linux/clock_settime.c (SYSDEP_SETTIME64_CPUTIME): Add. * sysdeps/unix/sysv/linux/clock_settime.c (SYSDEP_SETTIME64): Add.
2018-10-24Y2038: add function __clock_gettime64Albert ARIBAUD (3ADEV)
* include/time.h: Declare __clock_gettime64(). * ntpl/pthread_clock_gettime.c: Add __pthread_clock_gettime64(). * ntpl/pthread_clock_gettime.c: Make __pthread_clock_gettime() a wrapper around __pthread_clock_gettime64(). * sysdeps/unix/clock_gettime.c (hp_timing_gettime): Use struct __timespec64. * sysdeps/unix/clock_gettime.c (realtime_gettime): Likewise. * sysdeps/unix/clock_gettime.c: Add __clock_gettime64(). * sysdeps/unix/clock_gettime.c: Make __clock_gettime() a wrapper around __clock_gettime64(). * sysdeps/unix/sysv/linux/clock_gettime.c: Add 64-bit-time syscall support.
2018-10-24Y2038: provide kernel support indicationAlbert ARIBAUD (3ADEV)
Introduce __ASSUME_KERNEL_Y2038_SUPPORT which means that the underlying kernel *always* implements 64-bit-time Y2038-proof syscalls. If __ASSUME_KERNEL_Y2038_SUPPORT is not defined, glibc must check dynamically whether the underlying kernel provides these syscalls or not, and must fallback to 32-bit-time syscalls if not. Introduce function __y2038_get_kernel_support(), which returns true if the underlying kernel supports 64-bit-time syscalls. Also introduce function __y2038_set_kernel_support(), which allows an implementation to notify glibc of the absence of 64-bit-time syscalls (ENOSYS) so that they are not needlessly tried again. * misc/Makefile: Add module y2038-support. * misc/Versions: (__y2038_get_kernel_support): Add to GLIBC_PRIVATE. * misc/Versions: (__y2038_set_kernel_support): Likewise. * misc/y2038-support.c: New file. * misc/y2038-support.h: Likewise. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_KERNEL_Y2038_SUPPORT): Add. * sysdeps/unix/sysv/linux/y2038-support.c: New file. * sysdeps/unix/sysv/linux/y2038-support.h: New file.
2018-10-24Y2038: add struct __timespec64Albert ARIBAUD (3ADEV)
This type is a glibc-internal type similar to struct timespec but whose tv_sec field is a _time64_t rather than a time_t, which makes it Y2038-proof and useable to pass between user code and Y2038-proof kernel syscalls. On 64-bit architectures, and on X32, struct __timespec64 is just an alias of struct timespec, which is already 64-bit. On other architectures, it must be explicitly defined. In order to match the Linux kernel struct, the tv_nsec field of struct __timespec64 is also a signed 64-bit integer. The kernel ensures that the higher half of tv_nsec is always 0, which means glibc does not need to do it. Note: the corresponding glibc public* type will differ from this private type, as the user source code might depend on the tv_nsec field being a 32-bit long, not a 64-bit int. To meet this expectation, the public type will have a 32-bit tv_nsec field plus 32-bit anonymous padding, ordered according to the endianness of the architecture. Tested with make xtests on x86_64 and ARM. * include/bits/types/struct_timespec64.h: Include time/bits/types/struct_timespec64.h * include/time.h (valid_timeval_to_timespec64): Add. * include/time.h (valid_timespec_to_timespec64): Likewise. * include/time.h (valid_timespec64_to_timespec): Likewise. * include/time.h (valid_timespec64_to_timeval): Likewise. * include/time.h (IS_VALID_NANOSECONDS): Likewise. * include/time.h (timespec_to_timespec64): Likewise. * include/time.h (timespec64_to_timespec): Likewise. * include/time.h (timespec64_to_timeval): Likewise. * io/fcntl.h: Include bits/types/struct_timespec64.h. * io/sys/poll.h: Likewise. * io/sys/stat.h: Likewise. * misc/sys/select.h: Likewise. * posix/sched.h: Likewise. * posix/netdb.h: Likewise. * rt/aio.h: Likewise. * rt/mqueue.h: Likewise. * signal/signal.h: Likewise. * sysdeps/nptl/pthread.h: Likewise. * sysdeps/pthread/semaphore.h: Likewise. * sysdeps/unix/sysv/linux/hppa/pthread.h: Likewise. * sysvipc/sys/sem.h: Likewise. * time/Makefile: Add bits/types/struct_timespec64.h * time/bits/types/struct_itimerspec.h: Include bits/types/struct_timespec64.h * time/bits/types/struct_itimerspec64.h: Add. * time/time.h: Include bits/types/struct_timespec64.h