Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This implementation uses __settimeofday64.
Therefore, on a system where current time-of-day is 32 bits, this
implementation will fail for dates beyond Y2038.
|
|
This provides a generic Posix implementation based on calling
__gettimeofday64().
|
|
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'.
|
|
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'.
|
|
These implementations just use the existing syscalls and convert from
kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.
|
|
These implementations just use the existing syscalls and convert from
kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.
|
|
These implementations just use the existing syscalls and convert from
kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.
|
|
These implementations just use the existing syscalls and convert from
kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.
|
|
|
|
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.
|
|
For Linux this uses the 32-bit time syscall so it converts the
syscall output from 32-bit time to 64-bit time.
|
|
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.
|
|
For Linux this uses the 32-bit time syscall, so it
converts the syscall output into 64-bit time.
|
|
|
|
|
|
|
|
Also, provide static inline functions and macros for checking
and converting between 32-bit and 64-bit timevals.
|
|
|
|
|
|
|
|
|
|
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.
|
|
* 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.
|
|
* 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.
|
|
* 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.
|
|
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.
|
|
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
|