Introduce time64 support.
commit8ea0140d5ffd2dc4ec0e36de71b67e6c1955f3cb
authorDmitry Chestnykh <dm.chestnykh@gmail.com>
Wed, 21 Feb 2024 16:08:28 +0000 (21 19:08 +0300)
committerWaldemar Brodkorb <wbx@openadk.org>
Thu, 22 Feb 2024 18:50:09 +0000 (22 19:50 +0100)
treebbb3b38f991f4e194a79610eef089feaca9451f9
parenta908621a934643f51a58042abcf1d1e42e281943
Introduce time64 support.

This patch introduces *time64 syscalls support for uClibc-ng.
Currently the redirection of syscalls to their *time64
analogs is fully supported for 32bit ARM (ARMv5, ARMv6, ARMv7).
The main changes that take effect when time64 feature is enabled are:
- sizeof(time_t) is 8.
- There is a possibility os setting date beyond year 2038.
- some syscalls are redirected:
clock_adjtime -> clock_adjtime64
clock_getres -> clock_getres_time64
clock_gettime -> clock_gettime64
clock_nanosleep -> clock_nanosleep_time64
clock_settime -> clock_settime64
futex -> futex_time64
mq_timedreceive -> mq_timedreceive_time64
mq_timedsend -> mq_timedsend_time64
ppoll -> ppoll_time64
pselect6 -> pselect6_time64
recvmmsg -> recvmmsg_time64
rt_sigtimedwait -> rt_sigtimedwait_time64
sched_rr_get_interval -> sched_rr_get_interval_time64
semtimedop -> semtimedop_time64
timer_gettime -> timer_gettime64
timer_settime -> timer_settime64
timerfd_gettime -> timerfd_gettime64
timerfd_settime -> timerfd_settime64
utimensat -> utimensat_time64.

- settimeofday uses clock_settime (like in glibc/musl).
- gettimeofday uses clock_gettime (like in glibc/musl).
- nanosleep uses clock_nanosleep (like in glibc/musl).

- There are some fixes in data structures used by libc and kernel
for correct data handling both with and without enabled time64 support.

Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
47 files changed:
extra/Configs/Config.in
libc/inet/socketcalls.c
libc/misc/sysvipc/sem.c
libc/misc/time/time.c
libc/sysdeps/linux/arm/bits/kernel_stat.h
libc/sysdeps/linux/common/__rt_sigtimedwait.c
libc/sysdeps/linux/common/alarm.c
libc/sysdeps/linux/common/bits/sem.h
libc/sysdeps/linux/common/bits/syscalls-common.h
libc/sysdeps/linux/common/bits/typesizes.h
libc/sysdeps/linux/common/clock_adjtime.c
libc/sysdeps/linux/common/clock_getres.c
libc/sysdeps/linux/common/clock_gettime.c
libc/sysdeps/linux/common/clock_settime.c
libc/sysdeps/linux/common/fstatat.c
libc/sysdeps/linux/common/gettimeofday.c
libc/sysdeps/linux/common/nanosleep.c
libc/sysdeps/linux/common/ppoll.c
libc/sysdeps/linux/common/pselect.c
libc/sysdeps/linux/common/sched_rr_get_interval.c
libc/sysdeps/linux/common/setitimer.c
libc/sysdeps/linux/common/settimeofday.c
libc/sysdeps/linux/common/timerfd.c
libc/sysdeps/linux/common/utimensat.c
libc/sysdeps/linux/common/wait4.c
libc/sysdeps/linux/common/xstatconv.c
libpthread/linuxthreads/condvar.c
libpthread/nptl/init.c
libpthread/nptl/pthread_condattr_setclock.c
libpthread/nptl/pthread_mutex_init.c
libpthread/nptl/pthread_mutex_lock.c
libpthread/nptl/pthread_mutex_timedlock.c
libpthread/nptl/pthread_mutex_trylock.c
libpthread/nptl/pthread_mutex_unlock.c
libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c
libpthread/nptl/sysdeps/unix/sysv/linux/lowlevellock.h
libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c
libpthread/nptl/sysdeps/unix/sysv/linux/timer_create.c
libpthread/nptl/sysdeps/unix/sysv/linux/timer_gettime.c
libpthread/nptl/sysdeps/unix/sysv/linux/timer_settime.c
librt/clock_getcpuclockid.c
librt/clock_gettime.c
librt/clock_nanosleep.c
librt/mq_timedreceive.c
librt/mq_timedsend.c
librt/timer_gettime.c
librt/timer_settime.c