This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[[PATCH RFC 2] 00/63] Make GLIBC Y2038-proof


This series implements Y2038-proof types, implementation, internal
functions, and APIs. For more information, see documentation at
https://sourceware.org/glibc/wiki/Y2038ProofnessDesign

Each patch in this series except the last add one type or function,
with a few exception where several functions are implemented as a whole.

Right now, this series provides a 64-bit time API to application code
but does not use 64-bit Linux syscalls, only 32-bit ones. This means
application code will most probably not run properly if times involved
go beyond Y2038, but should work fine otherwise.

These patches are currently tested using an ad hoc framework published
at https://github.com/3adev/y2038 which runs functional tests of the
APIS below, at and beyond the Y2038 limit. The tests are run on the
ARM and PPC architecture.

These patches have also been subjected to a 'make (x)check' on the ARM
architexcture and the results compared to those obtained without the
patches; no new failure is introduced by the series.

The last patch enables the _TIME_BITS mechanism. Once this patch is
applied, API header files will will use 64-bit time if _TIME_BITS is
defined and equal to 64 prior to their inclusion, and conversively,
will use 32-bit time if _TIME_BITS is different from 64 or does not
exist.

Albert ARIBAUD (3ADEV) (63):
  Y2038: add type __time64_t
  Y2038: add function __difftime64
  Y2038: make __tz_convert compatible with 64-bit-time
  Y2038: add function __localtime64
  Y2038: add function __localtime64_r
  Y2038: add function __gmtime64
  Y2038: add function __gmtime64_r
  Y2038: add function __ctime64
  Y2038: add function __ctime64_r
  Y2038: implement 64-bit-time __mktime64() and timelocal()
  Y2038: implement 64-bit-time __timegm64()
  Y2038: add struct __timespec64
  Y2038: add function __clock_gettime64
  Y2038: arm: implement clock_gettime64 as a VDSO symbol
  Y2038: powerpc: implement clock_gettime64 as a VDSO symbol
  Y2038: add function __clock_settime64
  Y2038: add function __clock_getres64
  Y2038: add function __clock_nanosleep64
  Y2038: add function __timespec_get64
  Y2038: add function __futimens64
  Y2038: add function __utimensat64
  Y2038: add function __sigtimedwait64
  Y2038: add struct __timeval64
  Y2038: add function __futimes64
  Y2038: add function __lutimes64
  Y2038: add struct __itimerspec64
  Y2038: add function __timer_gettime64
  Y2038: add function __timer_settime64
  Y2038: add function __timerfd_gettime64
  Y2038: add function __timerfd_settime64
  Y2038: add struct __stat64_t64
  Y2038: add function __fstat64_t64 (and __fxstat64_t64)
  Y2038: add function __stat64_t64 (and __xstat64_t64)
  Y2038: add function __lstat64_t64 (and __lxstat64_t64)
  Y2038: add function __fstatat64_t64 (and __fxstatat_t64)
  Y2038: add function __gettimeofday64
  Y2038: add function __settimeofday64
  Y2038: add function __time64
  Y2038: add function __stime64
  Y2038: add function __utimes64
  Y2038: add function __mq_timedreceived64
  Y2038: add function __mq_timedsend64
  Y2038: add function __msgctl64
  Y2038: add function __sched_rr_get_interval64
  Y2038: add function __nanosleep64
  Y2038: add function __adjtime64
  Y2038: add function __utime64
  Y2038: add struct __itimerval64
  Y2038: add function __getitimer64
  Y2038: add function __setitimer64
  Y2038: add functions using futexes
  Y2038: add function __getrusage64
  Y2038: add struct __ntp_timeval64
  Y2038: add function __ntp_gettime64
  Y2038: add function __ntp_gettimex64
  Y2038: add struct __timex64
  Y2038: add function __adjtimex64 (and __ntp_adjtime64)
  Y2038: add function pselect64
  Y2038: add function select64
  Y2038: add function __clntudp_create64
  Y2038: add function __clntudp_bufcreate64
  Y2038: add function __pmap_rmtcall64
  Y2038: add _TIME_BITS support

 bits/typesizes.h                                   |   1 +
 include/features.h                                 |  19 +
 include/sys/select.h                               |  13 +
 include/sys/stat.h                                 |  35 ++
 include/sys/time.h                                 |   4 +
 include/time.h                                     | 188 +++++-
 include/utime.h                                    |   7 +
 io/Makefile                                        |   2 +-
 io/Versions                                        |   5 +
 io/fstat64.c                                       |   7 +
 io/fstatat64.c                                     |   7 +
 io/futimens.c                                      |   8 +
 io/lstat64.c                                       |   7 +
 io/stat64.c                                        |   7 +
 io/sys/stat.h                                      |  75 ++-
 io/utime.c                                         |  16 +
 io/utime.h                                         |  16 +-
 io/utimensat.c                                     |   9 +
 manual/creature.texi                               |  28 +
 misc/Makefile                                      |   3 +-
 misc/futimes.c                                     |   9 +
 misc/lutimes.c                                     |   8 +
 misc/sys/select.h                                  |  25 +
 misc/utimes.c                                      |  15 +
 nptl/Versions                                      |   8 +
 nptl/lll_timedlock_wait.c                          |  37 ++
 nptl/pthread_cond_wait.c                           | 285 +++++++++
 nptl/pthread_mutex_timedlock.c                     | 636 +++++++++++++++++++++
 nptl/pthread_rwlock_common.c                       | 591 +++++++++++++++++++
 nptl/pthread_rwlock_timedrdlock.c                  |  19 +
 nptl/pthread_rwlock_timedwrlock.c                  |  19 +
 nptl/sem_timedwait.c                               |  18 +
 nptl/sem_wait.c                                    |  24 +
 nptl/sem_waitcommon.c                              | 172 ++++++
 posix/Makefile                                     |   3 +-
 posix/Versions                                     |   2 +
 posix/bits/types.h                                 |   3 +-
 posix/nanosleep64.c                                |  63 ++
 posix/sched.h                                      |   9 +
 posix/sched_rr_gi64.c                              |  51 ++
 resource/Makefile                                  |   2 +-
 resource/Versions                                  |   3 +
 resource/getrusage64.c                             | 187 ++++++
 resource/sys/resource.h                            |   9 +
 rt/Makefile                                        |   6 +-
 rt/Versions                                        |   9 +
 rt/mq_timedreceive64.c                             |  46 ++
 rt/mq_timedsend64.c                                |  45 ++
 rt/mqueue.h                                        |  22 +
 rt/timerfd_gettime64.c                             |  29 +
 rt/timerfd_settime64.c                             |  30 +
 signal/signal.h                                    |  10 +
 signal/sigtimedwait.c                              |  10 +
 sunrpc/clnt_udp.c                                  |  37 ++
 sunrpc/pmap_rmt.c                                  |  23 +
 sunrpc/rpc/clnt.h                                  |  24 +
 sunrpc/rpc/pmap_clnt.h                             |  15 +
 sysdeps/nptl/aio_misc.h                            |  39 ++
 sysdeps/nptl/lowlevellock.h                        |  17 +
 sysdeps/nptl/pthread.h                             |  41 ++
 sysdeps/posix/clock_getres.c                       |  96 +++-
 sysdeps/posix/time64.c                             |  43 ++
 sysdeps/posix/utime64.c                            |  46 ++
 sysdeps/powerpc/powerpc32/backtrace.c              |   1 +
 sysdeps/pthread/aio_suspend.c                      | 164 ++++++
 sysdeps/pthread/semaphore.h                        |  10 +
 sysdeps/unix/clock_gettime.c                       |  54 ++
 sysdeps/unix/clock_settime.c                       |  56 +-
 sysdeps/unix/stime64.c                             |  47 ++
 sysdeps/unix/sysv/linux/Versions                   |   2 +
 sysdeps/unix/sysv/linux/adjtime.c                  | 124 ++++
 sysdeps/unix/sysv/linux/arm/init-first.c           |  15 +
 sysdeps/unix/sysv/linux/arm/libc-vdso.h            |   1 +
 sysdeps/unix/sysv/linux/arm/libpthread.abilist     |   4 +
 sysdeps/unix/sysv/linux/arm/librt.abilist          |   8 +
 sysdeps/unix/sysv/linux/bits/msq.h                 |  20 +
 sysdeps/unix/sysv/linux/bits/stat.h                |   6 +-
 sysdeps/unix/sysv/linux/clock_getres.c             |  60 ++
 sysdeps/unix/sysv/linux/clock_gettime.c            |  81 +++
 sysdeps/unix/sysv/linux/clock_nanosleep.c          |  42 +-
 sysdeps/unix/sysv/linux/clock_settime.c            |  60 ++
 sysdeps/unix/sysv/linux/futex-internal.h           | 123 ++++
 sysdeps/unix/sysv/linux/futimens.c                 |  48 ++
 sysdeps/unix/sysv/linux/futimes.c                  |  59 ++
 sysdeps/unix/sysv/linux/fxstat64.c                 |  50 ++
 sysdeps/unix/sysv/linux/fxstatat64.c               |  54 ++
 sysdeps/unix/sysv/linux/gettimeofday64.c           |  48 ++
 sysdeps/unix/sysv/linux/lowlevellock-futex.h       |  22 +
 sysdeps/unix/sysv/linux/lutimes.c                  |  58 ++
 sysdeps/unix/sysv/linux/lxstat64.c                 |  50 ++
 sysdeps/unix/sysv/linux/msgctl.c                   |  72 +++
 sysdeps/unix/sysv/linux/ntp_gettime.c              |  25 +
 sysdeps/unix/sysv/linux/ntp_gettimex.c             |  31 +
 sysdeps/unix/sysv/linux/powerpc/init-first.c       |  16 +
 sysdeps/unix/sysv/linux/powerpc/libc-vdso.h        |   2 +
 .../linux/powerpc/powerpc32/libpthread.abilist     |   4 +
 .../sysv/linux/powerpc/powerpc32/librt.abilist     |   8 +
 sysdeps/unix/sysv/linux/pselect.c                  |  61 ++
 sysdeps/unix/sysv/linux/select.c                   |  66 +++
 sysdeps/unix/sysv/linux/settimeofday64.c           |  39 ++
 sysdeps/unix/sysv/linux/sigtimedwait.c             |  76 +++
 sysdeps/unix/sysv/linux/sys/timerfd.h              |  19 +
 sysdeps/unix/sysv/linux/sys/timex.h                |  45 +-
 sysdeps/unix/sysv/linux/timer_gettime.c            |  22 +
 sysdeps/unix/sysv/linux/timer_settime.c            |  39 ++
 sysdeps/unix/sysv/linux/timerfd_gettime64.c        |  43 ++
 sysdeps/unix/sysv/linux/timerfd_settime64.c        |  61 ++
 sysdeps/unix/sysv/linux/timespec_get.c             |  41 ++
 sysdeps/unix/sysv/linux/utimensat.c                |  58 ++
 sysdeps/unix/sysv/linux/utimes64.c                 |  54 ++
 sysdeps/unix/sysv/linux/xstat64.c                  |  50 ++
 sysvipc/Versions                                   |   3 +
 sysvipc/sys/msg.h                                  |   9 +
 time/Makefile                                      |   3 +
 time/Versions                                      |  29 +
 time/adjtime.c                                     |  10 +
 time/bits/types/struct_itimerspec.h                |  13 +
 time/bits/types/struct_timespec.h                  |  30 +
 time/bits/types/struct_timeval.h                   |  15 +
 time/bits/types/time_t.h                           |   4 +
 time/ctime.c                                       |  10 +
 time/ctime_r.c                                     |   9 +
 time/difftime.c                                    |   9 +
 time/getitimer64.c                                 |  53 ++
 time/gettimeofday.c                                |  11 +-
 time/gmtime.c                                      |  30 +-
 time/localtime.c                                   |  32 +-
 time/mktime.c                                      | 403 +++++++++++++
 time/offtime.c                                     |   8 +-
 time/setitimer64.c                                 |  71 +++
 time/settimeofday.c                                |   8 +
 time/stime.c                                       |  17 +
 time/sys/time.h                                    |  84 +++
 time/time.c                                        |  13 +
 time/time.h                                        | 161 +++++-
 time/timegm.c                                      |  11 +
 time/tzfile.c                                      |   4 +-
 time/tzset.c                                       |  24 +-
 138 files changed, 6359 insertions(+), 57 deletions(-)
 create mode 100644 posix/nanosleep64.c
 create mode 100644 posix/sched_rr_gi64.c
 create mode 100644 resource/getrusage64.c
 create mode 100644 rt/mq_timedreceive64.c
 create mode 100644 rt/mq_timedsend64.c
 create mode 100644 rt/timerfd_gettime64.c
 create mode 100644 rt/timerfd_settime64.c
 create mode 100644 sysdeps/posix/time64.c
 create mode 100644 sysdeps/posix/utime64.c
 create mode 100644 sysdeps/unix/stime64.c
 create mode 100644 sysdeps/unix/sysv/linux/gettimeofday64.c
 create mode 100644 sysdeps/unix/sysv/linux/settimeofday64.c
 create mode 100644 sysdeps/unix/sysv/linux/timerfd_gettime64.c
 create mode 100644 sysdeps/unix/sysv/linux/timerfd_settime64.c
 create mode 100644 sysdeps/unix/sysv/linux/utimes64.c
 create mode 100644 time/getitimer64.c
 create mode 100644 time/setitimer64.c

-- 
2.14.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]