public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 00/25] Add 64 bit time support on legacy ABIs
@ 2021-05-18 20:55 Adhemerval Zanella
  2021-05-18 20:55 ` [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
                   ` (25 more replies)
  0 siblings, 26 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

This is an updated version of my previous patchset [1].  Based on
the reviews and weekly call discussions, I dropped the utmp and
lastlogin fixes and the also the internal time64 usage.

The former requires further discussion, since we might just deprecate
the interface since its hard to fix issues (such as BZ#24492).  The
later is not really required and simplifies the patchset (I plan to
resend it once we get the 64 bit time support upstream).

I also rebased against master to get the newer pthread move in sync
(which should not interfere with the 64 bit time_t anymore) and fixes
some issues.

As before this patchset add support for 64 bit time on ABIs which only
support 32 bit time.  It is done through a new build flags,
_TIME_BITS=64, which is supported only when Long File Support is also
used (_FILE_OFFSET_BITS=64).  The new flag redefine the required
structures and redirected the required symbols to newer exported ones.

However, different then LFS support, the new 64 bit time_t symbols
are only exported for the ABI that require them.  ABIs that provides
64 bit time as the default ABI are unaffected.

On Linux, to fully support 64 bit time_t it requires a minimum of
kernel v5.1 due the newer syscalls.

To make the patch review easier, it is divided in 3 subparts:

  1. Patches from 01/23 to 04/52 are changes requires which is
     indepedent of 64 bit time support.

  2. Patches from 04/23 to 19/23 export the newer 64 bit time symbols
     and enable the _TImE_BITS on installed headers.

  3. Patches from 20/23 to 23/23 enables basic test coverage.  It covers
     now all but two symbols (getrusage and gai_suspend).

I checked for i686-linux-gnu running on a x86_64 5.4 kernel,
powerpc-linux-gnu running on ppc64 5.10 kernel, and on
arm-linux-gnueabihf running on arm64 5.4 kernel.  The new 64 bit time_t
tests when running on older kernels shows as unsupported.

[1] https://patchwork.sourceware.org/project/glibc/list/?series=1783

Adhemerval Zanella (23):
  linux: mips: Split libpthread.abilist in n32 and n64
  linux: mips: Split librt.abilist in n32 and n64
  linux: mips: Split libanl.abilist in n32 and n64
  linux: s390: Add libanl.abilist in s390 and s390x
  linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO
  linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}
  y2038: Add __USE_TIME_BITS64 support for time_t
  y2038: Add __USE_TIME_BITS64 support for struct timeval
  y2038: Add __USE_TIME_BITS64 support for struct timespec
  y2038: Add __USE_TIME_BITS64 support for struct utimbuf
  y2038: linux: Add __USE_TIME_BITS64 support for struct timex
  y2038: Use a common definition for semid_ds
  y2038: Use a common definition for shmid_ds
  y2038: Add __USE_TIME_BITS64 support for socket-constants.h
  time: Add 64 bit time support for getdate
  y2038: Add support for 64 bit time on legacy ABIs
  posix: Add glob64 with 64 bit time_t support
  io: Add fts64 with 64 bit time_t support
  io: Add ftw64 with 64 bit time_t support
  libsupport: Add 64 bit time_t support for time functions
  libsupport: Add 64 bit time_t support for stat functions
  y2038: Add test coverage

Lukasz Majewski (2):
  y2038: Use a common definition for stat
  y2038: Use a common definition for msqid_ds

 Makeconfig                                    |  14 ++
 Makefile                                      |   2 +-
 Makerules                                     |  18 ++-
 NEWS                                          |   5 +
 include/features-time64.h                     |   1 +
 include/features.h                            |   2 +
 include/fts.h                                 |  51 +++++++
 include/ftw.h                                 |  18 +++
 include/glob.h                                |  28 ++++
 include/sys/socket.h                          |   5 +
 include/sys/stat.h                            |   2 +-
 include/time.h                                |  12 +-
 io/Makefile                                   |  28 +++-
 io/fts.h                                      |  43 +++++-
 io/fts64-time64.c                             |  35 +++++
 io/ftw.c                                      |   5 +-
 io/ftw.h                                      |  46 +++++-
 io/ftw64-time64.c                             |  34 +++++
 io/ftwtest-time64.c                           |   1 +
 io/sys/poll.h                                 |  11 ++
 io/sys/stat.h                                 | 113 ++++++++++++--
 io/tst-fts-time64.c                           |   1 +
 io/tst-futimens-time64.c                      |   2 +
 io/tst-futimens.c                             |   6 +-
 io/tst-futimes-time64.c                       |   2 +
 io/tst-futimes.c                              |   6 +-
 io/tst-futimesat-time64.c                     |   4 +
 io/tst-futimesat.c                            |  47 ++++--
 io/tst-lutimes-time64.c                       |   2 +
 io/tst-lutimes.c                              |  10 +-
 io/tst-stat-time64.c                          | 102 +++++++++++++
 io/tst-utime-time64.c                         |   2 +
 io/tst-utime.c                                |   6 +-
 io/tst-utimensat-time64.c                     |   2 +
 io/tst-utimensat.c                            |  12 +-
 io/tst-utimes-time64.c                        |   2 +
 io/tst-utimes.c                               |   6 +-
 io/utime.h                                    |  16 ++
 manual/creature.texi                          |  44 ++++++
 misc/Makefile                                 |   4 +
 misc/sys/select.h                             |  27 ++++
 misc/tst-pselect-time64.c                     |   1 +
 misc/tst-select-time64.c                      |   1 +
 nptl/Makefile                                 |   3 +
 nptl/pthread_clockjoin.c                      |   3 +-
 nptl/pthread_cond_wait.c                      |   9 +-
 nptl/pthread_mutex_timedlock.c                |   8 +-
 nptl/pthread_rwlock_clockrdlock.c             |   4 +-
 nptl/pthread_rwlock_clockwrlock.c             |   4 +-
 nptl/pthread_rwlock_timedrdlock.c             |   4 +-
 nptl/pthread_rwlock_timedwrlock.c             |   4 +-
 nptl/pthread_timedjoin.c                      |   3 +-
 nptl/sem_clockwait.c                          |   3 +-
 nptl/sem_timedwait.c                          |   4 +-
 nptl/tst-cancel4_2-time64.c                   |   1 +
 posix/Makefile                                |   7 +-
 posix/glob.c                                  |  46 +++---
 posix/glob.h                                  |  22 +++
 posix/glob64-lstat-compat.c                   |   3 +-
 posix/glob64-time64.c                         |  49 +++++++
 posix/globfree64-time64.c                     |  30 ++++
 posix/sched.h                                 |  11 +-
 posix/sys/wait.h                              |  20 +++
 posix/tst-gnuglob64-time64.c                  |   7 +
 posix/tst-sched_rr_get_interval-time64.c      |   1 +
 posix/tst-wait3-time64.c                      |   1 +
 posix/tst-wait4-time64.c                      |   1 +
 resolv/netdb.h                                |  11 ++
 resource/sys/resource.h                       |  10 ++
 rt/Makefile                                   |   9 ++
 rt/aio.h                                      |  15 +-
 rt/mqueue.h                                   |  22 +++
 rt/tst-aio6-time64.c                          |   1 +
 rt/tst-cpuclock2-time64.c                     |   1 +
 rt/tst-cpuclock2.c                            |   9 +-
 rt/tst-mqueue1-time64.c                       |   1 +
 rt/tst-mqueue2-time64.c                       |   1 +
 rt/tst-mqueue4-time64.c                       |   1 +
 rt/tst-mqueue8-time64.c                       |   1 +
 rt/tst-timer4-time64.c                        |   1 +
 signal/signal.h                               |  13 ++
 socket/sys/socket.h                           |  11 ++
 support/Makefile                              |   9 ++
 support/support-xfstat-time64.c               |  32 ++++
 support/support-xstat-time64.c                |  32 ++++
 support/timespec-add-time64.c                 |  27 ++++
 support/timespec-add.c                        |   2 +-
 support/timespec-sub-time64.c                 |  27 ++++
 support/timespec-sub.c                        |   2 +-
 support/timespec-time64.c                     |  40 +++++
 support/timespec.c                            |   9 +-
 support/timespec.h                            |  52 +++++--
 support/xclock_gettime_time64.c               |  26 ++++
 support/xclock_settime_time64.c               |  23 +++
 support/xlstat-time64.c                       |  32 ++++
 support/xtime.h                               |   7 +
 support/xunistd.h                             |  13 ++
 sysdeps/generic/features-time64.h             |  19 +++
 sysdeps/generic/time64-compat.h               |   3 +
 sysdeps/gnu/glob64-lstat-compat.c             |   3 +-
 sysdeps/nptl/pthread.h                        | 119 +++++++++++++++
 sysdeps/pthread/Makefile                      |  10 ++
 sysdeps/pthread/semaphore.h                   |  25 ++++
 sysdeps/pthread/threads.h                     |  33 +++++
 sysdeps/pthread/tst-abstime-time64.c          |   1 +
 sysdeps/pthread/tst-cnd-timedwait-time64.c    |   1 +
 sysdeps/pthread/tst-cond11-time64.c           |   1 +
 sysdeps/pthread/tst-join14-time64.c           |   1 +
 sysdeps/pthread/tst-mtx-timedlock-time64.c    |   1 +
 sysdeps/pthread/tst-rwlock14-time64.c         |   1 +
 sysdeps/pthread/tst-sem5-time64.c             |   1 +
 sysdeps/pthread/tst-thrd-sleep-time64.c       |   1 +
 sysdeps/unix/sysv/linux/Makefile              |  18 ++-
 sysdeps/unix/sysv/linux/Versions              | 107 ++++++++++++++
 sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  76 ++++++++++
 sysdeps/unix/sysv/linux/arm/be/librt.abilist  |   5 +
 sysdeps/unix/sysv/linux/arm/le/libanl.abilist |   1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  76 ++++++++++
 sysdeps/unix/sysv/linux/arm/le/librt.abilist  |   5 +
 sysdeps/unix/sysv/linux/arm/time64-compat.h   |   2 +
 sysdeps/unix/sysv/linux/bits/msq.h            |   1 +
 sysdeps/unix/sysv/linux/bits/sem.h            |   1 +
 sysdeps/unix/sysv/linux/bits/shm.h            |   1 +
 .../unix/sysv/linux/bits/socket-constants.h   |  47 +++++-
 sysdeps/unix/sysv/linux/bits/struct_stat.h    |  51 ++++---
 .../linux/bits/struct_stat_time64_helper.h    |  63 ++++++++
 sysdeps/unix/sysv/linux/bits/time.h           |  10 ++
 sysdeps/unix/sysv/linux/bits/timex.h          |  31 ++++
 .../sysv/linux/bits/types/struct_msqid64_ds.h |  10 +-
 .../bits/types/struct_msqid64_ds_helper.h     |  28 ++++
 .../sysv/linux/bits/types/struct_msqid_ds.h   |  12 +-
 .../sysv/linux/bits/types/struct_semid64_ds.h |   5 +-
 .../bits/types/struct_semid64_ds_helper.h     |  23 +++
 .../sysv/linux/bits/types/struct_semid_ds.h   |  10 +-
 .../sysv/linux/bits/types/struct_shmid64_ds.h |   9 +-
 .../bits/types/struct_shmid64_ds_helper.h     |  26 ++++
 .../sysv/linux/bits/types/struct_shmid_ds.h   |  10 +-
 sysdeps/unix/sysv/linux/cnd_timedwait.c       |   8 +-
 .../unix/sysv/linux/convert_scm_timestamps.c  |  96 ++++++++++++
 sysdeps/unix/sysv/linux/csky/libanl.abilist   |   1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  76 ++++++++++
 sysdeps/unix/sysv/linux/csky/librt.abilist    |   5 +
 sysdeps/unix/sysv/linux/csky/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/features-time64.h     |  37 +++++
 sysdeps/unix/sysv/linux/getsockopt.c          |  79 +++++++++-
 sysdeps/unix/sysv/linux/glob-lstat-compat.c   |   6 +-
 sysdeps/unix/sysv/linux/glob.c                |   6 +
 sysdeps/unix/sysv/linux/glob64-lstat-compat.c |  12 +-
 sysdeps/unix/sysv/linux/glob64-time64.c       |  44 ++++++
 sysdeps/unix/sysv/linux/glob64.c              |   8 +-
 sysdeps/unix/sysv/linux/globfree64-time64.c   |  35 +++++
 .../sysv/linux/hppa/bits/socket-constants.h   |  36 ++++-
 .../linux/hppa/bits/types/struct_msqid_ds.h   |  12 +-
 .../linux/hppa/bits/types/struct_semid_ds.h   |   4 +
 .../linux/hppa/bits/types/struct_shmid_ds.h   |  10 +-
 sysdeps/unix/sysv/linux/hppa/libanl.abilist   |   1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  76 ++++++++++
 sysdeps/unix/sysv/linux/hppa/librt.abilist    |   5 +
 .../sysv/linux/hppa/socket-constants-time64.h |  35 +++++
 sysdeps/unix/sysv/linux/hppa/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/i386/Makefile         |   2 +
 sysdeps/unix/sysv/linux/i386/libanl.abilist   |   1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  76 ++++++++++
 sysdeps/unix/sysv/linux/i386/librt.abilist    |   5 +
 sysdeps/unix/sysv/linux/i386/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/include/sys/msg.h     |   2 -
 sysdeps/unix/sysv/linux/include/sys/shm.h     |   2 -
 sysdeps/unix/sysv/linux/include/sys/timex.h   |   2 +
 .../unix/sysv/linux/m68k/bits/struct_stat.h   |  50 ++++---
 .../sysv/linux/m68k/coldfire/libanl.abilist   |   1 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |  76 ++++++++++
 .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
 .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  76 ++++++++++
 .../unix/sysv/linux/m68k/m680x0/librt.abilist |   5 +
 sysdeps/unix/sysv/linux/m68k/time64-compat.h  |   2 +
 .../sysv/linux/microblaze/be/libanl.abilist   |   1 +
 .../sysv/linux/microblaze/be/libc.abilist     |  76 ++++++++++
 .../sysv/linux/microblaze/be/librt.abilist    |   5 +
 .../sysv/linux/microblaze/bits/struct_stat.h  |  48 +++---
 .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
 .../sysv/linux/microblaze/le/libc.abilist     |  76 ++++++++++
 .../sysv/linux/microblaze/le/librt.abilist    |   5 +
 .../sysv/linux/microblaze/time64-compat.h     |   2 +
 .../sysv/linux/mips/bits/socket-constants.h   |  36 ++++-
 .../unix/sysv/linux/mips/bits/struct_stat.h   |  89 ++++++-----
 .../linux/mips/bits/types/struct_msqid_ds.h   |  18 ++-
 .../linux/mips/bits/types/struct_semid_ds.h   |   4 +
 .../linux/mips/bits/types/struct_shmid_ds.h   |  14 +-
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  76 ++++++++++
 .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
 .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  76 ++++++++++
 .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
 .../sysv/linux/mips/mips64/n32/libanl.abilist |   5 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  76 ++++++++++
 .../mips/mips64/{ => n32}/libpthread.abilist  |   0
 .../sysv/linux/mips/mips64/n32/librt.abilist  |  42 ++++++
 .../linux/mips/mips64/n32/time64-compat.h     |   2 +
 .../mips/mips64/{ => n64}/libanl.abilist      |   0
 .../linux/mips/mips64/n64/libpthread.abilist  |  15 ++
 .../linux/mips/mips64/{ => n64}/librt.abilist |   0
 .../sysv/linux/mips/socket-constants-time64.h |  35 +++++
 sysdeps/unix/sysv/linux/mtx_timedlock.c       |   8 +-
 sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  76 ++++++++++
 sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
 sysdeps/unix/sysv/linux/oldglob.c             |  11 +-
 .../linux/powerpc/bits/socket-constants.h     |  36 ++++-
 .../sysv/linux/powerpc/bits/struct_stat.h     |  52 ++++---
 .../powerpc/bits/types/struct_msqid_ds.h      |  12 +-
 .../powerpc/bits/types/struct_semid_ds.h      |  10 +-
 .../powerpc/bits/types/struct_shmid_ds.h      |  10 +-
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  76 ++++++++++
 .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
 .../linux/powerpc/powerpc32/librt.abilist     |   5 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  76 ++++++++++
 .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
 .../linux/powerpc/socket-constants-time64.h   |  35 +++++
 sysdeps/unix/sysv/linux/recvmmsg.c            |  17 ++-
 sysdeps/unix/sysv/linux/recvmsg.c             |  23 ++-
 .../unix/sysv/linux/s390/bits/struct_stat.h   |  56 ++++---
 .../sysv/linux/s390/s390-32/libanl.abilist    |   5 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  76 ++++++++++
 .../sysv/linux/s390/s390-32/librt.abilist     |   5 +
 .../sysv/linux/s390/s390-32/time64-compat.h   |   2 +
 .../linux/s390/{ => s390-64}/libanl.abilist   |   0
 sysdeps/unix/sysv/linux/semctl.c              |   1 -
 sysdeps/unix/sysv/linux/setsockopt.c          |  83 ++++++++++-
 sysdeps/unix/sysv/linux/sh/be/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  76 ++++++++++
 sysdeps/unix/sysv/linux/sh/be/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/sh/le/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  76 ++++++++++
 sysdeps/unix/sysv/linux/sh/le/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/sh/time64-compat.h    |   2 +
 .../unix/sysv/linux/socket-constants-time64.h |  35 +++++
 .../sysv/linux/sparc/bits/socket-constants.h  |  36 ++++-
 .../linux/sparc/bits/types/struct_msqid_ds.h  |  12 +-
 .../linux/sparc/bits/types/struct_semid_ds.h  |  10 +-
 .../linux/sparc/bits/types/struct_shmid_ds.h  |  10 +-
 .../linux/sparc/socket-constants-time64.h     |  35 +++++
 .../sysv/linux/sparc/sparc32/libanl.abilist   |   1 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  76 ++++++++++
 .../sysv/linux/sparc/sparc32/librt.abilist    |   5 +
 .../sysv/linux/sparc/sparc32/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/struct_stat_time64.h  |  59 +-------
 sysdeps/unix/sysv/linux/sys/timerfd.h         |  22 +++
 sysdeps/unix/sysv/linux/sys/timex.h           |  27 +++-
 sysdeps/unix/sysv/linux/tst-adjtimex-time64.c |   1 +
 .../sysv/linux/tst-clock_adjtime-time64.c     |   1 +
 .../unix/sysv/linux/tst-ntp_adjtime-time64.c  |   1 +
 .../unix/sysv/linux/tst-ntp_gettime-time64.c  |   1 +
 .../unix/sysv/linux/tst-ntp_gettimex-time64.c |   1 +
 sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
 .../unix/sysv/linux/tst-sigtimedwait-time64.c |   1 +
 sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
 .../unix/sysv/linux/x86/bits/struct_stat.h    |  90 ++++++------
 .../linux/x86/bits/types/struct_semid_ds.h    |   4 +
 sysvipc/Makefile                              |   2 +
 sysvipc/sys/msg.h                             |  10 ++
 sysvipc/sys/sem.h                             |  21 +++
 sysvipc/sys/shm.h                             |  10 ++
 sysvipc/test-sysvmsg-time64.c                 |   1 +
 sysvipc/test-sysvsem-time64.c                 |   1 +
 sysvipc/test-sysvshm-time64.c                 |   1 +
 time/Makefile                                 |  18 +++
 time/bits/types/struct_timespec.h             |  12 +-
 time/bits/types/struct_timeval.h              |   5 +
 time/bits/types/time_t.h                      |   4 +
 time/getdate.c                                |  22 ++-
 time/sys/time.h                               |  71 +++++++++
 time/time.h                                   | 138 +++++++++++++++++-
 time/tst-adjtime-time64.c                     |   1 +
 time/tst-clock-time64.c                       |   1 +
 time/tst-clock2-time64.c                      |   1 +
 time/tst-clock_nanosleep-time64.c             |   1 +
 time/tst-clock_settime-time64.c               |   1 +
 time/tst-cpuclock1-time64.c                   |   1 +
 time/tst-ctime-time64.c                       |   1 +
 time/tst-ctime.c                              |  16 ++
 time/tst-difftime-time64.c                    |   1 +
 time/tst-getdate.c                            |  14 +-
 time/tst-gmtime-time64.c                      |   1 +
 time/tst-itimer-time64.c                      |   1 +
 time/tst-mktime4-time64.c                     |   1 +
 time/tst-settimeofday-time64.c                |   1 +
 time/tst-timegm-time64.c                      |   1 +
 time/tst-timespec_get-time64.c                |   1 +
 time/tst-timespec_getres-time64.c             |   1 +
 time/tst-y2039-time64.c                       |   1 +
 time/tst-y2039.c                              |  10 ++
 294 files changed, 5048 insertions(+), 538 deletions(-)
 create mode 100644 include/features-time64.h
 create mode 100644 io/fts64-time64.c
 create mode 100644 io/ftw64-time64.c
 create mode 100644 io/ftwtest-time64.c
 create mode 100644 io/tst-fts-time64.c
 create mode 100644 io/tst-futimens-time64.c
 create mode 100644 io/tst-futimes-time64.c
 create mode 100644 io/tst-futimesat-time64.c
 create mode 100644 io/tst-lutimes-time64.c
 create mode 100644 io/tst-stat-time64.c
 create mode 100644 io/tst-utime-time64.c
 create mode 100644 io/tst-utimensat-time64.c
 create mode 100644 io/tst-utimes-time64.c
 create mode 100644 misc/tst-pselect-time64.c
 create mode 100644 misc/tst-select-time64.c
 create mode 100644 nptl/tst-cancel4_2-time64.c
 create mode 100644 posix/glob64-time64.c
 create mode 100644 posix/globfree64-time64.c
 create mode 100644 posix/tst-gnuglob64-time64.c
 create mode 100644 posix/tst-sched_rr_get_interval-time64.c
 create mode 100644 posix/tst-wait3-time64.c
 create mode 100644 posix/tst-wait4-time64.c
 create mode 100644 rt/tst-aio6-time64.c
 create mode 100644 rt/tst-cpuclock2-time64.c
 create mode 100644 rt/tst-mqueue1-time64.c
 create mode 100644 rt/tst-mqueue2-time64.c
 create mode 100644 rt/tst-mqueue4-time64.c
 create mode 100644 rt/tst-mqueue8-time64.c
 create mode 100644 rt/tst-timer4-time64.c
 create mode 100644 support/support-xfstat-time64.c
 create mode 100644 support/support-xstat-time64.c
 create mode 100644 support/timespec-add-time64.c
 create mode 100644 support/timespec-sub-time64.c
 create mode 100644 support/timespec-time64.c
 create mode 100644 support/xclock_gettime_time64.c
 create mode 100644 support/xclock_settime_time64.c
 create mode 100644 support/xlstat-time64.c
 create mode 100644 sysdeps/generic/features-time64.h
 create mode 100644 sysdeps/generic/time64-compat.h
 create mode 100644 sysdeps/pthread/tst-abstime-time64.c
 create mode 100644 sysdeps/pthread/tst-cnd-timedwait-time64.c
 create mode 100644 sysdeps/pthread/tst-cond11-time64.c
 create mode 100644 sysdeps/pthread/tst-join14-time64.c
 create mode 100644 sysdeps/pthread/tst-mtx-timedlock-time64.c
 create mode 100644 sysdeps/pthread/tst-rwlock14-time64.c
 create mode 100644 sysdeps/pthread/tst-sem5-time64.c
 create mode 100644 sysdeps/pthread/tst-thrd-sleep-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/arm/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
 create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
 create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
 create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
 create mode 100644 sysdeps/unix/sysv/linux/convert_scm_timestamps.c
 create mode 100644 sysdeps/unix/sysv/linux/csky/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/features-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/glob64-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/globfree64-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/hppa/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/i386/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/m68k/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/microblaze/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n64}/libanl.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n64}/librt.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/nios2/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
 rename sysdeps/unix/sysv/linux/s390/{ => s390-64}/libanl.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/sh/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c
 create mode 100644 sysvipc/test-sysvmsg-time64.c
 create mode 100644 sysvipc/test-sysvsem-time64.c
 create mode 100644 sysvipc/test-sysvshm-time64.c
 create mode 100644 time/tst-adjtime-time64.c
 create mode 100644 time/tst-clock-time64.c
 create mode 100644 time/tst-clock2-time64.c
 create mode 100644 time/tst-clock_nanosleep-time64.c
 create mode 100644 time/tst-clock_settime-time64.c
 create mode 100644 time/tst-cpuclock1-time64.c
 create mode 100644 time/tst-ctime-time64.c
 create mode 100644 time/tst-difftime-time64.c
 create mode 100644 time/tst-gmtime-time64.c
 create mode 100644 time/tst-itimer-time64.c
 create mode 100644 time/tst-mktime4-time64.c
 create mode 100644 time/tst-settimeofday-time64.c
 create mode 100644 time/tst-timegm-time64.c
 create mode 100644 time/tst-timespec_get-time64.c
 create mode 100644 time/tst-timespec_getres-time64.c
 create mode 100644 time/tst-y2039-time64.c

-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  8:24   ` Lukasz Majewski
                     ` (2 more replies)
  2021-05-18 20:55 ` [PATCH v2 02/25] linux: mips: Split librt.abilist " Adhemerval Zanella
                   ` (24 subsequent siblings)
  25 siblings, 3 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The n32 will require the 64 bit time symbols for y2038 support.
---
 .../mips/mips64/{ => n32}/libpthread.abilist      |  0
 .../sysv/linux/mips/mips64/n64/libpthread.abilist | 15 +++++++++++++++
 2 files changed, 15 insertions(+)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
new file mode 100644
index 0000000000..a5f3d5ce2a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
@@ -0,0 +1,15 @@
+GLIBC_2.0 __errno_location F
+GLIBC_2.0 pthread_create F
+GLIBC_2.11 __libpthread_version_placeholder F
+GLIBC_2.12 __libpthread_version_placeholder F
+GLIBC_2.18 __libpthread_version_placeholder F
+GLIBC_2.2 pthread_create F
+GLIBC_2.2.3 __libpthread_version_placeholder F
+GLIBC_2.2.6 __libpthread_version_placeholder F
+GLIBC_2.28 thrd_create F
+GLIBC_2.3.2 __libpthread_version_placeholder F
+GLIBC_2.3.3 __libpthread_version_placeholder F
+GLIBC_2.3.4 __libpthread_version_placeholder F
+GLIBC_2.30 __libpthread_version_placeholder F
+GLIBC_2.31 __libpthread_version_placeholder F
+GLIBC_2.4 __libpthread_version_placeholder F
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 02/25] linux: mips: Split librt.abilist in n32 and n64
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
  2021-05-18 20:55 ` [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  8:25   ` Lukasz Majewski
  2021-06-04 19:29   ` Carlos O'Donell
  2021-05-18 20:55 ` [PATCH v2 03/25] linux: mips: Split libanl.abilist " Adhemerval Zanella
                   ` (23 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The n32 will require the 64 bit time symbols for y2038 support.
---
 .../linux/mips/mips64/{ => n32}/librt.abilist |  0
 .../sysv/linux/mips/mips64/n64/librt.abilist  | 37 +++++++++++++++++++
 2 files changed, 37 insertions(+)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/librt.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
rename to sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
new file mode 100644
index 0000000000..1539c1cef9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
@@ -0,0 +1,37 @@
+GLIBC_2.2 aio_cancel F
+GLIBC_2.2 aio_cancel64 F
+GLIBC_2.2 aio_error F
+GLIBC_2.2 aio_error64 F
+GLIBC_2.2 aio_fsync F
+GLIBC_2.2 aio_fsync64 F
+GLIBC_2.2 aio_init F
+GLIBC_2.2 aio_read F
+GLIBC_2.2 aio_read64 F
+GLIBC_2.2 aio_return F
+GLIBC_2.2 aio_return64 F
+GLIBC_2.2 aio_suspend F
+GLIBC_2.2 aio_suspend64 F
+GLIBC_2.2 aio_write F
+GLIBC_2.2 aio_write64 F
+GLIBC_2.2 lio_listio F
+GLIBC_2.2 lio_listio64 F
+GLIBC_2.2 shm_open F
+GLIBC_2.2 shm_unlink F
+GLIBC_2.2 timer_create F
+GLIBC_2.2 timer_delete F
+GLIBC_2.2 timer_getoverrun F
+GLIBC_2.2 timer_gettime F
+GLIBC_2.2 timer_settime F
+GLIBC_2.3.4 mq_close F
+GLIBC_2.3.4 mq_getattr F
+GLIBC_2.3.4 mq_notify F
+GLIBC_2.3.4 mq_open F
+GLIBC_2.3.4 mq_receive F
+GLIBC_2.3.4 mq_send F
+GLIBC_2.3.4 mq_setattr F
+GLIBC_2.3.4 mq_timedreceive F
+GLIBC_2.3.4 mq_timedsend F
+GLIBC_2.3.4 mq_unlink F
+GLIBC_2.4 lio_listio F
+GLIBC_2.4 lio_listio64 F
+GLIBC_2.7 __mq_open_2 F
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 03/25] linux: mips: Split libanl.abilist in n32 and n64
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
  2021-05-18 20:55 ` [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
  2021-05-18 20:55 ` [PATCH v2 02/25] linux: mips: Split librt.abilist " Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  8:25   ` Lukasz Majewski
  2021-06-04 19:30   ` Carlos O'Donell
  2021-05-18 20:55 ` [PATCH v2 04/25] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella
                   ` (22 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The n32 will require the 64 bit time symbols for y2038 support.
---
 sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist | 0
 sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist       | 4 ++++
 2 files changed, 4 insertions(+)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist
rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
new file mode 100644
index 0000000000..d9a5ed015d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.2.3 gai_cancel F
+GLIBC_2.2.3 gai_error F
+GLIBC_2.2.3 gai_suspend F
+GLIBC_2.2.3 getaddrinfo_a F
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 04/25] linux: s390: Add libanl.abilist in s390 and s390x
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (2 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 03/25] linux: mips: Split libanl.abilist " Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  8:26   ` Lukasz Majewski
  2021-06-04 19:30   ` Carlos O'Donell
  2021-05-18 20:55 ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella
                   ` (21 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The s390 will require the 64 bit time symbols for y2038 support.
---
 sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist | 0
 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist       | 4 ++++
 2 files changed, 4 insertions(+)
 rename sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist

diff --git a/sysdeps/unix/sysv/linux/s390/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/s390/libanl.abilist
rename to sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
new file mode 100644
index 0000000000..d9a5ed015d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.2.3 gai_cancel F
+GLIBC_2.2.3 gai_error F
+GLIBC_2.2.3 gai_suspend F
+GLIBC_2.2.3 getaddrinfo_a F
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (3 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 04/25] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  8:36   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO Lukasz Majewski
                     ` (2 more replies)
  2021-05-18 20:55 ` [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella
                   ` (20 subsequent siblings)
  25 siblings, 3 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The constant values will be changed for __TIMESIZE=64, so binaries built
with 64-bit time support might fail to work properly on old kernels.
Both {get,set}sockopt will retry the syscall with the old constant
values and the timeout value adjusted when kernel returns ENOTPROTOPT.

It also adds an internal only SO_{RCV,SND}TIMEO where
COMPAT_SO_{RCV,SND}TIMEO_OLD indicates pre 32 bit time support and
COMPAT_SO_{RCV,SND}TIMEO_NEW indicates time64 support.  It allows to
refer to constant independently of the time_t ABI and kernel version
used.

Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
kernel).
---
 sysdeps/unix/sysv/linux/getsockopt.c          | 67 +++++++++++++++--
 .../sysv/linux/hppa/socket-constants-time64.h | 30 ++++++++
 .../sysv/linux/mips/socket-constants-time64.h | 30 ++++++++
 .../linux/powerpc/socket-constants-time64.h   | 30 ++++++++
 sysdeps/unix/sysv/linux/setsockopt.c          | 71 ++++++++++++++++---
 .../unix/sysv/linux/socket-constants-time64.h | 30 ++++++++
 .../linux/sparc/socket-constants-time64.h     | 30 ++++++++
 7 files changed, 273 insertions(+), 15 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/socket-constants-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h

diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c
index 76ee8a94d6..c8e502d976 100644
--- a/sysdeps/unix/sysv/linux/getsockopt.c
+++ b/sysdeps/unix/sysv/linux/getsockopt.c
@@ -15,16 +15,15 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <signal.h>
 #include <sys/socket.h>
-
+#include <time.h>
+#include <sysdep.h>
 #include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
+#include <socket-constants-time64.h>
 
-int
-__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len)
+static int
+getsockopt_syscall (int fd, int level, int optname, void *optval,
+		    socklen_t *len)
 {
 #ifdef __ASSUME_GETSOCKOPT_SYSCALL
   return INLINE_SYSCALL (getsockopt, 5, fd, level, optname, optval, len);
@@ -32,4 +31,58 @@ __getsockopt (int fd, int level, int optname, void *optval, socklen_t *len)
   return SOCKETCALL (getsockopt, fd, level, optname, optval, len);
 #endif
 }
+
+#ifndef __ASSUME_TIME64_SYSCALLS
+static int
+getsockopt32 (int fd, int level, int optname, void *optval,
+	      socklen_t *len)
+{
+  int r = -1;
+
+  if (level != SOL_SOCKET)
+    return r;
+
+  switch (optname)
+    {
+    case COMPAT_SO_RCVTIMEO_NEW:
+    case COMPAT_SO_SNDTIMEO_NEW:
+      {
+        if (*len < sizeof (struct __timeval64))
+	  {
+	    __set_errno (EINVAL);
+	    break;
+	  }
+
+	if (optname == COMPAT_SO_RCVTIMEO_NEW)
+	  optname = COMPAT_SO_RCVTIMEO_OLD;
+	if (optname == COMPAT_SO_SNDTIMEO_NEW)
+	  optname = COMPAT_SO_SNDTIMEO_OLD;
+
+	struct __timeval32 tv32;
+	r = getsockopt_syscall (fd, level, optname, &tv32,
+				(socklen_t[]) { sizeof tv32 });
+	if (r < 0)
+	  break;
+	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
+	*tv64 = valid_timeval32_to_timeval64 (tv32);
+	*len = sizeof (*tv64);
+      }
+    }
+
+  return r;
+}
+#endif
+
+int
+__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len)
+{
+  int r = getsockopt_syscall (fd, level, optname, optval, len);
+
+#ifndef __ASSUME_TIME64_SYSCALLS
+  if (r == -1 && errno == ENOPROTOOPT)
+    r = getsockopt32 (fd, level, optname, optval, len);
+#endif
+
+ return r;
+}
 weak_alias (__getsockopt, getsockopt)
diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
new file mode 100644
index 0000000000..ea721e0fc2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
@@ -0,0 +1,30 @@
+/* Compat socket constants used in 64 bit compat code.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SOCKET_CONSTANTS_TIME64_H
+#define _SOCKET_CONSTANTS_TIME64_H
+
+/* The compat code requires the SO_* constants used for both 32 and 64 bit
+   time_t, however they were only added on v5.1 kernel.  */
+
+#define COMPAT_SO_RCVTIMEO_OLD 4102
+#define COMPAT_SO_SNDTIMEO_OLD 4101
+#define COMPAT_SO_RCVTIMEO_NEW 16448
+#define COMPAT_SO_SNDTIMEO_NEW 16449
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
new file mode 100644
index 0000000000..ab8bd62853
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
@@ -0,0 +1,30 @@
+/* Compat socket constants used in 64 bit compat code.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SOCKET_CONSTANTS_TIME64_H
+#define _SOCKET_CONSTANTS_TIME64_H
+
+/* The compat code requires the SO_* constants used for both 32 and 64 bit
+   time_t, however they were only added on v5.1 kernel.  */
+
+#define COMPAT_SO_RCVTIMEO_OLD 4102
+#define COMPAT_SO_SNDTIMEO_OLD 4101
+#define COMPAT_SO_RCVTIMEO_NEW 66
+#define COMPAT_SO_SNDTIMEO_NEW 67
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
new file mode 100644
index 0000000000..1e48dcca8d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
@@ -0,0 +1,30 @@
+/* Compat socket constants used in 64 bit compat code.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SOCKET_CONSTANTS_TIME64_H
+#define _SOCKET_CONSTANTS_TIME64_H
+
+/* The compat code requires the SO_* constants used for both 32 and 64 bit
+   time_t, however they were only added on v5.1 kernel.  */
+
+#define COMPAT_SO_RCVTIMEO_OLD 18
+#define COMPAT_SO_SNDTIMEO_OLD 19
+#define COMPAT_SO_RCVTIMEO_NEW 66
+#define COMPAT_SO_SNDTIMEO_NEW 67
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
index 12fd7bdcde..6505202265 100644
--- a/sysdeps/unix/sysv/linux/setsockopt.c
+++ b/sysdeps/unix/sysv/linux/setsockopt.c
@@ -15,21 +15,76 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <signal.h>
 #include <sys/socket.h>
-
+#include <time.h>
+#include <sysdep.h>
 #include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
+#include <socket-constants-time64.h>
 
-int
-setsockopt (int fd, int level, int optname, const void *optval, socklen_t len)
+static int
+setsockopt_syscall (int fd, int level, int optname, const void *optval,
+		    socklen_t len)
 {
 #ifdef __ASSUME_SETSOCKOPT_SYSCALL
-  return INLINE_SYSCALL (setsockopt, 5, fd, level, optname, optval, len);
+  return INLINE_SYSCALL_CALL (setsockopt, fd, level, optname, optval, len);
 #else
   return SOCKETCALL (setsockopt, fd, level, optname, optval, len);
 #endif
 }
+
+#ifndef __ASSUME_TIME64_SYSCALLS
+static int
+setsockopt32 (int fd, int level, int optname, const void *optval,
+	      socklen_t len)
+{
+  int r = -1;
+
+  if (level != SOL_SOCKET)
+    return r;
+
+  switch (optname)
+    {
+    case COMPAT_SO_RCVTIMEO_NEW:
+    case COMPAT_SO_SNDTIMEO_NEW:
+      {
+        if (len < sizeof (struct __timeval64))
+	  {
+	    __set_errno (EINVAL);
+	    break;
+	  }
+
+	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
+	if (! in_time_t_range (tv64->tv_sec))
+	  {
+	    __set_errno (EOVERFLOW);
+	    break;
+	  }
+
+	if (optname == COMPAT_SO_RCVTIMEO_NEW)
+	  optname = COMPAT_SO_RCVTIMEO_OLD;
+	if (optname == COMPAT_SO_SNDTIMEO_NEW)
+	  optname = COMPAT_SO_SNDTIMEO_OLD;
+
+	struct __timeval32 tv32 = valid_timeval64_to_timeval32 (*tv64);
+
+	r = setsockopt_syscall (fd, level, optname, &tv32, sizeof (tv32));
+      }
+    }
+
+  return r;
+}
+#endif
+
+int
+setsockopt (int fd, int level, int optname, const void *optval, socklen_t len)
+{
+  int r = setsockopt_syscall (fd, level, optname, optval, len);
+
+#ifndef __ASSUME_TIME64_SYSCALLS
+  if (r == -1 && errno == ENOPROTOOPT)
+    r = setsockopt32 (fd, level, optname, optval, len);
+#endif
+
+  return r;
+}
 weak_alias (setsockopt, __setsockopt)
diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h b/sysdeps/unix/sysv/linux/socket-constants-time64.h
new file mode 100644
index 0000000000..e5a3777f28
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h
@@ -0,0 +1,30 @@
+/* Compat socket constants used in 64 bit compat code.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SOCKET_CONSTANTS_TIME64_H
+#define _SOCKET_CONSTANTS_TIME64_H
+
+/* The compat code requires the SO_* constants used for both 32 and 64 bit
+   time_t, however they were only added on v5.1 kernel.  */
+
+#define COMPAT_SO_RCVTIMEO_OLD 20
+#define COMPAT_SO_SNDTIMEO_OLD 21
+#define COMPAT_SO_RCVTIMEO_NEW 66
+#define COMPAT_SO_SNDTIMEO_NEW 67
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
new file mode 100644
index 0000000000..b137abdeea
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
@@ -0,0 +1,30 @@
+/* Compat socket constants used in 64 bit compat code.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SOCKET_CONSTANTS_TIME64_H
+#define _SOCKET_CONSTANTS_TIME64_H
+
+/* The compat code requires the SO_* constants used for both 32 and 64 bit
+   time_t, however they were only added on v5.1 kernel.  */
+
+#define COMPAT_SO_RCVTIMEO_OLD 8192
+#define COMPAT_SO_SNDTIMEO_OLD 16384
+#define COMPAT_SO_RCVTIMEO_NEW 68
+#define COMPAT_SO_SNDTIMEO_NEW 69
+
+#endif
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (4 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  8:50   ` Lukasz Majewski
                     ` (2 more replies)
  2021-05-18 20:55 ` [PATCH v2 07/25] linux: Add recvvmsg " Adhemerval Zanella
                   ` (19 subsequent siblings)
  25 siblings, 3 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The recvmsg handling is more complicated because it requires check the
returned kernel control message and make some convertions.  For
!__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP
or SO_TIMESTAMPNS and appends it to the control buffer if has extra
space or returns MSG_CTRUNC otherwise.  The 32-bit time field is kept
as-is.

Calls with __TIMESIZE=32 will see the converted 64-bit time control
messages as spurious control message of unknown type.  Calls with
__TIMESIZE=64 running on pre-time64 kernels will see the original
message as a spurious control ones of unknown typ while running on
kernel with native 64-bit time support will only see the time64 version
of the control message.

Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
kernel).
---
 include/sys/socket.h                          |  5 +
 sysdeps/unix/sysv/linux/Makefile              |  2 +-
 sysdeps/unix/sysv/linux/Versions              |  1 +
 .../unix/sysv/linux/convert_scm_timestamps.c  | 96 +++++++++++++++++++
 sysdeps/unix/sysv/linux/getsockopt.c          | 12 +++
 .../sysv/linux/hppa/socket-constants-time64.h |  5 +
 .../sysv/linux/mips/socket-constants-time64.h |  5 +
 .../linux/powerpc/socket-constants-time64.h   |  5 +
 sysdeps/unix/sysv/linux/recvmsg.c             | 23 +++--
 sysdeps/unix/sysv/linux/setsockopt.c          | 12 +++
 .../unix/sysv/linux/socket-constants-time64.h |  5 +
 .../linux/sparc/socket-constants-time64.h     |  5 +
 12 files changed, 169 insertions(+), 7 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/convert_scm_timestamps.c

diff --git a/include/sys/socket.h b/include/sys/socket.h
index 0e39dd2a3a..15d4a62b26 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -164,5 +164,10 @@ libc_hidden_proto (__libc_sa_len)
 
 libc_hidden_proto (__cmsg_nxthdr)
 
+#ifndef __ASSUME_TIME64_SYSCALLS
+extern void __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize) ;
+libc_hidden_proto (__convert_scm_timestamps)
+#endif
+
 #endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index fb155cf856..e28f6470e3 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -64,7 +64,7 @@ sysdep_routines += adjtimex clone umount umount2 readahead sysctl \
 		   time64-support pselect32 \
 		   xstat fxstat lxstat xstat64 fxstat64 lxstat64 \
 		   fxstatat fxstatat64 \
-		   xmknod xmknodat
+		   xmknod xmknodat convert_scm_timestamps
 
 CFLAGS-gethostid.c = -fexceptions
 CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 220bb2dffe..148f04c50a 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -177,6 +177,7 @@ libc {
     __pread64_nocancel;
     __close_nocancel;
     __sigtimedwait;
+    __convert_scm_timestamps;
     # functions used by nscd
     __netlink_assert_response;
   }
diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
new file mode 100644
index 0000000000..3c123c28ce
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
@@ -0,0 +1,96 @@
+/* Socket timestamp conversion routines.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <kernel-features.h>
+
+#ifndef __ASSUME_TIME64_SYSCALLS
+# include <stdint.h>
+# include <string.h>
+# include <sys/socket.h>
+# include <socket-constants-time64.h>
+
+/* It converts the first SO_TIMESTAMP or SO_TIMESTAMPNS with 32-bit time and
+   appends it to the control buffer.  The 32-bit time field is kept as-is.
+
+   Calls with __TIMESIZE=32 will see the converted 64-bit time control
+   messages as spurious control message of unknown type.
+
+   Calls with __TIMESIZE=64 running on pre-time64 kernels will see the
+   original message as a spurious control ones of unknown typ while running
+   on kernel with native 64-bit time support will only see the time64 version
+   of the control message.  */
+void
+__convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
+{
+  if (msg->msg_control == NULL || msg->msg_controllen == 0)
+    return;
+
+  /* The returned control message format for SO_TIMESTAMP_NEW is a
+     'struct __kernel_sock_timeval' while for SO_TIMESTAMPNS_NEW is a
+     'struct __kernel_timespec'.  In either case it is two uint64_t
+     members.  */
+  uint64_t tvts[2];
+
+  struct cmsghdr *cmsg, *last = NULL;
+  int type = 0;
+
+  for (cmsg = CMSG_FIRSTHDR (msg);
+       cmsg != NULL;
+       cmsg = CMSG_NXTHDR (msg, cmsg))
+    {
+      if (cmsg->cmsg_level != SOL_SOCKET)
+	continue;
+
+      switch (cmsg->cmsg_type)
+	{
+	case COMPAT_SO_TIMESTAMP_OLD:
+	  if (type != 0)
+	    break;
+	  type = COMPAT_SO_TIMESTAMP_NEW;
+	  goto common;
+
+	case COMPAT_SO_TIMESTAMPNS_OLD:
+	  type = COMPAT_SO_TIMESTAMPNS_NEW;
+
+	/* fallthrough  */
+	common:
+	  memcpy (tvts, CMSG_DATA (cmsg), sizeof (tvts));
+	  break;
+	}
+
+      last = cmsg;
+    }
+
+  if (last == NULL || type == 0)
+    return;
+
+  if (CMSG_SPACE (sizeof tvts) > msgsize - msg->msg_controllen)
+    {
+      msg->msg_flags |= MSG_CTRUNC;
+      return;
+    }
+
+  msg->msg_controllen += CMSG_SPACE (sizeof tvts);
+  cmsg = CMSG_NXTHDR(msg, last);
+  cmsg->cmsg_level = SOL_SOCKET;
+  cmsg->cmsg_type = type;
+  cmsg->cmsg_len = CMSG_LEN (sizeof tvts);
+  memcpy (CMSG_DATA (cmsg), tvts, sizeof tvts);
+}
+libc_hidden_def (__convert_scm_timestamps)
+#endif
diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c
index c8e502d976..14b782d0da 100644
--- a/sysdeps/unix/sysv/linux/getsockopt.c
+++ b/sysdeps/unix/sysv/linux/getsockopt.c
@@ -67,6 +67,18 @@ getsockopt32 (int fd, int level, int optname, void *optval,
 	*tv64 = valid_timeval32_to_timeval64 (tv32);
 	*len = sizeof (*tv64);
       }
+      break;
+
+    case COMPAT_SO_TIMESTAMP_NEW:
+    case COMPAT_SO_TIMESTAMPNS_NEW:
+      {
+	if (optname == COMPAT_SO_TIMESTAMP_NEW)
+	  optname = COMPAT_SO_TIMESTAMP_OLD;
+	if (optname == COMPAT_SO_TIMESTAMPNS_NEW)
+	  optname = COMPAT_SO_TIMESTAMPNS_OLD;
+	r = getsockopt_syscall (fd, level, optname, optval, len);
+      }
+      break;
     }
 
   return r;
diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
index ea721e0fc2..f3b98012d5 100644
--- a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
+++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
@@ -27,4 +27,9 @@
 #define COMPAT_SO_RCVTIMEO_NEW 16448
 #define COMPAT_SO_SNDTIMEO_NEW 16449
 
+#define COMPAT_SO_TIMESTAMP_OLD 0x4012
+#define COMPAT_SO_TIMESTAMPNS_OLD 0x4013
+#define COMPAT_SO_TIMESTAMP_NEW 0x4038
+#define COMPAT_SO_TIMESTAMPNS_NEW 0x4039
+
 #endif
diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
index ab8bd62853..31fa69fa9f 100644
--- a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
+++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
@@ -27,4 +27,9 @@
 #define COMPAT_SO_RCVTIMEO_NEW 66
 #define COMPAT_SO_SNDTIMEO_NEW 67
 
+#define COMPAT_SO_TIMESTAMP_OLD 29
+#define COMPAT_SO_TIMESTAMPNS_OLD 35
+#define COMPAT_SO_TIMESTAMP_NEW 63
+#define COMPAT_SO_TIMESTAMPNS_NEW 64
+
 #endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
index 1e48dcca8d..889251895b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
+++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
@@ -27,4 +27,9 @@
 #define COMPAT_SO_RCVTIMEO_NEW 66
 #define COMPAT_SO_SNDTIMEO_NEW 67
 
+#define COMPAT_SO_TIMESTAMP_OLD 29
+#define COMPAT_SO_TIMESTAMPNS_OLD 35
+#define COMPAT_SO_TIMESTAMP_NEW 63
+#define COMPAT_SO_TIMESTAMPNS_NEW 64
+
 #endif
diff --git a/sysdeps/unix/sysv/linux/recvmsg.c b/sysdeps/unix/sysv/linux/recvmsg.c
index b209b4ad99..a2a600228b 100644
--- a/sysdeps/unix/sysv/linux/recvmsg.c
+++ b/sysdeps/unix/sysv/linux/recvmsg.c
@@ -19,16 +19,27 @@
 #include <sys/socket.h>
 #include <sysdep-cancel.h>
 #include <socketcall.h>
-#include <shlib-compat.h>
 
 ssize_t
 __libc_recvmsg (int fd, struct msghdr *msg, int flags)
 {
-# ifdef __ASSUME_RECVMSG_SYSCALL
-  return SYSCALL_CANCEL (recvmsg, fd, msg, flags);
-# else
-  return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
-# endif
+  ssize_t r;
+#ifndef __ASSUME_TIME64_SYSCALLS
+  socklen_t orig_controllen = msg->msg_controllen;
+#endif
+
+#ifdef __ASSUME_RECVMSG_SYSCALL
+  r = SYSCALL_CANCEL (recvmsg, fd, msg, flags);
+#else
+  r = SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
+#endif
+
+#ifndef __ASSUME_TIME64_SYSCALLS
+  if (r >= 0)
+    __convert_scm_timestamps (msg, orig_controllen);
+#endif
+
+  return r;
 }
 weak_alias (__libc_recvmsg, recvmsg)
 weak_alias (__libc_recvmsg, __recvmsg)
diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
index 6505202265..a4780a9d33 100644
--- a/sysdeps/unix/sysv/linux/setsockopt.c
+++ b/sysdeps/unix/sysv/linux/setsockopt.c
@@ -69,6 +69,18 @@ setsockopt32 (int fd, int level, int optname, const void *optval,
 
 	r = setsockopt_syscall (fd, level, optname, &tv32, sizeof (tv32));
       }
+      break;
+
+    case COMPAT_SO_TIMESTAMP_NEW:
+    case COMPAT_SO_TIMESTAMPNS_NEW:
+      {
+	if (optname == COMPAT_SO_TIMESTAMP_NEW)
+	  optname = COMPAT_SO_TIMESTAMP_OLD;
+	if (optname == COMPAT_SO_TIMESTAMPNS_NEW)
+	  optname = COMPAT_SO_TIMESTAMPNS_OLD;
+	r = setsockopt_syscall (fd, level, optname, NULL, 0);
+      }
+      break;
     }
 
   return r;
diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h b/sysdeps/unix/sysv/linux/socket-constants-time64.h
index e5a3777f28..7f7ca05504 100644
--- a/sysdeps/unix/sysv/linux/socket-constants-time64.h
+++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h
@@ -27,4 +27,9 @@
 #define COMPAT_SO_RCVTIMEO_NEW 66
 #define COMPAT_SO_SNDTIMEO_NEW 67
 
+#define COMPAT_SO_TIMESTAMP_OLD 29
+#define COMPAT_SO_TIMESTAMPNS_OLD 35
+#define COMPAT_SO_TIMESTAMP_NEW 63
+#define COMPAT_SO_TIMESTAMPNS_NEW 64
+
 #endif
diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
index b137abdeea..56358923e1 100644
--- a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
+++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
@@ -27,4 +27,9 @@
 #define COMPAT_SO_RCVTIMEO_NEW 68
 #define COMPAT_SO_SNDTIMEO_NEW 69
 
+#define COMPAT_SO_TIMESTAMP_OLD 0x001d
+#define COMPAT_SO_TIMESTAMPNS_OLD 0x0021
+#define COMPAT_SO_TIMESTAMP_NEW 0x0046
+#define COMPAT_SO_TIMESTAMPNS_NEW 0x0042
+
 #endif
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 07/25] linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (5 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  9:02   ` Lukasz Majewski
  2021-06-04 19:30   ` Carlos O'Donell
  2021-05-18 20:55 ` [PATCH v2 08/25] y2038: Add __USE_TIME_BITS64 support for time_t Adhemerval Zanella
                   ` (18 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

Handle the SO_TIMESTAMP{NS} similar to recvmsg: for
!__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP
or SO_TIMESTAMPNS and appends it to the control buffer if has extra
space or returns MSG_CTRUNC otherwise.  The 32-bit time field is kept
as-is.

Also for !__ASSUME_TIME64_SYSCALLS it limits the maximum number of
'struct mmsghdr *' to IOV_MAX (and also increases the stack size
requirement to IOV_MAX times sizeof (socklen_t)).  The Linux imposes
a similar limit to sendmmsg, so bound the array size on recvmmsg is not
unreasonable.  And this will be used only on older when building with
32-bit time support.

Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
kernel).
---
 sysdeps/unix/sysv/linux/recvmmsg.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c
index 672ba20332..5cd107ffa9 100644
--- a/sysdeps/unix/sysv/linux/recvmmsg.c
+++ b/sysdeps/unix/sysv/linux/recvmmsg.c
@@ -44,13 +44,26 @@ __recvmmsg64 (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
       ts32 = valid_timespec64_to_timespec (*timeout);
       pts32 = &ts32;
     }
+
+  socklen_t csize[IOV_MAX];
+  if (vlen > IOV_MAX)
+    vlen = IOV_MAX;
+  for (int i = 0; i < vlen; i++)
+    csize[i] = vmessages[i].msg_hdr.msg_controllen;
+
 # ifdef __ASSUME_RECVMMSG_SYSCALL
   r = SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32);
 # else
   r = SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32);
 # endif
-  if (r >= 0 && timeout != NULL)
-    *timeout = valid_timespec_to_timespec64 (ts32);
+  if (r >= 0)
+    {
+      if (timeout != NULL)
+        *timeout = valid_timespec_to_timespec64 (ts32);
+
+      for (int i=0; i < r; i++)
+        __convert_scm_timestamps (&vmessages[i].msg_hdr, csize[i]);
+    }
 #endif /* __ASSUME_TIME64_SYSCALLS  */
   return r;
 }
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 08/25] y2038: Add __USE_TIME_BITS64 support for time_t
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (6 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 07/25] linux: Add recvvmsg " Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  9:02   ` Lukasz Majewski
  2021-06-04 19:30   ` Carlos O'Donell
  2021-05-18 20:55 ` [PATCH v2 09/25] y2038: Add __USE_TIME_BITS64 support for struct timeval Adhemerval Zanella
                   ` (17 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The __USE_TIME_BITS64 is not defined internally yet.
---
 time/bits/types/time_t.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/time/bits/types/time_t.h b/time/bits/types/time_t.h
index ab8287c6fe..84d67f6ac3 100644
--- a/time/bits/types/time_t.h
+++ b/time/bits/types/time_t.h
@@ -4,6 +4,10 @@
 #include <bits/types.h>
 
 /* Returned by `time'.  */
+#ifdef __USE_TIME_BITS64
+typedef __time64_t time_t;
+#else
 typedef __time_t time_t;
+#endif
 
 #endif
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 09/25] y2038: Add __USE_TIME_BITS64 support for struct timeval
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (7 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 08/25] y2038: Add __USE_TIME_BITS64 support for time_t Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  9:03   ` Lukasz Majewski
  2021-06-04 19:31   ` Carlos O'Donell
  2021-05-18 20:55 ` [PATCH v2 10/25] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella
                   ` (16 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The __USE_TIME_BITS64 is not defined internally yet.
---
 time/bits/types/struct_timeval.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/time/bits/types/struct_timeval.h b/time/bits/types/struct_timeval.h
index 70394ce886..3466137c35 100644
--- a/time/bits/types/struct_timeval.h
+++ b/time/bits/types/struct_timeval.h
@@ -7,7 +7,12 @@
    microsecond but also has a range of years.  */
 struct timeval
 {
+#ifdef __USE_TIME_BITS64
+  __time64_t tv_sec;		/* Seconds.  */
+  __suseconds64_t tv_usec;	/* Microseconds.  */
+#else
   __time_t tv_sec;		/* Seconds.  */
   __suseconds_t tv_usec;	/* Microseconds.  */
+#endif
 };
 #endif
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 10/25] y2038: Add __USE_TIME_BITS64 support for struct timespec
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (8 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 09/25] y2038: Add __USE_TIME_BITS64 support for struct timeval Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  9:03   ` Lukasz Majewski
  2021-06-04 19:31   ` Carlos O'Donell
  2021-05-18 20:55 ` [PATCH v2 11/25] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Adhemerval Zanella
                   ` (15 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The __USE_TIME_BITS64 is not defined internally yet.
---
 time/bits/types/struct_timespec.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h
index d11c69cfd3..4fe47a0d25 100644
--- a/time/bits/types/struct_timespec.h
+++ b/time/bits/types/struct_timespec.h
@@ -1,18 +1,22 @@
-/* NB: Include guard matches what <linux/time.h> uses.  */
-#ifndef _STRUCT_TIMESPEC
-#define _STRUCT_TIMESPEC 1
+#ifndef __struct_timespec_defined
+#define __struct_timespec_defined 1
 
 #include <bits/types.h>
 #include <bits/endian.h>
+#include <bits/types/time_t.h>
 
 /* POSIX.1b structure for a time value.  This is like a `struct timeval' but
    has nanoseconds instead of microseconds.  */
 struct timespec
 {
+#ifdef __USE_TIME_BITS64
+  __time64_t tv_sec;		/* Seconds.  */
+#else
   __time_t tv_sec;		/* Seconds.  */
+#endif
 #if __WORDSIZE == 64 \
   || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
-  || __TIMESIZE == 32
+  || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
   __syscall_slong_t tv_nsec;	/* Nanoseconds.  */
 #else
 # if __BYTE_ORDER == __BIG_ENDIAN
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 11/25] y2038: Add __USE_TIME_BITS64 support for struct utimbuf
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (9 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 10/25] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella
@ 2021-05-18 20:55 ` Adhemerval Zanella
  2021-05-19  9:04   ` Lukasz Majewski
  2021-06-04 19:31   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Adhemerval Zanella
                   ` (14 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:55 UTC (permalink / raw)
  To: libc-alpha

The __USE_TIME_BITS64 is not defined internally yet.
---
 io/utime.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/io/utime.h b/io/utime.h
index df2299e406..c7612d0838 100644
--- a/io/utime.h
+++ b/io/utime.h
@@ -35,8 +35,13 @@ __BEGIN_DECLS
 /* Structure describing file times.  */
 struct utimbuf
   {
+#ifdef __USE_TIME_BITS64
+    __time64_t actime;		/* Access time.  */
+    __time64_t modtime;		/* Modification time.  */
+#else
     __time_t actime;		/* Access time.  */
     __time_t modtime;		/* Modification time.  */
+#endif
   };
 
 /* Set the access and modification times of FILE to those given in
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (10 preceding siblings ...)
  2021-05-18 20:55 ` [PATCH v2 11/25] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19  9:04   ` Lukasz Majewski
  2021-06-04 19:31   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 13/25] y2038: Use a common definition for stat Adhemerval Zanella
                   ` (13 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

The __USE_TIME_BITS64 is not defined internally yet.
---
 sysdeps/unix/sysv/linux/bits/timex.h | 31 ++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h
index 9b2e30f3e0..ee37694e8f 100644
--- a/sysdeps/unix/sysv/linux/bits/timex.h
+++ b/sysdeps/unix/sysv/linux/bits/timex.h
@@ -25,6 +25,36 @@
 
 struct timex
 {
+# ifdef __USE_TIME_BITS64
+  unsigned int modes;          /* mode selector */
+  int :32;                     /* pad */
+  long long offset;            /* time offset (usec) */
+  long long freq;              /* frequency offset (scaled ppm) */
+  long long maxerror;          /* maximum error (usec) */
+  long long esterror;          /* estimated error (usec) */
+  int status;                  /* clock command/status */
+  int :32;                     /* pad */
+  long long constant;          /* pll time constant */
+  long long precision;         /* clock precision (usec) (read only) */
+  long long tolerance;         /* clock frequency tolerance (ppm) (ro) */
+  struct timeval time;     /* (read only, except for ADJ_SETOFFSET) */
+  long long tick;              /* (modified) usecs between clock ticks */
+  long long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
+  long long jitter;            /* pps jitter (us) (ro) */
+  int shift;                   /* interval duration (s) (shift) (ro) */
+  int :32;                     /* pad */
+  long long stabil;            /* pps stability (scaled ppm) (ro) */
+  long long jitcnt;            /* jitter limit exceeded (ro) */
+  long long calcnt;            /* calibration intervals (ro) */
+  long long errcnt;            /* calibration errors (ro) */
+  long long stbcnt;            /* stability limit exceeded (ro) */
+
+  int tai;                     /* TAI offset (ro) */
+
+  int  :32; int  :32; int  :32; int  :32;
+  int  :32; int  :32; int  :32; int  :32;
+  int  :32; int  :32; int  :32;
+# else
   unsigned int modes;		/* mode selector */
   __syscall_slong_t offset;	/* time offset (usec) */
   __syscall_slong_t freq;	/* frequency offset (scaled ppm) */
@@ -51,6 +81,7 @@ struct timex
   int  :32; int  :32; int  :32; int  :32;
   int  :32; int  :32; int  :32; int  :32;
   int  :32; int  :32; int  :32;
+# endif
 };
 
 /* Mode codes (timex.mode) */
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 13/25] y2038: Use a common definition for stat
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (11 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-06-04 19:37   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 14/25] y2038: Use a common definition for msqid_ds Adhemerval Zanella
                   ` (12 subsequent siblings)
  25 siblings, 1 reply; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

From: Lukasz Majewski <lukma@denx.de>

Instead of replicate the same definitions from struct_stat_time64.h
on the multiple struct_stat.h, use a common header which is included
when required (struct_stat_time64_helper.h).  The 64-bit time support
is added only for LFS support.

The __USE_TIME_BITS64 is not defined internally yet, although the
internal header is used when building the 64-bit stat implementations.
---
 sysdeps/unix/sysv/linux/Makefile              |  3 +-
 sysdeps/unix/sysv/linux/bits/struct_stat.h    | 51 ++++++-----
 .../linux/bits/struct_stat_time64_helper.h    | 63 +++++++++++++
 .../unix/sysv/linux/m68k/bits/struct_stat.h   | 50 ++++++-----
 .../sysv/linux/microblaze/bits/struct_stat.h  | 48 ++++++----
 .../unix/sysv/linux/mips/bits/struct_stat.h   | 89 ++++++++++--------
 .../sysv/linux/powerpc/bits/struct_stat.h     | 52 ++++++-----
 .../unix/sysv/linux/s390/bits/struct_stat.h   | 56 +++++++-----
 sysdeps/unix/sysv/linux/struct_stat_time64.h  | 59 +-----------
 .../unix/sysv/linux/x86/bits/struct_stat.h    | 90 ++++++++++---------
 10 files changed, 317 insertions(+), 244 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index e28f6470e3..f83f147ed1 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -100,7 +100,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
 		  bits/types/struct_msqid_ds.h \
 		  bits/types/struct_shmid_ds.h \
 		  bits/ipc-perm.h \
-		  bits/struct_stat.h
+		  bits/struct_stat.h \
+		  bits/struct_stat_time64_helper.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h
index b852ee256e..ba41f86142 100644
--- a/sysdeps/unix/sysv/linux/bits/struct_stat.h
+++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h
@@ -28,32 +28,35 @@
 
 struct stat
   {
+#ifdef __USE_TIME_BITS64
+# include <bits/struct_stat_time64_helper.h>
+#else
     __dev_t st_dev;			/* Device.  */
     unsigned short int __pad1;
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;			/* File serial number.	*/
-#else
+# else
     __ino_t __st_ino;			/* 32bit file serial number.	*/
-#endif
+# endif
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
     __uid_t st_uid;			/* User ID of the file's owner.	*/
     __gid_t st_gid;			/* Group ID of the file's group.*/
     __dev_t st_rdev;			/* Device number, if device.  */
     unsigned short int __pad2;
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
     __off_t st_size;			/* Size of file, in bytes.  */
-#else
+# else
     __off64_t st_size;			/* Size of file, in bytes.  */
-#endif
+# endif
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
-#else
+# else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#endif
-#ifdef __USE_XOPEN2K8
+# endif
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -63,28 +66,32 @@ struct stat
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
+#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-#endif
-#ifndef __USE_FILE_OFFSET64
+# endif
+# ifndef __USE_FILE_OFFSET64
     unsigned long int __glibc_reserved4;
     unsigned long int __glibc_reserved5;
-#else
+# else
     __ino64_t st_ino;			/* File serial number.	*/
-#endif
+# endif
+#endif /* __USE_TIME_BITS64  */
   };
 
 #ifdef __USE_LARGEFILE64
 struct stat64
   {
+# ifdef __USE_TIME_BITS64
+#  include <bits/struct_stat_time64_helper.h>
+# else
     __dev_t st_dev;			/* Device.  */
     unsigned int __pad1;
 
@@ -99,7 +106,7 @@ struct stat64
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-# ifdef __USE_XOPEN2K8
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -109,15 +116,16 @@ struct stat64
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-# else
+#  else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-# endif
+#  endif
     __ino64_t st_ino;			/* File serial number.		*/
+# endif /* __USE_TIME_BITS64  */
   };
 #endif
 
@@ -127,5 +135,4 @@ struct stat64
 /* Nanosecond resolution time values are supported.  */
 #define _STATBUF_ST_NSEC
 
-
 #endif /* _BITS_STRUCT_STAT_H  */
diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
new file mode 100644
index 0000000000..77385e9073
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
@@ -0,0 +1,63 @@
+/* Definition for helper to define struct stat with 64 bit time.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+  /* Content of internal __stat64_t64 struct.  */
+  __dev_t st_dev;		/* Device.  */
+  __ino64_t st_ino;		/* file serial number.	*/
+  __mode_t st_mode;		/* File mode.  */
+  __nlink_t st_nlink;		/* Link count.  */
+  __uid_t st_uid;		/* User ID of the file's owner.  */
+  __gid_t st_gid;		/* Group ID of the file's group.  */
+  __dev_t st_rdev;		/* Device number, if device.  */
+  __off64_t st_size;		/* Size of file, in bytes.  */
+  __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+  __blkcnt64_t st_blocks;	/* Number 512-byte blocks allocated. */
+#ifdef __USE_XOPEN2K8
+# ifndef __struct_timespec
+#  define __struct_timespec struct timespec
+# endif
+  /* Nanosecond resolution timestamps are stored in a format
+     equivalent to 'struct timespec'.  This is the type used
+     whenever possible but the Unix namespace rules do not allow the
+     identifier 'timespec' to appear in the <sys/stat.h> header.
+     Therefore we have to handle the use of this header in strictly
+     standard-compliant sources special.  */
+  __struct_timespec st_atim;
+  __struct_timespec st_mtim;
+  __struct_timespec st_ctim;
+# define st_atime st_atim.tv_sec
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+# undef __struct_timespec
+#else
+/* The definition should be equal to the 'struct __timespec64' internal
+   layout.  */
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __fieldts64(name)					\
+   __time64_t name; __int32_t :32; __int32_t name ## nsec
+# else
+#  define __fieldts64(name)					\
+   __time64_t name; __int32_t name ## nsec; __int32_t :32
+# endif
+
+  __fieldts64 (st_atime);
+  __fieldts64 (st_mtime);
+  __fieldts64 (st_ctime);
+
+# undef __fieldts64
+#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h b/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h
index 4ae7506eb5..0512ecc3bc 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h
@@ -25,32 +25,35 @@
 
 struct stat
   {
+#ifdef __USE_TIME_BITS64
+# include <bits/struct_stat_time64_helper.h>
+#else
     __dev_t st_dev;			/* Device.  */
     unsigned short int __pad1;
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;			/* File serial number.	*/
-#else
+# else
     __ino_t __st_ino;			/* 32bit file serial number.	*/
-#endif
+# endif
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
     __uid_t st_uid;			/* User ID of the file's owner.	*/
     __gid_t st_gid;			/* Group ID of the file's group.*/
     __dev_t st_rdev;			/* Device number, if device.  */
     unsigned short int __pad2;
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
     __off_t st_size;			/* Size of file, in bytes.  */
-#else
+# else
     __off64_t st_size;			/* Size of file, in bytes.  */
-#endif
+# endif
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
-#else
+# else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#endif
-#ifdef __USE_XOPEN2K8
+# endif
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -60,28 +63,32 @@ struct stat
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
+#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-#endif
-#ifndef __USE_FILE_OFFSET64
+# endif
+# ifndef __USE_FILE_OFFSET64
     unsigned long int __glibc_reserved4;
     unsigned long int __glibc_reserved5;
-#else
+# else
     __ino64_t st_ino;			/* File serial number.	*/
-#endif
+# endif
+#endif /* __USE_TIME_BITS64  */
   };
 
 #ifdef __USE_LARGEFILE64
 struct stat64
   {
+# ifdef __USE_TIME_BITS64
+#  include <bits/struct_stat_time64_helper.h>
+# else
     __dev_t st_dev;			/* Device.  */
     unsigned short int __pad1;
 
@@ -96,7 +103,7 @@ struct stat64
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-# ifdef __USE_XOPEN2K8
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -106,15 +113,16 @@ struct stat64
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-# else
+#  else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-# endif
+#  endif
     __ino64_t st_ino;			/* File serial number.		*/
+# endif /* __USE_TIME_BITS64 */
   };
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h
index be1bdc3557..0284d4b2b2 100644
--- a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h
+++ b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h
@@ -26,6 +26,9 @@
 #ifndef __USE_FILE_OFFSET64
 struct stat
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/struct_stat_time64_helper.h>
+#else
         __dev_t         st_dev;     /* Device.  */
         __ino_t         st_ino;     /* File serial number.  */
         __mode_t        st_mode;    /* File mode.  */
@@ -38,7 +41,7 @@ struct stat
         __blksize_t     st_blksize; /* Optimal block size for I/O.  */
         int             __pad3;
         __blkcnt_t      st_blocks;  /* Number 512-byte blocks allocated.  */
-#ifdef __USE_XOPEN2K8
+# ifdef __USE_XOPEN2K8
         /* Nanosecond resolution timestamps are stored in a format
          * equivalent to 'struct timespec'. This is the type used
          * whenever possible but the Unix namespace rules do not allow the
@@ -48,19 +51,20 @@ struct stat
         struct timespec         st_atim; /* Time of last access.  */
         struct timespec         st_mtim; /* Time of last modification.  */
         struct timespec         st_ctim; /* Time of last status change.  */
-# define st_atime st_atim.tv_sec         /* Backward compatibility.  */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
+#  define st_atime st_atim.tv_sec         /* Backward compatibility.  */
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# else
         __time_t                st_atime;     /* Time of last access.  */
         unsigned long int       st_atimensec; /* Nscecs of last access.  */
         __time_t                st_mtime;     /* Time of last modification.  */
         unsigned long int       st_mtimensec; /* Nsecs of last modification.  */
         __time_t                st_ctime;     /* Time of last status change.  */
         unsigned long int       st_ctimensec; /* Nsecs of last status change.  */
-#endif
+# endif
         unsigned int            __glibc_reserved4;
         unsigned int            __glibc_reserved5;
+#endif /* __USE_TIME_BITS64  */
 };
 #else /* __USE_FILE_OFFSET64 */
 /* MS: If __USE_FILE_OFFSET64 is setup then struct stat should match stat64
@@ -70,6 +74,9 @@ struct stat
  * create one ifdef to separate stats structures.  */
 struct stat
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/struct_stat_time64_helper.h>
+#else
         unsigned long long      st_dev;     /* Device.  */
         __ino64_t               st_ino;     /* 32bit file serial number.  */
         __mode_t                st_mode;    /* File mode.  */
@@ -82,7 +89,7 @@ struct stat
         __blksize_t             st_blksize; /* Optimal block size for I/O.  */
         int                     __pad3;
         __blkcnt64_t            st_blocks;  /* Number 512-byte blocks allocated.  */
-#ifdef __USE_MISC
+# ifdef __USE_MISC
         /* Nanosecond resolution timestamps are stored in a format
          * equivalent to 'struct timespec'. This is the type used
          * whenever possible but the Unix namespace rules do not allow the
@@ -92,25 +99,29 @@ struct stat
         struct timespec         st_atim;      /* Time of last access.  */
         struct timespec         st_mtim;      /* Time of last modification.  */
         struct timespec         st_ctim;      /* Time of last status change.  */
-# define st_atime st_atim.tv_sec              /* Backward compatibility.  */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
+#  define st_atime st_atim.tv_sec              /* Backward compatibility.  */
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# else
         __time_t                st_atime;     /* Time of last access.  */
         unsigned long int       st_atimensec; /* Nscecs of last access.  */
         __time_t                st_mtime;     /* Time of last modification.  */
         unsigned long int       st_mtimensec; /* Nsecs of last modification.  */
         __time_t                st_ctime;     /* Time of last status change.  */
         unsigned long int       st_ctimensec; /* Nsecs of last status change.  */
-#endif
+# endif
         unsigned int            __glibc_reserved4;
         unsigned int            __glibc_reserved5;
+# endif /* __USE_TIME_BITS64 */
 };
 #endif /* __USE_FILE_OFFSET64 */
 
 #ifdef __USE_LARGEFILE64
 struct stat64
 {
+# ifdef __USE_TIME_BITS64
+#  include <bits/struct_stat_time64_helper.h>
+# else
         unsigned long long      st_dev;     /* Device.  */
         __ino64_t               st_ino;     /* 32bit file serial number.  */
         __mode_t                st_mode;    /* File mode.  */
@@ -123,7 +134,7 @@ struct stat64
         __blksize_t             st_blksize; /* Optimal block size for I/O.  */
         int                     __pad3;
         __blkcnt64_t            st_blocks;  /* Number 512-byte blocks allocated.  */
-#ifdef __USE_XOPEN2K8
+#  ifdef __USE_XOPEN2K8
         /* Nanosecond resolution timestamps are stored in a format
          * equivalent to 'struct timespec'. This is the type used
          * whenever possible but the Unix namespace rules do not allow the
@@ -133,19 +144,20 @@ struct stat64
         struct timespec         st_atim;    /* Time of last access.  */
         struct timespec         st_mtim;    /* Time of last modification.  */
         struct timespec         st_ctim;    /* Time of last status change.  */
-# define st_atime st_atim.tv_sec            /* Backward compatibility.  */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
+#   define st_atime st_atim.tv_sec           /* Backward compatibility.  */
+#   define st_mtime st_mtim.tv_sec
+#   define st_ctime st_ctim.tv_sec
+#  else
         __time_t                st_atime;     /* Time of last access.  */
         unsigned long int       st_atimensec; /* Nscecs of last access.  */
         __time_t                st_mtime;     /* Time of last modification.  */
         unsigned long int       st_mtimensec; /* Nsecs of last modification.  */
         __time_t                st_ctime;     /* Time of last status change.  */
         unsigned long int       st_ctimensec; /* Nsecs of last status change.  */
-#endif
+#  endif
         unsigned int            __glibc_reserved4;
         unsigned int            __glibc_reserved5;
+# endif /* __USE_TIME_BITS64 */
 };
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h b/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
index 7ae4c10827..ab9f474cbc 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
@@ -29,28 +29,31 @@
 /* Structure describing file characteristics.  */
 struct stat
   {
+# ifdef __USE_TIME_BITS64
+#  include <bits/struct_stat_time64_helper.h>
+# else
     unsigned long int st_dev;
     long int st_pad1[3];
-#ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;		/* File serial number.		*/
-#else
+#  else
     __ino64_t st_ino;		/* File serial number.		*/
-#endif
+#  endif
     __mode_t st_mode;		/* File mode.  */
     __nlink_t st_nlink;		/* Link count.  */
     __uid_t st_uid;		/* User ID of the file's owner.	*/
     __gid_t st_gid;		/* Group ID of the file's group.*/
     unsigned long int st_rdev;	/* Device number, if device.  */
-#ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     long int st_pad2[2];
     __off_t st_size;		/* Size of file, in bytes.  */
     /* SVR4 added this extra long to allow for expansion of off_t.  */
     long int st_pad3;
-#else
+#  else
     long int st_pad2[3];
     __off64_t st_size;		/* Size of file, in bytes.  */
-#endif
-#ifdef __USE_XOPEN2K8
+#  endif
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -60,30 +63,34 @@ struct stat
     struct timespec st_atim;            /* Time of last access.  */
     struct timespec st_mtim;            /* Time of last modification.  */
     struct timespec st_ctim;            /* Time of last status change.  */
-# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
+#   define st_atime st_atim.tv_sec        /* Backward compatibility.  */
+#   define st_mtime st_mtim.tv_sec
+#   define st_ctime st_ctim.tv_sec
+#  else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-#endif
+#  endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
-#ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
-#else
+#  else
     long int st_pad4;
     __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.  */
-#endif
+#  endif
     long int st_pad5[14];
+# endif /* __USE_TIME_BITS64  */
   };
 
-#ifdef __USE_LARGEFILE64
+# ifdef __USE_LARGEFILE64
 struct stat64
   {
+#  ifdef __USE_TIME_BITS64
+#   include <bits/struct_stat_time64_helper.h>
+#  else
     unsigned long int st_dev;
     long int st_pad1[3];
     __ino64_t st_ino;		/* File serial number.		*/
@@ -94,7 +101,7 @@ struct stat64
     unsigned long int st_rdev;	/* Device number, if device.  */
     long int st_pad2[3];
     __off64_t st_size;		/* Size of file, in bytes.  */
-# ifdef __USE_XOPEN2K8
+#   ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -104,44 +111,47 @@ struct stat64
     struct timespec st_atim;            /* Time of last access.  */
     struct timespec st_mtim;            /* Time of last modification.  */
     struct timespec st_ctim;            /* Time of last status change.  */
-# else
+#   else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-# endif
+#   endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
     long int st_pad3;
     __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.  */
     long int st_pad4[14];
+#  endif /* __USE_TIME_BITS64  */
   };
-#endif
-#else
+# endif /* __USE_LARGEFILE64  */
+
+#else /* _MIPS_SIM != _ABIO32  */
+
 struct stat
   {
     __dev_t st_dev;
     int	st_pad1[3];		/* Reserved for st_dev expansion  */
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;
-#else
+# else
     __ino64_t st_ino;
-#endif
+# endif
     __mode_t st_mode;
     __nlink_t st_nlink;
     __uid_t st_uid;
     __gid_t st_gid;
     __dev_t st_rdev;
-#if !defined __USE_FILE_OFFSET64
+# if !defined __USE_FILE_OFFSET64
     unsigned int st_pad2[2];	/* Reserved for st_rdev expansion  */
     __off_t st_size;
     int st_pad3;
-#else
+# else
     unsigned int st_pad2[3];	/* Reserved for st_rdev expansion  */
     __off64_t st_size;
-#endif
-#ifdef __USE_XOPEN2K8
+# endif
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -151,24 +161,24 @@ struct stat
     struct timespec st_atim;            /* Time of last access.  */
     struct timespec st_mtim;            /* Time of last modification.  */
     struct timespec st_ctim;            /* Time of last status change.  */
-# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
+#  define st_atime st_atim.tv_sec        /* Backward compatibility.  */
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-#endif
+# endif
     __blksize_t st_blksize;
     unsigned int st_pad4;
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;
-#else
+# else
     __blkcnt64_t st_blocks;
-#endif
+# endif
     int st_pad5[14];
   };
 
@@ -185,7 +195,7 @@ struct stat64
     __dev_t st_rdev;
     unsigned int st_pad2[3];	/* Reserved for st_rdev expansion  */
     __off64_t st_size;
-# ifdef __USE_XOPEN2K8
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -195,20 +205,21 @@ struct stat64
     struct timespec st_atim;            /* Time of last access.  */
     struct timespec st_mtim;            /* Time of last modification.  */
     struct timespec st_ctim;            /* Time of last status change.  */
-# else
+#  else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-# endif
+#  endif
     __blksize_t st_blksize;
     unsigned int st_pad3;
     __blkcnt64_t st_blocks;
     int st_pad4[14];
 };
 #endif
+
 #endif
 
 /* Tell code we have these members.  */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
index 12caab2790..f55eb658a2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
@@ -26,35 +26,37 @@
 #include <bits/wordsize.h>
 
 #if __WORDSIZE == 32
-
 struct stat
   {
+# ifdef __USE_TIME_BITS64
+#  include <bits/struct_stat_time64_helper.h>
+# else
     __dev_t st_dev;			/* Device.  */
-# ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     unsigned short int __pad1;
     __ino_t st_ino;			/* File serial number.	*/
-# else
+#  else
     __ino64_t st_ino;			/* File serial number.	*/
-# endif
+#  endif
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
     __uid_t st_uid;			/* User ID of the file's owner.	*/
     __gid_t st_gid;			/* Group ID of the file's group.*/
     __dev_t st_rdev;			/* Device number, if device.  */
     unsigned short int __pad2;
-# ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     __off_t st_size;			/* Size of file, in bytes.  */
-# else
+#  else
     __off64_t st_size;			/* Size of file, in bytes.  */
-# endif
+#  endif
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
-# ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
-# else
+#  else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-# endif
-# ifdef __USE_XOPEN2K8
+#  endif
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -64,25 +66,28 @@ struct stat
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
-#  define st_mtime st_mtim.tv_sec
-#  define st_ctime st_ctim.tv_sec
-# else
+#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+#   define st_mtime st_mtim.tv_sec
+#   define st_ctime st_ctim.tv_sec
+#  else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-# endif
+#  endif
     unsigned long int __glibc_reserved4;
     unsigned long int __glibc_reserved5;
+# endif /* __USE_TIME_BITS64 */
   };
 
-
 # ifdef __USE_LARGEFILE64
 struct stat64
   {
+#  ifdef __USE_TIME_BITS64
+#   include <bits/struct_stat_time64_helper.h>
+#  else
     __dev_t st_dev;			/* Device.  */
     __ino64_t st_ino;			/* File serial number.	*/
     __mode_t st_mode;			/* File mode.  */
@@ -94,7 +99,7 @@ struct stat64
     __off64_t st_size;			/* Size of file, in bytes.  */
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#  ifdef __USE_XOPEN2K8
+#   ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -104,19 +109,20 @@ struct stat64
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
-#   define st_mtime st_mtim.tv_sec
-#   define st_ctime st_ctim.tv_sec
-#  else
+#    define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+#    define st_mtime st_mtim.tv_sec
+#    define st_ctime st_ctim.tv_sec
+#   else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-#  endif
+#   endif
     unsigned long int __glibc_reserved4;
     unsigned long int __glibc_reserved5;
+#  endif /* __USE_TIME_BITS64 */
   };
 # endif /* __USE_LARGEFILE64 */
 
diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h b/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h
index a733622cf5..f2933b8b12 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h
@@ -65,32 +65,35 @@ struct stat
 #else
 struct stat
   {
+# ifdef __USE_TIME_BITS64
+#  include <bits/struct_stat_time64_helper.h>
+# else
     __dev_t st_dev;			/* Device.  */
     unsigned int __pad1;
-# ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;			/* File serial number.	*/
-# else
+#  else
     __ino_t __st_ino;			/* 32bit file serial number.	*/
-# endif
+#  endif
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
     __uid_t st_uid;			/* User ID of the file's owner.	*/
     __gid_t st_gid;			/* Group ID of the file's group.*/
     __dev_t st_rdev;			/* Device number, if device.  */
     unsigned int __pad2;
-# ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     __off_t st_size;			/* Size of file, in bytes.  */
-# else
+#  else
     __off64_t st_size;			/* Size of file, in bytes.  */
-# endif
+#  endif
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
-# ifndef __USE_FILE_OFFSET64
+#  ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
-# else
+#  else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-# endif
-# ifdef __USE_XOPEN2K8
+#  endif
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -100,25 +103,26 @@ struct stat
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
-#  define st_mtime st_mtim.tv_sec
-#  define st_ctime st_ctim.tv_sec
-# else
+#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+#   define st_mtime st_mtim.tv_sec
+#   define st_ctime st_ctim.tv_sec
+#  else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-# endif
-# ifndef __USE_FILE_OFFSET64
+#  endif
+#  ifndef __USE_FILE_OFFSET64
     unsigned long int __glibc_reserved4;
     unsigned long int __glibc_reserved5;
-# else
+#  else
     __ino64_t st_ino;			/* File serial number.	*/
+#  endif
 # endif
   };
-#endif
+# endif
 
 #ifdef __USE_LARGEFILE64
 # if __WORDSIZE == 64
@@ -162,6 +166,9 @@ struct stat64
 # else
 struct stat64
   {
+#  ifdef __USE_TIME_BITS64
+#   include <bits/struct_stat_time64_helper.h>
+#  else
     __dev_t st_dev;			/* Device.  */
     unsigned int __pad1;
 
@@ -176,7 +183,7 @@ struct stat64
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#  ifdef __USE_XOPEN2K8
+#   ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -186,18 +193,19 @@ struct stat64
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
-#   define st_mtime st_mtim.tv_sec
-#   define st_ctime st_ctim.tv_sec
-#  else
+#    define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+#    define st_mtime st_mtim.tv_sec
+#    define st_ctime st_ctim.tv_sec
+#   else
     __time_t st_atime;			/* Time of last access.  */
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
-#  endif
+#   endif
     __ino64_t st_ino;			/* File serial number.		*/
+#  endif
   };
 # endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/struct_stat_time64.h b/sysdeps/unix/sysv/linux/struct_stat_time64.h
index f0a29d7fe5..260d1812be 100644
--- a/sysdeps/unix/sysv/linux/struct_stat_time64.h
+++ b/sysdeps/unix/sysv/linux/struct_stat_time64.h
@@ -22,64 +22,13 @@
 #if __TIMESIZE == 64
 # define __stat64_t64 stat64
 #else
-# ifdef __USE_LARGEFILE64
-#  include <endian.h>
-
-/* The definition should be equal to the 'struct __timespec64' internal
-   layout.  */
-#  if BYTE_ORDER == BIG_ENDIAN
-#   define __fieldts64(name) 					\
-     __time64_t name; __int32_t :32; __int32_t name ## nsec
-#  else
-#   define __fieldts64(name)					\
-     __time64_t name; __int32_t name ## nsec; __int32_t :32
-#  endif
-
-/* Workaround for the definition from struct_stat.h  */
-#  undef st_atime
-#  undef st_mtime
-#  undef st_ctime
+# include <struct___timespec64.h>
 
 struct __stat64_t64
   {
-    __dev_t st_dev;			/* Device.  */
-    __ino64_t st_ino;			/* file serial number.	*/
-    __mode_t st_mode;			/* File mode.  */
-    __nlink_t st_nlink;			/* Link count.  */
-    __uid_t st_uid;			/* User ID of the file's owner.	*/
-    __gid_t st_gid;			/* Group ID of the file's group.*/
-    __dev_t st_rdev;			/* Device number, if device.  */
-    __off64_t st_size;			/* Size of file, in bytes.  */
-    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#   ifdef __USE_XOPEN2K8
-    /* Nanosecond resolution timestamps are stored in a format
-       equivalent to 'struct timespec'.  This is the type used
-       whenever possible but the Unix namespace rules do not allow the
-       identifier 'timespec' to appear in the <sys/stat.h> header.
-       Therefore we have to handle the use of this header in strictly
-       standard-compliant sources special.  */
-    struct __timespec64 st_atim;	/* Time of last access.  */
-    struct __timespec64 st_mtim;	/* Time of last modification.  */
-    struct __timespec64 st_ctim;	/* Time of last status change.  */
-#    define st_atime st_atim.tv_sec	/* Backward compatibility.  */
-#    define st_mtime st_mtim.tv_sec
-#    define st_ctime st_ctim.tv_sec
-#   else
-    __fieldts64 (st_atime);
-    __fieldts64 (st_mtime);
-    __fieldts64 (st_ctime);
-#   endif /* __USE_XOPEN2K8  */
+# define __struct_timespec struct __timespec64
+# include <bits/struct_stat_time64_helper.h>
   };
-
-#   define _STATBUF_ST_BLKSIZE
-#   define _STATBUF_ST_RDEV
-#   define _STATBUF_ST_NSEC
-
-#   undef __fieldts64
-
-#  endif /* __USE_LARGEFILE64  */
-
-# endif /* __TIMESIZE == 64  */
+#endif /* __TIMESIZE == 64  */
 
 #endif /* _BITS_STRUCT_STAT_TIME64_H  */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h b/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
index 6ddd01db46..01ee7ff6b3 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
@@ -25,43 +25,46 @@
 
 struct stat
   {
+#ifdef __USE_TIME_BITS64
+# include <bits/struct_stat_time64_helper.h>
+#else
     __dev_t st_dev;		/* Device.  */
-#ifndef __x86_64__
+# ifndef __x86_64__
     unsigned short int __pad1;
-#endif
-#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
+# endif
+# if defined __x86_64__ || !defined __USE_FILE_OFFSET64
     __ino_t st_ino;		/* File serial number.	*/
-#else
+# else
     __ino_t __st_ino;			/* 32bit file serial number.	*/
-#endif
-#ifndef __x86_64__
+# endif
+# ifndef __x86_64__
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
-#else
+# else
     __nlink_t st_nlink;		/* Link count.  */
     __mode_t st_mode;		/* File mode.  */
-#endif
+# endif
     __uid_t st_uid;		/* User ID of the file's owner.	*/
     __gid_t st_gid;		/* Group ID of the file's group.*/
-#ifdef __x86_64__
+# ifdef __x86_64__
     int __pad0;
-#endif
+# endif
     __dev_t st_rdev;		/* Device number, if device.  */
-#ifndef __x86_64__
+# ifndef __x86_64__
     unsigned short int __pad2;
-#endif
-#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
+# endif
+# if defined __x86_64__ || !defined __USE_FILE_OFFSET64
     __off_t st_size;			/* Size of file, in bytes.  */
-#else
+# else
     __off64_t st_size;			/* Size of file, in bytes.  */
-#endif
+# endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
-#if defined __x86_64__  || !defined __USE_FILE_OFFSET64
+# if defined __x86_64__  || !defined __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
-#else
+# else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#endif
-#ifdef __USE_XOPEN2K8
+# endif
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -71,58 +74,62 @@ struct stat
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
+#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# else
     __time_t st_atime;			/* Time of last access.  */
     __syscall_ulong_t st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change.  */
-#endif
-#ifdef __x86_64__
+# endif
+# ifdef __x86_64__
     __syscall_slong_t __glibc_reserved[3];
-#else
-# ifndef __USE_FILE_OFFSET64
+# else
+#  ifndef __USE_FILE_OFFSET64
     unsigned long int __glibc_reserved4;
     unsigned long int __glibc_reserved5;
-# else
+#  else
     __ino64_t st_ino;			/* File serial number.	*/
+#  endif
 # endif
-#endif
+#endif /* __USE_TIME_BITS64  */
   };
 
 #ifdef __USE_LARGEFILE64
 /* Note stat64 has the same shape as stat for x86-64.  */
 struct stat64
   {
+# ifdef __USE_TIME_BITS64
+#  include <bits/struct_stat_time64_helper.h>
+# else
     __dev_t st_dev;		/* Device.  */
-# ifdef __x86_64__
+#  ifdef __x86_64__
     __ino64_t st_ino;		/* File serial number.  */
     __nlink_t st_nlink;		/* Link count.  */
     __mode_t st_mode;		/* File mode.  */
-# else
+#  else
     unsigned int __pad1;
     __ino_t __st_ino;			/* 32bit file serial number.	*/
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
-# endif
+#  endif
     __uid_t st_uid;		/* User ID of the file's owner.	*/
     __gid_t st_gid;		/* Group ID of the file's group.*/
-# ifdef __x86_64__
+#  ifdef __x86_64__
     int __pad0;
     __dev_t st_rdev;		/* Device number, if device.  */
     __off_t st_size;		/* Size of file, in bytes.  */
-# else
+#  else
     __dev_t st_rdev;			/* Device number, if device.  */
     unsigned int __pad2;
     __off64_t st_size;			/* Size of file, in bytes.  */
-# endif
+#  endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
-# ifdef __USE_XOPEN2K8
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -132,19 +139,20 @@ struct stat64
     struct timespec st_atim;		/* Time of last access.  */
     struct timespec st_mtim;		/* Time of last modification.  */
     struct timespec st_ctim;		/* Time of last status change.  */
-# else
+#  else
     __time_t st_atime;			/* Time of last access.  */
     __syscall_ulong_t st_atimensec;	/* Nscecs of last access.  */
     __time_t st_mtime;			/* Time of last modification.  */
     __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification.  */
     __time_t st_ctime;			/* Time of last status change.  */
     __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change.  */
-# endif
-# ifdef __x86_64__
+#  endif
+#  ifdef __x86_64__
     __syscall_slong_t __glibc_reserved[3];
-# else
+#  else
     __ino64_t st_ino;			/* File serial number.		*/
-# endif
+#  endif
+# endif /* __USE_TIME_BITS64  */
   };
 #endif
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 14/25] y2038: Use a common definition for msqid_ds
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (12 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 13/25] y2038: Use a common definition for stat Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-06-04 19:38   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 15/25] y2038: Use a common definition for semid_ds Adhemerval Zanella
                   ` (11 subsequent siblings)
  25 siblings, 1 reply; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

From: Lukasz Majewski <lukma@denx.de>

Instead of replicate the same definitions from struct_msqid64_ds.h
on the multiple struct_msqid_ds.h, use a common header which is included
when required (struct_msqid64_ds_helper.h).

The __USE_TIME_BITS64 is not defined internally yet, although the
internal header is used when building the 64-bit stat implementations.
---
 sysdeps/unix/sysv/linux/Makefile              |  3 +-
 .../linux/bits/struct_stat_time64_helper.h    |  2 +-
 .../sysv/linux/bits/types/struct_msqid64_ds.h | 10 +------
 .../bits/types/struct_msqid64_ds_helper.h     | 28 +++++++++++++++++++
 .../sysv/linux/bits/types/struct_msqid_ds.h   | 12 ++++++--
 .../linux/hppa/bits/types/struct_msqid_ds.h   | 12 ++++++--
 .../linux/mips/bits/types/struct_msqid_ds.h   | 18 ++++++++----
 .../powerpc/bits/types/struct_msqid_ds.h      | 12 ++++++--
 .../linux/sparc/bits/types/struct_msqid_ds.h  | 12 ++++++--
 9 files changed, 80 insertions(+), 29 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index f83f147ed1..193b7c46b9 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -101,7 +101,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
 		  bits/types/struct_shmid_ds.h \
 		  bits/ipc-perm.h \
 		  bits/struct_stat.h \
-		  bits/struct_stat_time64_helper.h
+		  bits/struct_stat_time64_helper.h \
+		  bits/types/struct_msqid64_ds_helper.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
index 77385e9073..b37056f5c4 100644
--- a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
+++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
@@ -1,4 +1,4 @@
-/* Definition for helper to define struct stat with 64 bit time.
+/* Common defitions for struct stat with 64 bit time.
    Copyright (C) 2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
index 43e8cd7cfc..992734914a 100644
--- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
@@ -25,14 +25,6 @@
 #else
 struct __msqid64_ds
 {
-  struct ipc_perm msg_perm;	/* structure describing operation permission */
-  __time64_t msg_stime;		/* time of last msgsnd command */
-  __time64_t msg_rtime;		/* time of last msgsnd command */
-  __time64_t msg_ctime;		/* time of last change */
-  __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
-  msgqnum_t msg_qnum;		/* number of messages currently on queue */
-  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
-  __pid_t msg_lspid;		/* pid of last msgsnd() */
-  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+# include <bits/types/struct_msqid64_ds_helper.h>
 };
 #endif
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
new file mode 100644
index 0000000000..02dfddaa2b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
@@ -0,0 +1,28 @@
+/* Common defintions for struct msqid_ds with 64 bit time.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+  /* Content of internal __msqid64_ds.  */
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+  __time64_t msg_stime;		/* time of last msgsnd command */
+  __time64_t msg_rtime;		/* time of last msgsnd command */
+  __time64_t msg_ctime;		/* time of last change */
+  __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h
index 1ed041ae30..ae10a48452 100644
--- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h
@@ -20,23 +20,28 @@
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
+#include <bits/types/time_t.h>
+
 /* Structure of record for one message inside the kernel.
    The type `struct msg' is opaque.  */
 struct msqid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_msqid64_ds_helper.h>
+#else
   struct ipc_perm msg_perm;	/* structure describing operation permission */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
   __time_t msg_stime;		/* time of last msgsnd command */
   unsigned long int __msg_stime_high;
   __time_t msg_rtime;		/* time of last msgsnd command */
   unsigned long int __msg_rtime_high;
   __time_t msg_ctime;		/* time of last change */
   unsigned long int __msg_ctime_high;
-#else
+# else
   __time_t msg_stime;		/* time of last msgsnd command */
   __time_t msg_rtime;		/* time of last msgsnd command */
   __time_t msg_ctime;		/* time of last change */
-#endif
+# endif
   __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
   msgqnum_t msg_qnum;		/* number of messages currently on queue */
   msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
@@ -44,4 +49,5 @@ struct msqid_ds
   __pid_t msg_lrpid;		/* pid of last msgrcv() */
   __syscall_ulong_t __glibc_reserved4;
   __syscall_ulong_t __glibc_reserved5;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h
index d943edeb78..5b82dd7f5e 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h
@@ -20,23 +20,28 @@
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
+#include <bits/types/time_t.h>
+
 /* Structure of record for one message inside the kernel.
    The type `struct msg' is opaque.  */
 struct msqid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_msqid64_ds_helper.h>
+#else
   struct ipc_perm msg_perm;	/* structure describing operation permission */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
   unsigned long int __msg_stime_high;
   __time_t msg_stime;		/* time of last msgsnd command */
   unsigned long int __msg_rtime_high;
   __time_t msg_rtime;		/* time of last msgsnd command */
   unsigned long int __msg_ctime_high;
   __time_t msg_ctime;		/* time of last change */
-#else
+# else
   __time_t msg_stime;		/* time of last msgsnd command */
   __time_t msg_rtime;		/* time of last msgsnd command */
   __time_t msg_ctime;		/* time of last change */
-#endif
+# endif
   __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
   msgqnum_t msg_qnum;		/* number of messages currently on queue */
   msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
@@ -44,4 +49,5 @@ struct msqid_ds
   __pid_t msg_lrpid;		/* pid of last msgrcv() */
   __syscall_ulong_t __glibc_reserved4;
   __syscall_ulong_t __glibc_reserved5;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h
index bdca5e5fe2..00c1804245 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h
@@ -20,32 +20,37 @@
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
+#include <bits/types/time_t.h>
+
 /* Structure of record for one message inside the kernel.
    The type `struct msg' is opaque.  */
 struct msqid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_msqid64_ds_helper.h>
+#else
   struct ipc_perm msg_perm;	/* structure describing operation permission */
-#if __TIMESIZE == 32
-# ifdef __MIPSEL__
+# if __TIMESIZE == 32
+#  ifdef __MIPSEL__
   __time_t msg_stime;		/* time of last msgsnd command */
   unsigned long int __msg_stime_high;
   __time_t msg_rtime;		/* time of last msgsnd command */
   unsigned long int __msg_rtime_high;
   __time_t msg_ctime;		/* time of last change */
   unsigned long int __msg_ctime_high;
-# else
+#  else
   unsigned long int __msg_stime_high;
   __time_t msg_stime;		/* time of last msgsnd command */
   unsigned long int __msg_rtime_high;
   __time_t msg_rtime;		/* time of last msgsnd command */
   unsigned long int __msg_ctime_high;
   __time_t msg_ctime;		/* time of last change */
-# endif
-#else
+#  endif
+# else
   __time_t msg_stime;		/* time of last msgsnd command */
   __time_t msg_rtime;		/* time of last msgsnd command */
   __time_t msg_ctime;		/* time of last change */
-#endif
+# endif
   __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
   msgqnum_t msg_qnum;		/* number of messages currently on queue */
   msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
@@ -53,4 +58,5 @@ struct msqid_ds
   __pid_t msg_lrpid;		/* pid of last msgrcv() */
   __syscall_ulong_t __glibc_reserved4;
   __syscall_ulong_t __glibc_reserved5;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h
index 72842ed747..8c296d2342 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h
@@ -20,23 +20,28 @@
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
+#include <bits/types/time_t.h>
+
 /* Structure of record for one message inside the kernel.
    The type `struct msg' is opaque.  */
 struct msqid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_msqid64_ds_helper.h>
+#else
   struct ipc_perm msg_perm;	/* structure describing operation permission */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
   unsigned long int __msg_stime_high;
   __time_t msg_stime;		/* time of last msgsnd command */
   unsigned long int __msg_rtime_high;
   __time_t msg_rtime;		/* time of last msgsnd command */
   unsigned long int __msg_ctime_high;
   __time_t msg_ctime;		/* time of last change */
-#else
+# else
   __time_t msg_stime;		/* time of last msgsnd command */
   __time_t msg_rtime;		/* time of last msgsnd command */
   __time_t msg_ctime;		/* time of last change */
-#endif
+# endif
   __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
   msgqnum_t msg_qnum;		/* number of messages currently on queue */
   msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
@@ -44,4 +49,5 @@ struct msqid_ds
   __pid_t msg_lrpid;		/* pid of last msgrcv() */
   __syscall_ulong_t __glibc_reserved4;
   __syscall_ulong_t __glibc_reserved5;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h
index 22e1839de1..3c1b68ccc0 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h
@@ -20,23 +20,28 @@
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
+#include <bits/types/time_t.h>
+
 /* Structure of record for one message inside the kernel.
    The type `struct msg' is opaque.  */
 struct msqid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_msqid64_ds_helper.h>
+#else
   struct ipc_perm msg_perm;	/* structure describing operation permission */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
   unsigned long int __msg_stime_high;
   __time_t msg_stime;		/* time of last msgsnd command */
   unsigned long int __msg_rtime_high;
   __time_t msg_rtime;		/* time of last msgsnd command */
   unsigned long int __msg_ctime_high;
   __time_t msg_ctime;		/* time of last change */
-#else
+# else
   __time_t msg_stime;		/* time of last msgsnd command */
   __time_t msg_rtime;		/* time of last msgsnd command */
   __time_t msg_ctime;		/* time of last change */
-#endif
+# endif
   __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
   msgqnum_t msg_qnum;		/* number of messages currently on queue */
   msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
@@ -44,4 +49,5 @@ struct msqid_ds
   __pid_t msg_lrpid;		/* pid of last msgrcv() */
   __syscall_ulong_t __glibc_reserved4;
   __syscall_ulong_t __glibc_reserved5;
+#endif
 };
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 15/25] y2038: Use a common definition for semid_ds
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (13 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 14/25] y2038: Use a common definition for msqid_ds Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19  9:09   ` Lukasz Majewski
  2021-06-04 19:38   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 16/25] y2038: Use a common definition for shmid_ds Adhemerval Zanella
                   ` (10 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

Instead of replicate the same definitions from struct_semid64_ds.h
on the multiple struct_semid_ds.h, use a common header which is included
when required (struct_semid64_ds_helper.h).

The __USE_TIME_BITS64 is not defined internally yet, although the
internal header is used when building the 64-bit semctl implementation.
---
 sysdeps/unix/sysv/linux/Makefile              |  3 ++-
 .../sysv/linux/bits/types/struct_semid64_ds.h |  5 +---
 .../bits/types/struct_semid64_ds_helper.h     | 23 +++++++++++++++++++
 .../sysv/linux/bits/types/struct_semid_ds.h   | 10 +++++---
 .../linux/hppa/bits/types/struct_semid_ds.h   |  4 ++++
 .../linux/mips/bits/types/struct_semid_ds.h   |  4 ++++
 .../powerpc/bits/types/struct_semid_ds.h      | 10 +++++---
 .../linux/sparc/bits/types/struct_semid_ds.h  | 10 +++++---
 .../linux/x86/bits/types/struct_semid_ds.h    |  4 ++++
 9 files changed, 59 insertions(+), 14 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 193b7c46b9..b599c423ed 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -102,7 +102,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
 		  bits/ipc-perm.h \
 		  bits/struct_stat.h \
 		  bits/struct_stat_time64_helper.h \
-		  bits/types/struct_msqid64_ds_helper.h
+		  bits/types/struct_msqid64_ds_helper.h \
+		  bits/types/struct_semid64_ds_helper.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
index 7263e50bbf..adaee3eb9e 100644
--- a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
@@ -25,9 +25,6 @@
 #else
 struct __semid64_ds
 {
-  struct ipc_perm sem_perm;		/* operation permission struct */
-  __time64_t sem_otime;			/* last semop() time */
-  __time64_t sem_ctime;			/* last time changed by semctl() */
-  __syscall_ulong_t sem_nsems;		/* number of semaphores in set */
+# include <bits/types/struct_semid64_ds_helper.h>
 };
 #endif
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
new file mode 100644
index 0000000000..ea60b671f1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
@@ -0,0 +1,23 @@
+/* Common definitions for struct semid_ds with 64 bit time.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+  /* Content of internal __semid64_ds.  */
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time64_t sem_otime;			/* last semop() time */
+  __time64_t sem_ctime;			/* last time changed by semctl() */
+  __syscall_ulong_t sem_nsems;		/* number of semaphores in set */
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h
index 2f32fa500e..a7b2c9022e 100644
--- a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h
@@ -23,17 +23,21 @@
 /* Data structure describing a set of semaphores.  */
 struct semid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_semid64_ds_helper.h>
+#else
   struct ipc_perm sem_perm;        /* operation permission struct */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
   __time_t sem_otime;              /* last semop() time */
   __syscall_ulong_t __sem_otime_high;
   __time_t sem_ctime;             /* last time changed by semctl() */
   __syscall_ulong_t __sem_ctime_high;
-#else
+# else
   __time_t sem_otime;
   __time_t sem_ctime;
-#endif
+# endif
   __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
   __syscall_ulong_t __glibc_reserved3;
   __syscall_ulong_t __glibc_reserved4;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h
index 16a9735e7b..5067fb1572 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h
@@ -23,6 +23,9 @@
 /* Data structure describing a set of semaphores.  */
 struct semid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_semid64_ds_helper.h>
+#else
   struct ipc_perm sem_perm;   /* operation permission struct */
   __syscall_ulong_t __sem_otime_high;
   __time_t sem_otime;         /* last semop() time */
@@ -31,4 +34,5 @@ struct semid_ds
   __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
   __syscall_ulong_t __glibc_reserved3;
   __syscall_ulong_t __glibc_reserved4;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h
index 73587ea634..ee9a1e5e61 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h
@@ -23,10 +23,14 @@
 /* Data structure describing a set of semaphores.  */
 struct semid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_semid64_ds_helper.h>
+#else
   struct ipc_perm sem_perm;		/* operation permission struct */
   __time_t sem_otime;	/* last semop() time */
   __time_t sem_ctime;	/* last time changed by semctl() */
   __syscall_ulong_t sem_nsems;		/* number of semaphores in set */
   __syscall_ulong_t __sem_otime_high;
   __syscall_ulong_t __sem_ctime_high;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h
index 8fdbc5d776..0c080fed61 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h
@@ -23,17 +23,21 @@
 /* Data structure describing a set of semaphores.  */
 struct semid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_semid64_ds_helper.h>
+#else
   struct ipc_perm sem_perm;   /* operation permission struct */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
   __syscall_ulong_t __sem_otime_high;
   __time_t sem_otime;         /* last semop() time */
   __syscall_ulong_t __sem_ctime_high;
   __time_t sem_ctime;        /* last time changed by semctl() */
-#else
+# else
   __time_t sem_otime;         /* last semop() time */
   __time_t sem_ctime;         /* last time changed by semctl() */
-#endif
+# endif
   __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
   __syscall_ulong_t __glibc_reserved3;
   __syscall_ulong_t __glibc_reserved4;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h
index 6b9b3639b2..76810427f6 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h
@@ -23,17 +23,21 @@
 /* Data structure describing a set of semaphores.  */
 struct semid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_semid64_ds_helper.h>
+#else
   struct ipc_perm sem_perm;   /* operation permission struct */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
   __syscall_ulong_t __sem_otime_high;
   __time_t sem_otime;         /* last semop() time */
   __syscall_ulong_t __sem_ctime_high;
   __time_t sem_ctime;        /* last time changed by semctl() */
-#else
+# else
   __time_t sem_otime;         /* last semop() time */
   __time_t sem_ctime;         /* last time changed by semctl() */
-#endif
+# endif
   __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
   __syscall_ulong_t __glibc_reserved3;
   __syscall_ulong_t __glibc_reserved4;
+#endif
 };
diff --git a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h
index 90f03b2407..affd38b6bd 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h
@@ -23,6 +23,9 @@
 /* Data structure describing a set of semaphores.  */
 struct semid_ds
 {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_semid64_ds_helper.h>
+#else
   struct ipc_perm sem_perm;   /* operation permission struct */
   __time_t sem_otime;  /* last semop() time */
   __syscall_ulong_t __sem_otime_high;
@@ -31,4 +34,5 @@ struct semid_ds
   __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
   __syscall_ulong_t __glibc_reserved3;
   __syscall_ulong_t __glibc_reserved4;
+#endif
 };
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 16/25] y2038: Use a common definition for shmid_ds
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (14 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 15/25] y2038: Use a common definition for semid_ds Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19  9:09   ` Lukasz Majewski
  2021-06-04 19:38   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 17/25] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Adhemerval Zanella
                   ` (9 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

Instead of replicate the same definitions from struct_shmid64_ds.h
on the multiple struct_shmid_ds.h, use a common header which is included
when required (struct_shmid64_ds_helper.h).

The __USE_TIME_BITS64 is not defined internally yet, although the
internal header is used when building the 64-bit semctl implementation.
---
 sysdeps/unix/sysv/linux/Makefile              |  3 ++-
 .../sysv/linux/bits/types/struct_shmid64_ds.h |  9 +------
 .../bits/types/struct_shmid64_ds_helper.h     | 26 +++++++++++++++++++
 .../sysv/linux/bits/types/struct_shmid_ds.h   | 10 ++++---
 .../linux/hppa/bits/types/struct_shmid_ds.h   | 10 ++++---
 .../linux/mips/bits/types/struct_shmid_ds.h   | 14 ++++++----
 .../powerpc/bits/types/struct_shmid_ds.h      | 10 ++++---
 .../linux/sparc/bits/types/struct_shmid_ds.h  | 10 ++++---
 8 files changed, 66 insertions(+), 26 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index b599c423ed..747d1083e0 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -103,7 +103,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
 		  bits/struct_stat.h \
 		  bits/struct_stat_time64_helper.h \
 		  bits/types/struct_msqid64_ds_helper.h \
-		  bits/types/struct_semid64_ds_helper.h
+		  bits/types/struct_semid64_ds_helper.h \
+		  bits/types/struct_shmid64_ds_helper.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h
index 71100db1b5..a4af8cc5f4 100644
--- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h
@@ -25,13 +25,6 @@
 #else
 struct __shmid64_ds
 {
-  struct ipc_perm shm_perm;	/* operation permission struct */
-  size_t shm_segsz;		/* size of segment in bytes */
-  __time64_t shm_atime;		/* time of last shmat() */
-  __time64_t shm_dtime;		/* time of last shmdt() */
-  __time64_t shm_ctime;		/* time of last change by shmctl() */
-  __pid_t shm_cpid;		/* pid of creator */
-  __pid_t shm_lpid;		/* pid of last shmop */
-  shmatt_t shm_nattch;		/* number of current attaches */
+# include <bits/types/struct_shmid64_ds_helper.h>
 };
 #endif
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
new file mode 100644
index 0000000000..8ab0937c4d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
@@ -0,0 +1,26 @@
+/* Common definitions for struct semid_ds with 64 bit time.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+  struct ipc_perm shm_perm;	/* operation permission struct */
+  size_t shm_segsz;		/* size of segment in bytes */
+  __time64_t shm_atime;		/* time of last shmat() */
+  __time64_t shm_dtime;		/* time of last shmdt() */
+  __time64_t shm_ctime;		/* time of last change by shmctl() */
+  __pid_t shm_cpid;		/* pid of creator */
+  __pid_t shm_lpid;		/* pid of last shmop */
+  shmatt_t shm_nattch;		/* number of current attaches */
diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h
index 2bd587d2b0..5f8ac6257b 100644
--- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h
+++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h
@@ -23,23 +23,27 @@
 /* Data structure describing a shared memory segment.  */
 struct shmid_ds
   {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_shmid64_ds_helper.h>
+#else
     struct ipc_perm shm_perm;		/* operation permission struct */
     size_t shm_segsz;			/* size of segment in bytes */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
     __time_t shm_atime;			/* time of last shmat() */
     unsigned long int __shm_atime_high;
     __time_t shm_dtime;			/* time of last shmdt() */
     unsigned long int __shm_dtime_high;
     __time_t shm_ctime;			/* time of last change by shmctl() */
     unsigned long int __shm_ctime_high;
-#else
+# else
     __time_t shm_atime;			/* time of last shmat() */
     __time_t shm_dtime;			/* time of last shmdt() */
     __time_t shm_ctime;			/* time of last change by shmctl() */
-#endif
+# endif
     __pid_t shm_cpid;			/* pid of creator */
     __pid_t shm_lpid;			/* pid of last shmop */
     shmatt_t shm_nattch;		/* number of current attaches */
     __syscall_ulong_t __glibc_reserved5;
     __syscall_ulong_t __glibc_reserved6;
+#endif
   };
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h
index 47ff80ebb0..7831fd7340 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h
@@ -23,8 +23,11 @@
 /* Data structure describing a shared memory segment.  */
 struct shmid_ds
   {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_shmid64_ds_helper.h>
+#else
     struct ipc_perm shm_perm;		/* operation permission struct */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
     unsigned long int __shm_atime_high;
     __time_t shm_atime;			/* time of last shmat() */
     unsigned long int __shm_dtime_high;
@@ -32,15 +35,16 @@ struct shmid_ds
     unsigned long int __shm_ctime_high;
     __time_t shm_ctime;			/* time of last change by shmctl() */
     unsigned long int __glibc_reserved4;
-#else
+# else
     __time_t shm_atime;			/* time of last shmat() */
     __time_t shm_dtime;			/* time of last shmdt() */
     __time_t shm_ctime;			/* time of last change by shmctl() */
-#endif
+# endif
     size_t shm_segsz;			/* size of segment in bytes */
     __pid_t shm_cpid;			/* pid of creator */
     __pid_t shm_lpid;			/* pid of last shmop */
     shmatt_t shm_nattch;		/* number of current attaches */
     __syscall_ulong_t __glibc_reserved5;
     __syscall_ulong_t __glibc_reserved6;
+#endif
   };
diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h
index 7f8f3b9c51..0691a610ae 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h
@@ -23,27 +23,31 @@
 /* Data structure describing a shared memory segment.  */
 struct shmid_ds
   {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_shmid64_ds_helper.h>
+#else
     struct ipc_perm shm_perm;		/* operation permission struct */
     size_t shm_segsz;			/* size of segment in bytes */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
     __time_t shm_atime;			/* time of last shmat() */
     __time_t shm_dtime;			/* time of last shmdt() */
     __time_t shm_ctime;			/* time of last change by shmctl() */
-#else
+# else
     __time_t shm_atime;			/* time of last shmat() */
     __time_t shm_dtime;			/* time of last shmdt() */
     __time_t shm_ctime;			/* time of last change by shmctl() */
-#endif
+# endif
     __pid_t shm_cpid;			/* pid of creator */
     __pid_t shm_lpid;			/* pid of last shmop */
     shmatt_t shm_nattch;		/* number of current attaches */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
     unsigned short int __shm_atime_high;
     unsigned short int __shm_dtime_high;
     unsigned short int __shm_ctime_high;
     unsigned short int __glibc_reserved4;
-#else
+# else
     __syscall_ulong_t __glibc_reserved5;
     __syscall_ulong_t __glibc_reserved6;
+# endif
 #endif
   };
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h
index d71bdf1ecf..316d43ec99 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h
@@ -23,8 +23,11 @@
 /* Data structure describing a shared memory segment.  */
 struct shmid_ds
   {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_shmid64_ds_helper.h>
+#else
     struct ipc_perm shm_perm;		/* operation permission struct */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
     unsigned long int __shm_atime_high;
     __time_t shm_atime;			/* time of last shmat() */
     unsigned long int __shm_dtime_high;
@@ -32,15 +35,16 @@ struct shmid_ds
     unsigned long int __shm_ctime_high;
     __time_t shm_ctime;			/* time of last change by shmctl() */
     unsigned long int __glibc_reserved4;
-#else
+# else
     __time_t shm_atime;			/* time of last shmat() */
     __time_t shm_dtime;			/* time of last shmdt() */
     __time_t shm_ctime;			/* time of last change by shmctl() */
-#endif
+# endif
     size_t shm_segsz;			/* size of segment in bytes */
     __pid_t shm_cpid;			/* pid of creator */
     __pid_t shm_lpid;			/* pid of last shmop */
     shmatt_t shm_nattch;		/* number of current attaches */
     __syscall_ulong_t __glibc_reserved5;
     __syscall_ulong_t __glibc_reserved6;
+#endif
   };
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h
index 767099803f..86f0cedac3 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h
@@ -23,23 +23,27 @@
 /* Data structure describing a shared memory segment.  */
 struct shmid_ds
   {
+#ifdef __USE_TIME_BITS64
+# include <bits/types/struct_shmid64_ds_helper.h>
+#else
     struct ipc_perm shm_perm;		/* operation permission struct */
-#if __TIMESIZE == 32
+# if __TIMESIZE == 32
     unsigned long int __shm_atime_high;
     __time_t shm_atime;			/* time of last shmat() */
     unsigned long int __shm_dtime_high;
     __time_t shm_dtime;			/* time of last shmdt() */
     unsigned long int __shm_ctime_high;
     __time_t shm_ctime;			/* time of last change by shmctl() */
-#else
+# else
     __time_t shm_atime;			/* time of last shmat() */
     __time_t shm_dtime;			/* time of last shmdt() */
     __time_t shm_ctime;			/* time of last change by shmctl() */
-#endif
+# endif
     size_t shm_segsz;			/* size of segment in bytes */
     __pid_t shm_cpid;			/* pid of creator */
     __pid_t shm_lpid;			/* pid of last shmop */
     shmatt_t shm_nattch;		/* number of current attaches */
     __syscall_ulong_t __glibc_reserved5;
     __syscall_ulong_t __glibc_reserved6;
+#endif
   };
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 17/25] y2038: Add __USE_TIME_BITS64 support for socket-constants.h
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (15 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 16/25] y2038: Use a common definition for shmid_ds Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19  9:13   ` Lukasz Majewski
  2021-06-04 19:38   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 18/25] time: Add 64 bit time support for getdate Adhemerval Zanella
                   ` (8 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

It is only used for !__USE_MISC, the default way uses the kernel
headers.  The patch also adds the SO_TIMESTAMP, SO_TIMESTAMPNS, and
SO_TIMESTAMPING which uses new values for 64 bit time_t kernel
interfaces.

The __USE_TIME_BITS64 is not defined internally yet, although the
internal header is used when building the 64-bit stat implementations.
---
 .../unix/sysv/linux/bits/socket-constants.h   | 47 +++++++++++++++----
 .../sysv/linux/hppa/bits/socket-constants.h   | 36 +++++++++++++-
 .../sysv/linux/mips/bits/socket-constants.h   | 36 +++++++++++++-
 .../linux/powerpc/bits/socket-constants.h     | 36 +++++++++++++-
 .../sysv/linux/sparc/bits/socket-constants.h  | 36 +++++++++++++-
 5 files changed, 175 insertions(+), 16 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/bits/socket-constants.h b/sysdeps/unix/sysv/linux/bits/socket-constants.h
index 84f7a333a2..c52e72bb73 100644
--- a/sysdeps/unix/sysv/linux/bits/socket-constants.h
+++ b/sysdeps/unix/sysv/linux/bits/socket-constants.h
@@ -32,19 +32,50 @@
 #define SO_OOBINLINE 10
 #define SO_RCVBUF 8
 #define SO_RCVLOWAT 18
-#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
-     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
-# define SO_RCVTIMEO 66
-#else
-# define SO_RCVTIMEO 20
-#endif
 #define SO_REUSEADDR 2
 #define SO_SNDBUF 7
 #define SO_SNDLOWAT 19
+#define SO_TYPE 3
+
 #if (__TIMESIZE == 64 && __WORDSIZE == 32 \
      && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+# define SO_RCVTIMEO 66
 # define SO_SNDTIMEO 67
+# define SO_TIMESTAMP 63
+# define SO_TIMESTAMPNS 64
+# define SO_TIMESTAMPING 65
 #else
-# define SO_SNDTIMEO 21
+# if __TIMESIZE == 64
+#  define SO_RCVTIMEO 20
+#  define SO_SNDTIMEO 21
+#  define SO_TIMESTAMP 29
+#  define SO_TIMESTAMPNS 35
+#  define SO_TIMESTAMPING 37
+# else
+#  define SO_RCVTIMEO_OLD 20
+#  define SO_SNDTIMEO_OLD 21
+#  define SO_RCVTIMEO_NEW 66
+#  define SO_SNDTIMEO_NEW 67
+
+#  define SO_TIMESTAMP_OLD 29
+#  define SO_TIMESTAMPNS_OLD 35
+#  define SO_TIMESTAMPING_OLD 37
+#  define SO_TIMESTAMP_NEW 63
+#  define SO_TIMESTAMPNS_NEW 64
+#  define SO_TIMESTAMPING_NEW 65
+
+#  ifdef __USE_TIME_BITS64
+#   define SO_RCVTIMEO SO_RCVTIMEO_NEW
+#   define SO_SNDTIMEO SO_SNDTIMEO_NEW
+#   define SO_TIMESTAMP SO_TIMESTAMP_NEW
+#   define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
+#   define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
+#  else
+#   define SO_RCVTIMEO SO_RCVTIMEO_OLD
+#   define SO_SNDTIMEO SO_SNDTIMEO_OLD
+#   define SO_TIMESTAMP SO_TIMESTAMP_OLD
+#   define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
+#   define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
+#  endif
+# endif
 #endif
-#define SO_TYPE 3
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h
index b4fb65b9f1..68b42d4606 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h
@@ -30,9 +30,41 @@
 #define SO_OOBINLINE 256
 #define SO_RCVBUF 4098
 #define SO_RCVLOWAT 4100
-#define SO_RCVTIMEO 4102
 #define SO_REUSEADDR 4
 #define SO_SNDBUF 4097
 #define SO_SNDLOWAT 4099
-#define SO_SNDTIMEO 4101
 #define SO_TYPE 4104
+
+#if __TIMESIZE == 64
+# define SO_RCVTIMEO 4102
+# define SO_SNDTIMEO 4101
+# define SO_TIMESTAMP 16402
+# define SO_TIMESTAMPNS 16403
+# define SO_TIMESTAMPING 16416
+#else
+# define SO_RCVTIMEO_OLD 4102
+# define SO_SNDTIMEO_OLD 4101
+# define SO_RCVTIMEO_NEW 16448
+# define SO_SNDTIMEO_NEW 16449
+
+# define SO_TIMESTAMP_OLD 0x4012
+# define SO_TIMESTAMPNS_OLD 0x4013
+# define SO_TIMESTAMPING_OLD 0x4020
+# define SO_TIMESTAMP_NEW 0x4038
+# define SO_TIMESTAMPNS_NEW 0x4039
+# define SO_TIMESTAMPING_NEW 0x403A
+
+# ifdef __USE_TIME_BITS64
+#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
+#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
+#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
+# else
+#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
+#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
+#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
+# endif
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h
index a5264536e9..b18a854e99 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h
@@ -30,9 +30,41 @@
 #define SO_OOBINLINE 256
 #define SO_RCVBUF 4098
 #define SO_RCVLOWAT 4100
-#define SO_RCVTIMEO 4102
 #define SO_REUSEADDR 4
 #define SO_SNDBUF 4097
 #define SO_SNDLOWAT 4099
-#define SO_SNDTIMEO 4101
 #define SO_TYPE 4104
+
+#if __TIMESIZE == 64
+# define SO_RCVTIMEO 4102
+# define SO_SNDTIMEO 4101
+# define SO_TIMESTAMP 29
+# define SO_TIMESTAMPNS 35
+# define SO_TIMESTAMPING 37
+#else
+# define SO_RCVTIMEO_OLD 4102
+# define SO_SNDTIMEO_OLD 4101
+# define SO_RCVTIMEO_NEW 66
+# define SO_SNDTIMEO_NEW 67
+
+# define SO_TIMESTAMP_OLD 29
+# define SO_TIMESTAMPNS_OLD 35
+# define SO_TIMESTAMPING_OLD 37
+# define SO_TIMESTAMP_NEW 63
+# define SO_TIMESTAMPNS_NEW 64
+# define SO_TIMESTAMPING_NEW 65
+
+# ifdef __USE_TIME_BITS64
+#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
+#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
+#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
+# else
+#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
+#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
+#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
+# endif
+#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h
index f35488b375..c03141bb8c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h
@@ -30,9 +30,41 @@
 #define SO_OOBINLINE 10
 #define SO_RCVBUF 8
 #define SO_RCVLOWAT 16
-#define SO_RCVTIMEO 18
 #define SO_REUSEADDR 2
 #define SO_SNDBUF 7
 #define SO_SNDLOWAT 17
-#define SO_SNDTIMEO 19
 #define SO_TYPE 3
+
+#if __TIMESIZE == 64
+# define SO_RCVTIMEO 18
+# define SO_SNDTIMEO 19
+# define SO_TIMESTAMP 29
+# define SO_TIMESTAMPNS 35
+# define SO_TIMESTAMPING 37
+#else
+# define SO_RCVTIMEO_OLD 18
+# define SO_SNDTIMEO_OLD 19
+# define SO_RCVTIMEO_NEW 66
+# define SO_SNDTIMEO_NEW 67
+
+# define SO_TIMESTAMP_OLD 29
+# define SO_TIMESTAMPNS_OLD 35
+# define SO_TIMESTAMPING_OLD 37
+# define SO_TIMESTAMP_NEW 63
+# define SO_TIMESTAMPNS_NEW 64
+# define SO_TIMESTAMPING_NEW 65
+
+# ifdef __USE_TIME_BITS64
+#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
+#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
+#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
+# else
+#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
+#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
+#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
+# endif
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
index a58d0b5f96..5c4ed76c8c 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
@@ -30,9 +30,41 @@
 #define SO_OOBINLINE 256
 #define SO_RCVBUF 4098
 #define SO_RCVLOWAT 2048
-#define SO_RCVTIMEO 8192
 #define SO_REUSEADDR 4
 #define SO_SNDBUF 4097
 #define SO_SNDLOWAT 4096
-#define SO_SNDTIMEO 16384
 #define SO_TYPE 4104
+
+#if __TIMESIZE == 64
+# define SO_RCVTIMEO 8192
+# define SO_SNDTIMEO 16384
+# define SO_TIMESTAMP 29
+# define SO_TIMESTAMPNS 33
+# define SO_TIMESTAMPING 35
+#else
+# define SO_RCVTIMEO_OLD 8192
+# define SO_SNDTIMEO_OLD 16384
+# define SO_RCVTIMEO_NEW 68
+# define SO_SNDTIMEO_NEW 69
+
+# define SO_TIMESTAMP_OLD 0x001d
+# define SO_TIMESTAMPNS_OLD 0x0021
+# define SO_TIMESTAMPING_OLD 0x0023
+# define SO_TIMESTAMP_NEW 0x0046
+# define SO_TIMESTAMPNS_NEW 0x0042
+# define SO_TIMESTAMPING_NEW 0x0043
+
+# ifdef __USE_TIME_BITS64
+#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
+#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
+#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
+# else
+#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
+#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
+#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
+#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
+#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
+# endif
+#endif
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 18/25] time: Add 64 bit time support for getdate
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (16 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 17/25] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19  9:15   ` Lukasz Majewski
  2021-06-04 19:38   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella
                   ` (7 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

The getdate is basically a wrapper localtime and mktime.  The 64 bit
time support is done calling the 64 bit internal functions, there is
no need to add a new symbol version.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 include/sys/stat.h |  2 +-
 include/time.h     | 12 ++++++++++--
 time/getdate.c     | 22 ++++++++++------------
 time/tst-getdate.c | 14 ++++----------
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/include/sys/stat.h b/include/sys/stat.h
index b4c9344628..13e777b3c7 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -46,7 +46,7 @@ hidden_proto (__lstat64)
 hidden_proto (__fstatat64)
 # endif
 
-# if __TIMESIZE == 64
+# if __TIMESIZE == 64 || defined NO_RTLD_HIDDEN
 #  define __stat64_time64  __stat64
 #  define __fstat64_time64  __fstat64
 #  define __lstat64_time64  __lstat64
diff --git a/include/time.h b/include/time.h
index 4372bfbd96..980c6bd924 100644
--- a/include/time.h
+++ b/include/time.h
@@ -283,8 +283,8 @@ hidden_proto (__nanosleep64)
 #endif
 
 
-extern int __getdate_r (const char *__string, struct tm *__resbufp)
-  attribute_hidden;
+extern int __getdate_r (const char *__string, struct tm *__resbufp);
+libc_hidden_proto (__getdate_r);
 
 
 /* Determine CLK_TCK value.  */
@@ -509,6 +509,14 @@ time_now (void)
   return ts.tv_sec;
 }
 
+static inline __time64_t
+time64_now (void)
+{
+  struct __timespec64 ts;
+  __clock_gettime64 (TIME_CLOCK_GETTIME_CLOCKID, &ts);
+  return ts.tv_sec;
+}
+
 #define NSEC_PER_SEC    1000000000L  /* Nanoseconds per second.  */
 #define USEC_PER_SEC    1000000L     /* Microseconds per second.  */
 #define NSEC_PER_USEC   1000L        /* Nanoseconds per microsecond.  */
diff --git a/time/getdate.c b/time/getdate.c
index 6e2f75566b..cdcc898517 100644
--- a/time/getdate.c
+++ b/time/getdate.c
@@ -112,16 +112,16 @@ __getdate_r (const char *string, struct tm *tp)
   size_t len;
   char *datemsk;
   char *result = NULL;
-  time_t timer;
+  __time64_t timer;
   struct tm tm;
-  struct stat64 st;
-  int mday_ok = 0;
+  struct __stat64_t64 st;
+  bool mday_ok = false;
 
   datemsk = getenv ("DATEMSK");
   if (datemsk == NULL || *datemsk == '\0')
     return 1;
 
-  if (__stat64 (datemsk, &st) < 0)
+  if (__stat64_time64 (datemsk, &st) < 0)
     return 3;
 
   if (!S_ISREG (st.st_mode))
@@ -219,8 +219,8 @@ __getdate_r (const char *string, struct tm *tp)
     return 7;
 
   /* Get current time.  */
-  timer = time_now ();
-  __localtime_r (&timer, &tm);
+  timer = time64_now ();
+  __localtime64_r (&timer, &tm);
 
   /* If only the weekday is given, today is assumed if the given day
      is equal to the current day and next week if it is less.  */
@@ -230,7 +230,7 @@ __getdate_r (const char *string, struct tm *tp)
       tp->tm_year = tm.tm_year;
       tp->tm_mon = tm.tm_mon;
       tp->tm_mday = tm.tm_mday + (tp->tm_wday - tm.tm_wday + 7) % 7;
-      mday_ok = 1;
+      mday_ok = true;
     }
 
   /* If only the month is given, the current month is assumed if the
@@ -242,7 +242,7 @@ __getdate_r (const char *string, struct tm *tp)
       if (tp->tm_year == INT_MIN)
 	tp->tm_year = tm.tm_year + (((tp->tm_mon - tm.tm_mon) < 0) ? 1 : 0);
       tp->tm_mday = first_wday (tp->tm_year, tp->tm_mon, tp->tm_wday);
-      mday_ok = 1;
+      mday_ok = true;
     }
 
   /* If no hour, minute and second are given the current hour, minute
@@ -285,15 +285,13 @@ __getdate_r (const char *string, struct tm *tp)
      call normalizes the struct tm.  */
   if ((!mday_ok && !check_mday (TM_YEAR_BASE + tp->tm_year, tp->tm_mon,
 				tp->tm_mday))
-      || mktime (tp) == (time_t) -1)
+      || __mktime64 (tp) == (time_t) -1)
     return 8;
 
   return 0;
 }
-#ifdef weak_alias
 weak_alias (__getdate_r, getdate_r)
-#endif
-
+libc_hidden_def (__getdate_r)
 
 struct tm *
 getdate (const char *string)
diff --git a/time/tst-getdate.c b/time/tst-getdate.c
index c37ba3083a..3bb0e96707 100644
--- a/time/tst-getdate.c
+++ b/time/tst-getdate.c
@@ -115,20 +115,14 @@ do_test (void)
     {
       setenv ("TZ", tests[i].tz, 1);
 
-      int expected_err;
-      if (sizeof (time_t) == 4 && tests[i].time64)
-	expected_err = 8;
-      else
-	expected_err = 0;
-
       tm = getdate (tests[i].str);
-      TEST_COMPARE (getdate_err, expected_err);
-      if (getdate_err != expected_err)
+      TEST_COMPARE (getdate_err, 0);
+      if (getdate_err != 0)
 	{
 	  support_record_failure ();
 	  printf ("%s\n", report_date_error ());
 	}
-      else if (getdate_err == 0)
+      else
 	{
 	  TEST_COMPARE (tests[i].tm.tm_mon, tm->tm_mon);
 	  TEST_COMPARE (tests[i].tm.tm_year, tm->tm_year);
@@ -139,7 +133,7 @@ do_test (void)
 	}
 
       struct tm tms;
-      TEST_COMPARE (getdate_r (tests[i].str, &tms), expected_err);
+      TEST_COMPARE (getdate_r (tests[i].str, &tms), 0);
       if (getdate_err == 0)
 	{
 	  TEST_COMPARE (tests[i].tm.tm_mon, tms.tm_mon);
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (17 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 18/25] time: Add 64 bit time support for getdate Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19  9:18   ` Lukasz Majewski
                     ` (2 more replies)
  2021-05-18 20:56 ` [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support Adhemerval Zanella
                   ` (6 subsequent siblings)
  25 siblings, 3 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

A new build flag, _TIME_BITS, enables the usage of the newer 64 bit
time symbols for legacy ABI (where 32 bit time_t is default).  The 64
bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is
also used.

Different than LFS support, the y2038 symbols are added only for the
required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32,
mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh).  The ABIs with
64 bit time support are unchanged, both for symbol and types
redirection.

On Linux the full 64 bit time support requires a minimum of kernel
version v5.1.  Otherwise, the 32 bit fallbacks are used and might
results in error with overflow return code (EOVERFLOW).

The i686-gnu does not yet support 64 bit time.

This patch exports following rediretions to support 64 bit time:

  * libc:
    adjtime;
    adjtimex;
    clock_adjtime;
    clock_getres;
    clock_gettime;
    clock_nanosleep;
    clock_settime;
    cnd_timedwait;
    ctime;
    ctime_r;
    difftime;
    fstat;
    fstatat;
    futimens;
    futimes;
    futimesat;
    getitimer;
    getrusage;
    gettimeofday;
    gmtime;
    gmtime_r;
    localtime;
    localtime_r;
    lstat_time;
    lutimes;
    mktime;
    msgctl;
    mtx_timedlock;
    nanosleep;
    nanosleep;
    ntp_gettime;
    ntp_gettimex;
    ppoll;
    pselec;
    pselect;
    pthread_clockjoin_np;
    pthread_cond_clockwait;
    pthread_cond_timedwait;
    pthread_mutex_clocklock;
    pthread_mutex_timedlock;
    pthread_rwlock_clockrdlock;
    pthread_rwlock_clockwrlock;
    pthread_rwlock_timedrdlock;
    pthread_rwlock_timedwrlock;
    pthread_timedjoin_np;
    recvmmsg;
    sched_rr_get_interval;
    select;
    sem_clockwait;
    semctl;
    semtimedop;
    sem_timedwait;
    setitimer;
    settimeofday;
    shmctl;
    sigtimedwait;
    stat_time;
    thrd_sleep;
    time;
    timegm;
    timerfd_gettime;
    timerfd_settime;
    timespec_get;
    utime;
    utimensat;
    utimes;
    utimes;
    wait3;
    wait4;

  * librt:
    - aio_suspend
    - mq_timedreceive
    - mq_timedsend
    - timer_gettime
    - timer_settime

  * libanl:
    - gai_suspend
---
 Makefile                                      |   2 +-
 NEWS                                          |   5 +
 include/features-time64.h                     |   1 +
 include/features.h                            |   2 +
 io/sys/poll.h                                 |  11 ++
 io/sys/stat.h                                 | 113 ++++++++++++--
 io/utime.h                                    |  11 ++
 manual/creature.texi                          |  44 ++++++
 misc/sys/select.h                             |  27 ++++
 nptl/pthread_clockjoin.c                      |   3 +-
 nptl/pthread_cond_wait.c                      |   9 +-
 nptl/pthread_mutex_timedlock.c                |   8 +-
 nptl/pthread_rwlock_clockrdlock.c             |   4 +-
 nptl/pthread_rwlock_clockwrlock.c             |   4 +-
 nptl/pthread_rwlock_timedrdlock.c             |   4 +-
 nptl/pthread_rwlock_timedwrlock.c             |   4 +-
 nptl/pthread_timedjoin.c                      |   3 +-
 nptl/sem_clockwait.c                          |   3 +-
 nptl/sem_timedwait.c                          |   4 +-
 posix/sched.h                                 |  11 +-
 posix/sys/wait.h                              |  20 +++
 resolv/netdb.h                                |  11 ++
 resource/sys/resource.h                       |  10 ++
 rt/aio.h                                      |  15 +-
 rt/mqueue.h                                   |  22 +++
 signal/signal.h                               |  13 ++
 socket/sys/socket.h                           |  11 ++
 sysdeps/generic/features-time64.h             |  19 +++
 sysdeps/generic/time64-compat.h               |   3 +
 sysdeps/nptl/pthread.h                        | 119 +++++++++++++++
 sysdeps/pthread/semaphore.h                   |  25 ++++
 sysdeps/pthread/threads.h                     |  33 +++++
 sysdeps/unix/sysv/linux/Versions              |  97 ++++++++++++
 sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  67 +++++++++
 sysdeps/unix/sysv/linux/arm/be/librt.abilist  |   5 +
 sysdeps/unix/sysv/linux/arm/le/libanl.abilist |   1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  67 +++++++++
 sysdeps/unix/sysv/linux/arm/le/librt.abilist  |   5 +
 sysdeps/unix/sysv/linux/arm/time64-compat.h   |   2 +
 sysdeps/unix/sysv/linux/bits/msq.h            |   1 +
 sysdeps/unix/sysv/linux/bits/sem.h            |   1 +
 sysdeps/unix/sysv/linux/bits/shm.h            |   1 +
 sysdeps/unix/sysv/linux/bits/time.h           |  10 ++
 sysdeps/unix/sysv/linux/cnd_timedwait.c       |   8 +-
 sysdeps/unix/sysv/linux/csky/libanl.abilist   |   1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  67 +++++++++
 sysdeps/unix/sysv/linux/csky/librt.abilist    |   5 +
 sysdeps/unix/sysv/linux/csky/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/features-time64.h     |  37 +++++
 sysdeps/unix/sysv/linux/hppa/libanl.abilist   |   1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  67 +++++++++
 sysdeps/unix/sysv/linux/hppa/librt.abilist    |   5 +
 sysdeps/unix/sysv/linux/hppa/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/i386/Makefile         |   2 +
 sysdeps/unix/sysv/linux/i386/libanl.abilist   |   1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  67 +++++++++
 sysdeps/unix/sysv/linux/i386/librt.abilist    |   5 +
 sysdeps/unix/sysv/linux/i386/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/include/sys/msg.h     |   2 -
 sysdeps/unix/sysv/linux/include/sys/shm.h     |   2 -
 sysdeps/unix/sysv/linux/include/sys/timex.h   |   2 +
 .../sysv/linux/m68k/coldfire/libanl.abilist   |   1 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |  67 +++++++++
 .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
 .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  67 +++++++++
 .../unix/sysv/linux/m68k/m680x0/librt.abilist |   5 +
 sysdeps/unix/sysv/linux/m68k/time64-compat.h  |   2 +
 .../sysv/linux/microblaze/be/libanl.abilist   |   1 +
 .../sysv/linux/microblaze/be/libc.abilist     |  67 +++++++++
 .../sysv/linux/microblaze/be/librt.abilist    |   5 +
 .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
 .../sysv/linux/microblaze/le/libc.abilist     |  67 +++++++++
 .../sysv/linux/microblaze/le/librt.abilist    |   5 +
 .../sysv/linux/microblaze/time64-compat.h     |   2 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  67 +++++++++
 .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
 .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  67 +++++++++
 .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
 .../sysv/linux/mips/mips64/n32/libanl.abilist |   1 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  67 +++++++++
 .../sysv/linux/mips/mips64/n32/librt.abilist  |   5 +
 .../linux/mips/mips64/n32/time64-compat.h     |   2 +
 sysdeps/unix/sysv/linux/mtx_timedlock.c       |   8 +-
 sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  67 +++++++++
 sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  67 +++++++++
 .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
 .../linux/powerpc/powerpc32/librt.abilist     |   5 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  67 +++++++++
 .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
 .../sysv/linux/s390/s390-32/libanl.abilist    |   1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  67 +++++++++
 .../sysv/linux/s390/s390-32/librt.abilist     |   5 +
 .../sysv/linux/s390/s390-32/time64-compat.h   |   2 +
 sysdeps/unix/sysv/linux/semctl.c              |   1 -
 sysdeps/unix/sysv/linux/sh/be/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  67 +++++++++
 sysdeps/unix/sysv/linux/sh/be/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/sh/le/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  67 +++++++++
 sysdeps/unix/sysv/linux/sh/le/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/sh/time64-compat.h    |   2 +
 .../sysv/linux/sparc/sparc32/libanl.abilist   |   1 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  67 +++++++++
 .../sysv/linux/sparc/sparc32/librt.abilist    |   5 +
 .../sysv/linux/sparc/sparc32/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/sys/timerfd.h         |  22 +++
 sysdeps/unix/sysv/linux/sys/timex.h           |  27 +++-
 sysvipc/sys/msg.h                             |  10 ++
 sysvipc/sys/sem.h                             |  21 +++
 sysvipc/sys/shm.h                             |  10 ++
 time/sys/time.h                               |  71 +++++++++
 time/time.h                                   | 138 +++++++++++++++++-
 118 files changed, 2386 insertions(+), 60 deletions(-)
 create mode 100644 include/features-time64.h
 create mode 100644 sysdeps/generic/features-time64.h
 create mode 100644 sysdeps/generic/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/arm/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/features-time64.h
 create mode 100644 sysdeps/unix/sysv/linux/hppa/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/i386/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/m68k/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/microblaze/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/nios2/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/sh/time64-compat.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h

diff --git a/Makefile b/Makefile
index 50f99ca611..6cc93efc27 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ endif # $(AUTOCONF) = no
 		   subdir_objs subdir_stubs subdir_testclean		\
 		   $(addprefix install-, no-libc.a bin lib data headers others)
 \f
-headers := limits.h values.h features.h gnu-versions.h \
+headers := limits.h values.h features.h features-time64.h gnu-versions.h \
 	   bits/xopen_lim.h gnu/libc-version.h stdc-predef.h \
 	   bits/libc-header-start.h
 
diff --git a/NEWS b/NEWS
index 266837bf2d..3bb122ec3c 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,11 @@ Major new features:
 
 * The ISO C2X function timespec_getres has been added.
 
+* Add support for 64 bit time_t for ABIs with defaults to 32 bit time_t.
+  This is enabled with the _TIME_BITS preprocessor set to 64 and only
+  supported when LFS (_FILE_OFFSET_BITS=64) is also enabled.  It is only
+  enabled for Linux and the full support requires a minimum version of 5.1.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The function pthread_mutex_consistent_np has been deprecated; programs
diff --git a/include/features-time64.h b/include/features-time64.h
new file mode 100644
index 0000000000..06115b7c86
--- /dev/null
+++ b/include/features-time64.h
@@ -0,0 +1 @@
+#include_next <features-time64.h>
diff --git a/include/features.h b/include/features.h
index eb97470afa..9d39e11345 100644
--- a/include/features.h
+++ b/include/features.h
@@ -387,6 +387,8 @@
 # define __USE_FILE_OFFSET64	1
 #endif
 
+#include <features-time64.h>
+
 #if defined _DEFAULT_SOURCE
 # define __USE_MISC	1
 #endif
diff --git a/io/sys/poll.h b/io/sys/poll.h
index 08f29df540..e640efb2bc 100644
--- a/io/sys/poll.h
+++ b/io/sys/poll.h
@@ -66,6 +66,17 @@ extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
 		  const __sigset_t *__ss)
     __attr_access ((__write_only__, 1, 2));
 
+# ifdef __USE_TIME_BITS64
+#  ifdef __REDIRECT
+extern int __REDIRECT (ppoll, (struct pollfd *__fds, nfds_t __nfds,
+                               const struct timespec *__timeout,
+                               const __sigset_t *__ss),
+                       __ppoll64)
+    __attr_access ((__write_only__, 1, 2));
+#  else
+#  define ppoll __ppoll64
+#  endif
+# endif
 #endif
 
 __END_DECLS
diff --git a/io/sys/stat.h b/io/sys/stat.h
index 549375c087..f7874ec5ba 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -209,21 +209,51 @@ extern int stat (const char *__restrict __file,
    that file descriptor FD is open on and put them in BUF.  */
 extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
 #else
-# ifdef __REDIRECT_NTH
+# ifdef __USE_TIME_BITS64
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
+				  struct stat *__restrict __buf),
+				  __stat64_time64)
+     __nonnull ((1, 2));
+extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf),
+				   __fstat64_time64)
+     __nonnull ((2));
+#  else
+#   define stat __stat64_time64
+#   define fstat __fstat64_time64
+#  endif
+# else
+#  ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
 				  struct stat *__restrict __buf), stat64)
      __nonnull ((1, 2));
 extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
      __nonnull ((2));
-# else
-#  define stat stat64
-#  define fstat fstat64
+#  else
+#   define stat stat64
+#   define fstat fstat64
+#  endif
 # endif
 #endif
 #ifdef __USE_LARGEFILE64
+# ifndef __USE_TIME_BITS64
 extern int stat64 (const char *__restrict __file,
 		   struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
 extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (stat64, (const char *__restrict __file,
+				    struct stat64 *__restrict __buf),
+			   __stat64_time64)
+     __nonnull ((1, 2));
+extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf),
+			   __fstat64_time64)
+     __nonnull ((2));
+#  else
+#   define stat64 __stat64_time64
+#   define fstat64 __fstat64_time
+#  endif
+# endif
 #endif
 
 #ifdef __USE_ATFILE
@@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char *__restrict __file,
 		    struct stat *__restrict __buf, int __flag)
      __THROW __nonnull ((2, 3));
 # else
-#  ifdef __REDIRECT_NTH
+#  ifdef __USE_TIME_BITS64
+#   ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
 				     struct stat *__restrict __buf,
 				     int __flag),
-			   fstatat64) __nonnull ((2, 3));
+			   __fstatat64_time64) __nonnull ((2, 3));
+#   else
+#    define fstatat __fstatat64_time64
+#   endif
 #  else
-#   define fstatat fstatat64
+#   ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
+				     struct stat *__restrict __buf,
+				     int __flag),
+			   fstatat64) __nonnull ((2, 3));
+#   else
+#    define fstatat fstatat64
+#   endif
 #  endif
 # endif
 
 # ifdef __USE_LARGEFILE64
+#  ifndef __USE_TIME_BITS64
 extern int fstatat64 (int __fd, const char *__restrict __file,
 		      struct stat64 *__restrict __buf, int __flag)
      __THROW __nonnull ((2, 3));
+#  else
+#   ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatat64, (int __fd,
+				       const char *__restrict __file,
+				       struct stat64 *__restrict __buf,
+				       int __flag),
+			   __fstatat64_time64)
+     __nonnull ((2, 3));
+#   else
+#    define fstatat64 __fstatat64_time64
+#   endif
+#  endif
 # endif
 #endif
 
@@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char *__restrict __file,
 extern int lstat (const char *__restrict __file,
 		  struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
 # else
-#  ifdef __REDIRECT_NTH
+#  ifdef __USE_TIME_BITS64
+#   ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (lstat,
 			   (const char *__restrict __file,
-			    struct stat *__restrict __buf), lstat64)
+			    struct stat *__restrict __buf), __lstat64_time64)
      __nonnull ((1, 2));
+#   else
+#    define lstat __lstat64_time64
+#   endif
 #  else
-#   define lstat lstat64
+#   ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (lstat,
+			   (const char *__restrict __file,
+			    struct stat *__restrict __buf), lstat64)
+     __nonnull ((1, 2));
+#   else
+#    define lstat lstat64
+#   endif
 #  endif
 # endif
 # ifdef __USE_LARGEFILE64
+#  ifndef __USE_TIME_BITS64
 extern int lstat64 (const char *__restrict __file,
 		    struct stat64 *__restrict __buf)
      __THROW __nonnull ((1, 2));
+#  else
+extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file,
+				     struct stat64 *__restrict __buf),
+			   __lstat64_time64)
+     __nonnull ((1, 2));
+#  endif
 # endif
 #endif
 
@@ -355,17 +427,38 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
 #endif
 \f
 #ifdef __USE_ATFILE
+# ifndef __USE_TIME_BITS64
 /* Set file access and modification times relative to directory file
    descriptor.  */
 extern int utimensat (int __fd, const char *__path,
 		      const struct timespec __times[2],
 		      int __flags)
      __THROW __nonnull ((2));
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path,
+                                       const struct timespec __times[2],
+                                       int flags),
+                           __utimensat64) __nonnull ((2));
+#  else
+#   define utimensat __utimensat64
+#  endif
+# endif
 #endif
 
 #ifdef __USE_XOPEN2K8
+# ifndef __USE_TIME_BITS64
 /* Set file access and modification times of the file associated with FD.  */
 extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
+
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]),
+                           __futimens64);
+#  else
+#   define futimens __futimens64
+#  endif
+# endif
 #endif
 
 #ifdef __USE_GNU
diff --git a/io/utime.h b/io/utime.h
index c7612d0838..1a645a3fff 100644
--- a/io/utime.h
+++ b/io/utime.h
@@ -46,10 +46,21 @@ struct utimbuf
 
 /* Set the access and modification times of FILE to those given in
    *FILE_TIMES.  If FILE_TIMES is NULL, set them to the current time.  */
+#ifndef __USE_TIME_BITS64
 extern int utime (const char *__file,
 		  const struct utimbuf *__file_times)
      __THROW __nonnull ((1));
 
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (utime, (const char *__file,
+                                   const struct utimbuf *__file_times),
+                           __utime64);
+# else
+#  define utime __utime64
+# endif
+#endif
+
 __END_DECLS
 
 #endif /* utime.h */
diff --git a/manual/creature.texi b/manual/creature.texi
index 5090735e4f..606b73d184 100644
--- a/manual/creature.texi
+++ b/manual/creature.texi
@@ -165,6 +165,50 @@ This macro was introduced as part of the Large File Support extension
 (LFS).
 @end defvr
 
+@defvr Macro _TIME_BITS
+This macro determines the bit size of @code{time_t} (and therefore the
+bit size of all @code{time_t} derived types and the prototypes of all
+related functions).  If @code{_TIME_BITS} is undefined, the bit size of
+@code{time_t} is architecture dependent.
+
+Possible values of @code{_TIME_BITS}:
+@enumerate
+@item
+@code{_TIME_BITS=64} and port from the outset uses 64-bit
+@code{time_t} and word size equals to @w{64 bits} (e.g. x86_64) - no
+action
+
+@item
+@code{_TIME_BITS=32} and port from the outset uses 32-bit
+@code{time_t} and word size equals to @w{64 bits} (e.g. ARM) - no
+action
+
+@item
+@code{_TIME_BITS=64} and port from the outset uses 64-bit
+@code{time_t} and word size equals to @w{32 bits} (e.g. ARC, RV32)
+- no action
+
+@item
+@code{_TIME_BITS=64} and port from the outset uses 32-bit
+@code{time_t} and word size equals to @w{32 bits} (e.g. ARM)
+- the @code{time_t} is modified to be able to hold 64-bit time.
+
+@item
+For any other use case the compile-time error is emitted.
+@end enumerate
+
+The @code{_TIME_BITS} can be only used when @code{_FILE_OFFSET_BITS=64}
+is also defined.
+
+For the point @b{4} above, calls to proper syscalls depend on the
+Linux kernel version on which the system is running. For Linux kernel
+version above @b{5.1} syscalls supporting 64-bit time are used. Otherwise,
+a fallback code is used with legacy (i.e. 32-bit) syscalls.
+
+By using this macro certain ports gain support for 64-bit time and as
+a result become immune to Y2038 problem.
+@end defvr
+
 @defvr Macro _ISOC99_SOURCE
 @standards{GNU, (none)}
 If this macro is defined, features from ISO C99 are included.  Since
diff --git a/misc/sys/select.h b/misc/sys/select.h
index 188a7fe607..e9c0e8fc20 100644
--- a/misc/sys/select.h
+++ b/misc/sys/select.h
@@ -98,10 +98,23 @@ __BEGIN_DECLS
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
+#ifndef __USE_TIME_BITS64
 extern int select (int __nfds, fd_set *__restrict __readfds,
 		   fd_set *__restrict __writefds,
 		   fd_set *__restrict __exceptfds,
 		   struct timeval *__restrict __timeout);
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (select,
+                       (int __nfds, fd_set *__restrict __readfds,
+                        fd_set *__restrict __writefds,
+                        fd_set *__restrict __exceptfds,
+                        struct timeval *__restrict __timeout),
+                       __select64);
+# else
+#  define select __select64
+# endif
+#endif
 
 #ifdef __USE_XOPEN2K
 /* Same as above only that the TIMEOUT value is given with higher
@@ -110,11 +123,25 @@ extern int select (int __nfds, fd_set *__restrict __readfds,
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
+# ifndef __USE_TIME_BITS64
 extern int pselect (int __nfds, fd_set *__restrict __readfds,
 		    fd_set *__restrict __writefds,
 		    fd_set *__restrict __exceptfds,
 		    const struct timespec *__restrict __timeout,
 		    const __sigset_t *__restrict __sigmask);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (pselect,
+                       (int __nfds, fd_set *__restrict __readfds,
+                        fd_set *__restrict __writefds,
+                        fd_set *__restrict __exceptfds,
+                        const struct timespec *__restrict __timeout,
+                        const __sigset_t *__restrict __sigmask),
+                       __pselect64);
+#  else
+#   define pselect __pselect64
+#  endif
+# endif
 #endif
 
 
diff --git a/nptl/pthread_clockjoin.c b/nptl/pthread_clockjoin.c
index f5007d7831..2d01ba03a2 100644
--- a/nptl/pthread_clockjoin.c
+++ b/nptl/pthread_clockjoin.c
@@ -36,7 +36,8 @@ ___pthread_clockjoin_np64 (pthread_t threadid, void **thread_return,
 #if __TIMESIZE == 64
 strong_alias (___pthread_clockjoin_np64, ___pthread_clockjoin_np)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___pthread_clockjoin_np64, __pthread_clockjoin_np64)
+strong_alias (___pthread_clockjoin_np64, __pthread_clockjoin_np64)
+libc_hidden_def (__pthread_clockjoin_np64)
 
 int
 ___pthread_clockjoin_np (pthread_t threadid, void **thread_return,
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
index 54e504a6b5..9a5897700b 100644
--- a/nptl/pthread_cond_wait.c
+++ b/nptl/pthread_cond_wait.c
@@ -644,10 +644,8 @@ ___pthread_cond_timedwait64 (pthread_cond_t *cond, pthread_mutex_t *mutex,
 #if __TIMESIZE == 64
 strong_alias (___pthread_cond_timedwait64, ___pthread_cond_timedwait)
 #else
-libc_hidden_ver (___pthread_cond_timedwait64, __pthread_cond_timedwait64)
-#ifndef SHARED
 strong_alias (___pthread_cond_timedwait64, __pthread_cond_timedwait64)
-#endif
+libc_hidden_def (__pthread_cond_timedwait64)
 
 int
 ___pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
@@ -685,9 +683,8 @@ ___pthread_cond_clockwait64 (pthread_cond_t *cond, pthread_mutex_t *mutex,
 #if __TIMESIZE == 64
 strong_alias (___pthread_cond_clockwait64, ___pthread_cond_clockwait)
 #else
-versioned_symbol (libc, ___pthread_cond_clockwait64,
-		  __pthread_cond_clockwait64, GLIBC_PRIVATE);
-libc_hidden_ver (___pthread_cond_clockwait64, __pthread_cond_clockwait64)
+strong_alias (___pthread_cond_clockwait64, __pthread_cond_clockwait64);
+libc_hidden_def (__pthread_cond_clockwait64)
 
 int
 ___pthread_cond_clockwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c
index acd78131b2..5afd6222d6 100644
--- a/nptl/pthread_mutex_timedlock.c
+++ b/nptl/pthread_mutex_timedlock.c
@@ -585,7 +585,8 @@ ___pthread_mutex_clocklock64 (pthread_mutex_t *mutex,
 #if __TIMESIZE == 64
 strong_alias (___pthread_mutex_clocklock64, ___pthread_mutex_clocklock)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___pthread_mutex_clocklock64, __pthread_mutex_clocklock64)
+strong_alias (___pthread_mutex_clocklock64, __pthread_mutex_clocklock64)
+libc_hidden_def (__pthread_mutex_clocklock64)
 
 int
 ___pthread_mutex_clocklock (pthread_mutex_t *mutex,
@@ -618,9 +619,8 @@ ___pthread_mutex_timedlock64 (pthread_mutex_t *mutex,
 #if __TIMESIZE == 64
 strong_alias (___pthread_mutex_timedlock64, ___pthread_mutex_timedlock)
 #else /* __TIMESPEC64 != 64 */
-versioned_symbol (libc, ___pthread_mutex_timedlock64,
-		  __pthread_mutex_timedlock64, GLIBC_PRIVATE);
-libc_hidden_ver (___pthread_mutex_timedlock64, __pthread_mutex_timedlock64)
+strong_alias (___pthread_mutex_timedlock64, __pthread_mutex_timedlock64);
+libc_hidden_def (__pthread_mutex_timedlock64)
 
 int
 ___pthread_mutex_timedlock (pthread_mutex_t *mutex,
diff --git a/nptl/pthread_rwlock_clockrdlock.c b/nptl/pthread_rwlock_clockrdlock.c
index 9db96b9904..83ae1d1823 100644
--- a/nptl/pthread_rwlock_clockrdlock.c
+++ b/nptl/pthread_rwlock_clockrdlock.c
@@ -31,8 +31,8 @@ ___pthread_rwlock_clockrdlock64 (pthread_rwlock_t *rwlock, clockid_t clockid,
 #if __TIMESIZE == 64
 strong_alias (___pthread_rwlock_clockrdlock64, ___pthread_rwlock_clockrdlock)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___pthread_rwlock_clockrdlock64,
-		 __pthread_rwlock_clockrdlock64)
+strong_alias (___pthread_rwlock_clockrdlock64, __pthread_rwlock_clockrdlock64)
+libc_hidden_def (__pthread_rwlock_clockrdlock64)
 
 int
 ___pthread_rwlock_clockrdlock (pthread_rwlock_t *rwlock, clockid_t clockid,
diff --git a/nptl/pthread_rwlock_clockwrlock.c b/nptl/pthread_rwlock_clockwrlock.c
index ca0ebe2a65..08a2276da5 100644
--- a/nptl/pthread_rwlock_clockwrlock.c
+++ b/nptl/pthread_rwlock_clockwrlock.c
@@ -31,8 +31,8 @@ ___pthread_rwlock_clockwrlock64 (pthread_rwlock_t *rwlock, clockid_t clockid,
 #if __TIMESIZE == 64
 strong_alias (___pthread_rwlock_clockwrlock64, ___pthread_rwlock_clockwrlock)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___pthread_rwlock_clockwrlock64,
-		 __pthread_rwlock_clockwrlock64)
+strong_alias (___pthread_rwlock_clockwrlock64, __pthread_rwlock_clockwrlock64)
+libc_hidden_def (__pthread_rwlock_clockwrlock64)
 
 int
 ___pthread_rwlock_clockwrlock (pthread_rwlock_t *rwlock, clockid_t clockid,
diff --git a/nptl/pthread_rwlock_timedrdlock.c b/nptl/pthread_rwlock_timedrdlock.c
index dd9b7cb0a2..8c73af26fb 100644
--- a/nptl/pthread_rwlock_timedrdlock.c
+++ b/nptl/pthread_rwlock_timedrdlock.c
@@ -30,8 +30,8 @@ ___pthread_rwlock_timedrdlock64 (pthread_rwlock_t *rwlock,
 #if __TIMESIZE == 64
 strong_alias (___pthread_rwlock_timedrdlock64, ___pthread_rwlock_timedrdlock)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___pthread_rwlock_timedrdlock64,
-		 __pthread_rwlock_timedrdlock64)
+strong_alias (___pthread_rwlock_timedrdlock64, __pthread_rwlock_timedrdlock64)
+libc_hidden_def (__pthread_rwlock_timedrdlock64)
 
 int
 ___pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock,
diff --git a/nptl/pthread_rwlock_timedwrlock.c b/nptl/pthread_rwlock_timedwrlock.c
index e660a544cd..890da92968 100644
--- a/nptl/pthread_rwlock_timedwrlock.c
+++ b/nptl/pthread_rwlock_timedwrlock.c
@@ -30,8 +30,8 @@ ___pthread_rwlock_timedwrlock64 (pthread_rwlock_t *rwlock,
 #if __TIMESIZE == 64
 strong_alias (___pthread_rwlock_timedwrlock64, ___pthread_rwlock_timedwrlock)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___pthread_rwlock_timedwrlock64,
-		 __pthread_rwlock_timedwrlock64)
+strong_alias (___pthread_rwlock_timedwrlock64, __pthread_rwlock_timedwrlock64)
+libc_hidden_def (__pthread_rwlock_timedwrlock64)
 
 int
 ___pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock,
diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c
index ebc31f935a..0b4026612f 100644
--- a/nptl/pthread_timedjoin.c
+++ b/nptl/pthread_timedjoin.c
@@ -31,7 +31,8 @@ ___pthread_timedjoin_np64 (pthread_t threadid, void **thread_return,
 #if __TIMESIZE == 64
 strong_alias (___pthread_timedjoin_np64, ___pthread_timedjoin_np)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___pthread_timedjoin_np64, __pthread_timedjoin_np64)
+strong_alias (___pthread_timedjoin_np64, __pthread_timedjoin_np64)
+libc_hidden_def (__pthread_timedjoin_np64)
 
 int
   ___pthread_timedjoin_np (pthread_t threadid, void **thread_return,
diff --git a/nptl/sem_clockwait.c b/nptl/sem_clockwait.c
index 2739799e26..19751aff04 100644
--- a/nptl/sem_clockwait.c
+++ b/nptl/sem_clockwait.c
@@ -49,7 +49,8 @@ ___sem_clockwait64 (sem_t *sem, clockid_t clockid,
 #if __TIMESIZE == 64
 strong_alias (___sem_clockwait64, ___sem_clockwait)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___sem_clockwait64, __sem_clockwait64)
+strong_alias (___sem_clockwait64, __sem_clockwait64)
+libc_hidden_def (__sem_clockwait64)
 
 int
 ___sem_clockwait (sem_t *sem, clockid_t clockid, const struct timespec *abstime)
diff --git a/nptl/sem_timedwait.c b/nptl/sem_timedwait.c
index 584546c706..5c8f37d3bb 100644
--- a/nptl/sem_timedwait.c
+++ b/nptl/sem_timedwait.c
@@ -45,10 +45,8 @@ ___sem_timedwait64 (sem_t *sem, const struct __timespec64 *abstime)
 #if __TIMESIZE == 64
 strong_alias (___sem_timedwait64, ___sem_timedwait)
 #else /* __TIMESPEC64 != 64 */
-libc_hidden_ver (___sem_timedwait64, __sem_timedwait64)
-#ifndef SHARED
 strong_alias (___sem_timedwait64, __sem_timedwait64)
-#endif
+libc_hidden_def (__sem_timedwait64)
 
 int
 ___sem_timedwait (sem_t *sem, const struct timespec *abstime)
diff --git a/posix/sched.h b/posix/sched.h
index d8ce08a3ea..7dd97a49b2 100644
--- a/posix/sched.h
+++ b/posix/sched.h
@@ -74,8 +74,17 @@ extern int sched_get_priority_max (int __algorithm) __THROW;
 extern int sched_get_priority_min (int __algorithm) __THROW;
 
 /* Get the SCHED_RR interval for the named process.  */
+#ifndef __USE_TIME_BITS64
 extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
-
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (sched_rr_get_interval,
+                           (__pid_t __pid, struct timespec *__t),
+                           __sched_rr_get_interval64);
+# else
+#  define sched_rr_get_interval __sched_rr_get_interval64
+# endif
+#endif
 
 #ifdef __USE_GNU
 /* Access macros for `cpu_set'.  */
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index 9e7bb7f154..5325bfa4d2 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -144,14 +144,34 @@ struct rusage;
    nil, store information about the child's resource usage there.  If the
    WUNTRACED bit is set in OPTIONS, return status for stopped children;
    otherwise don't.  */
+# ifndef __USE_TIME_BITS64
 extern __pid_t wait3 (int *__stat_loc, int __options,
 		      struct rusage * __usage) __THROWNL;
+# else
+#  ifdef __REDIRECT_NTHNL
+extern __pid_t __REDIRECT_NTHNL (wait3, (int *__stat_loc, int __options,
+                                         struct rusage * __usage),
+                                 __wait3_time64);
+#  else
+#   define wait3 __wait3_time64
+#  endif
+# endif
 #endif
 
 #ifdef __USE_MISC
+# ifndef __USE_TIME_BITS64
 /* PID is like waitpid.  Other args are like wait3.  */
 extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
 		      struct rusage *__usage) __THROWNL;
+# else
+#  ifdef __REDIRECT_NTHNL
+extern __pid_t __REDIRECT_NTHNL (wait4, (__pid_t __pid, int *__stat_loc,
+                                         int __options, struct rusage *__usage),
+                                 __wait4_time64);
+#  else
+#   define wait4 __wait4_time64
+#  endif
+# endif
 #endif /* Use misc.  */
 
 
diff --git a/resolv/netdb.h b/resolv/netdb.h
index 1f36f25d4a..9b242ce3d1 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -701,6 +701,17 @@ extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
 extern int gai_suspend (const struct gaicb *const __list[], int __ent,
 			const struct timespec *__timeout);
 
+# ifdef __USE_TIME_BITS64
+#  if defined(__REDIRECT)
+extern int __REDIRECT (gai_suspend, (const struct gaicb *const __list[],
+                                     int __ent,
+                                     const struct timespec *__timeout),
+                       __gai_suspend_time64);
+#  else
+#   define gai_suspend __gai_suspend_time64
+#  endif
+# endif
+
 /* Get the error status of the request REQ.  */
 extern int gai_error (struct gaicb *__req) __THROW;
 
diff --git a/resource/sys/resource.h b/resource/sys/resource.h
index d30379d085..551d25e275 100644
--- a/resource/sys/resource.h
+++ b/resource/sys/resource.h
@@ -88,6 +88,16 @@ extern int setrlimit64 (__rlimit_resource_t __resource,
    and put it in *USAGE.  Returns 0 for success, -1 for failure.  */
 extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
 
+#ifdef __USE_TIME_BITS64
+# if defined(__REDIRECT_NTH)
+extern int __REDIRECT_NTH (getrusage, (__rusage_who_t __who,
+                                       struct rusage *__usage),
+                           __getrusage64);
+# else
+# define getrusage __getrusage64
+# endif
+#endif
+
 /* Return the highest priority of any process specified by WHICH and WHO
    (see above); if WHO is zero, the current process, process group, or user
    (as specified by WHO) is used.  A lower priority number means higher
diff --git a/rt/aio.h b/rt/aio.h
index 3a107b2783..72cf626690 100644
--- a/rt/aio.h
+++ b/rt/aio.h
@@ -193,12 +193,17 @@ extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp),
 extern int __REDIRECT_NTH (aio_cancel,
 			   (int __fildes, struct aiocb *__aiocbp),
 			   aio_cancel64);
-
+#  ifdef __USE_TIME_BITS64
+extern int __REDIRECT_NTH (aio_suspend,
+			   (const struct aiocb *const __list[], int __nent,
+			    const struct timespec *__restrict __timeout),
+			   __aio_suspend_time64) __nonnull ((1));
+#  else
 extern int __REDIRECT_NTH (aio_suspend,
 			   (const struct aiocb *const __list[], int __nent,
 			    const struct timespec *__restrict __timeout),
 			   aio_suspend64) __nonnull ((1));
-
+#  endif
 extern int __REDIRECT_NTH (aio_fsync,
 			   (int __operation, struct aiocb *__aiocbp),
 			   aio_fsync64) __nonnull ((2));
@@ -210,7 +215,11 @@ extern int __REDIRECT_NTH (aio_fsync,
 #  define aio_error aio_error64
 #  define aio_return aio_return64
 #  define aio_cancel aio_cancel64
-#  define aio_suspend aio_suspend64
+#  ifdef __USE_TIME_BITS64
+#   define aio_suspend __aio_suspend_time64
+#  else
+#   define aio_suspend aio_suspend64
+#  endif
 #  define aio_fsync aio_fsync64
 # endif
 #endif
diff --git a/rt/mqueue.h b/rt/mqueue.h
index 8a62d99f50..e8a85637e4 100644
--- a/rt/mqueue.h
+++ b/rt/mqueue.h
@@ -71,6 +71,7 @@ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len,
 		    unsigned int __msg_prio) __nonnull ((2));
 
 #ifdef __USE_XOPEN2K
+# ifndef __USE_TIME_BITS64
 /* Receive the oldest from highest priority messages in message queue
    MQDES, stop waiting if ABS_TIMEOUT expires.  */
 extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr,
@@ -85,6 +86,27 @@ extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr,
 			 size_t __msg_len, unsigned int __msg_prio,
 			 const struct timespec *__abs_timeout)
   __nonnull ((2, 5));
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (mq_timedreceive, (mqd_t __mqdes,
+                               char *__restrict __msg_ptr,
+                               size_t __msg_len,
+                               unsigned int *__restrict __msg_prio,
+                               const struct timespec *__restrict __abs_timeout),
+                       __mq_timedreceive_time64)
+  __nonnull ((2, 5));
+
+extern int __REDIRECT (mq_timedsend, (mqd_t __mqdes,
+                       const char *__msg_ptr, size_t __msg_len,
+                       unsigned int __msg_prio,
+                       const struct timespec *__abs_timeout),
+		       __mq_timedsend_time64)
+  __nonnull ((2, 5));
+#  else
+#   define mq_timedreceive __mq_timedreceive_time64
+#   define mq_timedsend __mq_timedsend_time64
+#  endif
+# endif
 #endif
 
 /* Define some inlines helping to catch common problems.  */
diff --git a/signal/signal.h b/signal/signal.h
index b17203c99c..5fd93382fc 100644
--- a/signal/signal.h
+++ b/signal/signal.h
@@ -269,10 +269,23 @@ extern int sigwaitinfo (const sigset_t *__restrict __set,
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
+#  ifndef __USE_TIME_BITS64
 extern int sigtimedwait (const sigset_t *__restrict __set,
 			 siginfo_t *__restrict __info,
 			 const struct timespec *__restrict __timeout)
      __nonnull ((1));
+#  else
+#   ifdef __REDIRECT
+extern int __REDIRECT (sigtimedwait,
+                       (const sigset_t *__restrict __set,
+                        siginfo_t *__restrict __info,
+                        const struct timespec *__restrict __timeout),
+                       __sigtimedwait64)
+     __nonnull ((1));
+#   else
+#    define sigtimedwait __sigtimedwait64
+#   endif
+#  endif
 
 /* Send signal SIG to the process PID.  Associate data in VAL with the
    signal.  */
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index 949851a6ce..5577e75b80 100644
--- a/socket/sys/socket.h
+++ b/socket/sys/socket.h
@@ -196,9 +196,20 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
+# ifndef __USE_TIME_BITS64
 extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
 		     unsigned int __vlen, int __flags,
 		     struct timespec *__tmo);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (recvmmsg, (int __fd, struct mmsghdr *__vmessages,
+                                  unsigned int __vlen, int __flags,
+                                  struct timespec *__tmo),
+                       __recvmmsg64);
+#  else
+#   define recvmmsg __recvmmsg64
+#  endif
+# endif
 #endif
 
 
diff --git a/sysdeps/generic/features-time64.h b/sysdeps/generic/features-time64.h
new file mode 100644
index 0000000000..a5a677f837
--- /dev/null
+++ b/sysdeps/generic/features-time64.h
@@ -0,0 +1,19 @@
+/* Features part to handle 64-bit time_t support.  Generic version.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* The generic configuration only support _TIME_BITS=32.  */
diff --git a/sysdeps/generic/time64-compat.h b/sysdeps/generic/time64-compat.h
new file mode 100644
index 0000000000..e44b6b68e3
--- /dev/null
+++ b/sysdeps/generic/time64-compat.h
@@ -0,0 +1,3 @@
+/* Header included by Versions to generate the 64 bit time_t compat symbols.
+   Legacy ABIs with default 32 bit time support define TIME64_NON_DEFAULT to
+   generate the 64 bit symbols.  */
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index 22e037dcb4..52e2eadbfc 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -221,6 +221,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return);
    the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL.  */
 extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
 
+# ifndef __USE_TIME_BITS64
 /* Make calling thread wait for termination of the thread TH, but only
    until TIMEOUT.  The exit status of the thread is stored in
    *THREAD_RETURN, if THREAD_RETURN is not NULL.
@@ -240,6 +241,23 @@ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
 extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return,
                                  clockid_t __clockid,
 				 const struct timespec *__abstime);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (pthread_timedjoin_np,
+                       (pthread_t __th, void **__thread_return,
+                        const struct timespec *__abstime),
+                       __pthread_timedjoin_np64);
+
+extern int __REDIRECT (pthread_clockjoin_np,
+                       (pthread_t __th, void **__thread_return,
+                        clockid_t __clockid,
+                        const struct timespec *__abstime),
+                       __pthread_clockjoin_np64);
+#  else
+#   define pthread_timedjoin_np __pthread_timedjoin_np64
+#   define pthread_clockjoin_np __pthread_clockjoin_np64
+#  endif
+# endif
 #endif
 
 /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
@@ -776,16 +794,39 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
 
 #ifdef __USE_XOPEN2K
 /* Wait until lock becomes available, or specified time passes. */
+# ifndef __USE_TIME_BITS64
 extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
 				    const struct timespec *__restrict
 				    __abstime) __THROWNL __nonnull ((1, 2));
+# else
+#  ifdef __REDIRECT_NTHNL
+extern int __REDIRECT_NTHNL (pthread_mutex_timedlock,
+                             (pthread_mutex_t *__restrict __mutex,
+                              const struct timespec *__restrict __abstime),
+                             __pthread_mutex_timedlock64) __nonnull ((1, 2));
+#  else
+#   define pthread_mutex_timedlock __pthread_mutex_timedlock64
+#  endif
+# endif
 #endif
 
 #ifdef __USE_GNU
+# ifndef __USE_TIME_BITS64
 extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex,
 				    clockid_t __clockid,
 				    const struct timespec *__restrict
 				    __abstime) __THROWNL __nonnull ((1, 3));
+# else
+#  ifdef __REDIRECT_NTHNL
+extern int __REDIRECT_NTHNL (pthread_mutex_clocklock,
+                             (pthread_mutex_t *__restrict __mutex,
+                              clockid_t __clockid,
+                              const struct timespec *__restrict __abstime),
+                             __pthread_mutex_clocklock64) __nonnull ((1, 3));
+#  else
+#   define pthread_mutex_clocklock __pthread_mutex_clocklock64
+#  endif
+# endif
 #endif
 
 /* Unlock a mutex.  */
@@ -939,16 +980,41 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
 
 # ifdef __USE_XOPEN2K
 /* Try to acquire read lock for RWLOCK or return after specfied time.  */
+#  ifndef __USE_TIME_BITS64
 extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
 				       const struct timespec *__restrict
 				       __abstime) __THROWNL __nonnull ((1, 2));
+#  else
+#   ifdef __REDIRECT_NTHNL
+extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock,
+                             (pthread_rwlock_t *__restrict __rwlock,
+                              const struct timespec *__restrict __abstime),
+                             __pthread_rwlock_timedrdlock64)
+    __nonnull ((1, 2));
+#   else
+#    define pthread_rwlock_timedrdlock __pthread_rwlock_timedrdlock64
+#   endif
+#  endif
 # endif
 
 # ifdef __USE_GNU
+#  ifndef __USE_TIME_BITS64
 extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock,
 				       clockid_t __clockid,
 				       const struct timespec *__restrict
 				       __abstime) __THROWNL __nonnull ((1, 3));
+#  else
+#   ifdef __REDIRECT_NTHNL
+extern int __REDIRECT_NTHNL (pthread_rwlock_clockrdlock,
+                             (pthread_rwlock_t *__restrict __rwlock,
+                              clockid_t __clockid,
+                              const struct timespec *__restrict __abstime),
+                             __pthread_rwlock_clockrdlock64)
+    __nonnull ((1, 3));
+#   else
+#    define pthread_rwlock_clockrdlock __pthread_rwlock_clockrdlock64
+#   endif
+#  endif
 # endif
 
 /* Acquire write lock for RWLOCK.  */
@@ -961,16 +1027,42 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
 
 # ifdef __USE_XOPEN2K
 /* Try to acquire write lock for RWLOCK or return after specfied time.  */
+#  ifndef __USE_TIME_BITS64
 extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
 				       const struct timespec *__restrict
 				       __abstime) __THROWNL __nonnull ((1, 2));
+#  else
+#   ifdef __REDIRECT_NTHNL
+extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock,
+                             (pthread_rwlock_t *__restrict __rwlock,
+                              const struct timespec *__restrict __abstime),
+                             __pthread_rwlock_timedwrlock64)
+    __nonnull ((1, 2));
+#   else
+#    define pthread_rwlock_timedwrlock __pthread_rwlock_timedwrlock64
+#   endif
+#  endif
 # endif
 
 # ifdef __USE_GNU
+#  ifndef __USE_TIME_BITS64
 extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock,
 				       clockid_t __clockid,
 				       const struct timespec *__restrict
 				       __abstime) __THROWNL __nonnull ((1, 3));
+
+#  else
+#   ifdef __REDIRECT_NTHNL
+extern int __REDIRECT_NTHNL (pthread_rwlock_clockwrlock,
+                             (pthread_rwlock_t *__restrict __rwlock,
+                              clockid_t __clockid,
+                              const struct timespec *__restrict __abstime),
+                             __pthread_rwlock_clockwrlock64)
+    __nonnull ((1, 3));
+#   else
+#    define pthread_rwlock_clockwrlock __pthread_rwlock_clockwrlock64
+#   endif
+#  endif
 # endif
 
 /* Unlock RWLOCK.  */
@@ -1047,10 +1139,23 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
+# ifndef __USE_TIME_BITS64
 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
 				   pthread_mutex_t *__restrict __mutex,
 				   const struct timespec *__restrict __abstime)
      __nonnull ((1, 2, 3));
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (pthread_cond_timedwait,
+                       (pthread_cond_t *__restrict __cond,
+                        pthread_mutex_t *__restrict __mutex,
+                        const struct timespec *__restrict __abstime),
+                       __pthread_cond_timedwait64)
+     __nonnull ((1, 2, 3));
+#  else
+#   define pthread_cond_timedwait __pthread_cond_timedwait64
+#  endif
+# endif
 
 # ifdef __USE_GNU
 /* Wait for condition variable COND to be signaled or broadcast until
@@ -1060,11 +1165,25 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
 
    This function is a cancellation point and therefore not marked with
    __THROW. */
+#  ifndef __USE_TIME_BITS64
 extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
 				   pthread_mutex_t *__restrict __mutex,
 				   __clockid_t __clock_id,
 				   const struct timespec *__restrict __abstime)
      __nonnull ((1, 2, 4));
+#  else
+#   ifdef __REDIRECT
+extern int __REDIRECT (pthread_cond_clockwait,
+                       (pthread_cond_t *__restrict __cond,
+                        pthread_mutex_t *__restrict __mutex,
+                        __clockid_t __clock_id,
+                        const struct timespec *__restrict __abstime),
+                       __pthread_cond_clockwait64)
+     __nonnull ((1, 2, 4));
+#   else
+#    define pthread_cond_clockwait __pthread_cond_clockwait64
+#   endif
+#  endif
 # endif
 
 /* Functions for handling condition variable attributes.  */
diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h
index 7fb0e5c103..35780e7c4e 100644
--- a/sysdeps/pthread/semaphore.h
+++ b/sysdeps/pthread/semaphore.h
@@ -59,16 +59,41 @@ extern int sem_wait (sem_t *__sem) __nonnull ((1));
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
+# ifndef __USE_TIME_BITS64
 extern int sem_timedwait (sem_t *__restrict __sem,
 			  const struct timespec *__restrict __abstime)
   __nonnull ((1, 2));
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (sem_timedwait,
+                       (sem_t *__restrict __sem,
+                        const struct timespec *__restrict __abstime),
+                        __sem_timedwait64)
+  __nonnull ((1, 2));
+#  else
+#   define sem_timedwait __sem_timedwait64
+#  endif
+# endif
 #endif
 
 #ifdef __USE_GNU
+# ifndef __USE_TIME_BITS64
 extern int sem_clockwait (sem_t *__restrict __sem,
 			  clockid_t clock,
 			  const struct timespec *__restrict __abstime)
   __nonnull ((1, 3));
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (sem_clockwait,
+                       (sem_t *__restrict __sem,
+                        clockid_t clock,
+                        const struct timespec *__restrict __abstime),
+                        __sem_clockwait64)
+  __nonnull ((1, 3));
+#  else
+#   define sem_clockwait __sem_clockwait64
+#  endif
+# endif
 #endif
 
 /* Test whether SEM is posted.  */
diff --git a/sysdeps/pthread/threads.h b/sysdeps/pthread/threads.h
index 46929a025e..bf251c9db4 100644
--- a/sysdeps/pthread/threads.h
+++ b/sysdeps/pthread/threads.h
@@ -88,8 +88,18 @@ extern thrd_t thrd_current (void);
    __TIME_POINT.  The current thread may resume if receives a signal.  In
    that case, if __REMAINING is not NULL, the remaining time is stored in
    the object pointed by it.  */
+#ifndef __USE_TIME_BITS64
 extern int thrd_sleep (const struct timespec *__time_point,
 		       struct timespec *__remaining);
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (thrd_sleep, (const struct timespec *__time_point,
+                                    struct timespec *__remaining),
+                       __thrd_sleep64);
+# else
+#  define thrd_sleep __thrd_sleep64
+# endif
+#endif
 
 /* Terminate current thread execution, cleaning up any thread local
    storage and freeing resources.  Returns the value specified in __RES.  */
@@ -131,8 +141,19 @@ extern int mtx_lock (mtx_t *__mutex);
 /* Block the current thread until the mutex pointed by __MUTEX is unlocked
    or time pointed by __TIME_POINT is reached.  In case the mutex is unlock,
    the current thread will not be blocked.  */
+#ifndef __USE_TIME_BITS64
 extern int mtx_timedlock (mtx_t *__restrict __mutex,
 			  const struct timespec *__restrict __time_point);
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (mtx_timedlock, (mtx_t *__restrict __mutex,
+                                       const struct timespec *__restrict
+                                       __time_point),
+                       __mtx_timedlock64);
+# else
+#  define mtx_timedlock __mtx_timedlock64
+# endif
+#endif
 
 /* Try to lock the mutex pointed by __MUTEX without blocking.  If the mutex
    is free the current threads takes control of it, otherwise it returns
@@ -171,9 +192,21 @@ extern int cnd_wait (cnd_t *__cond, mtx_t *__mutex);
 /* Block current thread on the condition variable until condition variable
    pointed by __COND is signaled or time pointed by __TIME_POINT is
    reached.  */
+#ifndef __USE_TIME_BITS64
 extern int cnd_timedwait (cnd_t *__restrict __cond,
 			  mtx_t *__restrict __mutex,
 			  const struct timespec *__restrict __time_point);
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (cnd_timedwait, (cnd_t *__restrict __cond,
+                                       mtx_t *__restrict __mutex,
+                                       const struct timespec *__restrict
+                                       __time_point),
+                       __cnd_timedwait64);
+# else
+#  define cnd_timedwait __cnd_timedwait64
+# endif
+#endif
 
 /* Destroy condition variable pointed by __cond and free all of its
    resources.  */
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 148f04c50a..52fedc61f0 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -1,3 +1,4 @@
+%include <time64-compat.h>
 libc {
   GLIBC_2.0 {
     # functions used in inline functions or macros
@@ -168,6 +169,81 @@ libc {
     getdents64; gettid; tgkill;
   }
   GLIBC_2.32 {
+  }
+  GLIBC_2.34 {
+%ifdef TIME64_NON_DEFAULT
+    # 64 bit time_t support
+    __adjtime64;
+    ___adjtimex64;
+    __clock_adjtime64;
+    __clock_getres64;
+    __clock_gettime64;
+    __clock_nanosleep_time64;
+    __clock_settime64;
+    __cnd_timedwait64;
+    __ctime64;
+    __ctime64_r;
+    __difftime64;
+    __fstat64_time64;
+    __fstatat64_time64;
+    __futimens64;
+    __futimes64;
+    __futimesat64;
+    __getitimer64;
+    __getrusage64;
+    __gettimeofday64;
+    __gmtime64;
+    __gmtime64_r;
+    __localtime64;
+    __localtime64_r;
+    __lstat64_time64;
+    __lutimes64;
+    __mktime64;
+    __msgctl64;
+    __mtx_timedlock64;
+    __nanosleep64;
+    __nanosleep64;
+    __ntp_gettime64;
+    __ntp_gettimex64;
+    __ppoll64;
+    __pselec64;
+    __pselect64;
+    __pthread_clockjoin_np64;
+    __pthread_cond_clockwait64;
+    __pthread_cond_timedwait64;
+    __pthread_mutex_clocklock64;
+    __pthread_mutex_timedlock64;
+    __pthread_rwlock_clockrdlock64;
+    __pthread_rwlock_clockwrlock64;
+    __pthread_rwlock_timedrdlock64;
+    __pthread_rwlock_timedwrlock64;
+    __pthread_timedjoin_np64;
+    __recvmmsg64;
+    __sched_rr_get_interval64;
+    __select64;
+    __sem_clockwait64;
+    __semctl64;
+    __semtimedop64;
+    __sem_timedwait64;
+    __setitimer64;
+    __settimeofday64;
+    __shmctl64;
+    __sigtimedwait64;
+    __stat64_time64;
+    __thrd_sleep64;
+    __time64;
+    __timegm64;
+    __timerfd_gettime64;
+    __timerfd_settime64;
+    __timespec_get64;
+    __timespec_getres64;
+    __utime64;
+    __utimensat64;
+    __utimes64;
+    __utimes64;
+    __wait3_time64;
+    __wait4_time64;
+%endif
   }
   GLIBC_PRIVATE {
     # functions used in other libraries
@@ -188,3 +264,24 @@ ld {
     __nptl_change_stack_perm;
   }
 }
+
+librt {
+  GLIBC_2.34 {
+%ifdef TIME64_NON_DEFAULT
+    # 64 bit time_t support
+    __aio_suspend_time64;
+    __mq_timedsend_time64;
+    __mq_timedreceive_time64;
+    __timer_gettime64;
+    __timer_settime64;
+%endif
+  }
+}
+
+libanl {
+%ifdef TIME64_NON_DEFAULT
+  GLIBC_2.34 {
+    __gai_suspend_time64;
+  }
+%endif
+}
diff --git a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist
index a8fafedb66..37f9b49e52 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist
@@ -1,3 +1,4 @@
+GLIBC_2.34 __gai_suspend_time64 F
 GLIBC_2.4 gai_cancel F
 GLIBC_2.4 gai_error F
 GLIBC_2.4 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 7c3029a7e5..694033a42b 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -189,16 +189,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/arm/be/librt.abilist b/sysdeps/unix/sysv/linux/arm/be/librt.abilist
index 3c0647b251..8cb1ed626c 100644
--- a/sysdeps/unix/sysv/linux/arm/be/librt.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/librt.abilist
@@ -1,3 +1,8 @@
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 aio_cancel F
 GLIBC_2.4 aio_cancel64 F
 GLIBC_2.4 aio_error F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist
index a8fafedb66..37f9b49e52 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist
@@ -1,3 +1,4 @@
+GLIBC_2.34 __gai_suspend_time64 F
 GLIBC_2.4 gai_cancel F
 GLIBC_2.4 gai_error F
 GLIBC_2.4 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 24f5b202e8..1ead45904f 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -186,16 +186,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/arm/le/librt.abilist b/sysdeps/unix/sysv/linux/arm/le/librt.abilist
index 3c0647b251..8cb1ed626c 100644
--- a/sysdeps/unix/sysv/linux/arm/le/librt.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/librt.abilist
@@ -1,3 +1,8 @@
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 aio_cancel F
 GLIBC_2.4 aio_cancel64 F
 GLIBC_2.4 aio_error F
diff --git a/sysdeps/unix/sysv/linux/arm/time64-compat.h b/sysdeps/unix/sysv/linux/arm/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/bits/msq.h b/sysdeps/unix/sysv/linux/bits/msq.h
index 3313b69d78..7c9c479551 100644
--- a/sysdeps/unix/sysv/linux/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/bits/msq.h
@@ -26,6 +26,7 @@ typedef __syscall_ulong_t msgqnum_t;
 typedef __syscall_ulong_t msglen_t;
 
 #include <bits/types/struct_msqid_ds.h>
+#include <bits/types/struct_msqid64_ds.h>
 
 /* Define options for message queue functions.  */
 #define MSG_NOERROR	010000	/* no error if message is too big */
diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h
index ad13287e66..776524b876 100644
--- a/sysdeps/unix/sysv/linux/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/bits/sem.h
@@ -22,6 +22,7 @@
 #include <sys/types.h>
 #include <bits/timesize.h>
 #include <bits/types/struct_semid_ds.h>
+#include <bits/types/struct_semid64_ds.h>
 
 /* Flags for `semop'.  */
 #define SEM_UNDO	0x1000		/* undo the operation on exit */
diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h
index a50c79d7be..454fc3f366 100644
--- a/sysdeps/unix/sysv/linux/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/bits/shm.h
@@ -43,6 +43,7 @@ __BEGIN_DECLS
 typedef __syscall_ulong_t shmatt_t;
 
 #include <bits/types/struct_shmid_ds.h>
+#include <bits/types/struct_shmid64_ds.h>
 
 #ifdef __USE_MISC
 
diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h
index ee5a8b3ef4..d0c98a7864 100644
--- a/sysdeps/unix/sysv/linux/bits/time.h
+++ b/sysdeps/unix/sysv/linux/bits/time.h
@@ -77,6 +77,16 @@ __BEGIN_DECLS
 /* Tune a POSIX clock.  */
 extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW;
 
+#ifdef __USE_TIME_BITS64
+# if defined(__REDIRECT_NTH)
+extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
+                                           struct timex *__utx),
+                           __clock_adjtime64);
+# else
+# define clock_adjtime __clock_adjtime64
+# endif
+#endif
+
 __END_DECLS
 #endif /* use GNU */
 
diff --git a/sysdeps/unix/sysv/linux/cnd_timedwait.c b/sysdeps/unix/sysv/linux/cnd_timedwait.c
index 0415c683f9..6e8ce3d61b 100644
--- a/sysdeps/unix/sysv/linux/cnd_timedwait.c
+++ b/sysdeps/unix/sysv/linux/cnd_timedwait.c
@@ -21,8 +21,8 @@
 #include "thrd_priv.h"
 
 int
-___cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
-                    const struct __timespec64 *restrict time_point)
+__cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
+                   const struct __timespec64 *restrict time_point)
 {
   int err_code = __pthread_cond_timedwait64 ((pthread_cond_t *) cond,
                                              (pthread_mutex_t *) mutex,
@@ -31,9 +31,9 @@ ___cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
 }
 
 #if __TIMESIZE == 64
-strong_alias (___cnd_timedwait64, ___cnd_timedwait)
+strong_alias (__cnd_timedwait64, ___cnd_timedwait)
 #else
-libc_hidden_ver (___cnd_timedwait64, __cnd_timedwait64)
+libc_hidden_def (__cnd_timedwait64)
 
 int
 ___cnd_timedwait (cnd_t *restrict cond, mtx_t *restrict mutex,
diff --git a/sysdeps/unix/sysv/linux/csky/libanl.abilist b/sysdeps/unix/sysv/linux/csky/libanl.abilist
index 416a6f8ddb..01f2e6cbf0 100644
--- a/sysdeps/unix/sysv/linux/csky/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.29 gai_cancel F
 GLIBC_2.29 gai_error F
 GLIBC_2.29 gai_suspend F
 GLIBC_2.29 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 85851c5fca..e8fce124fd 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2266,16 +2266,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/csky/librt.abilist b/sysdeps/unix/sysv/linux/csky/librt.abilist
index c6690ef7c1..b60deca65a 100644
--- a/sysdeps/unix/sysv/linux/csky/librt.abilist
+++ b/sysdeps/unix/sysv/linux/csky/librt.abilist
@@ -33,3 +33,8 @@ GLIBC_2.29 timer_delete F
 GLIBC_2.29 timer_getoverrun F
 GLIBC_2.29 timer_gettime F
 GLIBC_2.29 timer_settime F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
diff --git a/sysdeps/unix/sysv/linux/csky/time64-compat.h b/sysdeps/unix/sysv/linux/csky/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/features-time64.h b/sysdeps/unix/sysv/linux/features-time64.h
new file mode 100644
index 0000000000..c6a0a1874c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/features-time64.h
@@ -0,0 +1,37 @@
+/* Features part to handle 64-bit time_t support.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* We need to know the word size in order to check the time size.  */
+#include <bits/wordsize.h>
+#include <bits/timesize.h>
+
+#if defined _TIME_BITS
+# if _TIME_BITS == 64
+#  if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
+#   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
+#  elif __TIMESIZE == 32
+#   define __USE_TIME_BITS64	1
+#  endif
+# elif _TIME_BITS == 32
+#  if __TIMESIZE > 32
+#   error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32"
+#  endif
+# else
+#  error Invalid _TIME_BITS value (can only be 32 or 64 bits)
+# endif
+#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/libanl.abilist b/sysdeps/unix/sysv/linux/hppa/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/hppa/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index ede69c7ed5..f196d94139 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2219,16 +2219,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist b/sysdeps/unix/sysv/linux/hppa/librt.abilist
index bb03781dcc..463a88a1df 100644
--- a/sysdeps/unix/sysv/linux/hppa/librt.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/hppa/time64-compat.h b/sysdeps/unix/sysv/linux/hppa/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index da716e2c1b..8d5efb4f65 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -1,6 +1,8 @@
 # The default ABI is 32.
 default-abi := 32
 
+extra-version := Versions-y2038
+
 ifeq ($(subdir),misc)
 sysdep_routines += ioperm iopl vm86
 
diff --git a/sysdeps/unix/sysv/linux/i386/libanl.abilist b/sysdeps/unix/sysv/linux/i386/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/i386/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index c883dc08bc..0687af280c 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2401,17 +2401,84 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __isnanf128 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist b/sysdeps/unix/sysv/linux/i386/librt.abilist
index bb03781dcc..463a88a1df 100644
--- a/sysdeps/unix/sysv/linux/i386/librt.abilist
+++ b/sysdeps/unix/sysv/linux/i386/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/i386/time64-compat.h b/sysdeps/unix/sysv/linux/i386/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/include/sys/msg.h b/sysdeps/unix/sysv/linux/include/sys/msg.h
index 522903f818..c460be0dc9 100644
--- a/sysdeps/unix/sysv/linux/include/sys/msg.h
+++ b/sysdeps/unix/sysv/linux/include/sys/msg.h
@@ -7,8 +7,6 @@ extern ssize_t __libc_msgrcv (int msqid, void *msgp, size_t msgsz,
 extern int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz,
 			  int msgflg);
 
-# include <bits/types/struct_msqid64_ds.h>
-
 # if __TIMESIZE == 64
 #  define __msgctl64 __msgctl
 # else
diff --git a/sysdeps/unix/sysv/linux/include/sys/shm.h b/sysdeps/unix/sysv/linux/include/sys/shm.h
index 530a1cdfc9..85177a632d 100644
--- a/sysdeps/unix/sysv/linux/include/sys/shm.h
+++ b/sysdeps/unix/sysv/linux/include/sys/shm.h
@@ -3,8 +3,6 @@
 
 #ifndef _ISOMAC
 
-# include <bits/types/struct_shmid64_ds.h>
-
 # if __TIMESIZE == 64
 #  define __shmctl64 __shmctl
 # else
diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h
index e136ed172e..c554248ed9 100644
--- a/sysdeps/unix/sysv/linux/include/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/include/sys/timex.h
@@ -23,10 +23,12 @@
 
 # ifndef _ISOMAC
 
+extern int __adjtimex (struct timex *__ntx);
 libc_hidden_proto (__adjtimex)
 
 #  include <time.h>
 #  include <struct___timeval64.h>
+
 /* Local definition of 64 bit time supporting timex struct */
 #  if __TIMESIZE == 64
 #   define __timex64 timex
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
index a8fafedb66..37f9b49e52 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
@@ -1,3 +1,4 @@
+GLIBC_2.34 __gai_suspend_time64 F
 GLIBC_2.4 gai_cancel F
 GLIBC_2.4 gai_error F
 GLIBC_2.4 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 8ee9648828..bfd2b7c135 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -190,16 +190,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
index 3c0647b251..8cb1ed626c 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
@@ -1,3 +1,8 @@
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 aio_cancel F
 GLIBC_2.4 aio_cancel64 F
 GLIBC_2.4 aio_error F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 1c51cb41ec..2bd9f7ab64 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2345,16 +2345,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
index bb03781dcc..463a88a1df 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/m68k/time64-compat.h b/sysdeps/unix/sysv/linux/m68k/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist
index 67c7554803..c06e33a1cf 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.18 gai_cancel F
 GLIBC_2.18 gai_error F
 GLIBC_2.18 gai_suspend F
 GLIBC_2.18 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index f8b67cd170..2436c57b2e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2317,16 +2317,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
index 889dfbc0ee..1b8fc10087 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
@@ -33,3 +33,8 @@ GLIBC_2.18 timer_delete F
 GLIBC_2.18 timer_getoverrun F
 GLIBC_2.18 timer_gettime F
 GLIBC_2.18 timer_settime F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist
index 67c7554803..c06e33a1cf 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.18 gai_cancel F
 GLIBC_2.18 gai_error F
 GLIBC_2.18 gai_suspend F
 GLIBC_2.18 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index edac4a1bb4..1262d01845 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2314,16 +2314,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
index 889dfbc0ee..1b8fc10087 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
@@ -33,3 +33,8 @@ GLIBC_2.18 timer_delete F
 GLIBC_2.18 timer_getoverrun F
 GLIBC_2.18 timer_gettime F
 GLIBC_2.18 timer_settime F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/time64-compat.h b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index db900c89ab..2812b458c8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2310,16 +2310,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
index 1539c1cef9..c4dd28e3b2 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 4e15f48b6c..782c5470a6 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2308,16 +2308,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 616a6076f1..3487d0f4c3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2316,16 +2316,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
index 1539c1cef9..c4dd28e3b2 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/mtx_timedlock.c b/sysdeps/unix/sysv/linux/mtx_timedlock.c
index 7715ebb315..8983eb8556 100644
--- a/sysdeps/unix/sysv/linux/mtx_timedlock.c
+++ b/sysdeps/unix/sysv/linux/mtx_timedlock.c
@@ -21,8 +21,8 @@
 #include "thrd_priv.h"
 
 int
-___mtx_timedlock64 (mtx_t *restrict mutex,
-                    const struct __timespec64 *restrict time_point)
+__mtx_timedlock64 (mtx_t *restrict mutex,
+                   const struct __timespec64 *restrict time_point)
 {
   int err_code = __pthread_mutex_timedlock64 ((pthread_mutex_t *)mutex,
                                               time_point);
@@ -30,9 +30,9 @@ ___mtx_timedlock64 (mtx_t *restrict mutex,
 }
 
 #if __TIMESIZE == 64
-strong_alias (___mtx_timedlock64, ___mtx_timedlock)
+strong_alias (__mtx_timedlock64, ___mtx_timedlock)
 #else
-libc_hidden_ver (___mtx_timedlock64, __mtx_timedlock64)
+libc_hidden_def (__mtx_timedlock64)
 
 int
 ___mtx_timedlock (mtx_t *restrict mutex,
diff --git a/sysdeps/unix/sysv/linux/nios2/libanl.abilist b/sysdeps/unix/sysv/linux/nios2/libanl.abilist
index 6ff9c2d94e..6b080bd075 100644
--- a/sysdeps/unix/sysv/linux/nios2/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.21 gai_cancel F
 GLIBC_2.21 gai_error F
 GLIBC_2.21 gai_suspend F
 GLIBC_2.21 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 0fc42897aa..056254475b 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2356,16 +2356,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/nios2/librt.abilist b/sysdeps/unix/sysv/linux/nios2/librt.abilist
index b4ae7a2dc2..2458614125 100644
--- a/sysdeps/unix/sysv/linux/nios2/librt.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/librt.abilist
@@ -33,3 +33,8 @@ GLIBC_2.21 timer_delete F
 GLIBC_2.21 timer_getoverrun F
 GLIBC_2.21 timer_gettime F
 GLIBC_2.21 timer_settime F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
diff --git a/sysdeps/unix/sysv/linux/nios2/time64-compat.h b/sysdeps/unix/sysv/linux/nios2/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nios2/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 553ecdabc9..98e1da179b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2372,16 +2372,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
index bb03781dcc..463a88a1df 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 7ec438f7b4..6dc0ecf108 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2405,16 +2405,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 2274342208..230031f2be 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2370,16 +2370,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
index bb03781dcc..463a88a1df 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
index 1043b2b80d..bb2690d30f 100644
--- a/sysdeps/unix/sysv/linux/semctl.c
+++ b/sysdeps/unix/sysv/linux/semctl.c
@@ -21,7 +21,6 @@
 #include <ipc_priv.h>
 #include <sysdep.h>
 #include <shlib-compat.h>
-#include <bits/types/struct_semid64_ds.h>  /* For __semid64_ds.  */
 #include <linux/posix_types.h>             /* For __kernel_mode_t.  */
 
 /* The struct used to issue the syscall.  For architectures that assume
diff --git a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 97942ff01a..72073ecc27 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2226,16 +2226,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/sh/be/librt.abilist b/sysdeps/unix/sysv/linux/sh/be/librt.abilist
index bb03781dcc..463a88a1df 100644
--- a/sysdeps/unix/sysv/linux/sh/be/librt.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 617b673620..e07c4657f9 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2223,16 +2223,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/sh/le/librt.abilist b/sysdeps/unix/sysv/linux/sh/le/librt.abilist
index bb03781dcc..463a88a1df 100644
--- a/sysdeps/unix/sysv/linux/sh/le/librt.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/librt.abilist
@@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/sh/time64-compat.h b/sysdeps/unix/sysv/linux/sh/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sh/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
index d9a5ed015d..ff719e7605 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
@@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
 GLIBC_2.2.3 gai_error F
 GLIBC_2.2.3 gai_suspend F
 GLIBC_2.2.3 getaddrinfo_a F
+GLIBC_2.34 __gai_suspend_time64 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 3c6559bb4f..7467677c1b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2363,16 +2363,83 @@ GLIBC_2.33 mknod F
 GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
+GLIBC_2.34 ___adjtimex64 F
+GLIBC_2.34 __adjtime64 F
+GLIBC_2.34 __clock_adjtime64 F
+GLIBC_2.34 __clock_getres64 F
+GLIBC_2.34 __clock_gettime64 F
+GLIBC_2.34 __clock_nanosleep_time64 F
+GLIBC_2.34 __clock_settime64 F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __ctime64 F
+GLIBC_2.34 __ctime64_r F
+GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fstat64_time64 F
+GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __futimens64 F
+GLIBC_2.34 __futimes64 F
+GLIBC_2.34 __futimesat64 F
+GLIBC_2.34 __getitimer64 F
+GLIBC_2.34 __getrusage64 F
+GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __gmtime64 F
+GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 __localtime64 F
+GLIBC_2.34 __localtime64_r F
+GLIBC_2.34 __lstat64_time64 F
+GLIBC_2.34 __lutimes64 F
+GLIBC_2.34 __mktime64 F
+GLIBC_2.34 __msgctl64 F
+GLIBC_2.34 __mtx_timedlock64 F
+GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __ntp_gettime64 F
+GLIBC_2.34 __ntp_gettimex64 F
+GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
+GLIBC_2.34 __pthread_clockjoin_np64 F
+GLIBC_2.34 __pthread_cond_clockwait64 F
+GLIBC_2.34 __pthread_cond_timedwait64 F
 GLIBC_2.34 __pthread_key_create F
+GLIBC_2.34 __pthread_mutex_clocklock64 F
 GLIBC_2.34 __pthread_mutex_lock F
+GLIBC_2.34 __pthread_mutex_timedlock64 F
 GLIBC_2.34 __pthread_mutex_unlock F
 GLIBC_2.34 __pthread_register_cancel F
 GLIBC_2.34 __pthread_register_cancel_defer F
+GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
+GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
+GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
+GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
+GLIBC_2.34 __pthread_timedjoin_np64 F
 GLIBC_2.34 __pthread_unregister_cancel F
 GLIBC_2.34 __pthread_unregister_cancel_restore F
 GLIBC_2.34 __pthread_unwind_next F
+GLIBC_2.34 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 F
+GLIBC_2.34 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
+GLIBC_2.34 __semctl64 F
+GLIBC_2.34 __semtimedop64 F
+GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __settimeofday64 F
+GLIBC_2.34 __shmctl64 F
+GLIBC_2.34 __sigtimedwait64 F
+GLIBC_2.34 __stat64_time64 F
+GLIBC_2.34 __thrd_sleep64 F
+GLIBC_2.34 __time64 F
+GLIBC_2.34 __timegm64 F
+GLIBC_2.34 __timerfd_gettime64 F
+GLIBC_2.34 __timerfd_settime64 F
+GLIBC_2.34 __timespec_get64 F
+GLIBC_2.34 __timespec_getres64 F
+GLIBC_2.34 __utime64 F
+GLIBC_2.34 __utimensat64 F
+GLIBC_2.34 __utimes64 F
+GLIBC_2.34 __wait3_time64 F
+GLIBC_2.34 __wait4_time64 F
 GLIBC_2.34 call_once F
 GLIBC_2.34 cnd_broadcast F
 GLIBC_2.34 cnd_destroy F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
index 38f0aad791..fb2769e87b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
@@ -34,6 +34,11 @@ GLIBC_2.3.4 mq_setattr F
 GLIBC_2.3.4 mq_timedreceive F
 GLIBC_2.3.4 mq_timedsend F
 GLIBC_2.3.4 mq_unlink F
+GLIBC_2.34 __aio_suspend_time64 F
+GLIBC_2.34 __mq_timedreceive_time64 F
+GLIBC_2.34 __mq_timedsend_time64 F
+GLIBC_2.34 __timer_gettime64 F
+GLIBC_2.34 __timer_settime64 F
 GLIBC_2.4 lio_listio F
 GLIBC_2.4 lio_listio64 F
 GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
new file mode 100644
index 0000000000..700f854597
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
@@ -0,0 +1,2 @@
+/* ABI support 64-bit in non-default mode.  */
+#define TIME64_NON_DEFAULT
diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h
index 4ad64c2259..790b9d5be6 100644
--- a/sysdeps/unix/sysv/linux/sys/timerfd.h
+++ b/sysdeps/unix/sysv/linux/sys/timerfd.h
@@ -47,9 +47,31 @@ extern int timerfd_settime (int __ufd, int __flags,
 			    const struct itimerspec *__utmr,
 			    struct itimerspec *__otmr) __THROW;
 
+#ifdef __USE_TIME_BITS64
+# if defined(__REDIRECT_NTH)
+extern int __REDIRECT_NTH (timerfd_settime,
+                           (int __ufd, int __flags,
+                            const struct itimerspec *__restrict __value,
+                            struct itimerspec *__restrict __ovalue),
+                           __timerfd_settime64);
+# else
+# define timerfd_settime __timerfd_settime64
+# endif
+#endif
+
 /* Return the next expiration time of UFD.  */
 extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
 
+#ifdef __USE_TIME_BITS64
+# if defined(__REDIRECT_NTH)
+extern int __REDIRECT_NTH (timerfd_gettime, (int __ufd,
+                                             struct itimerspec *__otmr),
+                           __timerfd_gettime64);
+# else
+# define timerfd_gettime __timerfd_gettime64
+# endif
+#endif
+
 __END_DECLS
 
 #endif /* sys/timerfd.h */
diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h
index eb8d15a806..e17265c607 100644
--- a/sysdeps/unix/sysv/linux/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/sys/timex.h
@@ -54,17 +54,34 @@ struct ntptimeval
 
 __BEGIN_DECLS
 
-extern int __adjtimex (struct timex *__ntx) __THROW;
+#ifndef __USE_TIME_BITS64
 extern int adjtimex (struct timex *__ntx) __THROW;
 extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
 
-#ifdef __REDIRECT_NTH
+# ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
-			   ntp_gettimex);
+                           ntp_gettimex);
+# else
+#  define ntp_gettime ntp_gettimex
+# endif
+extern int ntp_adjtime (struct timex *__tntx) __THROW;
 #else
-# define ntp_gettime ntp_gettimex
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx),
+                           ___adjtimex64);
+extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
+                           __ntp_gettime64);
+extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),
+                           __ntp_gettimex64);
+extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx),
+                           ___adjtimex64);
+# else
+#  define adjtimex ___adjtimex64
+#  define ntp_adjtime ___adjtimex64
+#  define ntp_gettime __ntp_gettime64
+#  define ntp_gettimex __ntp_gettimex64
+# endif
 #endif
-extern int ntp_adjtime (struct timex *__tntx) __THROW;
 
 __END_DECLS
 
diff --git a/sysvipc/sys/msg.h b/sysvipc/sys/msg.h
index 9ddedf5e15..f31a43757d 100644
--- a/sysvipc/sys/msg.h
+++ b/sysvipc/sys/msg.h
@@ -58,7 +58,17 @@ struct msgbuf
 __BEGIN_DECLS
 
 /* Message queue control operation.  */
+#ifndef __USE_TIME_BITS64
 extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (msgctl,
+                           (int __msqid, int __cmd, struct msqid_ds *__buf),
+                           __msgctl64);
+# else
+#  define msgctl __msgctl64
+# endif
+#endif
 
 /* Get messages queue.  */
 extern int msgget (key_t __key, int __msgflg) __THROW;
diff --git a/sysvipc/sys/sem.h b/sysvipc/sys/sem.h
index 03b65dff21..4eb4c51bbe 100644
--- a/sysvipc/sys/sem.h
+++ b/sysvipc/sys/sem.h
@@ -48,7 +48,17 @@ struct sembuf
 __BEGIN_DECLS
 
 /* Semaphore control operation.  */
+#ifndef __USE_TIME_BITS64
 extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (semctl,
+                           (int __semid, int __semnum, int __cmd, ...),
+                           __semctl64);
+# else
+#  define semctl __semctl64
+# endif
+#endif
 
 /* Get semaphore.  */
 extern int semget (key_t __key, int __nsems, int __semflg) __THROW;
@@ -58,8 +68,19 @@ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW;
 
 #ifdef __USE_GNU
 /* Operate on semaphore with timeout.  */
+# ifndef __USE_TIME_BITS64
 extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops,
 		       const struct timespec *__timeout) __THROW;
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (semtimedop, (int __semid, struct sembuf *__sops,
+                                        size_t __nsops,
+                                        const struct timespec *__timeout),
+                           __semtimedop64);
+#  else
+#   define semtimedop __semtimedop64
+#  endif
+# endif
 #endif
 
 __END_DECLS
diff --git a/sysvipc/sys/shm.h b/sysvipc/sys/shm.h
index 7506ba67bf..b09e0497e6 100644
--- a/sysvipc/sys/shm.h
+++ b/sysvipc/sys/shm.h
@@ -46,7 +46,17 @@ __BEGIN_DECLS
    facility.  The definition is found in XPG4.2.  */
 
 /* Shared memory control operation.  */
+#ifndef __USE_TIME_BITS64
 extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (shmctl,
+                           (int __shmid, int __cmd, struct shmid_ds *__buf),
+                           __shmctl64);
+# else
+#  define shmctl __shmctl64
+# endif
+#endif
 
 /* Get shared memory segment.  */
 extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
diff --git a/time/sys/time.h b/time/sys/time.h
index 42f91f186b..d21411c0b4 100644
--- a/time/sys/time.h
+++ b/time/sys/time.h
@@ -63,10 +63,21 @@ struct timezone
    use localtime etc. instead.
    This function itself is semi-obsolete;
    most callers should use time or clock_gettime instead. */
+#ifndef __USE_TIME_BITS64
 extern int gettimeofday (struct timeval *__restrict __tv,
 			 void *__restrict __tz) __THROW __nonnull ((1));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (gettimeofday, (struct timeval *__restrict __tv,
+                                          void *__restrict __tz),
+                           __gettimeofday64) __nonnull ((1));
+# else
+#  define gettimeofday __gettimeofday64
+# endif
+#endif
 
 #ifdef __USE_MISC
+# ifndef __USE_TIME_BITS64
 /* Set the current time of day and timezone information.
    This call is restricted to the super-user.
    Setting the timezone in this way is obsolete, but we don't yet
@@ -82,6 +93,20 @@ extern int settimeofday (const struct timeval *__tv,
    This call is restricted to the super-user.  */
 extern int adjtime (const struct timeval *__delta,
 		    struct timeval *__olddelta) __THROW;
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (settimeofday, (const struct timeval *__tv,
+                                          const struct timezone *__tz),
+                           __settimeofday64);
+
+extern int __REDIRECT_NTH (adjtime, (const struct timeval *__delta,
+                                     struct timeval *__olddelta),
+                           __adjtime64);
+#  else
+#   define settimeofday __settimeofday64
+#   define adjtime __adjtime64
+#  endif
+# endif
 #endif
 
 
@@ -118,6 +143,7 @@ typedef enum __itimer_which __itimer_which_t;
 typedef int __itimer_which_t;
 #endif
 
+#ifndef __USE_TIME_BITS64
 /* Set *VALUE to the current setting of timer WHICH.
    Return 0 on success, -1 on errors.  */
 extern int getitimer (__itimer_which_t __which,
@@ -136,21 +162,66 @@ extern int setitimer (__itimer_which_t __which,
 extern int utimes (const char *__file, const struct timeval __tvp[2])
      __THROW __nonnull ((1));
 
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (getitimer, (__itimer_which_t __which,
+                                       struct itimerval *__value),
+                           __getitimer64);
+
+extern int __REDIRECT_NTH (setitimer, (__itimer_which_t __which,
+                                       const struct itimerval *__restrict __new,
+                                       struct itimerval *__restrict __old),
+                           __setitimer64);
+
+extern int __REDIRECT_NTH (utimes, (const char *__file,
+                                    const struct timeval __tvp[2]),
+                           __utimes64) __nonnull ((1));
+# else
+#  define getitimer __getitimer64
+#  define setitimer __setitimer64
+#  define utimes __utimes64
+# endif
+#endif
+
 #ifdef __USE_MISC
+# ifndef __USE_TIME_BITS64
 /* Same as `utimes', but does not follow symbolic links.  */
 extern int lutimes (const char *__file, const struct timeval __tvp[2])
      __THROW __nonnull ((1));
 
 /* Same as `utimes', but takes an open file descriptor instead of a name.  */
 extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW;
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (lutimes, (const char *__file,
+                                     const struct timeval __tvp[2]),
+                           __lutimes64) __nonnull ((1));
+
+extern int __REDIRECT_NTH (futimes, (int __fd, const struct timeval __tvp[2]),
+                           __futimes64);
+#  else
+#   define lutimes __lutimes64
+#   define futimes __futimes64
+#  endif
+# endif
 #endif
 
 #ifdef __USE_GNU
+# ifndef __USE_TIME_BITS64
 /* Change the access time of FILE relative to FD to TVP[0] and the
    modification time of FILE to TVP[1].  If TVP is a null pointer, use
    the current time instead.  Returns 0 on success, -1 on errors.  */
 extern int futimesat (int __fd, const char *__file,
 		      const struct timeval __tvp[2]) __THROW;
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (futimesat, (int __fd, const char *__file,
+                                       const struct timeval __tvp[2]),
+                           __futimesat64);
+#  else
+#   define futimesat __futimesat64
+#  endif
+# endif
 #endif
 
 
diff --git a/time/time.h b/time/time.h
index e255db9772..bde870c934 100644
--- a/time/time.h
+++ b/time/time.h
@@ -71,6 +71,7 @@ __BEGIN_DECLS
    The result / CLOCKS_PER_SEC is program time in seconds.  */
 extern clock_t clock (void) __THROW;
 
+#ifndef __USE_TIME_BITS64
 /* Return the current time and put it in *TIMER if TIMER is not NULL.  */
 extern time_t time (time_t *__timer) __THROW;
 
@@ -80,7 +81,18 @@ extern double difftime (time_t __time1, time_t __time0)
 
 /* Return the `time_t' representation of TP and normalize TP.  */
 extern time_t mktime (struct tm *__tp) __THROW;
-
+#else
+# ifdef __REDIRECT_NTH
+extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64);
+extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t __time0),
+                              __difftime64) __attribute__ ((__const__));
+extern time_t __REDIRECT_NTH (mktime, (struct tm *__tp), __mktime64);
+# else
+#  define time __time64
+#  define difftime __difftime64
+#  define mktime __mktime64
+# endif
+#endif
 
 /* Format TP into S according to FORMAT.
    Write no more than MAXSIZE characters and return the number
@@ -114,6 +126,7 @@ extern char *strptime_l (const char *__restrict __s,
 #endif
 
 
+#ifndef __USE_TIME_BITS64
 /* Return the `struct tm' representation of *TIMER
    in Universal Coordinated Time (aka Greenwich Mean Time).  */
 extern struct tm *gmtime (const time_t *__timer) __THROW;
@@ -122,7 +135,20 @@ extern struct tm *gmtime (const time_t *__timer) __THROW;
    of *TIMER in the local timezone.  */
 extern struct tm *localtime (const time_t *__timer) __THROW;
 
+#else
+# ifdef __REDIRECT_NTH
+extern struct tm*__REDIRECT_NTH (gmtime, (const time_t *__timer), __gmtime64);
+extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer),
+				  __localtime64);
+# else
+#  define gmtime __gmtime64
+#  define localtime __localtime64
+# endif
+#endif
+
+
 #if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
+# ifndef __USE_TIME_BITS64
 /* Return the `struct tm' representation of *TIMER in UTC,
    using *TP to store the result.  */
 extern struct tm *gmtime_r (const time_t *__restrict __timer,
@@ -132,6 +158,20 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer,
    using *TP to store the result.  */
 extern struct tm *localtime_r (const time_t *__restrict __timer,
 			       struct tm *__restrict __tp) __THROW;
+# else
+#  ifdef __REDIRECT_NTH
+extern struct tm*__REDIRECT_NTH (gmtime_r, (const time_t *__restrict __timer,
+                                            struct tm *__restrict __tp),
+                                 __gmtime64_r);
+
+extern struct tm*__REDIRECT_NTH (localtime_r, (const time_t *__restrict __t,
+                                               struct tm *__restrict __tp),
+                                 __localtime64_r);
+#  else
+#   define gmtime_r __gmtime64_r
+#   define localtime_r __localtime_r
+#  endif
+# endif
 #endif	/* POSIX || C2X */
 
 /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n"
@@ -139,7 +179,15 @@ extern struct tm *localtime_r (const time_t *__restrict __timer,
 extern char *asctime (const struct tm *__tp) __THROW;
 
 /* Equivalent to `asctime (localtime (timer))'.  */
+#ifndef __USE_TIME_BITS64
 extern char *ctime (const time_t *__timer) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern char *__REDIRECT_NTH (ctime, (const time_t *__timer), __ctime64);
+# else
+#  define ctime __ctime64
+# endif
+#endif
 
 #ifdef __USE_POSIX
 /* Reentrant versions of the above functions.  */
@@ -150,8 +198,18 @@ extern char *asctime_r (const struct tm *__restrict __tp,
 			char *__restrict __buf) __THROW;
 
 /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'.  */
+#ifndef __USE_TIME_BITS64
 extern char *ctime_r (const time_t *__restrict __timer,
 		      char *__restrict __buf) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern char *__REDIRECT_NTH (ctime_r, (const time_t *__restrict __timer,
+                                       char *__restrict __buf), __ctime64_r);
+# else
+#  define ctime_r __ctime64_r
+# endif
+#endif
+
 #endif	/* POSIX */
 
 
@@ -186,11 +244,19 @@ extern long int timezone;
 /* Miscellaneous functions many Unices inherited from the public domain
    localtime package.  These are included only for compatibility.  */
 
+#ifndef __USE_TIME_BITS64
 /* Like `mktime', but for TP represents Universal Time, not local time.  */
 extern time_t timegm (struct tm *__tp) __THROW;
-
 /* Another name for `mktime'.  */
 extern time_t timelocal (struct tm *__tp) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64);
+extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64);
+# else
+#  define timegm __timegm64
+# endif
+#endif
 
 /* Return the number of days in YEAR.  */
 extern int dysize (int __year) __THROW  __attribute__ ((__const__));
@@ -198,6 +264,7 @@ extern int dysize (int __year) __THROW  __attribute__ ((__const__));
 
 
 #ifdef __USE_POSIX199309
+# ifndef __USE_TIME_BITS64
 /* Pause execution for a number of nanoseconds.
 
    This function is a cancellation point and therefore not marked with
@@ -205,7 +272,6 @@ extern int dysize (int __year) __THROW  __attribute__ ((__const__));
 extern int nanosleep (const struct timespec *__requested_time,
 		      struct timespec *__remaining);
 
-
 /* Get resolution of clock CLOCK_ID.  */
 extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW;
 
@@ -215,15 +281,46 @@ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW;
 /* Set clock CLOCK_ID to value TP.  */
 extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
      __THROW;
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (nanosleep, (const struct timespec *__requested_time,
+                                   struct timespec *__remaining),
+                       __nanosleep64);
+extern int __REDIRECT_NTH (clock_getres, (clockid_t __clock_id,
+                                          struct timespec *__res),
+                           __clock_getres64);
+extern int __REDIRECT_NTH (clock_gettime, (clockid_t __clock_id, struct
+                                           timespec *__tp), __clock_gettime64);
+extern int __REDIRECT_NTH (clock_settime, (clockid_t __clock_id, const struct
+                                           timespec *__tp), __clock_settime64);
+#  else
+#   define nanosleep __nanosleep64
+#   define clock_getres __clock_getres64
+#   define clock_gettime __clock_gettime64
+#   define clock_settime __clock_settime64
+#  endif
+# endif
+
 
 # ifdef __USE_XOPEN2K
 /* High-resolution sleep with the specified clock.
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
+#  ifndef __USE_TIME_BITS64
 extern int clock_nanosleep (clockid_t __clock_id, int __flags,
 			    const struct timespec *__req,
 			    struct timespec *__rem);
+#  else
+#   ifdef __REDIRECT
+extern int __REDIRECT (clock_nanosleep, (clockid_t __clock_id, int __flags,
+                                         const struct timespec *__req,
+                                         struct timespec *__rem),
+                       __clock_nanosleep_time64);
+#   else
+#    define clock_nanosleep __clock_nanosleep_time64
+#   endif
+#  endif
 
 /* Return clock ID for CPU-time clock.  */
 extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
@@ -239,6 +336,7 @@ extern int timer_create (clockid_t __clock_id,
 extern int timer_delete (timer_t __timerid) __THROW;
 
 /* Set timer TIMERID to VALUE, returning old value in OVALUE.  */
+# ifndef __USE_TIME_BITS64
 extern int timer_settime (timer_t __timerid, int __flags,
 			  const struct itimerspec *__restrict __value,
 			  struct itimerspec *__restrict __ovalue) __THROW;
@@ -246,6 +344,21 @@ extern int timer_settime (timer_t __timerid, int __flags,
 /* Get current value of timer TIMERID and store it in VALUE.  */
 extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
      __THROW;
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (timer_settime, (timer_t __timerid, int __flags,
+     const struct itimerspec *__restrict __value,
+     struct itimerspec *__restrict __ovalue),
+                          __timer_settime64);
+
+extern int __REDIRECT_NTH (timer_gettime, (timer_t __timerid,
+                                           struct itimerspec *__value),
+                           __timer_gettime64);
+#  else
+#   define timer_settime __timer_settime64
+#   define timer_gettime __timer_gettime64
+#  endif
+# endif
 
 /* Get expiration overrun for timer TIMERID.  */
 extern int timer_getoverrun (timer_t __timerid) __THROW;
@@ -253,16 +366,35 @@ extern int timer_getoverrun (timer_t __timerid) __THROW;
 
 
 #ifdef __USE_ISOC11
+# ifndef __USE_TIME_BITS64
 /* Set TS to calendar time based in time base BASE.  */
 extern int timespec_get (struct timespec *__ts, int __base)
      __THROW __nonnull ((1));
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (timespec_get, (struct timespec *__ts, int __base),
+                           __timespec_get64) __nonnull ((1));
+#  else
+#   define timespec_get __timespec_get64
+#  endif
+# endif
 #endif
 
 
 #if __GLIBC_USE (ISOC2X)
+# ifndef __USE_TIME_BITS64
 /* Set TS to resolution of time base BASE.  */
 extern int timespec_getres (struct timespec *__ts, int __base)
      __THROW;
+# else
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (timespec_getres, (struct timespec *__ts,
+                                             int __base),
+                           __timespec_getres64);
+#  else
+#   define timespec_getres __timespec_getres64
+#  endif
+# endif
 #endif
 
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (18 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19 10:44   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 21/25] io: Add fts64 " Adhemerval Zanella
                   ` (5 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

The glob might pass a different stat struct for gl_stat and gl_lstat
when GLOB_ALTDIRFUNC is used.  This requires add a new 64 time
version that also uses 64 time stat functions.

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 include/glob.h                                | 28 +++++++++++
 posix/Makefile                                |  5 +-
 posix/glob.c                                  | 46 +++++++++--------
 posix/glob.h                                  | 22 +++++++++
 posix/glob64-lstat-compat.c                   |  3 +-
 posix/glob64-time64.c                         | 49 +++++++++++++++++++
 posix/globfree64-time64.c                     | 30 ++++++++++++
 sysdeps/gnu/glob64-lstat-compat.c             |  3 +-
 sysdeps/unix/sysv/linux/Versions              |  2 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 +
 sysdeps/unix/sysv/linux/glob-lstat-compat.c   |  6 ++-
 sysdeps/unix/sysv/linux/glob.c                |  6 +++
 sysdeps/unix/sysv/linux/glob64-lstat-compat.c | 12 ++---
 sysdeps/unix/sysv/linux/glob64-time64.c       | 44 +++++++++++++++++
 sysdeps/unix/sysv/linux/glob64.c              |  8 +--
 sysdeps/unix/sysv/linux/globfree64-time64.c   | 35 +++++++++++++
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  2 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  2 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |  2 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  2 +
 .../sysv/linux/microblaze/be/libc.abilist     |  2 +
 .../sysv/linux/microblaze/le/libc.abilist     |  2 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  2 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  2 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 +
 sysdeps/unix/sysv/linux/oldglob.c             | 11 ++---
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  2 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  2 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  2 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  2 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  2 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  2 +
 35 files changed, 308 insertions(+), 40 deletions(-)
 create mode 100644 posix/glob64-time64.c
 create mode 100644 posix/globfree64-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/glob64-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/globfree64-time64.c

diff --git a/include/glob.h b/include/glob.h
index 1d2f78793e..f48c71960d 100644
--- a/include/glob.h
+++ b/include/glob.h
@@ -2,11 +2,39 @@
 #include <posix/glob.h>
 
 #ifndef _ISOMAC
+# include <sys/types.h>
+
 libc_hidden_proto (glob)
 libc_hidden_proto (glob64)
 libc_hidden_proto (globfree)
 libc_hidden_proto (globfree64)
 
+# if __TIMESIZE == 64
+#  define glob64_time64_t glob64_t
+# else
+# include <sys/stat.h>
+
+typedef struct
+  {
+    size_t gl_pathc;
+    char **gl_pathv;
+    size_t gl_offs;
+    int gl_flags;
+
+    void (*gl_closedir) (void *);
+    struct dirent64 *(*gl_readdir) (void *);
+    void *(*gl_opendir) (const char *);
+    int (*gl_lstat) (const char *__restrict, struct __stat64_t64 *__restrict);
+    int (*gl_stat) (const char *__restrict, struct __stat64_t64 *__restrict);
+  } glob64_time64_t;
+
+extern int __glob64_time64 (const char *pattern, int flags,
+			    int (*errfunc) (const char *, int),
+			    glob64_time64_t *pglob);
+void __globfree64_time64 (glob64_time64_t *pglob);
+libc_hidden_proto (__globfree64_time64)
+# endif
+
 /* Now define the internal interfaces.  */
 extern int __glob_pattern_p (const char *__pattern, int __quote);
 extern int __glob64 (const char *__pattern, int __flags,
diff --git a/posix/Makefile b/posix/Makefile
index fa0dc0ea20..84204b1270 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -67,7 +67,10 @@ routines :=								      \
 	get_child_max sched_cpucount sched_cpualloc sched_cpufree \
 	streams-compat \
 	shm-directory                                                         \
-	execveat
+	execveat \
+	shm-directory \
+	glob64-time64 \
+	globfree64-time64
 
 aux		:= init-posix environ
 tests		:= test-errno tstgetopt testfnm runtests runptests \
diff --git a/posix/glob.c b/posix/glob.c
index 32c88e5d15..593a4c358f 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -59,25 +59,37 @@
 # define readdir(str) __readdir64 (str)
 # define getpwnam_r(name, bufp, buf, len, res) \
     __getpwnam_r (name, bufp, buf, len, res)
-# define struct_stat64          struct stat64
 # define FLEXIBLE_ARRAY_MEMBER
+# ifndef struct_stat
+#  define struct_stat           struct stat
+# endif
+# ifndef struct_stat64
+#  define struct_stat64         struct stat64
+# endif
+# ifndef GLOB_LSTAT
+#  define GLOB_LSTAT            gl_lstat
+# endif
+# ifndef GLOB_STAT64
+#  define GLOB_STAT64           __stat64
+# endif
+# ifndef GLOB_LSTAT64
+#  define GLOB_LSTAT64          __lstat64
+# endif
 # include <shlib-compat.h>
 #else /* !_LIBC */
 # define __glob                 glob
 # define __getlogin_r(buf, len) getlogin_r (buf, len)
-# define __lstat64(fname, buf)  lstat (fname, buf)
-# if defined _WIN32 && !defined __CYGWIN__
-   /* Avoid GCC or clang warning.  The original __stat64 macro is unused.  */
-#  undef __stat64
-# endif
-# define __stat64(fname, buf)   stat (fname, buf)
 # define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag)
-# define struct_stat64          struct stat
 # ifndef __MVS__
 #  define __alloca              alloca
 # endif
 # define __readdir              readdir
 # define COMPILE_GLOB64
+# define struct_stat            struct stat
+# define struct_stat64          struct stat
+# define GLOB_LSTAT             gl_lstat
+# define GLOB_STAT64            stat
+# define GLOB_LSTAT64           lstat
 #endif /* _LIBC */
 
 #include <fnmatch.h>
@@ -196,22 +208,14 @@ glob_lstat (glob_t *pglob, int flags, const char *fullname)
 {
 /* Use on glob-lstat-compat.c to provide a compat symbol which does not
    use lstat / gl_lstat.  */
-#ifdef GLOB_NO_LSTAT
-# define GL_LSTAT gl_stat
-# define LSTAT64 __stat64
-#else
-# define GL_LSTAT gl_lstat
-# define LSTAT64 __lstat64
-#endif
-
   union
   {
-    struct stat st;
+    struct_stat st;
     struct_stat64 st64;
   } ust;
   return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC)
-          ? pglob->GL_LSTAT (fullname, &ust.st)
-          : LSTAT64 (fullname, &ust.st64));
+          ? pglob->GLOB_LSTAT (fullname, &ust.st)
+          : GLOB_LSTAT64 (fullname, &ust.st64));
 }
 
 /* Set *R = A + B.  Return true if the answer is mathematically
@@ -249,11 +253,11 @@ static int collated_compare (const void *, const void *) __THROWNL;
 static bool
 is_dir (char const *filename, int flags, glob_t const *pglob)
 {
-  struct stat st;
+  struct_stat st;
   struct_stat64 st64;
   return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC)
           ? pglob->gl_stat (filename, &st) == 0 && S_ISDIR (st.st_mode)
-          : __stat64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode));
+          : GLOB_STAT64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode));
 }
 
 /* Find the end of the sub-pattern in a brace expression.  */
diff --git a/posix/glob.h b/posix/glob.h
index b5686600c7..700aeb2392 100644
--- a/posix/glob.h
+++ b/posix/glob.h
@@ -150,20 +150,42 @@ extern int glob (const char *__restrict __pattern, int __flags,
 /* Free storage allocated in PGLOB by a previous `glob' call.  */
 extern void globfree (glob_t *__pglob) __THROW;
 #else
+# ifdef __USE_TIME_BITS64
+extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
+				    int __flags,
+				    int (*__errfunc) (const char *, int),
+				    glob_t *__restrict __pglob),
+			     __glob64_time64);
+
+extern void __REDIRECT_NTH (globfree, (glob_t *__pglob),
+			    __globfree64_time64);
+# else
 extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
 				    int __flags,
 				    int (*__errfunc) (const char *, int),
 				    glob_t *__restrict __pglob), glob64);
 
 extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
+# endif
 #endif
 
 #ifdef __USE_LARGEFILE64
+# ifdef __USE_TIME_BITS64
+extern int __REDIRECT_NTHNL (glob64, (const char *__restrict __pattern,
+				      int __flags,
+				      int (*__errfunc) (const char *, int),
+				      glob64_t *__restrict __pglob),
+			     __glob64_time64);
+
+extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob),
+			    __globfree64_time64);
+# else
 extern int glob64 (const char *__restrict __pattern, int __flags,
 		   int (*__errfunc) (const char *, int),
 		   glob64_t *__restrict __pglob) __THROWNL;
 
 extern void globfree64 (glob64_t *__pglob) __THROW;
+# endif
 #endif
 
 
diff --git a/posix/glob64-lstat-compat.c b/posix/glob64-lstat-compat.c
index bd81a1e390..e90d4ae93e 100644
--- a/posix/glob64-lstat-compat.c
+++ b/posix/glob64-lstat-compat.c
@@ -28,7 +28,8 @@
 # define GLOB_ATTRIBUTE attribute_compat_text_section
 
 /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
-# define GLOB_NO_LSTAT
+# define GLOB_LSTAT   gl_stat
+# define GLOB_LSTAT64 __stat64
 
 # include <posix/glob64.c>
 
diff --git a/posix/glob64-time64.c b/posix/glob64-time64.c
new file mode 100644
index 0000000000..04db45f93a
--- /dev/null
+++ b/posix/glob64-time64.c
@@ -0,0 +1,49 @@
+/* Long File Support glob with 64 bit time support.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <glob.h>
+#include <stddef.h>
+
+#if __TIMESIZE != 64
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+   The bits defined above may be set in FLAGS.
+   If a directory cannot be opened or read and ERRFUNC is not nil,
+   it is called with the pathname that caused the error, and the
+   `errno' value from the failing call; if it returns non-zero
+   `glob' returns GLOB_ABORTED; if it returns zero, the error is ignored.
+   If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+   Otherwise, `glob' returns zero.  */
+int
+__glob64_time64 (const char *pattern, int flags,
+		 int (*errfunc) (const char *, int), glob64_time64_t *pglob)
+{
+  if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  __set_errno (ENOSYS);
+  return GLOB_NOSYS;
+}
+
+stub_warning (glob64)
+
+#endif
diff --git a/posix/globfree64-time64.c b/posix/globfree64-time64.c
new file mode 100644
index 0000000000..d815bc6df1
--- /dev/null
+++ b/posix/globfree64-time64.c
@@ -0,0 +1,30 @@
+/* Long File Support globfree with 64 bit time support.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <glob.h>
+
+#if __TIMESIZE != 64
+
+/* Free storage allocated in PGLOB by a previous `glob' call.  */
+void
+__globfree64_time64 (glob64_time64_t *pglob)
+{
+}
+libc_hidden_def (__globfree64_time64)
+
+#endif
diff --git a/sysdeps/gnu/glob64-lstat-compat.c b/sysdeps/gnu/glob64-lstat-compat.c
index 6764f1d062..ade4ccac8a 100644
--- a/sysdeps/gnu/glob64-lstat-compat.c
+++ b/sysdeps/gnu/glob64-lstat-compat.c
@@ -39,7 +39,8 @@
 #define GLOB_ATTRIBUTE attribute_compat_text_section
 
 /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
-#define GLOB_NO_LSTAT
+#define GLOB_LSTAT   gl_stat
+#define GLOB_LSTAT64 __stat64
 
 #include <posix/glob.c>
 
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 52fedc61f0..27a464483b 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -192,6 +192,8 @@ libc {
     __getitimer64;
     __getrusage64;
     __gettimeofday64;
+    __glob64_time64;
+    __globfree64_time64;
     __gmtime64;
     __gmtime64_r;
     __localtime64;
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 694033a42b..397c97cc16 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -208,6 +208,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 1ead45904f..9bc948703c 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -205,6 +205,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index e8fce124fd..0f84021d9f 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2285,6 +2285,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/glob-lstat-compat.c b/sysdeps/unix/sysv/linux/glob-lstat-compat.c
index 1f502e3299..7729e0dc12 100644
--- a/sysdeps/unix/sysv/linux/glob-lstat-compat.c
+++ b/sysdeps/unix/sysv/linux/glob-lstat-compat.c
@@ -30,7 +30,11 @@
 #define GLOB_ATTRIBUTE attribute_compat_text_section
 
 /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
-#define GLOB_NO_LSTAT
+#define struct_stat    struct stat
+#define struct_stat64  struct stat64
+#define GLOB_LSTAT     gl_stat
+#define GLOB_STAT64    __stat64
+#define GLOB_LSTAT64   __stat64
 
 #include <posix/glob.c>
 
diff --git a/sysdeps/unix/sysv/linux/glob.c b/sysdeps/unix/sysv/linux/glob.c
index 1be4885b96..89c287d01d 100644
--- a/sysdeps/unix/sysv/linux/glob.c
+++ b/sysdeps/unix/sysv/linux/glob.c
@@ -19,6 +19,12 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 
+#define struct_stat    struct stat
+#define struct_stat64  struct stat64
+#define GLOB_LSTAT     gl_lstat
+#define GLOB_STAT64    __stat64
+#define GLOB_LSTAT64   __lstat64
+
 #define glob64 __no_glob64_decl
 #define __glob64 __no___glob64_decl
 #include <posix/glob.c>
diff --git a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
index 40ad625f58..302a44d3a4 100644
--- a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
+++ b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
@@ -33,15 +33,15 @@
 # define __glob __glob64_lstat_compat
 # define globfree globfree64
 
-# undef stat
-# define stat stat64
-
-# define COMPILE_GLOB64	1
-
 # define GLOB_ATTRIBUTE attribute_compat_text_section
 
 /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
-# define GLOB_NO_LSTAT
+# define COMPILE_GLOB64	1
+# define struct_stat    struct stat64
+# define struct_stat64  struct stat64
+# define GLOB_LSTAT     gl_stat
+# define GLOB_STAT64    __stat64
+# define GLOB_LSTAT64   __stat64
 
 # include <posix/glob.c>
 
diff --git a/sysdeps/unix/sysv/linux/glob64-time64.c b/sysdeps/unix/sysv/linux/glob64-time64.c
new file mode 100644
index 0000000000..260f067fa4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/glob64-time64.c
@@ -0,0 +1,44 @@
+/* Find pathnames matching a pattern.  Linux version.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/stat.h>
+
+#if __TIMESIZE != 64
+# include <glob.h>
+# include <dirent.h>
+# include <sys/stat.h>
+
+# define dirent dirent64
+# define __readdir(dirp) __readdir64 (dirp)
+
+# define glob_t glob64_time64_t
+# define __glob __glob64_time64
+
+# define globfree(pglob) __globfree64_time64 (pglob)
+
+# define COMPILE_GLOB64  1
+# define struct_stat     struct __stat64_t64
+# define struct_stat64   struct __stat64_t64
+# define GLOB_LSTAT      gl_lstat
+# define GLOB_STAT64     __stat64_time64
+# define GLOB_LSTAT64    __lstat64_time64
+
+# define COMPILE_GLOB64	1
+
+# include <posix/glob.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/glob64.c b/sysdeps/unix/sysv/linux/glob64.c
index 3cbadf34fb..572ca215df 100644
--- a/sysdeps/unix/sysv/linux/glob64.c
+++ b/sysdeps/unix/sysv/linux/glob64.c
@@ -31,10 +31,12 @@
 # define __glob __glob64
 # define globfree(pglob) globfree64 (pglob)
 
-# undef stat
-# define stat stat64
-
 # define COMPILE_GLOB64	1
+# define struct_stat    struct stat64
+# define struct_stat64  struct stat64
+# define GLOB_LSTAT     gl_lstat
+# define GLOB_STAT64    __stat64
+# define GLOB_LSTAT64   __lstat64
 
 # include <posix/glob.c>
 
diff --git a/sysdeps/unix/sysv/linux/globfree64-time64.c b/sysdeps/unix/sysv/linux/globfree64-time64.c
new file mode 100644
index 0000000000..d6b1e6ac49
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/globfree64-time64.c
@@ -0,0 +1,35 @@
+/* Frees the dynamically allocated storage from an earlier call to glob.
+   Linux version.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/stat.h>
+
+#if __TIMESIZE != 64
+# include <glob.h>
+# include <dirent.h>
+# include <sys/stat.h>
+
+# define glob_t glob64_time64_t
+# define globfree(pglob) __globfree64_time64 (pglob)
+
+# undef stat
+# define stat __stat64_t64
+
+# include <posix/globfree.c>
+libc_hidden_def (__globfree64_time64)
+#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index f196d94139..31caf8ebc3 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2238,6 +2238,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 0687af280c..75b71b8a5b 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2420,6 +2420,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __isnanf128 F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index bfd2b7c135..2f93afc071 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -209,6 +209,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 2bd9f7ab64..dc074cf576 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2364,6 +2364,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 2436c57b2e..a8b8366c48 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2336,6 +2336,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 1262d01845..63e3b096e3 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2333,6 +2333,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 2812b458c8..3d17b78b42 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2329,6 +2329,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 782c5470a6..ba96f15040 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2327,6 +2327,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 3487d0f4c3..04cc170344 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2335,6 +2335,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 056254475b..ce21e19622 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2375,6 +2375,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/oldglob.c b/sysdeps/unix/sysv/linux/oldglob.c
index 59bf89dc1d..a9a4439ddb 100644
--- a/sysdeps/unix/sysv/linux/oldglob.c
+++ b/sysdeps/unix/sysv/linux/oldglob.c
@@ -28,13 +28,12 @@ libc_hidden_proto (__old_glob64);
 #define convert_dirent __old_convert_dirent
 #define glob_in_dir __old_glob_in_dir
 
-#undef stat
-#define stat stat64
-#undef __stat
-#define __stat(file, buf) __stat64 (file, buf)
-
 /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
-#define GLOB_NO_LSTAT
+#define struct_stat    struct stat64
+#define struct_stat64  struct stat64
+#define GLOB_LSTAT     gl_stat
+#define GLOB_STAT64    __stat64
+#define GLOB_LSTAT64   __stat64
 
 #define GLOB_ATTRIBUTE attribute_compat_text_section
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 98e1da179b..4cfae3b735 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2391,6 +2391,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 6dc0ecf108..3e03f313b1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2424,6 +2424,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 230031f2be..4dfdc61761 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2389,6 +2389,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 72073ecc27..2c00100dd6 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2245,6 +2245,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index e07c4657f9..2bcf38af9b 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2242,6 +2242,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 7467677c1b..dad08de21f 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2382,6 +2382,8 @@ GLIBC_2.34 __futimesat64 F
 GLIBC_2.34 __getitimer64 F
 GLIBC_2.34 __getrusage64 F
 GLIBC_2.34 __gettimeofday64 F
+GLIBC_2.34 __glob64_time64 F
+GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
 GLIBC_2.34 __libc_start_main F
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 21/25] io: Add fts64 with 64 bit time_t support
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (19 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19 10:50   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 22/25] io: Add ftw64 " Adhemerval Zanella
                   ` (4 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

Similar to glob, fts routines passes a stat pointer that might
differ of size and layout when 64 bit time API is used.

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 include/fts.h                                 | 51 +++++++++++++++++++
 io/Makefile                                   |  4 +-
 io/fts.h                                      | 43 ++++++++++++++--
 io/fts64-time64.c                             | 35 +++++++++++++
 sysdeps/unix/sysv/linux/Versions              |  5 ++
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  5 ++
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  5 ++
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  5 ++
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  5 ++
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  5 ++
 .../sysv/linux/m68k/coldfire/libc.abilist     |  5 ++
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  5 ++
 .../sysv/linux/microblaze/be/libc.abilist     |  5 ++
 .../sysv/linux/microblaze/le/libc.abilist     |  5 ++
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  5 ++
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  5 ++
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  5 ++
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  5 ++
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  5 ++
 .../powerpc/powerpc32/nofpu/libc.abilist      |  5 ++
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  5 ++
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  5 ++
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  5 ++
 .../sysv/linux/sparc/sparc32/libc.abilist     |  5 ++
 24 files changed, 227 insertions(+), 6 deletions(-)
 create mode 100644 io/fts64-time64.c

diff --git a/include/fts.h b/include/fts.h
index 145dce6779..ea36a9b9be 100644
--- a/include/fts.h
+++ b/include/fts.h
@@ -1 +1,52 @@
+#ifndef _FTS_H
 #include <io/fts.h>
+
+#ifndef _ISOMAC
+# if __TIMESIZE != 64
+#  include <sys/stat.h>
+
+typedef struct
+{
+  struct _ftsent64_time64 *fts_cur;
+  struct _ftsent64_time64 *fts_child;
+  struct _ftsent64_time64 **fts_array;
+  dev_t fts_dev;
+  char *fts_path;
+  int fts_rfd;
+  int fts_pathlen;
+  int fts_nitems;
+  int (*fts_compar) (const void *, const void *);
+  int fts_options;
+} FTS64_TIME64;
+
+typedef struct _ftsent64_time64
+{
+  struct _ftsent64_time64 *fts_cycle;
+  struct _ftsent64_time64 *fts_parent;
+  struct _ftsent64_time64 *fts_link;
+  long fts_number;
+  void *fts_pointer;
+  char *fts_accpath;
+  char *fts_path;
+  int fts_errno;
+  int fts_symfd;
+  unsigned short fts_pathlen;
+  unsigned short fts_namelen;
+
+  ino64_t fts_ino;
+  dev_t fts_dev;
+  nlink_t fts_nlink;
+
+  short fts_level;
+  unsigned short fts_info;
+  unsigned short fts_flags;
+  unsigned short fts_instr;
+
+  struct __stat64_t64 *fts_statp;
+  char fts_name[1];
+} FSTENT64_TIME64;
+
+# endif
+#endif
+
+#endif /* _FTS_H  */
diff --git a/io/Makefile b/io/Makefile
index a22492f3f3..12c832cfcb 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -54,7 +54,8 @@ routines :=								\
 	posix_fadvise posix_fadvise64					\
 	posix_fallocate posix_fallocate64				\
 	sendfile sendfile64 copy_file_range 				\
-	utimensat futimens file_change_detection
+	utimensat futimens file_change_detection			\
+	fts64-time64
 
 others		:= pwd
 test-srcs	:= ftwtest
@@ -102,6 +103,7 @@ CFLAGS-statvfs.c += -fexceptions
 CFLAGS-fstatvfs.c += -fexceptions
 CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
 CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
+CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
 CFLAGS-ftw.c += $(uses-callbacks) -fexceptions
 CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions
 CFLAGS-posix_fallocate.c += -fexceptions
diff --git a/io/fts.h b/io/fts.h
index 867677a27e..8d3395fa31 100644
--- a/io/fts.h
+++ b/io/fts.h
@@ -187,6 +187,7 @@ FTSENT	*fts_read (FTS *);
 int	 fts_set (FTS *, FTSENT *, int) __THROW;
 #else
 # ifdef __REDIRECT
+#  ifndef __USE_TIME_BITS64
 FTSENT	*__REDIRECT (fts_children, (FTS *, int), fts64_children);
 int	 __REDIRECT (fts_close, (FTS *), fts64_close);
 FTS	*__REDIRECT (fts_open, (char * const *, int,
@@ -194,21 +195,53 @@ FTS	*__REDIRECT (fts_open, (char * const *, int,
 		     fts64_open);
 FTSENT	*__REDIRECT (fts_read, (FTS *), fts64_read);
 int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), fts64_set);
+#  else
+FTSENT	*__REDIRECT (fts_children, (FTS *, int), __fts64_children_time64);
+int	 __REDIRECT (fts_close, (FTS *), __fts64_close_time64);
+FTS	*__REDIRECT (fts_open, (char * const *, int,
+				int (*)(const FTSENT **, const FTSENT **)),
+		     __fts64_open_time64);
+FTSENT	*__REDIRECT (fts_read, (FTS *), __fts64_read_time64);
+int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),
+			 __fts64_set_time64);
+#  endif
 # else
-#  define fts_children fts64_children
-#  define fts_close fts64_close
-#  define fts_open fts64_open
-#  define fts_read fts64_read
-#  define fts_set fts64_set
+#  ifndef __USE_TIME_BITS64
+#   define fts_children fts64_children
+#   define fts_close fts64_close
+#   define fts_open fts64_open
+#   define fts_read fts64_read
+#   define fts_set fts64_set
+#  else
+#  endif
 # endif
 #endif
 #ifdef __USE_LARGEFILE64
+# ifndef __USE_TIME_BITS64
 FTSENT64 *fts64_children (FTS64 *, int);
 int	  fts64_close (FTS64 *);
 FTS64	 *fts64_open (char * const *, int,
 		      int (*)(const FTSENT64 **, const FTSENT64 **));
 FTSENT64 *fts64_read (FTS64 *);
 int	 fts64_set (FTS64 *, FTSENT64 *, int) __THROW;
+# else
+#  ifdef __REDIRECT
+FTSENT	*__REDIRECT (fts64_children, (FTS64 *, int), __fts64_children_time64);
+int	 __REDIRECT (fts64_close, (FTS64 *), __fts64_close_time64);
+FTS	*__REDIRECT (fts64_open, (char * const *, int,
+				int (*)(const FTSENT64 **, const FTSENT64 **)),
+		     __fts64_open_time64);
+FTSENT	*__REDIRECT (fts64_read, (FTS64 *), __fts64_read_time64);
+int	 __REDIRECT_NTH (fts64_set, (FTS64 *, FTSENT64 *, int),
+			 __fts64_set_time64);
+#  else
+#   define fts_children __fts64_children_time64
+#   define fts_close __fts64_close_time64
+#   define fts_open __fts64_open_time64
+#   define fts_read __fts64_read_time64
+#   define fts_set __fts64_set_time64
+#  endif
+# endif
 #endif
 __END_DECLS
 
diff --git a/io/fts64-time64.c b/io/fts64-time64.c
new file mode 100644
index 0000000000..c8885ca79b
--- /dev/null
+++ b/io/fts64-time64.c
@@ -0,0 +1,35 @@
+/* File tree traversal functions LFS version.
+   Copyright (C) 2015-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <time.h>
+
+#if __TIMESIZE != 64
+# define FTS_OPEN __fts64_open_time64
+# define FTS_CLOSE __fts64_close_time64
+# define FTS_READ __fts64_read_time64
+# define FTS_SET __fts64_set_time64
+# define FTS_CHILDREN __fts64_children_time64
+# define FTSOBJ FTS64_TIME64
+# define FTSENTRY FSTENT64_TIME64
+# define INO_T ino64_t
+# define STRUCT_STAT __stat64_t64
+# define STAT __stat64_time64
+# define LSTAT __lstat64_time64
+
+# include "fts.c"
+#endif
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 27a464483b..eb258a7333 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -189,6 +189,11 @@ libc {
     __futimens64;
     __futimes64;
     __futimesat64;
+    __fts64_open_time64;
+    __fts64_close_time64;
+    __fts64_read_time64;
+    __fts64_set_time64;
+    __fts64_children_time64;
     __getitimer64;
     __getrusage64;
     __gettimeofday64;
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 397c97cc16..4bdf41cae0 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -202,6 +202,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 9bc948703c..e7bd82b036 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -199,6 +199,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 0f84021d9f..857bc753e3 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2279,6 +2279,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 31caf8ebc3..3c94e046c5 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2232,6 +2232,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 75b71b8a5b..6b2f6e3ba9 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2414,6 +2414,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 2f93afc071..9379012dd9 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -203,6 +203,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index dc074cf576..15142aae53 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2358,6 +2358,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index a8b8366c48..fb73ff10d0 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2330,6 +2330,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 63e3b096e3..fafcf2f255 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2327,6 +2327,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 3d17b78b42..af82e41244 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2323,6 +2323,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index ba96f15040..9d7afa11f3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2321,6 +2321,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 04cc170344..3bbd2468d7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2329,6 +2329,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index ce21e19622..e3b4f8bd9d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2369,6 +2369,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 4cfae3b735..f0756a3997 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2385,6 +2385,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 3e03f313b1..9e4bf76ba1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2418,6 +2418,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 4dfdc61761..56db45a52d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2383,6 +2383,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 2c00100dd6..dbfdc3571f 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2239,6 +2239,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 2bcf38af9b..4b959c0f79 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2236,6 +2236,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index dad08de21f..95fea73af5 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2376,6 +2376,11 @@ GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
+GLIBC_2.34 __fts64_children_time64 F
+GLIBC_2.34 __fts64_close_time64 F
+GLIBC_2.34 __fts64_open_time64 F
+GLIBC_2.34 __fts64_read_time64 F
+GLIBC_2.34 __fts64_set_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 22/25] io: Add ftw64 with 64 bit time_t support
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (20 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 21/25] io: Add fts64 " Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19 10:57   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 23/25] libsupport: Add 64 bit time_t support for time functions Adhemerval Zanella
                   ` (3 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

Similar to fts, ftw routines passes a stat pointer that might
differ of size and layout when 64 bit time API is used.

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 include/ftw.h                                 | 18 ++++++++
 io/Makefile                                   |  4 +-
 io/ftw.c                                      |  5 +-
 io/ftw.h                                      | 46 ++++++++++++++++++-
 io/ftw64-time64.c                             | 34 ++++++++++++++
 sysdeps/unix/sysv/linux/Versions              |  2 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  2 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  2 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |  2 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  2 +
 .../sysv/linux/microblaze/be/libc.abilist     |  2 +
 .../sysv/linux/microblaze/le/libc.abilist     |  2 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  2 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  2 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  2 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  2 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  2 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  2 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  2 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  2 +
 25 files changed, 141 insertions(+), 6 deletions(-)
 create mode 100644 io/ftw64-time64.c

diff --git a/include/ftw.h b/include/ftw.h
index 4fb654cf22..8fb89c4046 100644
--- a/include/ftw.h
+++ b/include/ftw.h
@@ -1 +1,19 @@
+#ifndef _FTW_H
 #include <io/ftw.h>
+
+#ifndef _ISOMAC
+# if __TIMESIZE != 64
+#  include <sys/stat.h>
+
+typedef int (*__ftw64_time64_func_t) (const char *,
+				      const struct __stat64_t64 *, int);
+typedef int (*__nftw64_time64_func_t) (const char *,
+				       const struct __stat64_t64 *, int,
+				       struct FTW *);
+
+extern int __ftw64_time64 (const char *, __ftw64_time64_func_t, int);
+extern int __nftw64_time64 (const char *, __nftw64_time64_func_t, int, int);
+# endif
+#endif
+
+#endif /* _FTW_H  */
diff --git a/io/Makefile b/io/Makefile
index 12c832cfcb..d35e966258 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -55,7 +55,8 @@ routines :=								\
 	posix_fallocate posix_fallocate64				\
 	sendfile sendfile64 copy_file_range 				\
 	utimensat futimens file_change_detection			\
-	fts64-time64
+	fts64-time64							\
+	ftw64-time64
 
 others		:= pwd
 test-srcs	:= ftwtest
@@ -106,6 +107,7 @@ CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
 CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
 CFLAGS-ftw.c += $(uses-callbacks) -fexceptions
 CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions
+CFLAGS-ftw64-time64.c += $(uses-callbacks) -fexceptions
 CFLAGS-posix_fallocate.c += -fexceptions
 CFLAGS-posix_fallocate64.c += -fexceptions
 CFLAGS-fallocate.c += -fexceptions
diff --git a/io/ftw.c b/io/ftw.c
index baca3deeee..ce1c6a14a3 100644
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -821,7 +821,7 @@ FTW_NAME (const char *path, FTW_FUNC_T func, int descriptors)
   return ftw_startup (path, 0, func, descriptors, 0);
 }
 
-#ifndef _LIBC
+#ifndef NFTW_OLD_NAME
 int
 NFTW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags)
 {
@@ -844,7 +844,6 @@ NFTW_NEW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags)
     }
   return ftw_startup (path, 1, func, descriptors, flags);
 }
-
 versioned_symbol (libc, NFTW_NEW_NAME, NFTW_NAME, GLIBC_2_3_3);
 
 # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_3_3)
@@ -863,4 +862,4 @@ NFTW_OLD_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags)
 
 compat_symbol (libc, NFTW_OLD_NAME, NFTW_NAME, GLIBC_2_1);
 # endif
-#endif
+#endif /* NFTW_OLD_NAME  */
diff --git a/io/ftw.h b/io/ftw.h
index 751d689cdb..446498856d 100644
--- a/io/ftw.h
+++ b/io/ftw.h
@@ -137,15 +137,36 @@ extern int ftw (const char *__dir, __ftw_func_t __func, int __descriptors)
      __nonnull ((1, 2));
 #else
 # ifdef __REDIRECT
+#  ifndef __USE_TIME_BITS64
 extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func,
 			     int __descriptors), ftw64) __nonnull ((1, 2));
+#  else
+extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func,
+			     int __descriptors), __ftw64_time64)
+     __nonnull ((1, 2));
+#  endif
 # else
-#  define ftw ftw64
+#  ifndef __USE_TIME_BITS64
+#   define ftw ftw64
+#  else
+#   define ftw __ftw64_time64
+#  endif
 # endif
 #endif
 #ifdef __USE_LARGEFILE64
+# ifndef __USE_TIME_BITS64
 extern int ftw64 (const char *__dir, __ftw64_func_t __func,
 		  int __descriptors) __nonnull ((1, 2));
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (ftw64, (const char *__dir, __ftw64_func_t __func,
+			       int __descriptors),
+		       __ftw64_time64)
+     __nonnull ((1, 2));
+#  else
+#   define nftw64 __nftw64_time64
+#  endif
+# endif
 #endif
 
 #ifdef __USE_XOPEN_EXTENDED
@@ -159,16 +180,37 @@ extern int nftw (const char *__dir, __nftw_func_t __func, int __descriptors,
 		 int __flag) __nonnull ((1, 2));
 # else
 #  ifdef __REDIRECT
+#   ifndef __USE_TIME_BITS64
 extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func,
 			      int __descriptors, int __flag), nftw64)
      __nonnull ((1, 2));
+#   else
+extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func,
+			      int __descriptors, int __flag), __nftw64_time64)
+     __nonnull ((1, 2));
+#   endif
 #  else
-#   define nftw nftw64
+#   ifndef __USE_TIME_BITS64
+#    define nftw nftw64
+#   else
+#    define nftw __nftw64_time64
+#   endif
 #  endif
 # endif
 # ifdef __USE_LARGEFILE64
+#  ifndef __USE_TIME_BITS64
 extern int nftw64 (const char *__dir, __nftw64_func_t __func,
 		   int __descriptors, int __flag) __nonnull ((1, 2));
+#  else
+#   ifdef __REDIRECT
+extern int __REDIRECT (nftw64, (const char *__dir, __nftw64_func_t __func,
+				int __descriptors, int __flag),
+		       __nftw64_time64)
+     __nonnull ((1, 2));
+#   else
+#    define nftw64 __nftw64_time64
+#   endif
+#  endif
 # endif
 #endif
 
diff --git a/io/ftw64-time64.c b/io/ftw64-time64.c
new file mode 100644
index 0000000000..7c9db5448a
--- /dev/null
+++ b/io/ftw64-time64.c
@@ -0,0 +1,34 @@
+/* File tree walker functions.  LFS version.
+   Copyright (C) 1996-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/types.h>
+
+#if __TIMESIZE != 64
+# define FTW_NAME       __ftw64_time64
+# define NFTW_NAME      __nftw64_time64
+# define INO_T          ino64_t
+# define STRUCT_STAT    __stat64_t64
+# define LSTAT          __lstat64_time64
+# define STAT           __stat64_time64
+# define FSTATAT        __fstatat64_time64
+# define FTW_FUNC_T     __ftw64_time64_func_t
+# define NFTW_FUNC_T    __nftw64_time64_func_t
+
+# include "ftw.c"
+#endif
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index eb258a7333..84063d808c 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -194,6 +194,8 @@ libc {
     __fts64_read_time64;
     __fts64_set_time64;
     __fts64_children_time64;
+    __ftw64_time64;
+    __nftw64_time64;
     __getitimer64;
     __getrusage64;
     __gettimeofday64;
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 4bdf41cae0..829ecfec18 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -207,6 +207,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -226,6 +227,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index e7bd82b036..5653b99cf0 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -204,6 +204,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -223,6 +224,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 857bc753e3..e158505191 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2284,6 +2284,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2303,6 +2304,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 3c94e046c5..788b0fbb29 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2237,6 +2237,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2256,6 +2257,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 6b2f6e3ba9..2ca1bc3408 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2419,6 +2419,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2439,6 +2440,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 9379012dd9..5711de528e 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -208,6 +208,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -227,6 +228,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 15142aae53..514a8f321e 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2363,6 +2363,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2382,6 +2383,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index fb73ff10d0..a68e3e8422 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2335,6 +2335,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2354,6 +2355,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index fafcf2f255..e5412abb67 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2332,6 +2332,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2351,6 +2352,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index af82e41244..836e33db28 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2328,6 +2328,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2347,6 +2348,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 9d7afa11f3..30fe740a12 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2326,6 +2326,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2345,6 +2346,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 3bbd2468d7..345a35807e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2334,6 +2334,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2353,6 +2354,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e3b4f8bd9d..aba934d286 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2374,6 +2374,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2393,6 +2394,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index f0756a3997..bd0f351037 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2390,6 +2390,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2409,6 +2410,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 9e4bf76ba1..4b613fe9ba 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2423,6 +2423,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2442,6 +2443,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 56db45a52d..8e7ca663e8 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2388,6 +2388,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2407,6 +2408,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index dbfdc3571f..74fb49fc37 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2244,6 +2244,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2263,6 +2264,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 4b959c0f79..8b9df6cd1e 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2241,6 +2241,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2260,6 +2261,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 95fea73af5..023232a00b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2381,6 +2381,7 @@ GLIBC_2.34 __fts64_close_time64 F
 GLIBC_2.34 __fts64_open_time64 F
 GLIBC_2.34 __fts64_read_time64 F
 GLIBC_2.34 __fts64_set_time64 F
+GLIBC_2.34 __ftw64_time64 F
 GLIBC_2.34 __futimens64 F
 GLIBC_2.34 __futimes64 F
 GLIBC_2.34 __futimesat64 F
@@ -2400,6 +2401,7 @@ GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 F
 GLIBC_2.34 __mtx_timedlock64 F
 GLIBC_2.34 __nanosleep64 F
+GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 23/25] libsupport: Add 64 bit time_t support for time functions
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (21 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 22/25] io: Add ftw64 " Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19 11:00   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 24/25] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella
                   ` (2 subsequent siblings)
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

The patch adds redirections for xclock_gettime, xclock_settime,
timespec_add, timespec_sub, test_timespec_before_impl,
test_timespec_equal_or_after_impl, support_timespec_ns,
support_timespec_normalize, and support_timespec_check_in_range when
_TIME_BITS=64 is defined.

Co-authored-by: Lukasz Majewski <lukma@denx.de>
---
 support/Makefile                |  6 ++++
 support/timespec-add-time64.c   | 27 +++++++++++++++++
 support/timespec-add.c          |  2 +-
 support/timespec-sub-time64.c   | 27 +++++++++++++++++
 support/timespec-sub.c          |  2 +-
 support/timespec-time64.c       | 40 +++++++++++++++++++++++++
 support/timespec.c              |  9 +++---
 support/timespec.h              | 52 +++++++++++++++++++++++++--------
 support/xclock_gettime_time64.c | 26 +++++++++++++++++
 support/xclock_settime_time64.c | 23 +++++++++++++++
 support/xtime.h                 |  7 +++++
 11 files changed, 202 insertions(+), 19 deletions(-)
 create mode 100644 support/timespec-add-time64.c
 create mode 100644 support/timespec-sub-time64.c
 create mode 100644 support/timespec-time64.c
 create mode 100644 support/xclock_gettime_time64.c
 create mode 100644 support/xclock_settime_time64.c

diff --git a/support/Makefile b/support/Makefile
index da6dc58d37..1ee73f81bc 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -83,8 +83,11 @@ libsupport-routines = \
   support_test_verify_impl \
   temp_file \
   timespec \
+  timespec-time64 \
   timespec-add \
+  timespec-add-time64 \
   timespec-sub \
+  timespec-sub-time64 \
   write_message \
   xaccept \
   xaccept4 \
@@ -94,7 +97,9 @@ libsupport-routines = \
   xchdir \
   xchroot \
   xclock_gettime \
+  xclock_gettime_time64 \
   xclock_settime \
+  xclock_settime_time64 \
   xclose \
   xchmod \
   xconnect \
@@ -215,6 +220,7 @@ CFLAGS-support_paths.c = \
 # in support_timespec_check_in_range and for that computation we use
 # -fexcess-precision=standard.
 CFLAGS-timespec.c += -fexcess-precision=standard
+CFLAGS-timespec-time64.c += -fexcess-precision=standard
 
 ifeq (,$(CXX))
 LINKS_DSO_PROGRAM = links-dso-program-c
diff --git a/support/timespec-add-time64.c b/support/timespec-add-time64.c
new file mode 100644
index 0000000000..8574e1602c
--- /dev/null
+++ b/support/timespec-add-time64.c
@@ -0,0 +1,27 @@
+/* Add two struct __timespec64 values.  64 bit time support.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <time.h>
+
+#if __TIMESIZE != 64
+# define timespec      __timespec64
+# define time_t        __time64_t
+# define timespec_add  timespec_add_time64
+# include "timespec-add.c"
+#endif
diff --git a/support/timespec-add.c b/support/timespec-add.c
index cf8bd91291..8ed3acef6d 100644
--- a/support/timespec-add.c
+++ b/support/timespec-add.c
@@ -61,5 +61,5 @@ timespec_add (struct timespec a, struct timespec b)
         }
     }
 
-  return make_timespec (rs, rns);
+  return (struct timespec) { .tv_sec = rs, .tv_nsec = rns };
 }
diff --git a/support/timespec-sub-time64.c b/support/timespec-sub-time64.c
new file mode 100644
index 0000000000..f88307016d
--- /dev/null
+++ b/support/timespec-sub-time64.c
@@ -0,0 +1,27 @@
+/* Subtract two struct __timespec64 values.  64 bit time support.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <time.h>
+
+#if __TIMESIZE != 64
+# define timespec      __timespec64
+# define time_t        __time64_t
+# define timespec_sub  timespec_sub_time64
+# include "timespec-sub.c"
+#endif
diff --git a/support/timespec-sub.c b/support/timespec-sub.c
index 08cc233086..0b8fea042d 100644
--- a/support/timespec-sub.c
+++ b/support/timespec-sub.c
@@ -61,5 +61,5 @@ timespec_sub (struct timespec a, struct timespec b)
         }
     }
 
-  return make_timespec (rs, rns);
+  return (struct timespec) { .tv_sec = rs, .tv_nsec = rns };
 }
diff --git a/support/timespec-time64.c b/support/timespec-time64.c
new file mode 100644
index 0000000000..5bbf8be7e0
--- /dev/null
+++ b/support/timespec-time64.c
@@ -0,0 +1,40 @@
+/* Support code for timespec checks.  64 bit time support.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <support/timespec.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <assert.h>
+#include <intprops.h>
+
+#if __TIMESIZE != 64
+struct __timespec64 timespec_sub_time64 (struct __timespec64,
+					 struct __timespec64);
+
+#define test_timespec_before_impl          test_timespec_before_impl_time64
+#define test_timespec_equal_or_after_impl  \
+  test_timespec_equal_or_after_impl_time64
+#define support_timespec_ns                support_timespec_ns_time64
+#define support_timespec_normalize         support_timespec_normalize_time64
+#define support_timespec_check_in_range    \
+  support_timespec_check_in_range_time64
+#define timespec                           __timespec64
+#define timespec_sub                       timespec_sub_time64
+
+#include "timespec.c"
+#endif
diff --git a/support/timespec.c b/support/timespec.c
index b02afad9d3..fcc54861b1 100644
--- a/support/timespec.c
+++ b/support/timespec.c
@@ -23,9 +23,8 @@
 #include <intprops.h>
 
 void
-test_timespec_before_impl (const char *file, int line,
-			   const struct timespec left,
-			   const struct timespec right)
+test_timespec_before_impl (const char *file, int line, struct timespec left,
+			   struct timespec right)
 {
   if (left.tv_sec > right.tv_sec
       || (left.tv_sec == right.tv_sec
@@ -43,8 +42,8 @@ test_timespec_before_impl (const char *file, int line,
 
 void
 test_timespec_equal_or_after_impl (const char *file, int line,
-				   const struct timespec left,
-				   const struct timespec right)
+				   struct timespec left,
+				   struct timespec right)
 {
   if (left.tv_sec < right.tv_sec
       || (left.tv_sec == right.tv_sec
diff --git a/support/timespec.h b/support/timespec.h
index a3eb72aa01..0478aef51f 100644
--- a/support/timespec.h
+++ b/support/timespec.h
@@ -24,11 +24,6 @@
 #include <support/check.h>
 #include <support/xtime.h>
 
-struct timespec timespec_add (struct timespec, struct timespec)
-  __attribute__((const));
-struct timespec timespec_sub (struct timespec, struct timespec)
-  __attribute__((const));
-
 static inline struct timespec
 make_timespec (time_t s, long int ns)
 {
@@ -40,21 +35,54 @@ make_timespec (time_t s, long int ns)
 
 enum { TIMESPEC_HZ = 1000000000 };
 
+#ifndef __USE_TIME_BITS64
+struct timespec timespec_add (struct timespec, struct timespec)
+  __attribute__((const));
+struct timespec timespec_sub (struct timespec, struct timespec)
+  __attribute__((const));
+
 void test_timespec_before_impl (const char *file, int line,
-                                const struct timespec left,
-                                const struct timespec right);
+                                struct timespec left,
+                                struct timespec right);
 
 void test_timespec_equal_or_after_impl (const char *file, int line,
-                                        const struct timespec left,
-                                        const struct timespec right);
+                                        struct timespec left,
+                                        struct timespec right);
 
 time_t support_timespec_ns (struct timespec time);
 
 struct timespec support_timespec_normalize (struct timespec time);
 
-int support_timespec_check_in_range (struct timespec expected, struct timespec observed,
-				  double lower_bound, double upper_bound);
-
+int support_timespec_check_in_range (struct timespec expected,
+				     struct timespec observed,
+				     double lower_bound, double upper_bound);
+
+#else
+struct timespec __REDIRECT (timespec_add, (struct timespec, struct timespec),
+			    timespec_add_time64);
+struct timespec __REDIRECT (timespec_sub, (struct timespec, struct timespec),
+			    timespec_sub_time64);
+void __REDIRECT (test_timespec_before_impl, (const char *file, int line,
+					     struct timespec left,
+					     struct timespec right),
+		 test_timespec_before_impl_time64);
+void __REDIRECT (test_timespec_equal_or_after_impl, (const char *f, int line,
+						     struct timespec left,
+						     struct timespec right),
+		 test_timespec_equal_or_after_impl_time64);
+
+time_t __REDIRECT (support_timespec_ns, (struct timespec time),
+		   support_timespec_ns_time64);
+
+struct timespec __REDIRECT (support_timespec_normalize, (struct timespec time),
+			    support_timespec_normalize_time64);
+
+int __REDIRECT (support_timespec_check_in_range, (struct timespec expected,
+						  struct timespec observed,
+						  double lower_bound,
+						  double upper_bound),
+		support_timespec_check_in_range_time64);
+#endif
 
 /* Check that the timespec on the left represents a time before the
    time on the right. */
diff --git a/support/xclock_gettime_time64.c b/support/xclock_gettime_time64.c
new file mode 100644
index 0000000000..bf9fe9bf9c
--- /dev/null
+++ b/support/xclock_gettime_time64.c
@@ -0,0 +1,26 @@
+/* clock_settime with error checking.  64 bit time_t support.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <support/xtime.h>
+
+#if __TIMESIZE != 64
+# define xclock_gettime  xclock_gettime_time64
+# define timespec        __timespec64
+# define clock_gettime   __clock_gettime64
+# include "xclock_gettime.c"
+#endif
diff --git a/support/xclock_settime_time64.c b/support/xclock_settime_time64.c
new file mode 100644
index 0000000000..62a8be1815
--- /dev/null
+++ b/support/xclock_settime_time64.c
@@ -0,0 +1,23 @@
+/* clock_settime helper with error checking - 64 bit time_t support.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <support/xtime.h>
+
+#if __TIMESIZE != 64
+# define xclock_settime  xclock_settime_time64
+# define timespec        __timespec64
+# define clock_settime   __clock_settime64
+# include "xclock_settime.c"
+#endif
diff --git a/support/xtime.h b/support/xtime.h
index b4ac3b59e2..25a069d447 100644
--- a/support/xtime.h
+++ b/support/xtime.h
@@ -30,8 +30,15 @@ __BEGIN_DECLS
 /* The following functions call the corresponding libc functions and
    terminate the process on error.  */
 
+#ifndef __USE_TIME_BITS64
 void xclock_gettime (clockid_t clock, struct timespec *ts);
 void xclock_settime (clockid_t clock, const struct timespec *ts);
+#else
+void __REDIRECT (xclock_gettime, (clockid_t clock, struct timespec *ts),
+		 xclock_gettime_time64);
+void __REDIRECT (xclock_settime, (clockid_t clock, const struct timespec *ts),
+		 xclock_settime_time64);
+#endif
 
 /* This helper can often simplify tests by avoiding an explicit
    variable declaration or allowing that declaration to be const. */
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 24/25] libsupport: Add 64 bit time_t support for stat functions
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (22 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 23/25] libsupport: Add 64 bit time_t support for time functions Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19 11:04   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  2021-05-18 20:56 ` [PATCH v2 25/25] y2038: Add test coverage Adhemerval Zanella
  2021-06-04 19:29 ` [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Carlos O'Donell
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

The patch adds redirections for xstat, xlstat, and xfstat when
_TIME_BITS=64 is defined.
---
 support/Makefile                |  3 +++
 support/support-xfstat-time64.c | 32 ++++++++++++++++++++++++++++++++
 support/support-xstat-time64.c  | 32 ++++++++++++++++++++++++++++++++
 support/xlstat-time64.c         | 32 ++++++++++++++++++++++++++++++++
 support/xunistd.h               | 13 +++++++++++++
 5 files changed, 112 insertions(+)
 create mode 100644 support/support-xfstat-time64.c
 create mode 100644 support/support-xstat-time64.c
 create mode 100644 support/xlstat-time64.c

diff --git a/support/Makefile b/support/Makefile
index 1ee73f81bc..8b8534a3c6 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -40,7 +40,9 @@ libsupport-routines = \
   resolv_test \
   set_fortify_handler \
   support-xfstat \
+  support-xfstat-time64 \
   support-xstat \
+  support-xstat-time64 \
   support_become_root \
   support_can_chroot \
   support_capture_subprocess \
@@ -117,6 +119,7 @@ libsupport-routines = \
   xlisten \
   xlseek \
   xlstat \
+  xlstat-time64 \
   xmalloc \
   xmemstream \
   xmkdir \
diff --git a/support/support-xfstat-time64.c b/support/support-xfstat-time64.c
new file mode 100644
index 0000000000..324c5d20d2
--- /dev/null
+++ b/support/support-xfstat-time64.c
@@ -0,0 +1,32 @@
+/* 64-bit time_t stat with error checking.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* NB: Non-standard file name to avoid sysdeps override for xstat.  */
+
+#include <support/check.h>
+#include <support/xunistd.h>
+#include <sys/stat.h>
+
+#if __TIMESIZE != 64
+void
+xfstat_time64 (int fd, struct __stat64_t64 *result)
+{
+  if (__fstat64_time64 (fd, result) != 0)
+    FAIL_EXIT1 ("__fstat64_time64 (%d): %m", fd);
+}
+#endif
diff --git a/support/support-xstat-time64.c b/support/support-xstat-time64.c
new file mode 100644
index 0000000000..7d0194b98a
--- /dev/null
+++ b/support/support-xstat-time64.c
@@ -0,0 +1,32 @@
+/* 64-bit time_t stat with error checking.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* NB: Non-standard file name to avoid sysdeps override for xstat.  */
+
+#include <support/check.h>
+#include <support/xunistd.h>
+#include <sys/stat.h>
+
+#if __TIMESIZE != 64
+void
+xstat_time64 (const char *path, struct __stat64_t64 *result)
+{
+  if (__stat64_time64 (path, result) != 0)
+    FAIL_EXIT1 ("__stat64_time64 (\"%s\"): %m", path);
+}
+#endif
diff --git a/support/xlstat-time64.c b/support/xlstat-time64.c
new file mode 100644
index 0000000000..ef4d922635
--- /dev/null
+++ b/support/xlstat-time64.c
@@ -0,0 +1,32 @@
+/* 64-bit time_t stat with error checking.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* NB: Non-standard file name to avoid sysdeps override for xstat.  */
+
+#include <support/check.h>
+#include <support/xunistd.h>
+#include <sys/stat.h>
+
+#if __TIMESIZE != 64
+void
+xlstat_time64 (const char *path, struct __stat64_t64 *result)
+{
+  if (__lstat64_time64 (path, result) != 0)
+    FAIL_EXIT1 ("__lstat64_time64 (\"%s\"): %m", path);
+}
+#endif
diff --git a/support/xunistd.h b/support/xunistd.h
index c642588c29..e4ade65c85 100644
--- a/support/xunistd.h
+++ b/support/xunistd.h
@@ -24,6 +24,7 @@
 
 #include <sys/cdefs.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <unistd.h>
 
 __BEGIN_DECLS
@@ -35,9 +36,21 @@ pid_t xwaitpid (pid_t, int *status, int flags);
 void xpipe (int[2]);
 void xdup2 (int, int);
 int xopen (const char *path, int flags, mode_t);
+#ifndef __USE_TIME_BITS64
+# ifdef __USE_FILE_OFFSET64
+void xstat (const char *path, struct stat *);
+void xlstat (const char *path, struct stat *);
+void xfstat (int fd, struct stat *);
+# else
 void xstat (const char *path, struct stat64 *);
 void xlstat (const char *path, struct stat64 *);
 void xfstat (int fd, struct stat64 *);
+# endif
+#else
+void __REDIRECT (xstat, (const char *path, struct stat *), xstat_time64);
+void __REDIRECT (xlstat, (const char *path, struct stat *), xlstat_time64);
+void __REDIRECT (xfstat, (int fd, struct stat *), xfstat_time64);
+#endif
 void xmkdir (const char *path, mode_t);
 void xchroot (const char *path);
 void xunlink (const char *path);
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v2 25/25] y2038: Add test coverage
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (23 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 24/25] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella
@ 2021-05-18 20:56 ` Adhemerval Zanella
  2021-05-19 11:08   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  2021-06-04 19:29 ` [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Carlos O'Donell
  25 siblings, 2 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-18 20:56 UTC (permalink / raw)
  To: libc-alpha

It is enabled through a new rule, tests-y2038, which is built only
when the ABI supports the comapt 64-bit time_t (defined by the
header time64-compat.h, which also enables the creation of the
symbol Version for Linux).  It means the tests are not built
for ABI which already provide default 64-bit time_t.

The new rule already adds the required LFS and 64-bit time_t
compiler flags.

The current coverage is:

  * libc:
    - adjtime                       tst-adjtime-time64
    - adjtimex                      tst-adjtimex-time64
    - clock_adjtime                 tst-clock_adjtime-time64
    - clock_getres                  tst-clock-time64, tst-cpuclock1-time64
    - clock_gettime                 tst-clock-time64, tst-clock2-time64,
				    tst-cpuclock1-time64
    - clock_nanosleep               tst-clock_nanosleep-time64,
				    tst-cpuclock1-time64
    - clock_settime                 tst-clock2-time64
    - cnd_timedwait                 tst-cnd-timedwait-time64
    - ctime                         tst-ctime-time64
    - ctime_r                       tst-ctime-time64
    - difftime                      tst-difftime-time64
    - fstat                         tst-stat-time64
    - fstatat                       tst-stat-time64
    - futimens                      tst-futimens-time64
    - futimes                       tst-futimes-time64
    - futimesat                     tst-futimesat-time64
    - fts_*                         tst-fts-time64
    - getitimer                     tst-itimer-timer64
    - getrusage
    - gettimeofday                  tst-clock_nanosleep-time64
    - glob / globfree               tst-gnuglob64-time64
    - gmtime                        tst-gmtime-time64
    - gmtime_r                      tst-gmtime-time64
    - lstat                         tst-stat-time64
    - localtime                     tst-y2039-time64
    - localtime_t                   tst-y2039-time64
    - lutimes                       tst-lutimes-time64
    - mktime                        tst-mktime4-time64
    - mq_timedreceive               tst-mqueue{1248}-time64
    - mq_timedsend                  tst-mqueue{1248}-time64
    - msgctl                        test-sysvmsg-time64
    - mtx_timedlock                 tst-mtx-timedlock-time64
    - nanosleep                     tst-cpuclock{12}-time64,
				    tst-mqueue8-time64, tst-clock-time64
    - nftw / ftw                    ftwtest-time64
    - ntp_adjtime                   tst-ntp_adjtime-time64
    - ntp_gettime                   tst-ntp_gettime-time64
    - ntp_gettimex                  tst-ntp_gettimex-time64
    - ppoll                         tst-ppoll-time64
    - pselect                       tst-pselect-time64
    - pthread_clockjoin_np          tst-join14-time64
    - pthread_cond_clockwait        tst-cond11-time64
    - pthread_cond_timedwait        tst-abstime-time64
    - pthread_mutex_clocklock       tst-abstime-time64
    - pthread_mutex_timedlock       tst-abstime-time64
    - pthread_rwlock_clockrdlock    tst-abstime-time64, tst-rwlock14-time64
    - pthread_rwlock_clockwrlock    tst-abstime-time64, tst-rwlock14-time64
    - pthread_rwlock_timedrdlock    tst-abstime-time64, tst-rwlock14-time64
    - pthread_rwlock_timedwrlock    tst-abstime-time64, tst-rwlock14-time64
    - pthread_timedjoin_np          tst-join14-time64
    - recvmmsg                      tst-cancel4_2-time64
    - sched_rr_get_interval         tst-sched_rr_get_interval-time64
    - select                        tst-select-time64
    - sem_clockwait                 tst-sem5-time64
    - sem_timedwait                 tst-sem5-time64
    - semctl                        test-sysvsem-time64
    - semtimedop                    test-sysvsem-time64
    - setitimer                     tst-mqueue2-time64, tst-itimer-timer64
    - settimeofday                  tst-settimeofday-time64
    - shmctl                        test-sysvshm-time64
    - sigtimedwait                  tst-sigtimedwait-time64
    - stat                          tst-stat-time64
    - thrd_sleep                    tst-thrd-sleep-time64
    - time                          tst-mqueue{1248}-time64
    - timegm                        tst-timegm-time64
    - timer_gettime                 tst-timer4-time64
    - timer_settime                 tst-timer4-time64
    - timerfd_gettime               tst-timerfd-time64
    - timerfd_settime               tst-timerfd-time64
    - timespec_get                  tst-timespec_get-time64
    - timespec_getres               tst-timespec_getres-time64
    - utime                         tst-utime-time64
    - utimensat                     tst-utimensat-time64
    - utimes                        tst-utimes-time64
    - wait3                         tst-wait3-time64
    - wait4                         tst-wait4-time64

  * librt:
    - aio_suspend                   tst-aio6-time64
    - mq_timedreceive               tst-mqueue{1248}-time64
    - mq_timedsend                  tst-mqueue{1248}-time64
    - timer_gettime                 tst-timer4-time64
    - timer_settime                 tst-timer4-time64

  * libanl:
    - gai_suspend
---
 Makeconfig                                    |  14 +++
 Makerules                                     |  18 +++-
 io/Makefile                                   |  22 +++-
 io/ftwtest-time64.c                           |   1 +
 io/tst-fts-time64.c                           |   1 +
 io/tst-futimens-time64.c                      |   2 +
 io/tst-futimens.c                             |   6 +-
 io/tst-futimes-time64.c                       |   2 +
 io/tst-futimes.c                              |   6 +-
 io/tst-futimesat-time64.c                     |   4 +
 io/tst-futimesat.c                            |  47 +++++---
 io/tst-lutimes-time64.c                       |   2 +
 io/tst-lutimes.c                              |  10 +-
 io/tst-stat-time64.c                          | 102 ++++++++++++++++++
 io/tst-utime-time64.c                         |   2 +
 io/tst-utime.c                                |   6 +-
 io/tst-utimensat-time64.c                     |   2 +
 io/tst-utimensat.c                            |  12 ++-
 io/tst-utimes-time64.c                        |   2 +
 io/tst-utimes.c                               |   6 +-
 misc/Makefile                                 |   4 +
 misc/tst-pselect-time64.c                     |   1 +
 misc/tst-select-time64.c                      |   1 +
 nptl/Makefile                                 |   3 +
 nptl/tst-cancel4_2-time64.c                   |   1 +
 posix/Makefile                                |   2 +
 posix/tst-gnuglob64-time64.c                  |   7 ++
 posix/tst-sched_rr_get_interval-time64.c      |   1 +
 posix/tst-wait3-time64.c                      |   1 +
 posix/tst-wait4-time64.c                      |   1 +
 rt/Makefile                                   |   9 ++
 rt/tst-aio6-time64.c                          |   1 +
 rt/tst-cpuclock2-time64.c                     |   1 +
 rt/tst-cpuclock2.c                            |   9 +-
 rt/tst-mqueue1-time64.c                       |   1 +
 rt/tst-mqueue2-time64.c                       |   1 +
 rt/tst-mqueue4-time64.c                       |   1 +
 rt/tst-mqueue8-time64.c                       |   1 +
 rt/tst-timer4-time64.c                        |   1 +
 sysdeps/pthread/Makefile                      |  10 ++
 sysdeps/pthread/tst-abstime-time64.c          |   1 +
 sysdeps/pthread/tst-cnd-timedwait-time64.c    |   1 +
 sysdeps/pthread/tst-cond11-time64.c           |   1 +
 sysdeps/pthread/tst-join14-time64.c           |   1 +
 sysdeps/pthread/tst-mtx-timedlock-time64.c    |   1 +
 sysdeps/pthread/tst-rwlock14-time64.c         |   1 +
 sysdeps/pthread/tst-sem5-time64.c             |   1 +
 sysdeps/pthread/tst-thrd-sleep-time64.c       |   1 +
 sysdeps/unix/sysv/linux/Makefile              |  10 ++
 sysdeps/unix/sysv/linux/tst-adjtimex-time64.c |   1 +
 .../sysv/linux/tst-clock_adjtime-time64.c     |   1 +
 .../unix/sysv/linux/tst-ntp_adjtime-time64.c  |   1 +
 .../unix/sysv/linux/tst-ntp_gettime-time64.c  |   1 +
 .../unix/sysv/linux/tst-ntp_gettimex-time64.c |   1 +
 sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
 .../unix/sysv/linux/tst-sigtimedwait-time64.c |   1 +
 sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
 sysvipc/Makefile                              |   2 +
 sysvipc/test-sysvmsg-time64.c                 |   1 +
 sysvipc/test-sysvsem-time64.c                 |   1 +
 sysvipc/test-sysvshm-time64.c                 |   1 +
 time/Makefile                                 |  18 ++++
 time/tst-adjtime-time64.c                     |   1 +
 time/tst-clock-time64.c                       |   1 +
 time/tst-clock2-time64.c                      |   1 +
 time/tst-clock_nanosleep-time64.c             |   1 +
 time/tst-clock_settime-time64.c               |   1 +
 time/tst-cpuclock1-time64.c                   |   1 +
 time/tst-ctime-time64.c                       |   1 +
 time/tst-ctime.c                              |  16 +++
 time/tst-difftime-time64.c                    |   1 +
 time/tst-gmtime-time64.c                      |   1 +
 time/tst-itimer-time64.c                      |   1 +
 time/tst-mktime4-time64.c                     |   1 +
 time/tst-settimeofday-time64.c                |   1 +
 time/tst-timegm-time64.c                      |   1 +
 time/tst-timespec_get-time64.c                |   1 +
 time/tst-timespec_getres-time64.c             |   1 +
 time/tst-y2039-time64.c                       |   1 +
 time/tst-y2039.c                              |  10 ++
 80 files changed, 385 insertions(+), 30 deletions(-)
 create mode 100644 io/ftwtest-time64.c
 create mode 100644 io/tst-fts-time64.c
 create mode 100644 io/tst-futimens-time64.c
 create mode 100644 io/tst-futimes-time64.c
 create mode 100644 io/tst-futimesat-time64.c
 create mode 100644 io/tst-lutimes-time64.c
 create mode 100644 io/tst-stat-time64.c
 create mode 100644 io/tst-utime-time64.c
 create mode 100644 io/tst-utimensat-time64.c
 create mode 100644 io/tst-utimes-time64.c
 create mode 100644 misc/tst-pselect-time64.c
 create mode 100644 misc/tst-select-time64.c
 create mode 100644 nptl/tst-cancel4_2-time64.c
 create mode 100644 posix/tst-gnuglob64-time64.c
 create mode 100644 posix/tst-sched_rr_get_interval-time64.c
 create mode 100644 posix/tst-wait3-time64.c
 create mode 100644 posix/tst-wait4-time64.c
 create mode 100644 rt/tst-aio6-time64.c
 create mode 100644 rt/tst-cpuclock2-time64.c
 create mode 100644 rt/tst-mqueue1-time64.c
 create mode 100644 rt/tst-mqueue2-time64.c
 create mode 100644 rt/tst-mqueue4-time64.c
 create mode 100644 rt/tst-mqueue8-time64.c
 create mode 100644 rt/tst-timer4-time64.c
 create mode 100644 sysdeps/pthread/tst-abstime-time64.c
 create mode 100644 sysdeps/pthread/tst-cnd-timedwait-time64.c
 create mode 100644 sysdeps/pthread/tst-cond11-time64.c
 create mode 100644 sysdeps/pthread/tst-join14-time64.c
 create mode 100644 sysdeps/pthread/tst-mtx-timedlock-time64.c
 create mode 100644 sysdeps/pthread/tst-rwlock14-time64.c
 create mode 100644 sysdeps/pthread/tst-sem5-time64.c
 create mode 100644 sysdeps/pthread/tst-thrd-sleep-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c
 create mode 100644 sysvipc/test-sysvmsg-time64.c
 create mode 100644 sysvipc/test-sysvsem-time64.c
 create mode 100644 sysvipc/test-sysvshm-time64.c
 create mode 100644 time/tst-adjtime-time64.c
 create mode 100644 time/tst-clock-time64.c
 create mode 100644 time/tst-clock2-time64.c
 create mode 100644 time/tst-clock_nanosleep-time64.c
 create mode 100644 time/tst-clock_settime-time64.c
 create mode 100644 time/tst-cpuclock1-time64.c
 create mode 100644 time/tst-ctime-time64.c
 create mode 100644 time/tst-difftime-time64.c
 create mode 100644 time/tst-gmtime-time64.c
 create mode 100644 time/tst-itimer-time64.c
 create mode 100644 time/tst-mktime4-time64.c
 create mode 100644 time/tst-settimeofday-time64.c
 create mode 100644 time/tst-timegm-time64.c
 create mode 100644 time/tst-timespec_get-time64.c
 create mode 100644 time/tst-timespec_getres-time64.c
 create mode 100644 time/tst-y2039-time64.c

diff --git a/Makeconfig b/Makeconfig
index 1d5e45926c..e50d1351a9 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1235,6 +1235,20 @@ $(common-objpfx)versions.stmp: $(common-objpfx)Versions.all \
 	touch $@
 endif # avoid-generated
 endif # $(build-shared) = yes
+
+-include $(common-objpfx)time64-compat.mk
+postclean-generated += time64-compat.mk
+
+$(common-objpfx)time64-compat.mk: $(sysd-versions-force) \
+				  $(common-objpfx)time64-compat.i
+	sed '/^[        ]*#/d;/^[       ]*$$/d' $< > $@T
+	mv -f $@T $@
+$(common-objpfx)time64-compat.i: $(..)Makeconfig
+	printf "#include <time64-compat.h>\n#ifdef TIME64_NON_DEFAULT\nhave-time64-compat = yes\n#endif" \
+	| $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - > $@T
+	mv -f $@T $@
+
+
 endif # sysd-sorted-done
 
 # The name under which the run-time dynamic linker is installed.
diff --git a/Makerules b/Makerules
index ca9885436e..12f1a5cb50 100644
--- a/Makerules
+++ b/Makerules
@@ -771,7 +771,8 @@ endif
 	     $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
 	     $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \
 	     $(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \
-	     $(addsuffix .d,$(tests) $(tests-internal) $(xtests) $(test-srcs))
+	     $(addsuffix .d,$(tests) $(tests-internal) $(xtests) \
+		$(test-srcs) $(tests-time64) $(xtests-time64))
 ifeq ($(build-programs),yes)
 +depfiles += $(addsuffix .d,$(others) $(sysdep-others))
 endif
@@ -1286,6 +1287,21 @@ check: tests
 .PHONY: xcheck
 xcheck: xtests
 
+# Handle tests-time64 and xtests-time64 that should built with LFS
+# and 64-bit time support.
+include $(o-iterator)
+define o-iterator-doit
+$(foreach f,$(tests-time64) $(xtests-time64),\
+	    $(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
+
+ifeq ($(have-time64-compat),yes)
+tests += $(foreach t,$(tests-time64),$(t))
+xtests += $(foreach t,$(xtests-time64),$(t))
+endif
+
 # The only difference between MODULE_NAME=testsuite and MODULE_NAME=nonlib is
 # that almost all internal declarations from config.h, libc-symbols.h, and
 # include/*.h are not available to 'testsuite' code, but are to 'nonlib' code.
diff --git a/io/Makefile b/io/Makefile
index d35e966258..ba8bd37355 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -59,7 +59,7 @@ routines :=								\
 	ftw64-time64
 
 others		:= pwd
-test-srcs	:= ftwtest
+test-srcs	:= ftwtest ftwtest-time64
 tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \
 		   tst-openat tst-unlinkat tst-fstatat tst-futimesat \
@@ -78,12 +78,24 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-futimens \
 		   tst-utimensat \
 
+tests-time64 := \
+  tst-futimens-time64 \
+  tst-futimes-time64\
+  tst-fts-time64 \
+  tst-lutimes-time64 \
+  tst-stat-time64 \
+  tst-futimesat-time64 \
+  tst-utime-time64 \
+  tst-utimensat-time64 \
+  tst-utimes-time64 \
+
 # Likewise for statx, but we do not need static linking here.
 tests-internal += tst-statx
 tests-static += tst-statx
 
 ifeq ($(run-built-tests),yes)
-tests-special += $(objpfx)ftwtest.out
+tests-special += $(objpfx)ftwtest.out \
+		 $(objpfx)ftwtest-time64.out
 endif
 
 include ../Rules
@@ -125,8 +137,14 @@ tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp
 
 tst-open-tmpfile-ARGS = --test-dir=$(objpfx)
 
+CFLAGS-ftwtest-time64.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
+
 ifeq ($(run-built-tests),yes)
 $(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest
 	$(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
 	$(evaluate-test)
+
+$(objpfx)ftwtest-time64.out: ftwtest-sh $(objpfx)ftwtest-time64
+	$(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
+	$(evaluate-test)
 endif
diff --git a/io/ftwtest-time64.c b/io/ftwtest-time64.c
new file mode 100644
index 0000000000..67f1c46826
--- /dev/null
+++ b/io/ftwtest-time64.c
@@ -0,0 +1 @@
+#include "ftwtest.c"
diff --git a/io/tst-fts-time64.c b/io/tst-fts-time64.c
new file mode 100644
index 0000000000..a4a41fe1cf
--- /dev/null
+++ b/io/tst-fts-time64.c
@@ -0,0 +1 @@
+#include "tst-fts.c"
diff --git a/io/tst-futimens-time64.c b/io/tst-futimens-time64.c
new file mode 100644
index 0000000000..88fcb38489
--- /dev/null
+++ b/io/tst-futimens-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-futimens.c"
diff --git a/io/tst-futimens.c b/io/tst-futimens.c
index b3e3f3137f..4c18ede573 100644
--- a/io/tst-futimens.c
+++ b/io/tst-futimens.c
@@ -20,13 +20,17 @@
 #include <support/xunistd.h>
 #include <sys/stat.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int
 test_futimens_helper (const char *file, int fd, const struct timespec *ts)
 {
   int result = futimens (fd, ts);
   TEST_VERIFY_EXIT (result == 0);
 
-  struct stat64 st;
+  struct_stat st;
   xfstat (fd, &st);
 
   /* Check if seconds for atime match */
diff --git a/io/tst-futimes-time64.c b/io/tst-futimes-time64.c
new file mode 100644
index 0000000000..d489c265d1
--- /dev/null
+++ b/io/tst-futimes-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-futimes.c"
diff --git a/io/tst-futimes.c b/io/tst-futimes.c
index bdef38d7cb..9575a4b08e 100644
--- a/io/tst-futimes.c
+++ b/io/tst-futimes.c
@@ -21,13 +21,17 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int
 test_futimens_helper (const char *file, int fd, const struct timeval *tv)
 {
   int r = futimes (fd, tv);
   TEST_VERIFY_EXIT (r == 0);
 
-  struct stat64 st;
+  struct_stat st;
   xfstat (fd, &st);
 
   /* Check if seconds for atime match */
diff --git a/io/tst-futimesat-time64.c b/io/tst-futimesat-time64.c
new file mode 100644
index 0000000000..f6c0500eef
--- /dev/null
+++ b/io/tst-futimesat-time64.c
@@ -0,0 +1,4 @@
+#define struct_stat  struct stat
+#define fstat        fstat
+#define fstatat      fstatat
+#include "io/tst-futimesat.c"
diff --git a/io/tst-futimesat.c b/io/tst-futimesat.c
index af58ad06dd..c32ab2b668 100644
--- a/io/tst-futimesat.c
+++ b/io/tst-futimesat.c
@@ -1,4 +1,23 @@
+/* futimesat basic tests.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
 #include <dirent.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -7,19 +26,19 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
+#include <support/test-driver.h>
+#include <support/temp_file.h>
 
-static void prepare (void);
-#define PREPARE(argc, argv) prepare ()
-
-static int do_test (void);
-#define TEST_FUNCTION do_test ()
-
-#include "../test-skeleton.c"
+#ifndef struct_stat
+# define struct_stat struct stat64
+# define fstat       fstat64
+# define fstatat     fstatat64
+#endif
 
 static int dir_fd;
 
 static void
-prepare (void)
+prepare (int argc, char *argv[])
 {
   size_t test_dir_len = strlen (test_dir);
   static const char dir_name[] = "/tst-futimesat.XXXXXX";
@@ -48,7 +67,7 @@ prepare (void)
       exit (1);
     }
 }
-
+#define PREPARE prepare
 
 static int
 do_test (void)
@@ -98,8 +117,8 @@ do_test (void)
   write (fd, "hello", 5);
   puts ("file created");
 
-  struct stat64 st1;
-  if (fstat64 (fd, &st1) != 0)
+  struct_stat st1;
+  if (fstat (fd, &st1) != 0)
     {
       puts ("fstat64 failed");
       return 1;
@@ -118,8 +137,8 @@ do_test (void)
       return 1;
     }
 
-  struct stat64 st2;
-  if (fstatat64 (dir_fd, "some-file", &st2, 0) != 0)
+  struct_stat st2;
+  if (fstatat (dir_fd, "some-file", &st2, 0) != 0)
     {
       puts ("fstatat64 failed");
       return 1;
@@ -146,3 +165,5 @@ do_test (void)
 
   return 0;
 }
+
+#include <support/test-driver.c>
diff --git a/io/tst-lutimes-time64.c b/io/tst-lutimes-time64.c
new file mode 100644
index 0000000000..06caec0a91
--- /dev/null
+++ b/io/tst-lutimes-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-lutimes.c"
diff --git a/io/tst-lutimes.c b/io/tst-lutimes.c
index b2da3c5796..237a870415 100644
--- a/io/tst-lutimes.c
+++ b/io/tst-lutimes.c
@@ -21,23 +21,27 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int
 test_lutimes_helper (const char *testfile, int fd, const char *testlink,
                      const struct timeval *tv)
 {
-  struct stat64 stfile_orig;
+  struct_stat stfile_orig;
   xlstat (testfile, &stfile_orig);
 
   TEST_VERIFY_EXIT (lutimes (testlink, tv) == 0);
 
-  struct stat64 stlink;
+  struct_stat stlink;
   xlstat (testlink, &stlink);
 
   TEST_COMPARE (stlink.st_atime, tv[0].tv_sec);
   TEST_COMPARE (stlink.st_mtime, tv[1].tv_sec);
 
   /* Check if the timestamp from original file is not changed.  */
-  struct stat64 stfile;
+  struct_stat stfile;
   xlstat (testfile, &stfile);
 
   TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
diff --git a/io/tst-stat-time64.c b/io/tst-stat-time64.c
new file mode 100644
index 0000000000..c10fe1284a
--- /dev/null
+++ b/io/tst-stat-time64.c
@@ -0,0 +1,102 @@
+/* Basic test of stat with 64 bit time_t interfaces.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <support/check.h>
+#include <support/support.h>
+#include <support/temp_file.h>
+#include <support/xunistd.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+
+/* The idea of the test is check whether the 64 bit time_t stat implementation
+   returns the expected value for comparable fields, so it does not really
+   matter whether statx uses a fallback implementation or not.  */
+
+static void
+stat_check (int fd, const char *path, struct stat *st)
+{
+  TEST_COMPARE (stat (path, st), 0);
+}
+
+static void
+lstat_check (int fd, const char *path, struct stat *st)
+{
+  TEST_COMPARE (lstat (path, st), 0);
+}
+
+static void
+fstat_check (int fd, const char *path, struct stat *st)
+{
+  TEST_COMPARE (fstat (fd, st), 0);
+}
+
+static void
+fstatat_check (int fd, const char *path, struct stat *st)
+{
+  TEST_COMPARE (fstatat (fd, path, st, 0), 0);
+}
+
+typedef void (*test_t)(int, const char *path, struct stat *);
+
+static int
+do_test (void)
+{
+  char *path;
+  int fd = create_temp_file ("tst-statx-", &path);
+  TEST_VERIFY_EXIT (fd >= 0);
+  support_write_file_string (path, "abc");
+
+  struct statx stx;
+  TEST_COMPARE (statx (fd, path, 0, STATX_BASIC_STATS, &stx), 0);
+
+  for (test_t *test = (test_t[]) { stat_check, lstat_check, fstat_check,
+				   fstatat_check, NULL };
+       *test != NULL; test++)
+  {
+    struct stat st;
+    (*test) (fd, path, &st);
+
+    TEST_COMPARE (stx.stx_dev_major, major (st.st_dev));
+    TEST_COMPARE (stx.stx_dev_minor, minor (st.st_dev));
+    TEST_COMPARE (stx.stx_ino, st.st_ino);
+    TEST_COMPARE (stx.stx_mode, st.st_mode);
+    TEST_COMPARE (stx.stx_nlink, st.st_nlink);
+    TEST_COMPARE (stx.stx_uid, st.st_uid);
+    TEST_COMPARE (stx.stx_gid, st.st_gid);
+    TEST_COMPARE (stx.stx_rdev_major, major (st.st_rdev));
+    TEST_COMPARE (stx.stx_rdev_minor, minor (st.st_rdev));
+    TEST_COMPARE (stx.stx_blksize, st.st_blksize);
+    TEST_COMPARE (stx.stx_blocks, st.st_blocks);
+
+    TEST_COMPARE (stx.stx_ctime.tv_sec, st.st_ctim.tv_sec);
+    TEST_COMPARE (stx.stx_ctime.tv_nsec, st.st_ctim.tv_nsec);
+    TEST_COMPARE (stx.stx_mtime.tv_sec, st.st_mtim.tv_sec);
+    TEST_COMPARE (stx.stx_mtime.tv_nsec, st.st_mtim.tv_nsec);
+  }
+
+  xclose (fd);
+  free (path);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/io/tst-utime-time64.c b/io/tst-utime-time64.c
new file mode 100644
index 0000000000..eb62f59126
--- /dev/null
+++ b/io/tst-utime-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-utime.c"
diff --git a/io/tst-utime.c b/io/tst-utime.c
index 6269ef7929..0144e2a22a 100644
--- a/io/tst-utime.c
+++ b/io/tst-utime.c
@@ -21,13 +21,17 @@
 #include <support/xunistd.h>
 #include <sys/stat.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int
 test_utime_helper (const char *file, int fd, const struct utimbuf *ut)
 {
   int result = utime (file, ut);
   TEST_VERIFY_EXIT (result == 0);
 
-  struct stat64 st;
+  struct_stat st;
   xfstat (fd, &st);
 
   /* Check if seconds for actime match */
diff --git a/io/tst-utimensat-time64.c b/io/tst-utimensat-time64.c
new file mode 100644
index 0000000000..7ac7d8df1d
--- /dev/null
+++ b/io/tst-utimensat-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-utimensat.c"
diff --git a/io/tst-utimensat.c b/io/tst-utimensat.c
index 0c7c8470bc..062abdd8d3 100644
--- a/io/tst-utimensat.c
+++ b/io/tst-utimensat.c
@@ -22,6 +22,10 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int
 test_utimesat_helper (const char *testfile, int fd, const char *testlink,
                       const struct timespec *ts)
@@ -29,7 +33,7 @@ test_utimesat_helper (const char *testfile, int fd, const char *testlink,
   {
     TEST_VERIFY_EXIT (utimensat (fd, testfile, ts, 0) == 0);
 
-    struct stat64 st;
+    struct_stat st;
     xfstat (fd, &st);
 
     /* Check if seconds for atime match */
@@ -40,20 +44,20 @@ test_utimesat_helper (const char *testfile, int fd, const char *testlink,
   }
 
   {
-    struct stat64 stfile_orig;
+    struct_stat stfile_orig;
     xlstat (testfile, &stfile_orig);
 
     TEST_VERIFY_EXIT (utimensat (0 /* ignored  */, testlink, ts,
 				 AT_SYMLINK_NOFOLLOW)
 		       == 0);
-    struct stat64 stlink;
+    struct_stat stlink;
     xlstat (testlink, &stlink);
 
     TEST_COMPARE (stlink.st_atime, ts[0].tv_sec);
     TEST_COMPARE (stlink.st_mtime, ts[1].tv_sec);
 
     /* Check if the timestamp from original file is not changed.  */
-    struct stat64 stfile;
+    struct_stat stfile;
     xlstat (testfile, &stfile);
 
     TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
diff --git a/io/tst-utimes-time64.c b/io/tst-utimes-time64.c
new file mode 100644
index 0000000000..234ec02541
--- /dev/null
+++ b/io/tst-utimes-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-utimes.c"
diff --git a/io/tst-utimes.c b/io/tst-utimes.c
index 991ab0c7d3..e88efff45b 100644
--- a/io/tst-utimes.c
+++ b/io/tst-utimes.c
@@ -22,13 +22,17 @@
 #include <sys/time.h>
 #include <time.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int
 test_utimes_helper (const char *file, int fd, const struct timeval *tv)
 {
   int result = utimes (file, tv);
   TEST_VERIFY_EXIT (result == 0);
 
-  struct stat64 st;
+  struct_stat st;
   xfstat (fd, &st);
 
   /* Check if seconds for atime match */
diff --git a/misc/Makefile b/misc/Makefile
index 38dad737f2..7f51f7163d 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -90,6 +90,10 @@ tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \
 	 tst-ldbl-warn tst-ldbl-error tst-dbl-efgcvt tst-ldbl-efgcvt \
 	 tst-mntent-autofs tst-syscalls tst-mntent-escape tst-select
 
+tests-time64 := \
+  tst-select-time64 \
+  tst-pselect-time64
+
 # Tests which need libdl.
 ifeq (yes,$(build-shared))
 tests += tst-gethostid
diff --git a/misc/tst-pselect-time64.c b/misc/tst-pselect-time64.c
new file mode 100644
index 0000000000..15a1e49292
--- /dev/null
+++ b/misc/tst-pselect-time64.c
@@ -0,0 +1 @@
+#include "tst-pselect.c"
diff --git a/misc/tst-select-time64.c b/misc/tst-select-time64.c
new file mode 100644
index 0000000000..13120bfe31
--- /dev/null
+++ b/misc/tst-select-time64.c
@@ -0,0 +1 @@
+#include "tst-select.c"
diff --git a/nptl/Makefile b/nptl/Makefile
index bd5a9ce51f..50dde03ba8 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -329,6 +329,9 @@ xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
 	tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 tst-setgroups \
 	tst-mutexpp5 tst-mutexpp9
 
+tests-time64 := \
+  tst-cancel4_2-time64
+
 # This test can run into task limits because of a linux kernel bug
 # and then cause the make process to fail too, see bug 24537.
 xtests += tst-eintr1
diff --git a/nptl/tst-cancel4_2-time64.c b/nptl/tst-cancel4_2-time64.c
new file mode 100644
index 0000000000..4ac086a312
--- /dev/null
+++ b/nptl/tst-cancel4_2-time64.c
@@ -0,0 +1 @@
+#include "tst-cancel4_2.c"
diff --git a/posix/Makefile b/posix/Makefile
index 84204b1270..31e745fadc 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -123,7 +123,9 @@ endif
 tests-internal	:= bug-regex5 bug-regex20 bug-regex33 \
 		   tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3
 tests-container := bug-ga2
+tests-time64	:= tst-wait4-time64 tst-wait3-time64 tst-gnuglob64-time64
 xtests		:= tst-getaddrinfo4 tst-getaddrinfo5 tst-sched_rr_get_interval
+xtests-time64	:= tst-sched_rr_get_interval-time64
 ifeq (yes,$(build-shared))
 test-srcs	:= globtest
 tests           += wordexp-test tst-exec tst-spawn tst-spawn2 tst-spawn3
diff --git a/posix/tst-gnuglob64-time64.c b/posix/tst-gnuglob64-time64.c
new file mode 100644
index 0000000000..00922bcdc6
--- /dev/null
+++ b/posix/tst-gnuglob64-time64.c
@@ -0,0 +1,7 @@
+#define GLOB_FUNC glob
+#define GLOB_TYPE glob_t
+#define GLOBFREE_FUNC globfree
+#define DIRENT_STRUCT dirent
+#define STAT_STRUCT stat
+
+#include "tst-gnuglob-skeleton.c"
diff --git a/posix/tst-sched_rr_get_interval-time64.c b/posix/tst-sched_rr_get_interval-time64.c
new file mode 100644
index 0000000000..f4e66d2939
--- /dev/null
+++ b/posix/tst-sched_rr_get_interval-time64.c
@@ -0,0 +1 @@
+#include "tst-sched_rr_get_interval.c"
diff --git a/posix/tst-wait3-time64.c b/posix/tst-wait3-time64.c
new file mode 100644
index 0000000000..2837bc7a9e
--- /dev/null
+++ b/posix/tst-wait3-time64.c
@@ -0,0 +1 @@
+#include "tst-wait3.c"
diff --git a/posix/tst-wait4-time64.c b/posix/tst-wait4-time64.c
new file mode 100644
index 0000000000..12543b270f
--- /dev/null
+++ b/posix/tst-wait4-time64.c
@@ -0,0 +1 @@
+#include "tst-wait4.c"
diff --git a/rt/Makefile b/rt/Makefile
index 97c9bbd9de..797f2da51e 100644
--- a/rt/Makefile
+++ b/rt/Makefile
@@ -51,6 +51,15 @@ tests := tst-shm tst-timer tst-timer2 \
 	 tst-shm-cancel
 tests-internal := tst-timer-sigmask
 
+tests-time64 := \
+  tst-aio6-time64 \
+  tst-cpuclock2-time64 \
+  tst-mqueue1-time64 \
+  tst-mqueue2-time64 \
+  tst-mqueue4-time64 \
+  tst-mqueue8-time64 \
+  tst-timer4-time64
+
 extra-libs := librt
 extra-libs-others := $(extra-libs)
 
diff --git a/rt/tst-aio6-time64.c b/rt/tst-aio6-time64.c
new file mode 100644
index 0000000000..a386a577ec
--- /dev/null
+++ b/rt/tst-aio6-time64.c
@@ -0,0 +1 @@
+#include "tst-aio6.c"
diff --git a/rt/tst-cpuclock2-time64.c b/rt/tst-cpuclock2-time64.c
new file mode 100644
index 0000000000..05775522bb
--- /dev/null
+++ b/rt/tst-cpuclock2-time64.c
@@ -0,0 +1 @@
+#include "tst-cpuclock2.c"
diff --git a/rt/tst-cpuclock2.c b/rt/tst-cpuclock2.c
index c1c7ed2ad8..eebc3609d0 100644
--- a/rt/tst-cpuclock2.c
+++ b/rt/tst-cpuclock2.c
@@ -21,7 +21,11 @@
 
 #if (_POSIX_THREADS - 0) <= 0
 
-# define TEST_FUNCTION 0
+static int
+do_test ()
+{
+  return 0;
+}
 
 #else
 
@@ -330,7 +334,6 @@ do_test (void)
 
   return result;
 }
-# define TEST_FUNCTION do_test ()
 #endif
 
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
diff --git a/rt/tst-mqueue1-time64.c b/rt/tst-mqueue1-time64.c
new file mode 100644
index 0000000000..9c600a9a97
--- /dev/null
+++ b/rt/tst-mqueue1-time64.c
@@ -0,0 +1 @@
+#include "tst-mqueue1.c"
diff --git a/rt/tst-mqueue2-time64.c b/rt/tst-mqueue2-time64.c
new file mode 100644
index 0000000000..9d49f0b196
--- /dev/null
+++ b/rt/tst-mqueue2-time64.c
@@ -0,0 +1 @@
+#include "tst-mqueue2.c"
diff --git a/rt/tst-mqueue4-time64.c b/rt/tst-mqueue4-time64.c
new file mode 100644
index 0000000000..c23a228dc4
--- /dev/null
+++ b/rt/tst-mqueue4-time64.c
@@ -0,0 +1 @@
+#include "tst-mqueue4.c"
diff --git a/rt/tst-mqueue8-time64.c b/rt/tst-mqueue8-time64.c
new file mode 100644
index 0000000000..972637f7f5
--- /dev/null
+++ b/rt/tst-mqueue8-time64.c
@@ -0,0 +1 @@
+#include "tst-mqueue8.c"
diff --git a/rt/tst-timer4-time64.c b/rt/tst-timer4-time64.c
new file mode 100644
index 0000000000..e47a593f10
--- /dev/null
+++ b/rt/tst-timer4-time64.c
@@ -0,0 +1 @@
+#include "tst-timer4.c"
diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
index b15d085f51..0ae241209d 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -125,6 +125,16 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \
 	 tst-unwind-thread \
 	 tst-pt-vfork1 tst-pt-vfork2 tst-vfork1x tst-vfork2x \
 
+tests-time64 := \
+  tst-abstime-time64 \
+  tst-cnd-timedwait-time64 \
+  tst-cond11-time64 \
+  tst-join14-time64 \
+  tst-mtx-timedlock-time64 \
+  tst-rwlock14-time64 \
+  tst-sem5-time64 \
+  tst-thrd-sleep-time64 \
+
 
 # Files which must not be linked with libpthread.
 tests-nolibpthread += tst-unload
diff --git a/sysdeps/pthread/tst-abstime-time64.c b/sysdeps/pthread/tst-abstime-time64.c
new file mode 100644
index 0000000000..2fc77cb365
--- /dev/null
+++ b/sysdeps/pthread/tst-abstime-time64.c
@@ -0,0 +1 @@
+#include "tst-abstime.c"
diff --git a/sysdeps/pthread/tst-cnd-timedwait-time64.c b/sysdeps/pthread/tst-cnd-timedwait-time64.c
new file mode 100644
index 0000000000..9b2abfd277
--- /dev/null
+++ b/sysdeps/pthread/tst-cnd-timedwait-time64.c
@@ -0,0 +1 @@
+#include "tst-cnd-timedwait.c"
diff --git a/sysdeps/pthread/tst-cond11-time64.c b/sysdeps/pthread/tst-cond11-time64.c
new file mode 100644
index 0000000000..9bccb8ec8b
--- /dev/null
+++ b/sysdeps/pthread/tst-cond11-time64.c
@@ -0,0 +1 @@
+#include "tst-cond11.c"
diff --git a/sysdeps/pthread/tst-join14-time64.c b/sysdeps/pthread/tst-join14-time64.c
new file mode 100644
index 0000000000..bed784ee24
--- /dev/null
+++ b/sysdeps/pthread/tst-join14-time64.c
@@ -0,0 +1 @@
+#include "tst-join14.c"
diff --git a/sysdeps/pthread/tst-mtx-timedlock-time64.c b/sysdeps/pthread/tst-mtx-timedlock-time64.c
new file mode 100644
index 0000000000..b3393c99ef
--- /dev/null
+++ b/sysdeps/pthread/tst-mtx-timedlock-time64.c
@@ -0,0 +1 @@
+#include "tst-mtx-timedlock.c"
diff --git a/sysdeps/pthread/tst-rwlock14-time64.c b/sysdeps/pthread/tst-rwlock14-time64.c
new file mode 100644
index 0000000000..ae9b1912cf
--- /dev/null
+++ b/sysdeps/pthread/tst-rwlock14-time64.c
@@ -0,0 +1 @@
+#include "tst-rwlock14.c"
diff --git a/sysdeps/pthread/tst-sem5-time64.c b/sysdeps/pthread/tst-sem5-time64.c
new file mode 100644
index 0000000000..89c2a14f94
--- /dev/null
+++ b/sysdeps/pthread/tst-sem5-time64.c
@@ -0,0 +1 @@
+#include "tst-sem5.c"
diff --git a/sysdeps/pthread/tst-thrd-sleep-time64.c b/sysdeps/pthread/tst-thrd-sleep-time64.c
new file mode 100644
index 0000000000..02837bd19f
--- /dev/null
+++ b/sysdeps/pthread/tst-thrd-sleep-time64.c
@@ -0,0 +1 @@
+#include "tst-thrd-sleep.c"
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 747d1083e0..27716e53b7 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -122,6 +122,16 @@ endif
 
 tests-internal += tst-sigcontext-get_pc
 
+tests-time64 += \
+  tst-adjtimex-time64 \
+  tst-clock_adjtime-time64 \
+  tst-ntp_adjtime-time64 \
+  tst-ntp_gettime-time64 \
+  tst-ntp_gettimex-time64 \
+  tst-ppoll-time64 \
+  tst-sigtimedwait-time64 \
+  tst-timerfd-time64 \
+
 CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
 
 # Generate the list of SYS_* macros for the system calls (__NR_*
diff --git a/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c b/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
new file mode 100644
index 0000000000..2b6988b7c4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
@@ -0,0 +1 @@
+#include "tst-adjtimex.c"
diff --git a/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c b/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
new file mode 100644
index 0000000000..9691e81229
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
@@ -0,0 +1 @@
+#include "tst-clock_adjtime.c"
diff --git a/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
new file mode 100644
index 0000000000..30e7380b02
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
@@ -0,0 +1 @@
+#include "tst-ntp_adjtime.c"
diff --git a/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
new file mode 100644
index 0000000000..42caa66301
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
@@ -0,0 +1 @@
+#include "tst-ntp_gettime.c"
diff --git a/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
new file mode 100644
index 0000000000..3f017b3c22
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
@@ -0,0 +1 @@
+#include "tst-ntp_gettimex.c"
diff --git a/sysdeps/unix/sysv/linux/tst-ppoll-time64.c b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c
new file mode 100644
index 0000000000..96ee2faee3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c
@@ -0,0 +1 @@
+#include "tst-ppoll.c"
diff --git a/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c b/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
new file mode 100644
index 0000000000..1513e81749
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
@@ -0,0 +1 @@
+#include "tst-sigtimedwait.c"
diff --git a/sysdeps/unix/sysv/linux/tst-timerfd-time64.c b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c
new file mode 100644
index 0000000000..bb17f48139
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c
@@ -0,0 +1 @@
+#include "tst-timerfd.c"
diff --git a/sysvipc/Makefile b/sysvipc/Makefile
index a534791928..86911803b5 100644
--- a/sysvipc/Makefile
+++ b/sysvipc/Makefile
@@ -32,6 +32,8 @@ routines := ftok \
 
 tests    := test-sysvmsg test-sysvsem test-sysvshm
 
+tests-time64 := test-sysvmsg-time64 test-sysvsem-time64 test-sysvshm-time64
+
 include ../Rules
 
 CFLAGS-msgrcv.c += -fexceptions -fasynchronous-unwind-tables
diff --git a/sysvipc/test-sysvmsg-time64.c b/sysvipc/test-sysvmsg-time64.c
new file mode 100644
index 0000000000..c23e0c337e
--- /dev/null
+++ b/sysvipc/test-sysvmsg-time64.c
@@ -0,0 +1 @@
+#include "test-sysvmsg.c"
diff --git a/sysvipc/test-sysvsem-time64.c b/sysvipc/test-sysvsem-time64.c
new file mode 100644
index 0000000000..05c95068cd
--- /dev/null
+++ b/sysvipc/test-sysvsem-time64.c
@@ -0,0 +1 @@
+#include "test-sysvsem.c"
diff --git a/sysvipc/test-sysvshm-time64.c b/sysvipc/test-sysvshm-time64.c
new file mode 100644
index 0000000000..8e2963f563
--- /dev/null
+++ b/sysvipc/test-sysvshm-time64.c
@@ -0,0 +1 @@
+#include "test-sysvshm.c"
diff --git a/time/Makefile b/time/Makefile
index 805c79c4d0..c84bd5d3ec 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -52,6 +52,24 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-settimeofday tst-itimer tst-gmtime tst-timegm \
 	   tst-timespec_get tst-timespec_getres
 
+tests-time64 := \
+  tst-adjtime-time64 \
+  tst-clock-time64 \
+  tst-clock2-time64 \
+  tst-clock_nanosleep-time64 \
+  tst-clock_settime-time64 \
+  tst-cpuclock1-time64 \
+  tst-ctime-time64 \
+  tst-difftime-time64 \
+  tst-gmtime-time64 \
+  tst-itimer-time64 \
+  tst-mktime4-time64 \
+  tst-settimeofday-time64 \
+  tst-timegm-time64 \
+  tst-timespec_get-time64 \
+  tst-timespec_getres-time64 \
+  tst-y2039-time64
+
 include ../Rules
 
 ifeq ($(run-built-tests),yes)
diff --git a/time/tst-adjtime-time64.c b/time/tst-adjtime-time64.c
new file mode 100644
index 0000000000..097d6efc4b
--- /dev/null
+++ b/time/tst-adjtime-time64.c
@@ -0,0 +1 @@
+#include <tst-adjtime.c>
diff --git a/time/tst-clock-time64.c b/time/tst-clock-time64.c
new file mode 100644
index 0000000000..a1349678c8
--- /dev/null
+++ b/time/tst-clock-time64.c
@@ -0,0 +1 @@
+#include "tst-clock.c"
diff --git a/time/tst-clock2-time64.c b/time/tst-clock2-time64.c
new file mode 100644
index 0000000000..897f47b287
--- /dev/null
+++ b/time/tst-clock2-time64.c
@@ -0,0 +1 @@
+#include "tst-clock2.c"
diff --git a/time/tst-clock_nanosleep-time64.c b/time/tst-clock_nanosleep-time64.c
new file mode 100644
index 0000000000..c8638aa3d2
--- /dev/null
+++ b/time/tst-clock_nanosleep-time64.c
@@ -0,0 +1 @@
+#include "tst-clock_nanosleep.c"
diff --git a/time/tst-clock_settime-time64.c b/time/tst-clock_settime-time64.c
new file mode 100644
index 0000000000..328b04a030
--- /dev/null
+++ b/time/tst-clock_settime-time64.c
@@ -0,0 +1 @@
+#include <tst-clock_settime.c>
diff --git a/time/tst-cpuclock1-time64.c b/time/tst-cpuclock1-time64.c
new file mode 100644
index 0000000000..5a7ffa27ac
--- /dev/null
+++ b/time/tst-cpuclock1-time64.c
@@ -0,0 +1 @@
+#include "tst-cpuclock1.c"
diff --git a/time/tst-ctime-time64.c b/time/tst-ctime-time64.c
new file mode 100644
index 0000000000..24a5ae98ed
--- /dev/null
+++ b/time/tst-ctime-time64.c
@@ -0,0 +1 @@
+#include "tst-ctime.c"
diff --git a/time/tst-ctime.c b/time/tst-ctime.c
index e89a906bf8..884d69bfa0 100644
--- a/time/tst-ctime.c
+++ b/time/tst-ctime.c
@@ -24,6 +24,7 @@ static int
 do_test (void)
 {
   char *str;
+  char strb[32];
   time_t t;
 
   /* Use glibc time zone extension "TZ=:" to to guarantee that UTC
@@ -36,11 +37,21 @@ do_test (void)
   str = ctime (&t);
   TEST_COMPARE_STRING (str, "Thu Jan  1 00:00:00 1970\n");
 
+  /* Same as before but with ctime_r.  */
+  str = ctime_r (&t, strb);
+  TEST_VERIFY (str == strb);
+  TEST_COMPARE_STRING (str, "Thu Jan  1 00:00:00 1970\n");
+
   /* Check if the max time value for 32 bit time_t can be converted.  */
   t = 0x7fffffff;
   str = ctime (&t);
   TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n");
 
+  /* Same as before but with ctime_r.  */
+  str = ctime_r (&t, strb);
+  TEST_VERIFY (str == strb);
+  TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n");
+
   /* Check if we run on port with 32 bit time_t size */
   time_t tov;
   if (__builtin_add_overflow (t, 1, &tov))
@@ -50,6 +61,11 @@ do_test (void)
   str = ctime (&tov);
   TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n");
 
+  /* Same as before but with ctime_r.  */
+  str = ctime_r (&tov, strb);
+  TEST_VERIFY (str == strb);
+  TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n");
+
   return 0;
 }
 
diff --git a/time/tst-difftime-time64.c b/time/tst-difftime-time64.c
new file mode 100644
index 0000000000..751ce6c483
--- /dev/null
+++ b/time/tst-difftime-time64.c
@@ -0,0 +1 @@
+#include "tst-difftime.c"
diff --git a/time/tst-gmtime-time64.c b/time/tst-gmtime-time64.c
new file mode 100644
index 0000000000..0df11c1913
--- /dev/null
+++ b/time/tst-gmtime-time64.c
@@ -0,0 +1 @@
+#include "tst-gmtime.c"
diff --git a/time/tst-itimer-time64.c b/time/tst-itimer-time64.c
new file mode 100644
index 0000000000..ddd2efa175
--- /dev/null
+++ b/time/tst-itimer-time64.c
@@ -0,0 +1 @@
+#include <time/tst-itimer.c>
diff --git a/time/tst-mktime4-time64.c b/time/tst-mktime4-time64.c
new file mode 100644
index 0000000000..bf5197c6f3
--- /dev/null
+++ b/time/tst-mktime4-time64.c
@@ -0,0 +1 @@
+#include "tst-mktime4.c"
diff --git a/time/tst-settimeofday-time64.c b/time/tst-settimeofday-time64.c
new file mode 100644
index 0000000000..185d167a22
--- /dev/null
+++ b/time/tst-settimeofday-time64.c
@@ -0,0 +1 @@
+#include <tst-settimeofday.c>
diff --git a/time/tst-timegm-time64.c b/time/tst-timegm-time64.c
new file mode 100644
index 0000000000..8e3084f74e
--- /dev/null
+++ b/time/tst-timegm-time64.c
@@ -0,0 +1 @@
+#include "tst-timegm.c"
diff --git a/time/tst-timespec_get-time64.c b/time/tst-timespec_get-time64.c
new file mode 100644
index 0000000000..48f336385d
--- /dev/null
+++ b/time/tst-timespec_get-time64.c
@@ -0,0 +1 @@
+#include "tst-timespec_get.c"
diff --git a/time/tst-timespec_getres-time64.c b/time/tst-timespec_getres-time64.c
new file mode 100644
index 0000000000..59a0f36103
--- /dev/null
+++ b/time/tst-timespec_getres-time64.c
@@ -0,0 +1 @@
+#include "tst-timespec_getres.c"
diff --git a/time/tst-y2039-time64.c b/time/tst-y2039-time64.c
new file mode 100644
index 0000000000..3c8a504186
--- /dev/null
+++ b/time/tst-y2039-time64.c
@@ -0,0 +1 @@
+#include "tst-y2039.c"
diff --git a/time/tst-y2039.c b/time/tst-y2039.c
index ef024c0a77..66a22d4c2c 100644
--- a/time/tst-y2039.c
+++ b/time/tst-y2039.c
@@ -37,6 +37,16 @@ do_test (void)
 			> 0);
       puts (buf);
       TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
+
+      /* Same as before but for localtime_r.  */
+      struct tm tmd;
+      tm = localtime_r (&ouch, &tmd);
+      TEST_VERIFY_EXIT (tm == &tmd);
+
+      TEST_VERIFY_EXIT (strftime (buf, sizeof buf, "%Y-%m-%d %H:%M:%S %Z", tm)
+			> 0);
+      puts (buf);
+      TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
     }
   else
     FAIL_UNSUPPORTED ("32-bit time_t");
-- 
2.30.2


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64
  2021-05-18 20:55 ` [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
@ 2021-05-19  8:24   ` Lukasz Majewski
  2021-05-20  6:38   ` Florian Weimer
  2021-06-04 19:29   ` Carlos O'Donell
  2 siblings, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  8:24 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]

On Tue, 18 May 2021 17:55:49 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The n32 will require the 64 bit time symbols for y2038 support.
> ---
>  .../mips/mips64/{ => n32}/libpthread.abilist      |  0
>  .../sysv/linux/mips/mips64/n64/libpthread.abilist | 15
> +++++++++++++++ 2 files changed, 15 insertions(+)
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ =>
> n32}/libpthread.abilist (100%) create mode 100644
> sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> 
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
> similarity index 100% rename from
> sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist rename to
> sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist diff --git
> a/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist new file
> mode 100644 index 0000000000..a5f3d5ce2a

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 02/25] linux: mips: Split librt.abilist in n32 and n64
  2021-05-18 20:55 ` [PATCH v2 02/25] linux: mips: Split librt.abilist " Adhemerval Zanella
@ 2021-05-19  8:25   ` Lukasz Majewski
  2021-06-04 19:29   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  8:25 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 2413 bytes --]

On Tue, 18 May 2021 17:55:50 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The n32 will require the 64 bit time symbols for y2038 support.
> ---
>  .../linux/mips/mips64/{ => n32}/librt.abilist |  0
>  .../sysv/linux/mips/mips64/n64/librt.abilist  | 37
> +++++++++++++++++++ 2 files changed, 37 insertions(+)
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/librt.abilist
> (100%) create mode 100644
> sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist similarity
> index 100% rename from
> sysdeps/unix/sysv/linux/mips/mips64/librt.abilist rename to
> sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist diff --git
> a/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist new file mode
> 100644 index 0000000000..1539c1cef9 --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
> @@ -0,0 +1,37 @@
> +GLIBC_2.2 aio_cancel F
> +GLIBC_2.2 aio_cancel64 F
> +GLIBC_2.2 aio_error F
> +GLIBC_2.2 aio_error64 F
> +GLIBC_2.2 aio_fsync F
> +GLIBC_2.2 aio_fsync64 F
> +GLIBC_2.2 aio_init F
> +GLIBC_2.2 aio_read F
> +GLIBC_2.2 aio_read64 F
> +GLIBC_2.2 aio_return F
> +GLIBC_2.2 aio_return64 F
> +GLIBC_2.2 aio_suspend F
> +GLIBC_2.2 aio_suspend64 F
> +GLIBC_2.2 aio_write F
> +GLIBC_2.2 aio_write64 F
> +GLIBC_2.2 lio_listio F
> +GLIBC_2.2 lio_listio64 F
> +GLIBC_2.2 shm_open F
> +GLIBC_2.2 shm_unlink F
> +GLIBC_2.2 timer_create F
> +GLIBC_2.2 timer_delete F
> +GLIBC_2.2 timer_getoverrun F
> +GLIBC_2.2 timer_gettime F
> +GLIBC_2.2 timer_settime F
> +GLIBC_2.3.4 mq_close F
> +GLIBC_2.3.4 mq_getattr F
> +GLIBC_2.3.4 mq_notify F
> +GLIBC_2.3.4 mq_open F
> +GLIBC_2.3.4 mq_receive F
> +GLIBC_2.3.4 mq_send F
> +GLIBC_2.3.4 mq_setattr F
> +GLIBC_2.3.4 mq_timedreceive F
> +GLIBC_2.3.4 mq_timedsend F
> +GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.4 lio_listio F
> +GLIBC_2.4 lio_listio64 F
> +GLIBC_2.7 __mq_open_2 F



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 03/25] linux: mips: Split libanl.abilist in n32 and n64
  2021-05-18 20:55 ` [PATCH v2 03/25] linux: mips: Split libanl.abilist " Adhemerval Zanella
@ 2021-05-19  8:25   ` Lukasz Majewski
  2021-06-04 19:30   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  8:25 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

On Tue, 18 May 2021 17:55:51 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The n32 will require the 64 bit time symbols for y2038 support.
> ---
>  sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist | 0
>  sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist       | 4 ++++
>  2 files changed, 4 insertions(+)
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist
> (100%) create mode 100644
> sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
> 
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist similarity
> index 100% rename from
> sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist rename to
> sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist diff --git
> a/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist new file
> mode 100644 index 0000000000..d9a5ed015d --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
> @@ -0,0 +1,4 @@
> +GLIBC_2.2.3 gai_cancel F
> +GLIBC_2.2.3 gai_error F
> +GLIBC_2.2.3 gai_suspend F
> +GLIBC_2.2.3 getaddrinfo_a F

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 04/25] linux: s390: Add libanl.abilist in s390 and s390x
  2021-05-18 20:55 ` [PATCH v2 04/25] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella
@ 2021-05-19  8:26   ` Lukasz Majewski
  2021-06-04 19:30   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  8:26 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

On Tue, 18 May 2021 17:55:52 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The s390 will require the 64 bit time symbols for y2038 support.
> ---
>  sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist | 0
>  sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist       | 4 ++++
>  2 files changed, 4 insertions(+)
>  rename sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist
> (100%) create mode 100644
> sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
> 
> diff --git a/sysdeps/unix/sysv/linux/s390/libanl.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist similarity
> index 100% rename from sysdeps/unix/sysv/linux/s390/libanl.abilist
> rename to sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist new file mode
> 100644 index 0000000000..d9a5ed015d
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
> @@ -0,0 +1,4 @@
> +GLIBC_2.2.3 gai_cancel F
> +GLIBC_2.2.3 gai_error F
> +GLIBC_2.2.3 gai_suspend F
> +GLIBC_2.2.3 getaddrinfo_a F

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO
  2021-05-18 20:55 ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella
@ 2021-05-19  8:36   ` Lukasz Majewski
  2021-05-20  6:44   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Florian Weimer
  2021-06-04 19:30   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO Carlos O'Donell
  2 siblings, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  8:36 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 15099 bytes --]

On Tue, 18 May 2021 17:55:53 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The constant values will be changed for __TIMESIZE=64, so binaries
> built with 64-bit time support might fail to work properly on old
> kernels. Both {get,set}sockopt will retry the syscall with the old
> constant values and the timeout value adjusted when kernel returns
> ENOTPROTOPT.
> 
> It also adds an internal only SO_{RCV,SND}TIMEO where
> COMPAT_SO_{RCV,SND}TIMEO_OLD indicates pre 32 bit time support and
> COMPAT_SO_{RCV,SND}TIMEO_NEW indicates time64 support.  It allows to
> refer to constant independently of the time_t ABI and kernel version
> used.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
> kernel).

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  sysdeps/unix/sysv/linux/getsockopt.c          | 67 +++++++++++++++--
>  .../sysv/linux/hppa/socket-constants-time64.h | 30 ++++++++
>  .../sysv/linux/mips/socket-constants-time64.h | 30 ++++++++
>  .../linux/powerpc/socket-constants-time64.h   | 30 ++++++++
>  sysdeps/unix/sysv/linux/setsockopt.c          | 71
> ++++++++++++++++--- .../unix/sysv/linux/socket-constants-time64.h |
> 30 ++++++++ .../linux/sparc/socket-constants-time64.h     | 30
> ++++++++ 7 files changed, 273 insertions(+), 15 deletions(-)
>  create mode 100644
> sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h create mode
> 100644 sysdeps/unix/sysv/linux/mips/socket-constants-time64.h create
> mode 100644 sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> create mode 100644 sysdeps/unix/sysv/linux/socket-constants-time64.h
> create mode 100644
> sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> 
> diff --git a/sysdeps/unix/sysv/linux/getsockopt.c
> b/sysdeps/unix/sysv/linux/getsockopt.c index 76ee8a94d6..c8e502d976
> 100644 --- a/sysdeps/unix/sysv/linux/getsockopt.c
> +++ b/sysdeps/unix/sysv/linux/getsockopt.c
> @@ -15,16 +15,15 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#include <errno.h>
> -#include <signal.h>
>  #include <sys/socket.h>
> -
> +#include <time.h>
> +#include <sysdep.h>
>  #include <socketcall.h>
> -#include <kernel-features.h>
> -#include <sys/syscall.h>
> +#include <socket-constants-time64.h>
>  
> -int
> -__getsockopt (int fd, int level, int optname, void *optval,
> socklen_t *len) +static int
> +getsockopt_syscall (int fd, int level, int optname, void *optval,
> +		    socklen_t *len)
>  {
>  #ifdef __ASSUME_GETSOCKOPT_SYSCALL
>    return INLINE_SYSCALL (getsockopt, 5, fd, level, optname, optval,
> len); @@ -32,4 +31,58 @@ __getsockopt (int fd, int level, int
> optname, void *optval, socklen_t *len) return SOCKETCALL (getsockopt,
> fd, level, optname, optval, len); #endif
>  }
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +static int
> +getsockopt32 (int fd, int level, int optname, void *optval,
> +	      socklen_t *len)
> +{
> +  int r = -1;
> +
> +  if (level != SOL_SOCKET)
> +    return r;
> +
> +  switch (optname)
> +    {
> +    case COMPAT_SO_RCVTIMEO_NEW:
> +    case COMPAT_SO_SNDTIMEO_NEW:
> +      {
> +        if (*len < sizeof (struct __timeval64))
> +	  {
> +	    __set_errno (EINVAL);
> +	    break;
> +	  }
> +
> +	if (optname == COMPAT_SO_RCVTIMEO_NEW)
> +	  optname = COMPAT_SO_RCVTIMEO_OLD;
> +	if (optname == COMPAT_SO_SNDTIMEO_NEW)
> +	  optname = COMPAT_SO_SNDTIMEO_OLD;
> +
> +	struct __timeval32 tv32;
> +	r = getsockopt_syscall (fd, level, optname, &tv32,
> +				(socklen_t[]) { sizeof tv32 });
> +	if (r < 0)
> +	  break;
> +	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
> +	*tv64 = valid_timeval32_to_timeval64 (tv32);
> +	*len = sizeof (*tv64);
> +      }
> +    }
> +
> +  return r;
> +}
> +#endif
> +
> +int
> +__getsockopt (int fd, int level, int optname, void *optval,
> socklen_t *len) +{
> +  int r = getsockopt_syscall (fd, level, optname, optval, len);
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +  if (r == -1 && errno == ENOPROTOOPT)
> +    r = getsockopt32 (fd, level, optname, optval, len);
> +#endif
> +
> + return r;
> +}
>  weak_alias (__getsockopt, getsockopt)
> diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h new file
> mode 100644 index 0000000000..ea721e0fc2
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and
> 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 4102
> +#define COMPAT_SO_SNDTIMEO_OLD 4101
> +#define COMPAT_SO_RCVTIMEO_NEW 16448
> +#define COMPAT_SO_SNDTIMEO_NEW 16449
> +
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h new file
> mode 100644 index 0000000000..ab8bd62853
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and
> 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 4102
> +#define COMPAT_SO_SNDTIMEO_OLD 4101
> +#define COMPAT_SO_RCVTIMEO_NEW 66
> +#define COMPAT_SO_SNDTIMEO_NEW 67
> +
> +#endif
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h new file
> mode 100644 index 0000000000..1e48dcca8d --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and
> 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 18
> +#define COMPAT_SO_SNDTIMEO_OLD 19
> +#define COMPAT_SO_RCVTIMEO_NEW 66
> +#define COMPAT_SO_SNDTIMEO_NEW 67
> +
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/setsockopt.c
> b/sysdeps/unix/sysv/linux/setsockopt.c index 12fd7bdcde..6505202265
> 100644 --- a/sysdeps/unix/sysv/linux/setsockopt.c
> +++ b/sysdeps/unix/sysv/linux/setsockopt.c
> @@ -15,21 +15,76 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#include <errno.h>
> -#include <signal.h>
>  #include <sys/socket.h>
> -
> +#include <time.h>
> +#include <sysdep.h>
>  #include <socketcall.h>
> -#include <kernel-features.h>
> -#include <sys/syscall.h>
> +#include <socket-constants-time64.h>
>  
> -int
> -setsockopt (int fd, int level, int optname, const void *optval,
> socklen_t len) +static int
> +setsockopt_syscall (int fd, int level, int optname, const void
> *optval,
> +		    socklen_t len)
>  {
>  #ifdef __ASSUME_SETSOCKOPT_SYSCALL
> -  return INLINE_SYSCALL (setsockopt, 5, fd, level, optname, optval,
> len);
> +  return INLINE_SYSCALL_CALL (setsockopt, fd, level, optname,
> optval, len); #else
>    return SOCKETCALL (setsockopt, fd, level, optname, optval, len);
>  #endif
>  }
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +static int
> +setsockopt32 (int fd, int level, int optname, const void *optval,
> +	      socklen_t len)
> +{
> +  int r = -1;
> +
> +  if (level != SOL_SOCKET)
> +    return r;
> +
> +  switch (optname)
> +    {
> +    case COMPAT_SO_RCVTIMEO_NEW:
> +    case COMPAT_SO_SNDTIMEO_NEW:
> +      {
> +        if (len < sizeof (struct __timeval64))
> +	  {
> +	    __set_errno (EINVAL);
> +	    break;
> +	  }
> +
> +	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
> +	if (! in_time_t_range (tv64->tv_sec))
> +	  {
> +	    __set_errno (EOVERFLOW);
> +	    break;
> +	  }
> +
> +	if (optname == COMPAT_SO_RCVTIMEO_NEW)
> +	  optname = COMPAT_SO_RCVTIMEO_OLD;
> +	if (optname == COMPAT_SO_SNDTIMEO_NEW)
> +	  optname = COMPAT_SO_SNDTIMEO_OLD;
> +
> +	struct __timeval32 tv32 = valid_timeval64_to_timeval32
> (*tv64); +
> +	r = setsockopt_syscall (fd, level, optname, &tv32, sizeof
> (tv32));
> +      }
> +    }
> +
> +  return r;
> +}
> +#endif
> +
> +int
> +setsockopt (int fd, int level, int optname, const void *optval,
> socklen_t len) +{
> +  int r = setsockopt_syscall (fd, level, optname, optval, len);
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +  if (r == -1 && errno == ENOPROTOOPT)
> +    r = setsockopt32 (fd, level, optname, optval, len);
> +#endif
> +
> +  return r;
> +}
>  weak_alias (setsockopt, __setsockopt)
> diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/socket-constants-time64.h new file mode
> 100644 index 0000000000..e5a3777f28
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and
> 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 20
> +#define COMPAT_SO_SNDTIMEO_OLD 21
> +#define COMPAT_SO_RCVTIMEO_NEW 66
> +#define COMPAT_SO_SNDTIMEO_NEW 67
> +
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h new file
> mode 100644 index 0000000000..b137abdeea
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and
> 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 8192
> +#define COMPAT_SO_SNDTIMEO_OLD 16384
> +#define COMPAT_SO_RCVTIMEO_NEW 68
> +#define COMPAT_SO_SNDTIMEO_NEW 69
> +
> +#endif



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-18 20:55 ` [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella
@ 2021-05-19  8:50   ` Lukasz Majewski
  2021-05-20  6:50   ` Florian Weimer
  2021-06-04 19:30   ` Carlos O'Donell
  2 siblings, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  8:50 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 12821 bytes --]

On Tue, 18 May 2021 17:55:54 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The recvmsg handling is more complicated because it requires check the
> returned kernel control message and make some convertions.  For
> !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time
> SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer
> if has extra space or returns MSG_CTRUNC otherwise.  The 32-bit time
> field is kept as-is.
> 
> Calls with __TIMESIZE=32 will see the converted 64-bit time control
> messages as spurious control message of unknown type.  Calls with
> __TIMESIZE=64 running on pre-time64 kernels will see the original
> message as a spurious control ones of unknown typ while running on
> kernel with native 64-bit time support will only see the time64
> version of the control message.
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
> kernel).
> ---
>  include/sys/socket.h                          |  5 +
>  sysdeps/unix/sysv/linux/Makefile              |  2 +-
>  sysdeps/unix/sysv/linux/Versions              |  1 +
>  .../unix/sysv/linux/convert_scm_timestamps.c  | 96
> +++++++++++++++++++ sysdeps/unix/sysv/linux/getsockopt.c          |
> 12 +++ .../sysv/linux/hppa/socket-constants-time64.h |  5 +
>  .../sysv/linux/mips/socket-constants-time64.h |  5 +
>  .../linux/powerpc/socket-constants-time64.h   |  5 +
>  sysdeps/unix/sysv/linux/recvmsg.c             | 23 +++--
>  sysdeps/unix/sysv/linux/setsockopt.c          | 12 +++
>  .../unix/sysv/linux/socket-constants-time64.h |  5 +
>  .../linux/sparc/socket-constants-time64.h     |  5 +
>  12 files changed, 169 insertions(+), 7 deletions(-)
>  create mode 100644 sysdeps/unix/sysv/linux/convert_scm_timestamps.c
> 
> diff --git a/include/sys/socket.h b/include/sys/socket.h
> index 0e39dd2a3a..15d4a62b26 100644
> --- a/include/sys/socket.h
> +++ b/include/sys/socket.h
> @@ -164,5 +164,10 @@ libc_hidden_proto (__libc_sa_len)
>  
>  libc_hidden_proto (__cmsg_nxthdr)
>  
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +extern void __convert_scm_timestamps (struct msghdr *msg, socklen_t
> msgsize) ; +libc_hidden_proto (__convert_scm_timestamps)
> +#endif
> +
>  #endif
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/Makefile
> b/sysdeps/unix/sysv/linux/Makefile index fb155cf856..e28f6470e3 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -64,7 +64,7 @@ sysdep_routines += adjtimex clone umount umount2
> readahead sysctl \ time64-support pselect32 \
>  		   xstat fxstat lxstat xstat64 fxstat64 lxstat64 \
>  		   fxstatat fxstatat64 \
> -		   xmknod xmknodat
> +		   xmknod xmknodat convert_scm_timestamps
>  
>  CFLAGS-gethostid.c = -fexceptions
>  CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
> diff --git a/sysdeps/unix/sysv/linux/Versions
> b/sysdeps/unix/sysv/linux/Versions index 220bb2dffe..148f04c50a 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -177,6 +177,7 @@ libc {
>      __pread64_nocancel;
>      __close_nocancel;
>      __sigtimedwait;
> +    __convert_scm_timestamps;
>      # functions used by nscd
>      __netlink_assert_response;
>    }
> diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
> b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c new file mode
> 100644 index 0000000000..3c123c28ce
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
> @@ -0,0 +1,96 @@
> +/* Socket timestamp conversion routines.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <kernel-features.h>
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +# include <stdint.h>
> +# include <string.h>
> +# include <sys/socket.h>
> +# include <socket-constants-time64.h>
> +
> +/* It converts the first SO_TIMESTAMP or SO_TIMESTAMPNS with 32-bit
> time and
> +   appends it to the control buffer.  The 32-bit time field is kept
> as-is. +
> +   Calls with __TIMESIZE=32 will see the converted 64-bit time
> control
> +   messages as spurious control message of unknown type.
> +
> +   Calls with __TIMESIZE=64 running on pre-time64 kernels will see
> the
> +   original message as a spurious control ones of unknown typ while
> running
> +   on kernel with native 64-bit time support will only see the
> time64 version
> +   of the control message.  */
> +void
> +__convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
> +{
> +  if (msg->msg_control == NULL || msg->msg_controllen == 0)
> +    return;
> +
> +  /* The returned control message format for SO_TIMESTAMP_NEW is a
> +     'struct __kernel_sock_timeval' while for SO_TIMESTAMPNS_NEW is a
> +     'struct __kernel_timespec'.  In either case it is two uint64_t
> +     members.  */
> +  uint64_t tvts[2];
> +
> +  struct cmsghdr *cmsg, *last = NULL;
> +  int type = 0;
> +
> +  for (cmsg = CMSG_FIRSTHDR (msg);
> +       cmsg != NULL;
> +       cmsg = CMSG_NXTHDR (msg, cmsg))
> +    {
> +      if (cmsg->cmsg_level != SOL_SOCKET)
> +	continue;
> +
> +      switch (cmsg->cmsg_type)
> +	{
> +	case COMPAT_SO_TIMESTAMP_OLD:
> +	  if (type != 0)
> +	    break;
> +	  type = COMPAT_SO_TIMESTAMP_NEW;
> +	  goto common;
> +
> +	case COMPAT_SO_TIMESTAMPNS_OLD:
> +	  type = COMPAT_SO_TIMESTAMPNS_NEW;
> +
> +	/* fallthrough  */
> +	common:
> +	  memcpy (tvts, CMSG_DATA (cmsg), sizeof (tvts));
> +	  break;
> +	}
> +
> +      last = cmsg;
> +    }
> +
> +  if (last == NULL || type == 0)
> +    return;
> +
> +  if (CMSG_SPACE (sizeof tvts) > msgsize - msg->msg_controllen)
> +    {
> +      msg->msg_flags |= MSG_CTRUNC;
> +      return;
> +    }
> +
> +  msg->msg_controllen += CMSG_SPACE (sizeof tvts);
> +  cmsg = CMSG_NXTHDR(msg, last);
> +  cmsg->cmsg_level = SOL_SOCKET;
> +  cmsg->cmsg_type = type;
> +  cmsg->cmsg_len = CMSG_LEN (sizeof tvts);
> +  memcpy (CMSG_DATA (cmsg), tvts, sizeof tvts);
> +}
> +libc_hidden_def (__convert_scm_timestamps)
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/getsockopt.c
> b/sysdeps/unix/sysv/linux/getsockopt.c index c8e502d976..14b782d0da
> 100644 --- a/sysdeps/unix/sysv/linux/getsockopt.c
> +++ b/sysdeps/unix/sysv/linux/getsockopt.c
> @@ -67,6 +67,18 @@ getsockopt32 (int fd, int level, int optname, void
> *optval, *tv64 = valid_timeval32_to_timeval64 (tv32);
>  	*len = sizeof (*tv64);
>        }
> +      break;
> +
> +    case COMPAT_SO_TIMESTAMP_NEW:
> +    case COMPAT_SO_TIMESTAMPNS_NEW:
> +      {
> +	if (optname == COMPAT_SO_TIMESTAMP_NEW)
> +	  optname = COMPAT_SO_TIMESTAMP_OLD;
> +	if (optname == COMPAT_SO_TIMESTAMPNS_NEW)
> +	  optname = COMPAT_SO_TIMESTAMPNS_OLD;
> +	r = getsockopt_syscall (fd, level, optname, optval, len);
> +      }
> +      break;
>      }
>  
>    return r;
> diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h index
> ea721e0fc2..f3b98012d5 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h +++
> b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h @@ -27,4
> +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 16448
>  #define COMPAT_SO_SNDTIMEO_NEW 16449
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 0x4012
> +#define COMPAT_SO_TIMESTAMPNS_OLD 0x4013
> +#define COMPAT_SO_TIMESTAMP_NEW 0x4038
> +#define COMPAT_SO_TIMESTAMPNS_NEW 0x4039
> +
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h index
> ab8bd62853..31fa69fa9f 100644 ---
> a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h +++
> b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h @@ -27,4
> +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 66
>  #define COMPAT_SO_SNDTIMEO_NEW 67
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 29
> +#define COMPAT_SO_TIMESTAMPNS_OLD 35
> +#define COMPAT_SO_TIMESTAMP_NEW 63
> +#define COMPAT_SO_TIMESTAMPNS_NEW 64
> +
>  #endif
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h index
> 1e48dcca8d..889251895b 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h +++
> b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h @@ -27,4
> +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 66 #define
> COMPAT_SO_SNDTIMEO_NEW 67 
> +#define COMPAT_SO_TIMESTAMP_OLD 29
> +#define COMPAT_SO_TIMESTAMPNS_OLD 35
> +#define COMPAT_SO_TIMESTAMP_NEW 63
> +#define COMPAT_SO_TIMESTAMPNS_NEW 64
> +
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/recvmsg.c
> b/sysdeps/unix/sysv/linux/recvmsg.c index b209b4ad99..a2a600228b
> 100644 --- a/sysdeps/unix/sysv/linux/recvmsg.c
> +++ b/sysdeps/unix/sysv/linux/recvmsg.c
> @@ -19,16 +19,27 @@
>  #include <sys/socket.h>
>  #include <sysdep-cancel.h>
>  #include <socketcall.h>
> -#include <shlib-compat.h>
>  
>  ssize_t
>  __libc_recvmsg (int fd, struct msghdr *msg, int flags)
>  {
> -# ifdef __ASSUME_RECVMSG_SYSCALL
> -  return SYSCALL_CANCEL (recvmsg, fd, msg, flags);
> -# else
> -  return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
> -# endif
> +  ssize_t r;
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +  socklen_t orig_controllen = msg->msg_controllen;
> +#endif
> +
> +#ifdef __ASSUME_RECVMSG_SYSCALL
> +  r = SYSCALL_CANCEL (recvmsg, fd, msg, flags);
> +#else
> +  r = SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
> +#endif
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +  if (r >= 0)
> +    __convert_scm_timestamps (msg, orig_controllen);
> +#endif
> +
> +  return r;
>  }
>  weak_alias (__libc_recvmsg, recvmsg)
>  weak_alias (__libc_recvmsg, __recvmsg)
> diff --git a/sysdeps/unix/sysv/linux/setsockopt.c
> b/sysdeps/unix/sysv/linux/setsockopt.c index 6505202265..a4780a9d33
> 100644 --- a/sysdeps/unix/sysv/linux/setsockopt.c
> +++ b/sysdeps/unix/sysv/linux/setsockopt.c
> @@ -69,6 +69,18 @@ setsockopt32 (int fd, int level, int optname,
> const void *optval, 
>  	r = setsockopt_syscall (fd, level, optname, &tv32, sizeof
> (tv32)); }
> +      break;
> +
> +    case COMPAT_SO_TIMESTAMP_NEW:
> +    case COMPAT_SO_TIMESTAMPNS_NEW:
> +      {
> +	if (optname == COMPAT_SO_TIMESTAMP_NEW)
> +	  optname = COMPAT_SO_TIMESTAMP_OLD;
> +	if (optname == COMPAT_SO_TIMESTAMPNS_NEW)
> +	  optname = COMPAT_SO_TIMESTAMPNS_OLD;
> +	r = setsockopt_syscall (fd, level, optname, NULL, 0);
> +      }
> +      break;
>      }
>  
>    return r;
> diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/socket-constants-time64.h index
> e5a3777f28..7f7ca05504 100644 ---
> a/sysdeps/unix/sysv/linux/socket-constants-time64.h +++
> b/sysdeps/unix/sysv/linux/socket-constants-time64.h @@ -27,4 +27,9 @@
>  #define COMPAT_SO_RCVTIMEO_NEW 66
>  #define COMPAT_SO_SNDTIMEO_NEW 67
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 29
> +#define COMPAT_SO_TIMESTAMPNS_OLD 35
> +#define COMPAT_SO_TIMESTAMP_NEW 63
> +#define COMPAT_SO_TIMESTAMPNS_NEW 64
> +
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h index
> b137abdeea..56358923e1 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h +++
> b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h @@ -27,4
> +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 68
>  #define COMPAT_SO_SNDTIMEO_NEW 69
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 0x001d
> +#define COMPAT_SO_TIMESTAMPNS_OLD 0x0021
> +#define COMPAT_SO_TIMESTAMP_NEW 0x0046
> +#define COMPAT_SO_TIMESTAMPNS_NEW 0x0042
> +
>  #endif



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 07/25] linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-18 20:55 ` [PATCH v2 07/25] linux: Add recvvmsg " Adhemerval Zanella
@ 2021-05-19  9:02   ` Lukasz Majewski
  2021-06-04 19:30   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:02 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 2482 bytes --]

On Tue, 18 May 2021 17:55:55 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> Handle the SO_TIMESTAMP{NS} similar to recvmsg: for
> !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time
> SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer
> if has extra space or returns MSG_CTRUNC otherwise.  The 32-bit time
> field is kept as-is.
> 
> Also for !__ASSUME_TIME64_SYSCALLS it limits the maximum number of
> 'struct mmsghdr *' to IOV_MAX (and also increases the stack size
> requirement to IOV_MAX times sizeof (socklen_t)).  The Linux imposes
> a similar limit to sendmmsg, so bound the array size on recvmmsg is
> not unreasonable.  And this will be used only on older when building
> with 32-bit time support.
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
> kernel).
> ---
>  sysdeps/unix/sysv/linux/recvmmsg.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c
> b/sysdeps/unix/sysv/linux/recvmmsg.c index 672ba20332..5cd107ffa9
> 100644 --- a/sysdeps/unix/sysv/linux/recvmmsg.c
> +++ b/sysdeps/unix/sysv/linux/recvmmsg.c
> @@ -44,13 +44,26 @@ __recvmmsg64 (int fd, struct mmsghdr *vmessages,
> unsigned int vlen, int flags, ts32 = valid_timespec64_to_timespec
> (*timeout); pts32 = &ts32;
>      }
> +
> +  socklen_t csize[IOV_MAX];
> +  if (vlen > IOV_MAX)
> +    vlen = IOV_MAX;
> +  for (int i = 0; i < vlen; i++)
> +    csize[i] = vmessages[i].msg_hdr.msg_controllen;
> +
>  # ifdef __ASSUME_RECVMMSG_SYSCALL
>    r = SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32);
>  # else
>    r = SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags,
> pts32); # endif
> -  if (r >= 0 && timeout != NULL)
> -    *timeout = valid_timespec_to_timespec64 (ts32);
> +  if (r >= 0)
> +    {
> +      if (timeout != NULL)
> +        *timeout = valid_timespec_to_timespec64 (ts32);
> +
> +      for (int i=0; i < r; i++)
> +        __convert_scm_timestamps (&vmessages[i].msg_hdr, csize[i]);
> +    }
>  #endif /* __ASSUME_TIME64_SYSCALLS  */
>    return r;
>  }



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 08/25] y2038: Add __USE_TIME_BITS64 support for time_t
  2021-05-18 20:55 ` [PATCH v2 08/25] y2038: Add __USE_TIME_BITS64 support for time_t Adhemerval Zanella
@ 2021-05-19  9:02   ` Lukasz Majewski
  2021-06-04 19:30   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:02 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

On Tue, 18 May 2021 17:55:56 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The __USE_TIME_BITS64 is not defined internally yet.
> ---
>  time/bits/types/time_t.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/time/bits/types/time_t.h b/time/bits/types/time_t.h
> index ab8287c6fe..84d67f6ac3 100644
> --- a/time/bits/types/time_t.h
> +++ b/time/bits/types/time_t.h
> @@ -4,6 +4,10 @@
>  #include <bits/types.h>
>  
>  /* Returned by `time'.  */
> +#ifdef __USE_TIME_BITS64
> +typedef __time64_t time_t;
> +#else
>  typedef __time_t time_t;
> +#endif
>  
>  #endif

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 09/25] y2038: Add __USE_TIME_BITS64 support for struct timeval
  2021-05-18 20:55 ` [PATCH v2 09/25] y2038: Add __USE_TIME_BITS64 support for struct timeval Adhemerval Zanella
@ 2021-05-19  9:03   ` Lukasz Majewski
  2021-06-04 19:31   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:03 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]

On Tue, 18 May 2021 17:55:57 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The __USE_TIME_BITS64 is not defined internally yet.
> ---
>  time/bits/types/struct_timeval.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/time/bits/types/struct_timeval.h
> b/time/bits/types/struct_timeval.h index 70394ce886..3466137c35 100644
> --- a/time/bits/types/struct_timeval.h
> +++ b/time/bits/types/struct_timeval.h
> @@ -7,7 +7,12 @@
>     microsecond but also has a range of years.  */
>  struct timeval
>  {
> +#ifdef __USE_TIME_BITS64
> +  __time64_t tv_sec;		/* Seconds.  */
> +  __suseconds64_t tv_usec;	/* Microseconds.  */
> +#else
>    __time_t tv_sec;		/* Seconds.  */
>    __suseconds_t tv_usec;	/* Microseconds.  */
> +#endif
>  };
>  #endif

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 10/25] y2038: Add __USE_TIME_BITS64 support for struct timespec
  2021-05-18 20:55 ` [PATCH v2 10/25] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella
@ 2021-05-19  9:03   ` Lukasz Majewski
  2021-06-04 19:31   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:03 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

On Tue, 18 May 2021 17:55:58 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The __USE_TIME_BITS64 is not defined internally yet.
> ---
>  time/bits/types/struct_timespec.h | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/time/bits/types/struct_timespec.h
> b/time/bits/types/struct_timespec.h index d11c69cfd3..4fe47a0d25
> 100644 --- a/time/bits/types/struct_timespec.h
> +++ b/time/bits/types/struct_timespec.h
> @@ -1,18 +1,22 @@
> -/* NB: Include guard matches what <linux/time.h> uses.  */
> -#ifndef _STRUCT_TIMESPEC
> -#define _STRUCT_TIMESPEC 1
> +#ifndef __struct_timespec_defined
> +#define __struct_timespec_defined 1
>  
>  #include <bits/types.h>
>  #include <bits/endian.h>
> +#include <bits/types/time_t.h>
>  
>  /* POSIX.1b structure for a time value.  This is like a `struct
> timeval' but has nanoseconds instead of microseconds.  */
>  struct timespec
>  {
> +#ifdef __USE_TIME_BITS64
> +  __time64_t tv_sec;		/* Seconds.  */
> +#else
>    __time_t tv_sec;		/* Seconds.  */
> +#endif
>  #if __WORDSIZE == 64 \
>    || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
> -  || __TIMESIZE == 32
> +  || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
>    __syscall_slong_t tv_nsec;	/* Nanoseconds.  */
>  #else
>  # if __BYTE_ORDER == __BIG_ENDIAN

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 11/25] y2038: Add __USE_TIME_BITS64 support for struct utimbuf
  2021-05-18 20:55 ` [PATCH v2 11/25] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Adhemerval Zanella
@ 2021-05-19  9:04   ` Lukasz Majewski
  2021-06-04 19:31   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:04 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

On Tue, 18 May 2021 17:55:59 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The __USE_TIME_BITS64 is not defined internally yet.
> ---
>  io/utime.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/io/utime.h b/io/utime.h
> index df2299e406..c7612d0838 100644
> --- a/io/utime.h
> +++ b/io/utime.h
> @@ -35,8 +35,13 @@ __BEGIN_DECLS
>  /* Structure describing file times.  */
>  struct utimbuf
>    {
> +#ifdef __USE_TIME_BITS64
> +    __time64_t actime;		/* Access time.  */
> +    __time64_t modtime;		/* Modification time.  */
> +#else
>      __time_t actime;		/* Access time.  */
>      __time_t modtime;		/* Modification time.  */
> +#endif
>    };
>  
>  /* Set the access and modification times of FILE to those given in

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex
  2021-05-18 20:56 ` [PATCH v2 12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Adhemerval Zanella
@ 2021-05-19  9:04   ` Lukasz Majewski
  2021-06-04 19:31   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:04 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 2928 bytes --]

On Tue, 18 May 2021 17:56:00 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The __USE_TIME_BITS64 is not defined internally yet.
> ---
>  sysdeps/unix/sysv/linux/bits/timex.h | 31
> ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/bits/timex.h
> b/sysdeps/unix/sysv/linux/bits/timex.h index 9b2e30f3e0..ee37694e8f
> 100644 --- a/sysdeps/unix/sysv/linux/bits/timex.h
> +++ b/sysdeps/unix/sysv/linux/bits/timex.h
> @@ -25,6 +25,36 @@
>  
>  struct timex
>  {
> +# ifdef __USE_TIME_BITS64
> +  unsigned int modes;          /* mode selector */
> +  int :32;                     /* pad */
> +  long long offset;            /* time offset (usec) */
> +  long long freq;              /* frequency offset (scaled ppm) */
> +  long long maxerror;          /* maximum error (usec) */
> +  long long esterror;          /* estimated error (usec) */
> +  int status;                  /* clock command/status */
> +  int :32;                     /* pad */
> +  long long constant;          /* pll time constant */
> +  long long precision;         /* clock precision (usec) (read only)
> */
> +  long long tolerance;         /* clock frequency tolerance (ppm)
> (ro) */
> +  struct timeval time;     /* (read only, except for ADJ_SETOFFSET)
> */
> +  long long tick;              /* (modified) usecs between clock
> ticks */
> +  long long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
> +  long long jitter;            /* pps jitter (us) (ro) */
> +  int shift;                   /* interval duration (s) (shift) (ro)
> */
> +  int :32;                     /* pad */
> +  long long stabil;            /* pps stability (scaled ppm) (ro) */
> +  long long jitcnt;            /* jitter limit exceeded (ro) */
> +  long long calcnt;            /* calibration intervals (ro) */
> +  long long errcnt;            /* calibration errors (ro) */
> +  long long stbcnt;            /* stability limit exceeded (ro) */
> +
> +  int tai;                     /* TAI offset (ro) */
> +
> +  int  :32; int  :32; int  :32; int  :32;
> +  int  :32; int  :32; int  :32; int  :32;
> +  int  :32; int  :32; int  :32;
> +# else
>    unsigned int modes;		/* mode selector */
>    __syscall_slong_t offset;	/* time offset (usec) */
>    __syscall_slong_t freq;	/* frequency offset (scaled ppm) */
> @@ -51,6 +81,7 @@ struct timex
>    int  :32; int  :32; int  :32; int  :32;
>    int  :32; int  :32; int  :32; int  :32;
>    int  :32; int  :32; int  :32;
> +# endif
>  };
>  
>  /* Mode codes (timex.mode) */

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 15/25] y2038: Use a common definition for semid_ds
  2021-05-18 20:56 ` [PATCH v2 15/25] y2038: Use a common definition for semid_ds Adhemerval Zanella
@ 2021-05-19  9:09   ` Lukasz Majewski
  2021-06-04 19:38   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:09 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 10452 bytes --]

On Tue, 18 May 2021 17:56:03 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> Instead of replicate the same definitions from struct_semid64_ds.h
> on the multiple struct_semid_ds.h, use a common header which is
> included when required (struct_semid64_ds_helper.h).
> 
> The __USE_TIME_BITS64 is not defined internally yet, although the
> internal header is used when building the 64-bit semctl
> implementation.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  sysdeps/unix/sysv/linux/Makefile              |  3 ++-
>  .../sysv/linux/bits/types/struct_semid64_ds.h |  5 +---
>  .../bits/types/struct_semid64_ds_helper.h     | 23
> +++++++++++++++++++ .../sysv/linux/bits/types/struct_semid_ds.h   |
> 10 +++++--- .../linux/hppa/bits/types/struct_semid_ds.h   |  4 ++++
>  .../linux/mips/bits/types/struct_semid_ds.h   |  4 ++++
>  .../powerpc/bits/types/struct_semid_ds.h      | 10 +++++---
>  .../linux/sparc/bits/types/struct_semid_ds.h  | 10 +++++---
>  .../linux/x86/bits/types/struct_semid_ds.h    |  4 ++++
>  9 files changed, 59 insertions(+), 14 deletions(-)
>  create mode 100644
> sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
> 
> diff --git a/sysdeps/unix/sysv/linux/Makefile
> b/sysdeps/unix/sysv/linux/Makefile index 193b7c46b9..b599c423ed 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -102,7 +102,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
>  		  bits/ipc-perm.h \
>  		  bits/struct_stat.h \
>  		  bits/struct_stat_time64_helper.h \
> -		  bits/types/struct_msqid64_ds_helper.h
> +		  bits/types/struct_msqid64_ds_helper.h \
> +		  bits/types/struct_semid64_ds_helper.h
>  
>  tests += tst-clone tst-clone2 tst-clone3 tst-fanotify
> tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max
> tst-ttyname \ diff --git
> a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
> b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h index
> 7263e50bbf..adaee3eb9e 100644 ---
> a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h +++
> b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h @@ -25,9
> +25,6 @@ #else struct __semid64_ds
>  {
> -  struct ipc_perm sem_perm;		/* operation permission
> struct */
> -  __time64_t sem_otime;			/* last semop() time
> */
> -  __time64_t sem_ctime;			/* last time changed
> by semctl() */
> -  __syscall_ulong_t sem_nsems;		/* number of
> semaphores in set */ +# include
> <bits/types/struct_semid64_ds_helper.h> };
>  #endif
> diff --git
> a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
> b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h new
> file mode 100644 index 0000000000..ea60b671f1 --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
> @@ -0,0 +1,23 @@
> +/* Common definitions for struct semid_ds with 64 bit time.
> +   Copyright (C) 2020-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +  /* Content of internal __semid64_ds.  */
> +  struct ipc_perm sem_perm;		/* operation permission
> struct */
> +  __time64_t sem_otime;			/* last semop() time
> */
> +  __time64_t sem_ctime;			/* last time changed
> by semctl() */
> +  __syscall_ulong_t sem_nsems;		/* number of
> semaphores in set */ diff --git
> a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h
> b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h index
> 2f32fa500e..a7b2c9022e 100644 ---
> a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h +++
> b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h @@ -23,17
> +23,21 @@ /* Data structure describing a set of semaphores.  */
> struct semid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>
> +#else
>    struct ipc_perm sem_perm;        /* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    __time_t sem_otime;              /* last semop() time */
>    __syscall_ulong_t __sem_otime_high;
>    __time_t sem_ctime;             /* last time changed by semctl() */
>    __syscall_ulong_t __sem_ctime_high;
> -#else
> +# else
>    __time_t sem_otime;
>    __time_t sem_ctime;
> -#endif
> +# endif
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> diff --git
> a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h
> b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h index
> 16a9735e7b..5067fb1572 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h +++
> b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h @@ -23,6
> +23,9 @@ /* Data structure describing a set of semaphores.  */ struct
> semid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>
> +#else
>    struct ipc_perm sem_perm;   /* operation permission struct */
>    __syscall_ulong_t __sem_otime_high;
>    __time_t sem_otime;         /* last semop() time */
> @@ -31,4 +34,5 @@ struct semid_ds
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> diff --git
> a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h
> b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h index
> 73587ea634..ee9a1e5e61 100644 ---
> a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h +++
> b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h @@ -23,10
> +23,14 @@ /* Data structure describing a set of semaphores.  */
> struct semid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>
> +#else
>    struct ipc_perm sem_perm;		/* operation permission
> struct */ __time_t sem_otime;	/* last semop() time */
>    __time_t sem_ctime;	/* last time changed by semctl() */
>    __syscall_ulong_t sem_nsems;		/* number of
> semaphores in set */ __syscall_ulong_t __sem_otime_high;
>    __syscall_ulong_t __sem_ctime_high;
> +#endif
>  };
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h
> b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h index
> 8fdbc5d776..0c080fed61 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h +++
> b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h @@
> -23,17 +23,21 @@ /* Data structure describing a set of semaphores.
> */ struct semid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>
> +#else
>    struct ipc_perm sem_perm;   /* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    __syscall_ulong_t __sem_otime_high;
>    __time_t sem_otime;         /* last semop() time */
>    __syscall_ulong_t __sem_ctime_high;
>    __time_t sem_ctime;        /* last time changed by semctl() */
> -#else
> +# else
>    __time_t sem_otime;         /* last semop() time */
>    __time_t sem_ctime;         /* last time changed by semctl() */
> -#endif
> +# endif
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> diff --git
> a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h
> b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h index
> 6b9b3639b2..76810427f6 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h +++
> b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h @@
> -23,17 +23,21 @@ /* Data structure describing a set of semaphores.
> */ struct semid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>
> +#else
>    struct ipc_perm sem_perm;   /* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    __syscall_ulong_t __sem_otime_high;
>    __time_t sem_otime;         /* last semop() time */
>    __syscall_ulong_t __sem_ctime_high;
>    __time_t sem_ctime;        /* last time changed by semctl() */
> -#else
> +# else
>    __time_t sem_otime;         /* last semop() time */
>    __time_t sem_ctime;         /* last time changed by semctl() */
> -#endif
> +# endif
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h
> b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h index
> 90f03b2407..affd38b6bd 100644 ---
> a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h +++
> b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h @@ -23,6
> +23,9 @@ /* Data structure describing a set of semaphores.  */
>  struct semid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>
> +#else
>    struct ipc_perm sem_perm;   /* operation permission struct */
>    __time_t sem_otime;  /* last semop() time */
>    __syscall_ulong_t __sem_otime_high;
> @@ -31,4 +34,5 @@ struct semid_ds
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 16/25] y2038: Use a common definition for shmid_ds
  2021-05-18 20:56 ` [PATCH v2 16/25] y2038: Use a common definition for shmid_ds Adhemerval Zanella
@ 2021-05-19  9:09   ` Lukasz Majewski
  2021-06-04 19:38   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:09 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 12218 bytes --]

On Tue, 18 May 2021 17:56:04 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> Instead of replicate the same definitions from struct_shmid64_ds.h
> on the multiple struct_shmid_ds.h, use a common header which is
> included when required (struct_shmid64_ds_helper.h).
> 
> The __USE_TIME_BITS64 is not defined internally yet, although the
> internal header is used when building the 64-bit semctl
> implementation. ---

Reviewed-by: Lukasz Majewski <lukma@denx.de>

>  sysdeps/unix/sysv/linux/Makefile              |  3 ++-
>  .../sysv/linux/bits/types/struct_shmid64_ds.h |  9 +------
>  .../bits/types/struct_shmid64_ds_helper.h     | 26
> +++++++++++++++++++ .../sysv/linux/bits/types/struct_shmid_ds.h   |
> 10 ++++--- .../linux/hppa/bits/types/struct_shmid_ds.h   | 10 ++++---
>  .../linux/mips/bits/types/struct_shmid_ds.h   | 14 ++++++----
>  .../powerpc/bits/types/struct_shmid_ds.h      | 10 ++++---
>  .../linux/sparc/bits/types/struct_shmid_ds.h  | 10 ++++---
>  8 files changed, 66 insertions(+), 26 deletions(-)
>  create mode 100644
> sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
> 
> diff --git a/sysdeps/unix/sysv/linux/Makefile
> b/sysdeps/unix/sysv/linux/Makefile index b599c423ed..747d1083e0 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -103,7 +103,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
>  		  bits/struct_stat.h \
>  		  bits/struct_stat_time64_helper.h \
>  		  bits/types/struct_msqid64_ds_helper.h \
> -		  bits/types/struct_semid64_ds_helper.h
> +		  bits/types/struct_semid64_ds_helper.h \
> +		  bits/types/struct_shmid64_ds_helper.h
>  
>  tests += tst-clone tst-clone2 tst-clone3 tst-fanotify
> tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max
> tst-ttyname \ diff --git
> a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h
> b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h index
> 71100db1b5..a4af8cc5f4 100644 ---
> a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h +++
> b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h @@ -25,13
> +25,6 @@ #else struct __shmid64_ds
>  {
> -  struct ipc_perm shm_perm;	/* operation permission struct */
> -  size_t shm_segsz;		/* size of segment in bytes */
> -  __time64_t shm_atime;		/* time of last shmat() */
> -  __time64_t shm_dtime;		/* time of last shmdt() */
> -  __time64_t shm_ctime;		/* time of last change by
> shmctl() */
> -  __pid_t shm_cpid;		/* pid of creator */
> -  __pid_t shm_lpid;		/* pid of last shmop */
> -  shmatt_t shm_nattch;		/* number of current attaches
> */ +# include <bits/types/struct_shmid64_ds_helper.h>
>  };
>  #endif
> diff --git
> a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
> b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h new
> file mode 100644 index 0000000000..8ab0937c4d --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
> @@ -0,0 +1,26 @@
> +/* Common definitions for struct semid_ds with 64 bit time.
> +   Copyright (C) 2020-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +  struct ipc_perm shm_perm;	/* operation permission struct */
> +  size_t shm_segsz;		/* size of segment in bytes */
> +  __time64_t shm_atime;		/* time of last shmat() */
> +  __time64_t shm_dtime;		/* time of last shmdt() */
> +  __time64_t shm_ctime;		/* time of last change by
> shmctl() */
> +  __pid_t shm_cpid;		/* pid of creator */
> +  __pid_t shm_lpid;		/* pid of last shmop */
> +  shmatt_t shm_nattch;		/* number of current attaches
> */ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h
> b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h index
> 2bd587d2b0..5f8ac6257b 100644 ---
> a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h +++
> b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h @@ -23,23
> +23,27 @@ /* Data structure describing a shared memory segment.  */
>  struct shmid_ds
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>
> +#else
>      struct ipc_perm shm_perm;		/* operation permission
> struct */ size_t shm_segsz;			/* size of segment
> in bytes */ -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      __time_t shm_atime;			/* time of last
> shmat() */ unsigned long int __shm_atime_high;
>      __time_t shm_dtime;			/* time of last
> shmdt() */ unsigned long int __shm_dtime_high;
>      __time_t shm_ctime;			/* time of last
> change by shmctl() */ unsigned long int __shm_ctime_high;
> -#else
> +# else
>      __time_t shm_atime;			/* time of last
> shmat() */ __time_t shm_dtime;			/* time of last
> shmdt() */ __time_t shm_ctime;			/* time of last
> change by shmctl() */ -#endif
> +# endif
>      __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current
> attaches */ __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +#endif
>    };
> diff --git
> a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h
> b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h index
> 47ff80ebb0..7831fd7340 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h +++
> b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h @@ -23,8
> +23,11 @@ /* Data structure describing a shared memory segment.  */
> struct shmid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>
> +#else
>      struct ipc_perm shm_perm;		/* operation permission
> struct */ -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      unsigned long int __shm_atime_high;
>      __time_t shm_atime;			/* time of last
> shmat() */ unsigned long int __shm_dtime_high;
> @@ -32,15 +35,16 @@ struct shmid_ds
>      unsigned long int __shm_ctime_high;
>      __time_t shm_ctime;			/* time of last
> change by shmctl() */ unsigned long int __glibc_reserved4;
> -#else
> +# else
>      __time_t shm_atime;			/* time of last
> shmat() */ __time_t shm_dtime;			/* time of last
> shmdt() */ __time_t shm_ctime;			/* time of last
> change by shmctl() */ -#endif
> +# endif
>      size_t shm_segsz;			/* size of segment in
> bytes */ __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current
> attaches */ __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +#endif
>    };
> diff --git
> a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h
> b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h index
> 7f8f3b9c51..0691a610ae 100644 ---
> a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h +++
> b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h @@ -23,27
> +23,31 @@ /* Data structure describing a shared memory segment.  */
> struct shmid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>
> +#else
>      struct ipc_perm shm_perm;		/* operation permission
> struct */ size_t shm_segsz;			/* size of segment
> in bytes */ -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      __time_t shm_atime;			/* time of last
> shmat() */ __time_t shm_dtime;			/* time of last
> shmdt() */ __time_t shm_ctime;			/* time of last
> change by shmctl() */ -#else
> +# else
>      __time_t shm_atime;			/* time of last
> shmat() */ __time_t shm_dtime;			/* time of last
> shmdt() */ __time_t shm_ctime;			/* time of last
> change by shmctl() */ -#endif
> +# endif
>      __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current
> attaches */ -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      unsigned short int __shm_atime_high;
>      unsigned short int __shm_dtime_high;
>      unsigned short int __shm_ctime_high;
>      unsigned short int __glibc_reserved4;
> -#else
> +# else
>      __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +# endif
>  #endif
>    };
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h
> b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h index
> d71bdf1ecf..316d43ec99 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h +++
> b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h @@
> -23,8 +23,11 @@ /* Data structure describing a shared memory segment.
>  */ struct shmid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>
> +#else
>      struct ipc_perm shm_perm;		/* operation permission
> struct */ -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      unsigned long int __shm_atime_high;
>      __time_t shm_atime;			/* time of last
> shmat() */ unsigned long int __shm_dtime_high;
> @@ -32,15 +35,16 @@ struct shmid_ds
>      unsigned long int __shm_ctime_high;
>      __time_t shm_ctime;			/* time of last
> change by shmctl() */ unsigned long int __glibc_reserved4;
> -#else
> +# else
>      __time_t shm_atime;			/* time of last
> shmat() */ __time_t shm_dtime;			/* time of last
> shmdt() */ __time_t shm_ctime;			/* time of last
> change by shmctl() */ -#endif
> +# endif
>      size_t shm_segsz;			/* size of segment in
> bytes */ __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current
> attaches */ __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +#endif
>    };
> diff --git
> a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h
> b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h index
> 767099803f..86f0cedac3 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h +++
> b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h @@
> -23,23 +23,27 @@ /* Data structure describing a shared memory
> segment.  */ struct shmid_ds {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>
> +#else
>      struct ipc_perm shm_perm;		/* operation permission
> struct */ -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      unsigned long int __shm_atime_high;
>      __time_t shm_atime;			/* time of last
> shmat() */ unsigned long int __shm_dtime_high;
>      __time_t shm_dtime;			/* time of last
> shmdt() */ unsigned long int __shm_ctime_high;
>      __time_t shm_ctime;			/* time of last
> change by shmctl() */ -#else
> +# else
>      __time_t shm_atime;			/* time of last
> shmat() */ __time_t shm_dtime;			/* time of last
> shmdt() */ __time_t shm_ctime;			/* time of last
> change by shmctl() */ -#endif
> +# endif
>      size_t shm_segsz;			/* size of segment in
> bytes */ __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current
> attaches */ __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +#endif
>    };



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 17/25] y2038: Add __USE_TIME_BITS64 support for socket-constants.h
  2021-05-18 20:56 ` [PATCH v2 17/25] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Adhemerval Zanella
@ 2021-05-19  9:13   ` Lukasz Majewski
  2021-06-04 19:38   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:13 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 9803 bytes --]

On Tue, 18 May 2021 17:56:05 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> It is only used for !__USE_MISC, the default way uses the kernel
> headers.  The patch also adds the SO_TIMESTAMP, SO_TIMESTAMPNS, and
> SO_TIMESTAMPING which uses new values for 64 bit time_t kernel
> interfaces.
> 
> The __USE_TIME_BITS64 is not defined internally yet, although the
> internal header is used when building the 64-bit stat implementations.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  .../unix/sysv/linux/bits/socket-constants.h   | 47
> +++++++++++++++---- .../sysv/linux/hppa/bits/socket-constants.h   |
> 36 +++++++++++++- .../sysv/linux/mips/bits/socket-constants.h   | 36
> +++++++++++++- .../linux/powerpc/bits/socket-constants.h     | 36
> +++++++++++++- .../sysv/linux/sparc/bits/socket-constants.h  | 36
> +++++++++++++- 5 files changed, 175 insertions(+), 16 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/bits/socket-constants.h
> b/sysdeps/unix/sysv/linux/bits/socket-constants.h index
> 84f7a333a2..c52e72bb73 100644 ---
> a/sysdeps/unix/sysv/linux/bits/socket-constants.h +++
> b/sysdeps/unix/sysv/linux/bits/socket-constants.h @@ -32,19 +32,50 @@
>  #define SO_OOBINLINE 10
>  #define SO_RCVBUF 8
>  #define SO_RCVLOWAT 18
> -#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
> -     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
> -# define SO_RCVTIMEO 66
> -#else
> -# define SO_RCVTIMEO 20
> -#endif
>  #define SO_REUSEADDR 2
>  #define SO_SNDBUF 7
>  #define SO_SNDLOWAT 19
> +#define SO_TYPE 3
> +
>  #if (__TIMESIZE == 64 && __WORDSIZE == 32 \
>       && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
> +# define SO_RCVTIMEO 66
>  # define SO_SNDTIMEO 67
> +# define SO_TIMESTAMP 63
> +# define SO_TIMESTAMPNS 64
> +# define SO_TIMESTAMPING 65
>  #else
> -# define SO_SNDTIMEO 21
> +# if __TIMESIZE == 64
> +#  define SO_RCVTIMEO 20
> +#  define SO_SNDTIMEO 21
> +#  define SO_TIMESTAMP 29
> +#  define SO_TIMESTAMPNS 35
> +#  define SO_TIMESTAMPING 37
> +# else
> +#  define SO_RCVTIMEO_OLD 20
> +#  define SO_SNDTIMEO_OLD 21
> +#  define SO_RCVTIMEO_NEW 66
> +#  define SO_SNDTIMEO_NEW 67
> +
> +#  define SO_TIMESTAMP_OLD 29
> +#  define SO_TIMESTAMPNS_OLD 35
> +#  define SO_TIMESTAMPING_OLD 37
> +#  define SO_TIMESTAMP_NEW 63
> +#  define SO_TIMESTAMPNS_NEW 64
> +#  define SO_TIMESTAMPING_NEW 65
> +
> +#  ifdef __USE_TIME_BITS64
> +#   define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#   define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#   define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#   define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#   define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +#  else
> +#   define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#   define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#   define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#   define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#   define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +#  endif
> +# endif
>  #endif
> -#define SO_TYPE 3
> diff --git a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h
> b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h index
> b4fb65b9f1..68b42d4606 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h +++
> b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h @@ -30,9
> +30,41 @@ #define SO_OOBINLINE 256
>  #define SO_RCVBUF 4098
>  #define SO_RCVLOWAT 4100
> -#define SO_RCVTIMEO 4102
>  #define SO_REUSEADDR 4
>  #define SO_SNDBUF 4097
>  #define SO_SNDLOWAT 4099
> -#define SO_SNDTIMEO 4101
>  #define SO_TYPE 4104
> +
> +#if __TIMESIZE == 64
> +# define SO_RCVTIMEO 4102
> +# define SO_SNDTIMEO 4101
> +# define SO_TIMESTAMP 16402
> +# define SO_TIMESTAMPNS 16403
> +# define SO_TIMESTAMPING 16416
> +#else
> +# define SO_RCVTIMEO_OLD 4102
> +# define SO_SNDTIMEO_OLD 4101
> +# define SO_RCVTIMEO_NEW 16448
> +# define SO_SNDTIMEO_NEW 16449
> +
> +# define SO_TIMESTAMP_OLD 0x4012
> +# define SO_TIMESTAMPNS_OLD 0x4013
> +# define SO_TIMESTAMPING_OLD 0x4020
> +# define SO_TIMESTAMP_NEW 0x4038
> +# define SO_TIMESTAMPNS_NEW 0x4039
> +# define SO_TIMESTAMPING_NEW 0x403A
> +
> +# ifdef __USE_TIME_BITS64
> +#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +# else
> +#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +# endif
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h
> b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h index
> a5264536e9..b18a854e99 100644 ---
> a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h +++
> b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h @@ -30,9
> +30,41 @@ #define SO_OOBINLINE 256
>  #define SO_RCVBUF 4098
>  #define SO_RCVLOWAT 4100
> -#define SO_RCVTIMEO 4102
>  #define SO_REUSEADDR 4
>  #define SO_SNDBUF 4097
>  #define SO_SNDLOWAT 4099
> -#define SO_SNDTIMEO 4101
>  #define SO_TYPE 4104
> +
> +#if __TIMESIZE == 64
> +# define SO_RCVTIMEO 4102
> +# define SO_SNDTIMEO 4101
> +# define SO_TIMESTAMP 29
> +# define SO_TIMESTAMPNS 35
> +# define SO_TIMESTAMPING 37
> +#else
> +# define SO_RCVTIMEO_OLD 4102
> +# define SO_SNDTIMEO_OLD 4101
> +# define SO_RCVTIMEO_NEW 66
> +# define SO_SNDTIMEO_NEW 67
> +
> +# define SO_TIMESTAMP_OLD 29
> +# define SO_TIMESTAMPNS_OLD 35
> +# define SO_TIMESTAMPING_OLD 37
> +# define SO_TIMESTAMP_NEW 63
> +# define SO_TIMESTAMPNS_NEW 64
> +# define SO_TIMESTAMPING_NEW 65
> +
> +# ifdef __USE_TIME_BITS64
> +#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +# else
> +#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +# endif
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h
> b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h index
> f35488b375..c03141bb8c 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h +++
> b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h @@ -30,9
> +30,41 @@ #define SO_OOBINLINE 10
>  #define SO_RCVBUF 8
>  #define SO_RCVLOWAT 16
> -#define SO_RCVTIMEO 18
>  #define SO_REUSEADDR 2
>  #define SO_SNDBUF 7
>  #define SO_SNDLOWAT 17
> -#define SO_SNDTIMEO 19
>  #define SO_TYPE 3
> +
> +#if __TIMESIZE == 64
> +# define SO_RCVTIMEO 18
> +# define SO_SNDTIMEO 19
> +# define SO_TIMESTAMP 29
> +# define SO_TIMESTAMPNS 35
> +# define SO_TIMESTAMPING 37
> +#else
> +# define SO_RCVTIMEO_OLD 18
> +# define SO_SNDTIMEO_OLD 19
> +# define SO_RCVTIMEO_NEW 66
> +# define SO_SNDTIMEO_NEW 67
> +
> +# define SO_TIMESTAMP_OLD 29
> +# define SO_TIMESTAMPNS_OLD 35
> +# define SO_TIMESTAMPING_OLD 37
> +# define SO_TIMESTAMP_NEW 63
> +# define SO_TIMESTAMPNS_NEW 64
> +# define SO_TIMESTAMPING_NEW 65
> +
> +# ifdef __USE_TIME_BITS64
> +#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +# else
> +#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +# endif
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
> b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h index
> a58d0b5f96..5c4ed76c8c 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h +++
> b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h @@ -30,9
> +30,41 @@ #define SO_OOBINLINE 256
>  #define SO_RCVBUF 4098
>  #define SO_RCVLOWAT 2048
> -#define SO_RCVTIMEO 8192
>  #define SO_REUSEADDR 4
>  #define SO_SNDBUF 4097
>  #define SO_SNDLOWAT 4096
> -#define SO_SNDTIMEO 16384
>  #define SO_TYPE 4104
> +
> +#if __TIMESIZE == 64
> +# define SO_RCVTIMEO 8192
> +# define SO_SNDTIMEO 16384
> +# define SO_TIMESTAMP 29
> +# define SO_TIMESTAMPNS 33
> +# define SO_TIMESTAMPING 35
> +#else
> +# define SO_RCVTIMEO_OLD 8192
> +# define SO_SNDTIMEO_OLD 16384
> +# define SO_RCVTIMEO_NEW 68
> +# define SO_SNDTIMEO_NEW 69
> +
> +# define SO_TIMESTAMP_OLD 0x001d
> +# define SO_TIMESTAMPNS_OLD 0x0021
> +# define SO_TIMESTAMPING_OLD 0x0023
> +# define SO_TIMESTAMP_NEW 0x0046
> +# define SO_TIMESTAMPNS_NEW 0x0042
> +# define SO_TIMESTAMPING_NEW 0x0043
> +
> +# ifdef __USE_TIME_BITS64
> +#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +# else
> +#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +# endif
> +#endif



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 18/25] time: Add 64 bit time support for getdate
  2021-05-18 20:56 ` [PATCH v2 18/25] time: Add 64 bit time support for getdate Adhemerval Zanella
@ 2021-05-19  9:15   ` Lukasz Majewski
  2021-06-04 19:38   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:15 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 5778 bytes --]

On Tue, 18 May 2021 17:56:06 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The getdate is basically a wrapper localtime and mktime.  The 64 bit
> time support is done calling the 64 bit internal functions, there is
> no need to add a new symbol version.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  include/sys/stat.h |  2 +-
>  include/time.h     | 12 ++++++++++--
>  time/getdate.c     | 22 ++++++++++------------
>  time/tst-getdate.c | 14 ++++----------
>  4 files changed, 25 insertions(+), 25 deletions(-)
> 
> diff --git a/include/sys/stat.h b/include/sys/stat.h
> index b4c9344628..13e777b3c7 100644
> --- a/include/sys/stat.h
> +++ b/include/sys/stat.h
> @@ -46,7 +46,7 @@ hidden_proto (__lstat64)
>  hidden_proto (__fstatat64)
>  # endif
>  
> -# if __TIMESIZE == 64
> +# if __TIMESIZE == 64 || defined NO_RTLD_HIDDEN
>  #  define __stat64_time64  __stat64
>  #  define __fstat64_time64  __fstat64
>  #  define __lstat64_time64  __lstat64
> diff --git a/include/time.h b/include/time.h
> index 4372bfbd96..980c6bd924 100644
> --- a/include/time.h
> +++ b/include/time.h
> @@ -283,8 +283,8 @@ hidden_proto (__nanosleep64)
>  #endif
>  
>  
> -extern int __getdate_r (const char *__string, struct tm *__resbufp)
> -  attribute_hidden;
> +extern int __getdate_r (const char *__string, struct tm *__resbufp);
> +libc_hidden_proto (__getdate_r);
>  
>  
>  /* Determine CLK_TCK value.  */
> @@ -509,6 +509,14 @@ time_now (void)
>    return ts.tv_sec;
>  }
>  
> +static inline __time64_t
> +time64_now (void)
> +{
> +  struct __timespec64 ts;
> +  __clock_gettime64 (TIME_CLOCK_GETTIME_CLOCKID, &ts);
> +  return ts.tv_sec;
> +}
> +
>  #define NSEC_PER_SEC    1000000000L  /* Nanoseconds per second.  */
>  #define USEC_PER_SEC    1000000L     /* Microseconds per second.  */
>  #define NSEC_PER_USEC   1000L        /* Nanoseconds per microsecond.
>  */ diff --git a/time/getdate.c b/time/getdate.c
> index 6e2f75566b..cdcc898517 100644
> --- a/time/getdate.c
> +++ b/time/getdate.c
> @@ -112,16 +112,16 @@ __getdate_r (const char *string, struct tm *tp)
>    size_t len;
>    char *datemsk;
>    char *result = NULL;
> -  time_t timer;
> +  __time64_t timer;
>    struct tm tm;
> -  struct stat64 st;
> -  int mday_ok = 0;
> +  struct __stat64_t64 st;
> +  bool mday_ok = false;
>  
>    datemsk = getenv ("DATEMSK");
>    if (datemsk == NULL || *datemsk == '\0')
>      return 1;
>  
> -  if (__stat64 (datemsk, &st) < 0)
> +  if (__stat64_time64 (datemsk, &st) < 0)
>      return 3;
>  
>    if (!S_ISREG (st.st_mode))
> @@ -219,8 +219,8 @@ __getdate_r (const char *string, struct tm *tp)
>      return 7;
>  
>    /* Get current time.  */
> -  timer = time_now ();
> -  __localtime_r (&timer, &tm);
> +  timer = time64_now ();
> +  __localtime64_r (&timer, &tm);
>  
>    /* If only the weekday is given, today is assumed if the given day
>       is equal to the current day and next week if it is less.  */
> @@ -230,7 +230,7 @@ __getdate_r (const char *string, struct tm *tp)
>        tp->tm_year = tm.tm_year;
>        tp->tm_mon = tm.tm_mon;
>        tp->tm_mday = tm.tm_mday + (tp->tm_wday - tm.tm_wday + 7) % 7;
> -      mday_ok = 1;
> +      mday_ok = true;
>      }
>  
>    /* If only the month is given, the current month is assumed if the
> @@ -242,7 +242,7 @@ __getdate_r (const char *string, struct tm *tp)
>        if (tp->tm_year == INT_MIN)
>  	tp->tm_year = tm.tm_year + (((tp->tm_mon - tm.tm_mon) < 0) ?
> 1 : 0); tp->tm_mday = first_wday (tp->tm_year, tp->tm_mon,
> tp->tm_wday);
> -      mday_ok = 1;
> +      mday_ok = true;
>      }
>  
>    /* If no hour, minute and second are given the current hour, minute
> @@ -285,15 +285,13 @@ __getdate_r (const char *string, struct tm *tp)
>       call normalizes the struct tm.  */
>    if ((!mday_ok && !check_mday (TM_YEAR_BASE + tp->tm_year,
> tp->tm_mon, tp->tm_mday))
> -      || mktime (tp) == (time_t) -1)
> +      || __mktime64 (tp) == (time_t) -1)
>      return 8;
>  
>    return 0;
>  }
> -#ifdef weak_alias
>  weak_alias (__getdate_r, getdate_r)
> -#endif
> -
> +libc_hidden_def (__getdate_r)
>  
>  struct tm *
>  getdate (const char *string)
> diff --git a/time/tst-getdate.c b/time/tst-getdate.c
> index c37ba3083a..3bb0e96707 100644
> --- a/time/tst-getdate.c
> +++ b/time/tst-getdate.c
> @@ -115,20 +115,14 @@ do_test (void)
>      {
>        setenv ("TZ", tests[i].tz, 1);
>  
> -      int expected_err;
> -      if (sizeof (time_t) == 4 && tests[i].time64)
> -	expected_err = 8;
> -      else
> -	expected_err = 0;
> -
>        tm = getdate (tests[i].str);
> -      TEST_COMPARE (getdate_err, expected_err);
> -      if (getdate_err != expected_err)
> +      TEST_COMPARE (getdate_err, 0);
> +      if (getdate_err != 0)
>  	{
>  	  support_record_failure ();
>  	  printf ("%s\n", report_date_error ());
>  	}
> -      else if (getdate_err == 0)
> +      else
>  	{
>  	  TEST_COMPARE (tests[i].tm.tm_mon, tm->tm_mon);
>  	  TEST_COMPARE (tests[i].tm.tm_year, tm->tm_year);
> @@ -139,7 +133,7 @@ do_test (void)
>  	}
>  
>        struct tm tms;
> -      TEST_COMPARE (getdate_r (tests[i].str, &tms), expected_err);
> +      TEST_COMPARE (getdate_r (tests[i].str, &tms), 0);
>        if (getdate_err == 0)
>  	{
>  	  TEST_COMPARE (tests[i].tm.tm_mon, tms.tm_mon);



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs
  2021-05-18 20:56 ` [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella
@ 2021-05-19  9:18   ` Lukasz Majewski
  2021-05-20  6:58   ` Florian Weimer
  2021-06-04 19:38   ` Carlos O'Donell
  2 siblings, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19  9:18 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 173003 bytes --]

On Tue, 18 May 2021 17:56:07 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> A new build flag, _TIME_BITS, enables the usage of the newer 64 bit
> time symbols for legacy ABI (where 32 bit time_t is default).  The 64
> bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is
> also used.
> 
> Different than LFS support, the y2038 symbols are added only for the
> required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32,
> mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh).  The ABIs
> with 64 bit time support are unchanged, both for symbol and types
> redirection.
> 
> On Linux the full 64 bit time support requires a minimum of kernel
> version v5.1.  Otherwise, the 32 bit fallbacks are used and might
> results in error with overflow return code (EOVERFLOW).
> 
> The i686-gnu does not yet support 64 bit time.
> 
> This patch exports following rediretions to support 64 bit time:
> 
>   * libc:
>     adjtime;
>     adjtimex;
>     clock_adjtime;
>     clock_getres;
>     clock_gettime;
>     clock_nanosleep;
>     clock_settime;
>     cnd_timedwait;
>     ctime;
>     ctime_r;
>     difftime;
>     fstat;
>     fstatat;
>     futimens;
>     futimes;
>     futimesat;
>     getitimer;
>     getrusage;
>     gettimeofday;
>     gmtime;
>     gmtime_r;
>     localtime;
>     localtime_r;
>     lstat_time;
>     lutimes;
>     mktime;
>     msgctl;
>     mtx_timedlock;
>     nanosleep;
>     nanosleep;
>     ntp_gettime;
>     ntp_gettimex;
>     ppoll;
>     pselec;
>     pselect;
>     pthread_clockjoin_np;
>     pthread_cond_clockwait;
>     pthread_cond_timedwait;
>     pthread_mutex_clocklock;
>     pthread_mutex_timedlock;
>     pthread_rwlock_clockrdlock;
>     pthread_rwlock_clockwrlock;
>     pthread_rwlock_timedrdlock;
>     pthread_rwlock_timedwrlock;
>     pthread_timedjoin_np;
>     recvmmsg;
>     sched_rr_get_interval;
>     select;
>     sem_clockwait;
>     semctl;
>     semtimedop;
>     sem_timedwait;
>     setitimer;
>     settimeofday;
>     shmctl;
>     sigtimedwait;
>     stat_time;
>     thrd_sleep;
>     time;
>     timegm;
>     timerfd_gettime;
>     timerfd_settime;
>     timespec_get;
>     utime;
>     utimensat;
>     utimes;
>     utimes;
>     wait3;
>     wait4;
> 
>   * librt:
>     - aio_suspend
>     - mq_timedreceive
>     - mq_timedsend
>     - timer_gettime
>     - timer_settime
> 
>   * libanl:
>     - gai_suspend


Reviewed-by: Lukasz Majewski <lukma@denx.de>


> ---
>  Makefile                                      |   2 +-
>  NEWS                                          |   5 +
>  include/features-time64.h                     |   1 +
>  include/features.h                            |   2 +
>  io/sys/poll.h                                 |  11 ++
>  io/sys/stat.h                                 | 113 ++++++++++++--
>  io/utime.h                                    |  11 ++
>  manual/creature.texi                          |  44 ++++++
>  misc/sys/select.h                             |  27 ++++
>  nptl/pthread_clockjoin.c                      |   3 +-
>  nptl/pthread_cond_wait.c                      |   9 +-
>  nptl/pthread_mutex_timedlock.c                |   8 +-
>  nptl/pthread_rwlock_clockrdlock.c             |   4 +-
>  nptl/pthread_rwlock_clockwrlock.c             |   4 +-
>  nptl/pthread_rwlock_timedrdlock.c             |   4 +-
>  nptl/pthread_rwlock_timedwrlock.c             |   4 +-
>  nptl/pthread_timedjoin.c                      |   3 +-
>  nptl/sem_clockwait.c                          |   3 +-
>  nptl/sem_timedwait.c                          |   4 +-
>  posix/sched.h                                 |  11 +-
>  posix/sys/wait.h                              |  20 +++
>  resolv/netdb.h                                |  11 ++
>  resource/sys/resource.h                       |  10 ++
>  rt/aio.h                                      |  15 +-
>  rt/mqueue.h                                   |  22 +++
>  signal/signal.h                               |  13 ++
>  socket/sys/socket.h                           |  11 ++
>  sysdeps/generic/features-time64.h             |  19 +++
>  sysdeps/generic/time64-compat.h               |   3 +
>  sysdeps/nptl/pthread.h                        | 119 +++++++++++++++
>  sysdeps/pthread/semaphore.h                   |  25 ++++
>  sysdeps/pthread/threads.h                     |  33 +++++
>  sysdeps/unix/sysv/linux/Versions              |  97 ++++++++++++
>  sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  67 +++++++++
>  sysdeps/unix/sysv/linux/arm/be/librt.abilist  |   5 +
>  sysdeps/unix/sysv/linux/arm/le/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  67 +++++++++
>  sysdeps/unix/sysv/linux/arm/le/librt.abilist  |   5 +
>  sysdeps/unix/sysv/linux/arm/time64-compat.h   |   2 +
>  sysdeps/unix/sysv/linux/bits/msq.h            |   1 +
>  sysdeps/unix/sysv/linux/bits/sem.h            |   1 +
>  sysdeps/unix/sysv/linux/bits/shm.h            |   1 +
>  sysdeps/unix/sysv/linux/bits/time.h           |  10 ++
>  sysdeps/unix/sysv/linux/cnd_timedwait.c       |   8 +-
>  sysdeps/unix/sysv/linux/csky/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  67 +++++++++
>  sysdeps/unix/sysv/linux/csky/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/csky/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/features-time64.h     |  37 +++++
>  sysdeps/unix/sysv/linux/hppa/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  67 +++++++++
>  sysdeps/unix/sysv/linux/hppa/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/hppa/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/i386/Makefile         |   2 +
>  sysdeps/unix/sysv/linux/i386/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  67 +++++++++
>  sysdeps/unix/sysv/linux/i386/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/i386/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/include/sys/msg.h     |   2 -
>  sysdeps/unix/sysv/linux/include/sys/shm.h     |   2 -
>  sysdeps/unix/sysv/linux/include/sys/timex.h   |   2 +
>  .../sysv/linux/m68k/coldfire/libanl.abilist   |   1 +
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  67 +++++++++
>  .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
>  .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  67 +++++++++
>  .../unix/sysv/linux/m68k/m680x0/librt.abilist |   5 +
>  sysdeps/unix/sysv/linux/m68k/time64-compat.h  |   2 +
>  .../sysv/linux/microblaze/be/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/be/libc.abilist     |  67 +++++++++
>  .../sysv/linux/microblaze/be/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  67 +++++++++
>  .../sysv/linux/microblaze/le/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/time64-compat.h     |   2 +
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  67 +++++++++
>  .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
>  .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  67 +++++++++
>  .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
>  .../sysv/linux/mips/mips64/n32/libanl.abilist |   1 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  67 +++++++++
>  .../sysv/linux/mips/mips64/n32/librt.abilist  |   5 +
>  .../linux/mips/mips64/n32/time64-compat.h     |   2 +
>  sysdeps/unix/sysv/linux/mtx_timedlock.c       |   8 +-
>  sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  67 +++++++++
>  sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  67 +++++++++
>  .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
>  .../linux/powerpc/powerpc32/librt.abilist     |   5 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  67 +++++++++
>  .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
>  .../sysv/linux/s390/s390-32/libanl.abilist    |   1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  67 +++++++++
>  .../sysv/linux/s390/s390-32/librt.abilist     |   5 +
>  .../sysv/linux/s390/s390-32/time64-compat.h   |   2 +
>  sysdeps/unix/sysv/linux/semctl.c              |   1 -
>  sysdeps/unix/sysv/linux/sh/be/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  67 +++++++++
>  sysdeps/unix/sysv/linux/sh/be/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/sh/le/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  67 +++++++++
>  sysdeps/unix/sysv/linux/sh/le/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/sh/time64-compat.h    |   2 +
>  .../sysv/linux/sparc/sparc32/libanl.abilist   |   1 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  67 +++++++++
>  .../sysv/linux/sparc/sparc32/librt.abilist    |   5 +
>  .../sysv/linux/sparc/sparc32/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/sys/timerfd.h         |  22 +++
>  sysdeps/unix/sysv/linux/sys/timex.h           |  27 +++-
>  sysvipc/sys/msg.h                             |  10 ++
>  sysvipc/sys/sem.h                             |  21 +++
>  sysvipc/sys/shm.h                             |  10 ++
>  time/sys/time.h                               |  71 +++++++++
>  time/time.h                                   | 138
> +++++++++++++++++- 118 files changed, 2386 insertions(+), 60
> deletions(-) create mode 100644 include/features-time64.h
>  create mode 100644 sysdeps/generic/features-time64.h
>  create mode 100644 sysdeps/generic/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/arm/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/csky/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/features-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/hppa/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/i386/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/m68k/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/microblaze/time64-compat.h
>  create mode 100644
> sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h create mode
> 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h create
> mode 100644 sysdeps/unix/sysv/linux/nios2/time64-compat.h create mode
> 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
> create mode 100644
> sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h create mode
> 100644 sysdeps/unix/sysv/linux/sh/time64-compat.h create mode 100644
> sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
> 
> diff --git a/Makefile b/Makefile
> index 50f99ca611..6cc93efc27 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -68,7 +68,7 @@ endif # $(AUTOCONF) = no
>  		   subdir_objs subdir_stubs subdir_testclean
> 	\ $(addprefix install-, no-libc.a bin lib data headers others)
>  \f
> -headers := limits.h values.h features.h gnu-versions.h \
> +headers := limits.h values.h features.h features-time64.h
> gnu-versions.h \ bits/xopen_lim.h gnu/libc-version.h stdc-predef.h \
>  	   bits/libc-header-start.h
>  
> diff --git a/NEWS b/NEWS
> index 266837bf2d..3bb122ec3c 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -25,6 +25,11 @@ Major new features:
>  
>  * The ISO C2X function timespec_getres has been added.
>  
> +* Add support for 64 bit time_t for ABIs with defaults to 32 bit
> time_t.
> +  This is enabled with the _TIME_BITS preprocessor set to 64 and only
> +  supported when LFS (_FILE_OFFSET_BITS=64) is also enabled.  It is
> only
> +  enabled for Linux and the full support requires a minimum version
> of 5.1. +
>  Deprecated and removed features, and other changes affecting
> compatibility: 
>  * The function pthread_mutex_consistent_np has been deprecated;
> programs diff --git a/include/features-time64.h
> b/include/features-time64.h new file mode 100644
> index 0000000000..06115b7c86
> --- /dev/null
> +++ b/include/features-time64.h
> @@ -0,0 +1 @@
> +#include_next <features-time64.h>
> diff --git a/include/features.h b/include/features.h
> index eb97470afa..9d39e11345 100644
> --- a/include/features.h
> +++ b/include/features.h
> @@ -387,6 +387,8 @@
>  # define __USE_FILE_OFFSET64	1
>  #endif
>  
> +#include <features-time64.h>
> +
>  #if defined _DEFAULT_SOURCE
>  # define __USE_MISC	1
>  #endif
> diff --git a/io/sys/poll.h b/io/sys/poll.h
> index 08f29df540..e640efb2bc 100644
> --- a/io/sys/poll.h
> +++ b/io/sys/poll.h
> @@ -66,6 +66,17 @@ extern int ppoll (struct pollfd *__fds, nfds_t
> __nfds, const __sigset_t *__ss)
>      __attr_access ((__write_only__, 1, 2));
>  
> +# ifdef __USE_TIME_BITS64
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (ppoll, (struct pollfd *__fds, nfds_t __nfds,
> +                               const struct timespec *__timeout,
> +                               const __sigset_t *__ss),
> +                       __ppoll64)
> +    __attr_access ((__write_only__, 1, 2));
> +#  else
> +#  define ppoll __ppoll64
> +#  endif
> +# endif
>  #endif
>  
>  __END_DECLS
> diff --git a/io/sys/stat.h b/io/sys/stat.h
> index 549375c087..f7874ec5ba 100644
> --- a/io/sys/stat.h
> +++ b/io/sys/stat.h
> @@ -209,21 +209,51 @@ extern int stat (const char *__restrict __file,
>     that file descriptor FD is open on and put them in BUF.  */
>  extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull
> ((2)); #else
> -# ifdef __REDIRECT_NTH
> +# ifdef __USE_TIME_BITS64
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
> +				  struct stat *__restrict __buf),
> +				  __stat64_time64)
> +     __nonnull ((1, 2));
> +extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf),
> +				   __fstat64_time64)
> +     __nonnull ((2));
> +#  else
> +#   define stat __stat64_time64
> +#   define fstat __fstat64_time64
> +#  endif
> +# else
> +#  ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
>  				  struct stat *__restrict __buf),
> stat64) __nonnull ((1, 2));
>  extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf),
> fstat64) __nonnull ((2));
> -# else
> -#  define stat stat64
> -#  define fstat fstat64
> +#  else
> +#   define stat stat64
> +#   define fstat fstat64
> +#  endif
>  # endif
>  #endif
>  #ifdef __USE_LARGEFILE64
> +# ifndef __USE_TIME_BITS64
>  extern int stat64 (const char *__restrict __file,
>  		   struct stat64 *__restrict __buf) __THROW
> __nonnull ((1, 2)); extern int fstat64 (int __fd, struct stat64
> *__buf) __THROW __nonnull ((2)); +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (stat64, (const char *__restrict __file,
> +				    struct stat64 *__restrict __buf),
> +			   __stat64_time64)
> +     __nonnull ((1, 2));
> +extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf),
> +			   __fstat64_time64)
> +     __nonnull ((2));
> +#  else
> +#   define stat64 __stat64_time64
> +#   define fstat64 __fstat64_time
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_ATFILE
> @@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char
> *__restrict __file, struct stat *__restrict __buf, int __flag)
>       __THROW __nonnull ((2, 3));
>  # else
> -#  ifdef __REDIRECT_NTH
> +#  ifdef __USE_TIME_BITS64
> +#   ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (fstatat, (int __fd, const char
> *__restrict __file, struct stat *__restrict __buf,
>  				     int __flag),
> -			   fstatat64) __nonnull ((2, 3));
> +			   __fstatat64_time64) __nonnull ((2, 3));
> +#   else
> +#    define fstatat __fstatat64_time64
> +#   endif
>  #  else
> -#   define fstatat fstatat64
> +#   ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (fstatat, (int __fd, const char
> *__restrict __file,
> +				     struct stat *__restrict __buf,
> +				     int __flag),
> +			   fstatat64) __nonnull ((2, 3));
> +#   else
> +#    define fstatat fstatat64
> +#   endif
>  #  endif
>  # endif
>  
>  # ifdef __USE_LARGEFILE64
> +#  ifndef __USE_TIME_BITS64
>  extern int fstatat64 (int __fd, const char *__restrict __file,
>  		      struct stat64 *__restrict __buf, int __flag)
>       __THROW __nonnull ((2, 3));
> +#  else
> +#   ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (fstatat64, (int __fd,
> +				       const char *__restrict __file,
> +				       struct stat64 *__restrict
> __buf,
> +				       int __flag),
> +			   __fstatat64_time64)
> +     __nonnull ((2, 3));
> +#   else
> +#    define fstatat64 __fstatat64_time64
> +#   endif
> +#  endif
>  # endif
>  #endif
>  
> @@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char
> *__restrict __file, extern int lstat (const char *__restrict __file,
>  		  struct stat *__restrict __buf) __THROW __nonnull
> ((1, 2)); # else
> -#  ifdef __REDIRECT_NTH
> +#  ifdef __USE_TIME_BITS64
> +#   ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (lstat,
>  			   (const char *__restrict __file,
> -			    struct stat *__restrict __buf), lstat64)
> +			    struct stat *__restrict __buf),
> __lstat64_time64) __nonnull ((1, 2));
> +#   else
> +#    define lstat __lstat64_time64
> +#   endif
>  #  else
> -#   define lstat lstat64
> +#   ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (lstat,
> +			   (const char *__restrict __file,
> +			    struct stat *__restrict __buf), lstat64)
> +     __nonnull ((1, 2));
> +#   else
> +#    define lstat lstat64
> +#   endif
>  #  endif
>  # endif
>  # ifdef __USE_LARGEFILE64
> +#  ifndef __USE_TIME_BITS64
>  extern int lstat64 (const char *__restrict __file,
>  		    struct stat64 *__restrict __buf)
>       __THROW __nonnull ((1, 2));
> +#  else
> +extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file,
> +				     struct stat64 *__restrict
> __buf),
> +			   __lstat64_time64)
> +     __nonnull ((1, 2));
> +#  endif
>  # endif
>  #endif
>  
> @@ -355,17 +427,38 @@ extern int mkfifoat (int __fd, const char
> *__path, __mode_t __mode) #endif
>  \f
>  #ifdef __USE_ATFILE
> +# ifndef __USE_TIME_BITS64
>  /* Set file access and modification times relative to directory file
>     descriptor.  */
>  extern int utimensat (int __fd, const char *__path,
>  		      const struct timespec __times[2],
>  		      int __flags)
>       __THROW __nonnull ((2));
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path,
> +                                       const struct timespec
> __times[2],
> +                                       int flags),
> +                           __utimensat64) __nonnull ((2));
> +#  else
> +#   define utimensat __utimensat64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_XOPEN2K8
> +# ifndef __USE_TIME_BITS64
>  /* Set file access and modification times of the file associated
> with FD.  */ extern int futimens (int __fd, const struct timespec
> __times[2]) __THROW; +
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec
> __times[2]),
> +                           __futimens64);
> +#  else
> +#   define futimens __futimens64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_GNU
> diff --git a/io/utime.h b/io/utime.h
> index c7612d0838..1a645a3fff 100644
> --- a/io/utime.h
> +++ b/io/utime.h
> @@ -46,10 +46,21 @@ struct utimbuf
>  
>  /* Set the access and modification times of FILE to those given in
>     *FILE_TIMES.  If FILE_TIMES is NULL, set them to the current
> time.  */ +#ifndef __USE_TIME_BITS64
>  extern int utime (const char *__file,
>  		  const struct utimbuf *__file_times)
>       __THROW __nonnull ((1));
>  
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (utime, (const char *__file,
> +                                   const struct utimbuf
> *__file_times),
> +                           __utime64);
> +# else
> +#  define utime __utime64
> +# endif
> +#endif
> +
>  __END_DECLS
>  
>  #endif /* utime.h */
> diff --git a/manual/creature.texi b/manual/creature.texi
> index 5090735e4f..606b73d184 100644
> --- a/manual/creature.texi
> +++ b/manual/creature.texi
> @@ -165,6 +165,50 @@ This macro was introduced as part of the Large
> File Support extension (LFS).
>  @end defvr
>  
> +@defvr Macro _TIME_BITS
> +This macro determines the bit size of @code{time_t} (and therefore
> the +bit size of all @code{time_t} derived types and the prototypes
> of all +related functions).  If @code{_TIME_BITS} is undefined, the
> bit size of +@code{time_t} is architecture dependent.
> +
> +Possible values of @code{_TIME_BITS}:
> +@enumerate
> +@item
> +@code{_TIME_BITS=64} and port from the outset uses 64-bit
> +@code{time_t} and word size equals to @w{64 bits} (e.g. x86_64) - no
> +action
> +
> +@item
> +@code{_TIME_BITS=32} and port from the outset uses 32-bit
> +@code{time_t} and word size equals to @w{64 bits} (e.g. ARM) - no
> +action
> +
> +@item
> +@code{_TIME_BITS=64} and port from the outset uses 64-bit
> +@code{time_t} and word size equals to @w{32 bits} (e.g. ARC, RV32)
> +- no action
> +
> +@item
> +@code{_TIME_BITS=64} and port from the outset uses 32-bit
> +@code{time_t} and word size equals to @w{32 bits} (e.g. ARM)
> +- the @code{time_t} is modified to be able to hold 64-bit time.
> +
> +@item
> +For any other use case the compile-time error is emitted.
> +@end enumerate
> +
> +The @code{_TIME_BITS} can be only used when
> @code{_FILE_OFFSET_BITS=64} +is also defined.
> +
> +For the point @b{4} above, calls to proper syscalls depend on the
> +Linux kernel version on which the system is running. For Linux kernel
> +version above @b{5.1} syscalls supporting 64-bit time are used.
> Otherwise, +a fallback code is used with legacy (i.e. 32-bit)
> syscalls. +
> +By using this macro certain ports gain support for 64-bit time and as
> +a result become immune to Y2038 problem.
> +@end defvr
> +
>  @defvr Macro _ISOC99_SOURCE
>  @standards{GNU, (none)}
>  If this macro is defined, features from ISO C99 are included.  Since
> diff --git a/misc/sys/select.h b/misc/sys/select.h
> index 188a7fe607..e9c0e8fc20 100644
> --- a/misc/sys/select.h
> +++ b/misc/sys/select.h
> @@ -98,10 +98,23 @@ __BEGIN_DECLS
>  
>     This function is a cancellation point and therefore not marked
> with __THROW.  */
> +#ifndef __USE_TIME_BITS64
>  extern int select (int __nfds, fd_set *__restrict __readfds,
>  		   fd_set *__restrict __writefds,
>  		   fd_set *__restrict __exceptfds,
>  		   struct timeval *__restrict __timeout);
> +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT (select,
> +                       (int __nfds, fd_set *__restrict __readfds,
> +                        fd_set *__restrict __writefds,
> +                        fd_set *__restrict __exceptfds,
> +                        struct timeval *__restrict __timeout),
> +                       __select64);
> +# else
> +#  define select __select64
> +# endif
> +#endif
>  
>  #ifdef __USE_XOPEN2K
>  /* Same as above only that the TIMEOUT value is given with higher
> @@ -110,11 +123,25 @@ extern int select (int __nfds, fd_set
> *__restrict __readfds, 
>     This function is a cancellation point and therefore not marked
> with __THROW.  */
> +# ifndef __USE_TIME_BITS64
>  extern int pselect (int __nfds, fd_set *__restrict __readfds,
>  		    fd_set *__restrict __writefds,
>  		    fd_set *__restrict __exceptfds,
>  		    const struct timespec *__restrict __timeout,
>  		    const __sigset_t *__restrict __sigmask);
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (pselect,
> +                       (int __nfds, fd_set *__restrict __readfds,
> +                        fd_set *__restrict __writefds,
> +                        fd_set *__restrict __exceptfds,
> +                        const struct timespec *__restrict __timeout,
> +                        const __sigset_t *__restrict __sigmask),
> +                       __pselect64);
> +#  else
> +#   define pselect __pselect64
> +#  endif
> +# endif
>  #endif
>  
>  
> diff --git a/nptl/pthread_clockjoin.c b/nptl/pthread_clockjoin.c
> index f5007d7831..2d01ba03a2 100644
> --- a/nptl/pthread_clockjoin.c
> +++ b/nptl/pthread_clockjoin.c
> @@ -36,7 +36,8 @@ ___pthread_clockjoin_np64 (pthread_t threadid, void
> **thread_return, #if __TIMESIZE == 64
>  strong_alias (___pthread_clockjoin_np64, ___pthread_clockjoin_np)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_clockjoin_np64, __pthread_clockjoin_np64)
> +strong_alias (___pthread_clockjoin_np64, __pthread_clockjoin_np64)
> +libc_hidden_def (__pthread_clockjoin_np64)
>  
>  int
>  ___pthread_clockjoin_np (pthread_t threadid, void **thread_return,
> diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
> index 54e504a6b5..9a5897700b 100644
> --- a/nptl/pthread_cond_wait.c
> +++ b/nptl/pthread_cond_wait.c
> @@ -644,10 +644,8 @@ ___pthread_cond_timedwait64 (pthread_cond_t
> *cond, pthread_mutex_t *mutex, #if __TIMESIZE == 64
>  strong_alias (___pthread_cond_timedwait64, ___pthread_cond_timedwait)
>  #else
> -libc_hidden_ver (___pthread_cond_timedwait64,
> __pthread_cond_timedwait64) -#ifndef SHARED
>  strong_alias (___pthread_cond_timedwait64,
> __pthread_cond_timedwait64) -#endif
> +libc_hidden_def (__pthread_cond_timedwait64)
>  
>  int
>  ___pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t
> *mutex, @@ -685,9 +683,8 @@ ___pthread_cond_clockwait64
> (pthread_cond_t *cond, pthread_mutex_t *mutex, #if __TIMESIZE == 64
>  strong_alias (___pthread_cond_clockwait64, ___pthread_cond_clockwait)
>  #else
> -versioned_symbol (libc, ___pthread_cond_clockwait64,
> -		  __pthread_cond_clockwait64, GLIBC_PRIVATE);
> -libc_hidden_ver (___pthread_cond_clockwait64,
> __pthread_cond_clockwait64) +strong_alias
> (___pthread_cond_clockwait64, __pthread_cond_clockwait64);
> +libc_hidden_def (__pthread_cond_clockwait64) 
>  int
>  ___pthread_cond_clockwait (pthread_cond_t *cond, pthread_mutex_t
> *mutex, diff --git a/nptl/pthread_mutex_timedlock.c
> b/nptl/pthread_mutex_timedlock.c index acd78131b2..5afd6222d6 100644
> --- a/nptl/pthread_mutex_timedlock.c
> +++ b/nptl/pthread_mutex_timedlock.c
> @@ -585,7 +585,8 @@ ___pthread_mutex_clocklock64 (pthread_mutex_t
> *mutex, #if __TIMESIZE == 64
>  strong_alias (___pthread_mutex_clocklock64,
> ___pthread_mutex_clocklock) #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_mutex_clocklock64,
> __pthread_mutex_clocklock64) +strong_alias
> (___pthread_mutex_clocklock64, __pthread_mutex_clocklock64)
> +libc_hidden_def (__pthread_mutex_clocklock64) 
>  int
>  ___pthread_mutex_clocklock (pthread_mutex_t *mutex,
> @@ -618,9 +619,8 @@ ___pthread_mutex_timedlock64 (pthread_mutex_t
> *mutex, #if __TIMESIZE == 64
>  strong_alias (___pthread_mutex_timedlock64,
> ___pthread_mutex_timedlock) #else /* __TIMESPEC64 != 64 */
> -versioned_symbol (libc, ___pthread_mutex_timedlock64,
> -		  __pthread_mutex_timedlock64, GLIBC_PRIVATE);
> -libc_hidden_ver (___pthread_mutex_timedlock64,
> __pthread_mutex_timedlock64) +strong_alias
> (___pthread_mutex_timedlock64, __pthread_mutex_timedlock64);
> +libc_hidden_def (__pthread_mutex_timedlock64) 
>  int
>  ___pthread_mutex_timedlock (pthread_mutex_t *mutex,
> diff --git a/nptl/pthread_rwlock_clockrdlock.c
> b/nptl/pthread_rwlock_clockrdlock.c index 9db96b9904..83ae1d1823
> 100644 --- a/nptl/pthread_rwlock_clockrdlock.c
> +++ b/nptl/pthread_rwlock_clockrdlock.c
> @@ -31,8 +31,8 @@ ___pthread_rwlock_clockrdlock64 (pthread_rwlock_t
> *rwlock, clockid_t clockid, #if __TIMESIZE == 64
>  strong_alias (___pthread_rwlock_clockrdlock64,
> ___pthread_rwlock_clockrdlock) #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_rwlock_clockrdlock64,
> -		 __pthread_rwlock_clockrdlock64)
> +strong_alias (___pthread_rwlock_clockrdlock64,
> __pthread_rwlock_clockrdlock64) +libc_hidden_def
> (__pthread_rwlock_clockrdlock64) 
>  int
>  ___pthread_rwlock_clockrdlock (pthread_rwlock_t *rwlock, clockid_t
> clockid, diff --git a/nptl/pthread_rwlock_clockwrlock.c
> b/nptl/pthread_rwlock_clockwrlock.c index ca0ebe2a65..08a2276da5
> 100644 --- a/nptl/pthread_rwlock_clockwrlock.c
> +++ b/nptl/pthread_rwlock_clockwrlock.c
> @@ -31,8 +31,8 @@ ___pthread_rwlock_clockwrlock64 (pthread_rwlock_t
> *rwlock, clockid_t clockid, #if __TIMESIZE == 64
>  strong_alias (___pthread_rwlock_clockwrlock64,
> ___pthread_rwlock_clockwrlock) #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_rwlock_clockwrlock64,
> -		 __pthread_rwlock_clockwrlock64)
> +strong_alias (___pthread_rwlock_clockwrlock64,
> __pthread_rwlock_clockwrlock64) +libc_hidden_def
> (__pthread_rwlock_clockwrlock64) 
>  int
>  ___pthread_rwlock_clockwrlock (pthread_rwlock_t *rwlock, clockid_t
> clockid, diff --git a/nptl/pthread_rwlock_timedrdlock.c
> b/nptl/pthread_rwlock_timedrdlock.c index dd9b7cb0a2..8c73af26fb
> 100644 --- a/nptl/pthread_rwlock_timedrdlock.c
> +++ b/nptl/pthread_rwlock_timedrdlock.c
> @@ -30,8 +30,8 @@ ___pthread_rwlock_timedrdlock64 (pthread_rwlock_t
> *rwlock, #if __TIMESIZE == 64
>  strong_alias (___pthread_rwlock_timedrdlock64,
> ___pthread_rwlock_timedrdlock) #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_rwlock_timedrdlock64,
> -		 __pthread_rwlock_timedrdlock64)
> +strong_alias (___pthread_rwlock_timedrdlock64,
> __pthread_rwlock_timedrdlock64) +libc_hidden_def
> (__pthread_rwlock_timedrdlock64) 
>  int
>  ___pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock,
> diff --git a/nptl/pthread_rwlock_timedwrlock.c
> b/nptl/pthread_rwlock_timedwrlock.c index e660a544cd..890da92968
> 100644 --- a/nptl/pthread_rwlock_timedwrlock.c
> +++ b/nptl/pthread_rwlock_timedwrlock.c
> @@ -30,8 +30,8 @@ ___pthread_rwlock_timedwrlock64 (pthread_rwlock_t
> *rwlock, #if __TIMESIZE == 64
>  strong_alias (___pthread_rwlock_timedwrlock64,
> ___pthread_rwlock_timedwrlock) #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_rwlock_timedwrlock64,
> -		 __pthread_rwlock_timedwrlock64)
> +strong_alias (___pthread_rwlock_timedwrlock64,
> __pthread_rwlock_timedwrlock64) +libc_hidden_def
> (__pthread_rwlock_timedwrlock64) 
>  int
>  ___pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock,
> diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c
> index ebc31f935a..0b4026612f 100644
> --- a/nptl/pthread_timedjoin.c
> +++ b/nptl/pthread_timedjoin.c
> @@ -31,7 +31,8 @@ ___pthread_timedjoin_np64 (pthread_t threadid, void
> **thread_return, #if __TIMESIZE == 64
>  strong_alias (___pthread_timedjoin_np64, ___pthread_timedjoin_np)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_timedjoin_np64, __pthread_timedjoin_np64)
> +strong_alias (___pthread_timedjoin_np64, __pthread_timedjoin_np64)
> +libc_hidden_def (__pthread_timedjoin_np64)
>  
>  int
>    ___pthread_timedjoin_np (pthread_t threadid, void **thread_return,
> diff --git a/nptl/sem_clockwait.c b/nptl/sem_clockwait.c
> index 2739799e26..19751aff04 100644
> --- a/nptl/sem_clockwait.c
> +++ b/nptl/sem_clockwait.c
> @@ -49,7 +49,8 @@ ___sem_clockwait64 (sem_t *sem, clockid_t clockid,
>  #if __TIMESIZE == 64
>  strong_alias (___sem_clockwait64, ___sem_clockwait)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___sem_clockwait64, __sem_clockwait64)
> +strong_alias (___sem_clockwait64, __sem_clockwait64)
> +libc_hidden_def (__sem_clockwait64)
>  
>  int
>  ___sem_clockwait (sem_t *sem, clockid_t clockid, const struct
> timespec *abstime) diff --git a/nptl/sem_timedwait.c
> b/nptl/sem_timedwait.c index 584546c706..5c8f37d3bb 100644
> --- a/nptl/sem_timedwait.c
> +++ b/nptl/sem_timedwait.c
> @@ -45,10 +45,8 @@ ___sem_timedwait64 (sem_t *sem, const struct
> __timespec64 *abstime) #if __TIMESIZE == 64
>  strong_alias (___sem_timedwait64, ___sem_timedwait)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___sem_timedwait64, __sem_timedwait64)
> -#ifndef SHARED
>  strong_alias (___sem_timedwait64, __sem_timedwait64)
> -#endif
> +libc_hidden_def (__sem_timedwait64)
>  
>  int
>  ___sem_timedwait (sem_t *sem, const struct timespec *abstime)
> diff --git a/posix/sched.h b/posix/sched.h
> index d8ce08a3ea..7dd97a49b2 100644
> --- a/posix/sched.h
> +++ b/posix/sched.h
> @@ -74,8 +74,17 @@ extern int sched_get_priority_max (int
> __algorithm) __THROW; extern int sched_get_priority_min (int
> __algorithm) __THROW; 
>  /* Get the SCHED_RR interval for the named process.  */
> +#ifndef __USE_TIME_BITS64
>  extern int sched_rr_get_interval (__pid_t __pid, struct timespec
> *__t) __THROW; -
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (sched_rr_get_interval,
> +                           (__pid_t __pid, struct timespec *__t),
> +                           __sched_rr_get_interval64);
> +# else
> +#  define sched_rr_get_interval __sched_rr_get_interval64
> +# endif
> +#endif
>  
>  #ifdef __USE_GNU
>  /* Access macros for `cpu_set'.  */
> diff --git a/posix/sys/wait.h b/posix/sys/wait.h
> index 9e7bb7f154..5325bfa4d2 100644
> --- a/posix/sys/wait.h
> +++ b/posix/sys/wait.h
> @@ -144,14 +144,34 @@ struct rusage;
>     nil, store information about the child's resource usage there.
> If the WUNTRACED bit is set in OPTIONS, return status for stopped
> children; otherwise don't.  */
> +# ifndef __USE_TIME_BITS64
>  extern __pid_t wait3 (int *__stat_loc, int __options,
>  		      struct rusage * __usage) __THROWNL;
> +# else
> +#  ifdef __REDIRECT_NTHNL
> +extern __pid_t __REDIRECT_NTHNL (wait3, (int *__stat_loc, int
> __options,
> +                                         struct rusage * __usage),
> +                                 __wait3_time64);
> +#  else
> +#   define wait3 __wait3_time64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_MISC
> +# ifndef __USE_TIME_BITS64
>  /* PID is like waitpid.  Other args are like wait3.  */
>  extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
>  		      struct rusage *__usage) __THROWNL;
> +# else
> +#  ifdef __REDIRECT_NTHNL
> +extern __pid_t __REDIRECT_NTHNL (wait4, (__pid_t __pid, int
> *__stat_loc,
> +                                         int __options, struct
> rusage *__usage),
> +                                 __wait4_time64);
> +#  else
> +#   define wait4 __wait4_time64
> +#  endif
> +# endif
>  #endif /* Use misc.  */
>  
>  
> diff --git a/resolv/netdb.h b/resolv/netdb.h
> index 1f36f25d4a..9b242ce3d1 100644
> --- a/resolv/netdb.h
> +++ b/resolv/netdb.h
> @@ -701,6 +701,17 @@ extern int getaddrinfo_a (int __mode, struct
> gaicb *__list[__restrict_arr], extern int gai_suspend (const struct
> gaicb *const __list[], int __ent, const struct timespec *__timeout);
>  
> +# ifdef __USE_TIME_BITS64
> +#  if defined(__REDIRECT)
> +extern int __REDIRECT (gai_suspend, (const struct gaicb *const
> __list[],
> +                                     int __ent,
> +                                     const struct timespec
> *__timeout),
> +                       __gai_suspend_time64);
> +#  else
> +#   define gai_suspend __gai_suspend_time64
> +#  endif
> +# endif
> +
>  /* Get the error status of the request REQ.  */
>  extern int gai_error (struct gaicb *__req) __THROW;
>  
> diff --git a/resource/sys/resource.h b/resource/sys/resource.h
> index d30379d085..551d25e275 100644
> --- a/resource/sys/resource.h
> +++ b/resource/sys/resource.h
> @@ -88,6 +88,16 @@ extern int setrlimit64 (__rlimit_resource_t
> __resource, and put it in *USAGE.  Returns 0 for success, -1 for
> failure.  */ extern int getrusage (__rusage_who_t __who, struct
> rusage *__usage) __THROW; 
> +#ifdef __USE_TIME_BITS64
> +# if defined(__REDIRECT_NTH)
> +extern int __REDIRECT_NTH (getrusage, (__rusage_who_t __who,
> +                                       struct rusage *__usage),
> +                           __getrusage64);
> +# else
> +# define getrusage __getrusage64
> +# endif
> +#endif
> +
>  /* Return the highest priority of any process specified by WHICH and
> WHO (see above); if WHO is zero, the current process, process group,
> or user (as specified by WHO) is used.  A lower priority number means
> higher diff --git a/rt/aio.h b/rt/aio.h
> index 3a107b2783..72cf626690 100644
> --- a/rt/aio.h
> +++ b/rt/aio.h
> @@ -193,12 +193,17 @@ extern __ssize_t __REDIRECT_NTH (aio_return,
> (struct aiocb *__aiocbp), extern int __REDIRECT_NTH (aio_cancel,
>  			   (int __fildes, struct aiocb *__aiocbp),
>  			   aio_cancel64);
> -
> +#  ifdef __USE_TIME_BITS64
> +extern int __REDIRECT_NTH (aio_suspend,
> +			   (const struct aiocb *const __list[], int
> __nent,
> +			    const struct timespec *__restrict
> __timeout),
> +			   __aio_suspend_time64) __nonnull ((1));
> +#  else
>  extern int __REDIRECT_NTH (aio_suspend,
>  			   (const struct aiocb *const __list[], int
> __nent, const struct timespec *__restrict __timeout),
>  			   aio_suspend64) __nonnull ((1));
> -
> +#  endif
>  extern int __REDIRECT_NTH (aio_fsync,
>  			   (int __operation, struct aiocb *__aiocbp),
>  			   aio_fsync64) __nonnull ((2));
> @@ -210,7 +215,11 @@ extern int __REDIRECT_NTH (aio_fsync,
>  #  define aio_error aio_error64
>  #  define aio_return aio_return64
>  #  define aio_cancel aio_cancel64
> -#  define aio_suspend aio_suspend64
> +#  ifdef __USE_TIME_BITS64
> +#   define aio_suspend __aio_suspend_time64
> +#  else
> +#   define aio_suspend aio_suspend64
> +#  endif
>  #  define aio_fsync aio_fsync64
>  # endif
>  #endif
> diff --git a/rt/mqueue.h b/rt/mqueue.h
> index 8a62d99f50..e8a85637e4 100644
> --- a/rt/mqueue.h
> +++ b/rt/mqueue.h
> @@ -71,6 +71,7 @@ extern int mq_send (mqd_t __mqdes, const char
> *__msg_ptr, size_t __msg_len, unsigned int __msg_prio) __nonnull
> ((2)); 
>  #ifdef __USE_XOPEN2K
> +# ifndef __USE_TIME_BITS64
>  /* Receive the oldest from highest priority messages in message queue
>     MQDES, stop waiting if ABS_TIMEOUT expires.  */
>  extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict
> __msg_ptr, @@ -85,6 +86,27 @@ extern int mq_timedsend (mqd_t __mqdes,
> const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio,
>  			 const struct timespec *__abs_timeout)
>    __nonnull ((2, 5));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (mq_timedreceive, (mqd_t __mqdes,
> +                               char *__restrict __msg_ptr,
> +                               size_t __msg_len,
> +                               unsigned int *__restrict __msg_prio,
> +                               const struct timespec *__restrict
> __abs_timeout),
> +                       __mq_timedreceive_time64)
> +  __nonnull ((2, 5));
> +
> +extern int __REDIRECT (mq_timedsend, (mqd_t __mqdes,
> +                       const char *__msg_ptr, size_t __msg_len,
> +                       unsigned int __msg_prio,
> +                       const struct timespec *__abs_timeout),
> +		       __mq_timedsend_time64)
> +  __nonnull ((2, 5));
> +#  else
> +#   define mq_timedreceive __mq_timedreceive_time64
> +#   define mq_timedsend __mq_timedsend_time64
> +#  endif
> +# endif
>  #endif
>  
>  /* Define some inlines helping to catch common problems.  */
> diff --git a/signal/signal.h b/signal/signal.h
> index b17203c99c..5fd93382fc 100644
> --- a/signal/signal.h
> +++ b/signal/signal.h
> @@ -269,10 +269,23 @@ extern int sigwaitinfo (const sigset_t
> *__restrict __set, 
>     This function is a cancellation point and therefore not marked
> with __THROW.  */
> +#  ifndef __USE_TIME_BITS64
>  extern int sigtimedwait (const sigset_t *__restrict __set,
>  			 siginfo_t *__restrict __info,
>  			 const struct timespec *__restrict __timeout)
>       __nonnull ((1));
> +#  else
> +#   ifdef __REDIRECT
> +extern int __REDIRECT (sigtimedwait,
> +                       (const sigset_t *__restrict __set,
> +                        siginfo_t *__restrict __info,
> +                        const struct timespec *__restrict __timeout),
> +                       __sigtimedwait64)
> +     __nonnull ((1));
> +#   else
> +#    define sigtimedwait __sigtimedwait64
> +#   endif
> +#  endif
>  
>  /* Send signal SIG to the process PID.  Associate data in VAL with
> the signal.  */
> diff --git a/socket/sys/socket.h b/socket/sys/socket.h
> index 949851a6ce..5577e75b80 100644
> --- a/socket/sys/socket.h
> +++ b/socket/sys/socket.h
> @@ -196,9 +196,20 @@ extern ssize_t recvmsg (int __fd, struct msghdr
> *__message, int __flags); 
>     This function is a cancellation point and therefore not marked
> with __THROW.  */
> +# ifndef __USE_TIME_BITS64
>  extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
>  		     unsigned int __vlen, int __flags,
>  		     struct timespec *__tmo);
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (recvmmsg, (int __fd, struct mmsghdr
> *__vmessages,
> +                                  unsigned int __vlen, int __flags,
> +                                  struct timespec *__tmo),
> +                       __recvmmsg64);
> +#  else
> +#   define recvmmsg __recvmmsg64
> +#  endif
> +# endif
>  #endif
>  
>  
> diff --git a/sysdeps/generic/features-time64.h
> b/sysdeps/generic/features-time64.h new file mode 100644
> index 0000000000..a5a677f837
> --- /dev/null
> +++ b/sysdeps/generic/features-time64.h
> @@ -0,0 +1,19 @@
> +/* Features part to handle 64-bit time_t support.  Generic version.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* The generic configuration only support _TIME_BITS=32.  */
> diff --git a/sysdeps/generic/time64-compat.h
> b/sysdeps/generic/time64-compat.h new file mode 100644
> index 0000000000..e44b6b68e3
> --- /dev/null
> +++ b/sysdeps/generic/time64-compat.h
> @@ -0,0 +1,3 @@
> +/* Header included by Versions to generate the 64 bit time_t compat
> symbols.
> +   Legacy ABIs with default 32 bit time support define
> TIME64_NON_DEFAULT to
> +   generate the 64 bit symbols.  */
> diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
> index 22e037dcb4..52e2eadbfc 100644
> --- a/sysdeps/nptl/pthread.h
> +++ b/sysdeps/nptl/pthread.h
> @@ -221,6 +221,7 @@ extern int pthread_join (pthread_t __th, void
> **__thread_return); the thread in *THREAD_RETURN, if THREAD_RETURN is
> not NULL.  */ extern int pthread_tryjoin_np (pthread_t __th, void
> **__thread_return) __THROW; 
> +# ifndef __USE_TIME_BITS64
>  /* Make calling thread wait for termination of the thread TH, but
> only until TIMEOUT.  The exit status of the thread is stored in
>     *THREAD_RETURN, if THREAD_RETURN is not NULL.
> @@ -240,6 +241,23 @@ extern int pthread_timedjoin_np (pthread_t __th,
> void **__thread_return, extern int pthread_clockjoin_np (pthread_t
> __th, void **__thread_return, clockid_t __clockid,
>  				 const struct timespec *__abstime);
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (pthread_timedjoin_np,
> +                       (pthread_t __th, void **__thread_return,
> +                        const struct timespec *__abstime),
> +                       __pthread_timedjoin_np64);
> +
> +extern int __REDIRECT (pthread_clockjoin_np,
> +                       (pthread_t __th, void **__thread_return,
> +                        clockid_t __clockid,
> +                        const struct timespec *__abstime),
> +                       __pthread_clockjoin_np64);
> +#  else
> +#   define pthread_timedjoin_np __pthread_timedjoin_np64
> +#   define pthread_clockjoin_np __pthread_clockjoin_np64
> +#  endif
> +# endif
>  #endif
>  
>  /* Indicate that the thread TH is never to be joined with
> PTHREAD_JOIN. @@ -776,16 +794,39 @@ extern int pthread_mutex_lock
> (pthread_mutex_t *__mutex) 
>  #ifdef __USE_XOPEN2K
>  /* Wait until lock becomes available, or specified time passes. */
> +# ifndef __USE_TIME_BITS64
>  extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict
> __mutex, const struct timespec *__restrict
>  				    __abstime) __THROWNL __nonnull
> ((1, 2)); +# else
> +#  ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_mutex_timedlock,
> +                             (pthread_mutex_t *__restrict __mutex,
> +                              const struct timespec *__restrict
> __abstime),
> +                             __pthread_mutex_timedlock64) __nonnull
> ((1, 2)); +#  else
> +#   define pthread_mutex_timedlock __pthread_mutex_timedlock64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_GNU
> +# ifndef __USE_TIME_BITS64
>  extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict
> __mutex, clockid_t __clockid,
>  				    const struct timespec *__restrict
>  				    __abstime) __THROWNL __nonnull
> ((1, 3)); +# else
> +#  ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_mutex_clocklock,
> +                             (pthread_mutex_t *__restrict __mutex,
> +                              clockid_t __clockid,
> +                              const struct timespec *__restrict
> __abstime),
> +                             __pthread_mutex_clocklock64) __nonnull
> ((1, 3)); +#  else
> +#   define pthread_mutex_clocklock __pthread_mutex_clocklock64
> +#  endif
> +# endif
>  #endif
>  
>  /* Unlock a mutex.  */
> @@ -939,16 +980,41 @@ extern int pthread_rwlock_tryrdlock
> (pthread_rwlock_t *__rwlock) 
>  # ifdef __USE_XOPEN2K
>  /* Try to acquire read lock for RWLOCK or return after specfied
> time.  */ +#  ifndef __USE_TIME_BITS64
>  extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict
> __rwlock, const struct timespec *__restrict
>  				       __abstime) __THROWNL
> __nonnull ((1, 2)); +#  else
> +#   ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock,
> +                             (pthread_rwlock_t *__restrict __rwlock,
> +                              const struct timespec *__restrict
> __abstime),
> +                             __pthread_rwlock_timedrdlock64)
> +    __nonnull ((1, 2));
> +#   else
> +#    define pthread_rwlock_timedrdlock __pthread_rwlock_timedrdlock64
> +#   endif
> +#  endif
>  # endif
>  
>  # ifdef __USE_GNU
> +#  ifndef __USE_TIME_BITS64
>  extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict
> __rwlock, clockid_t __clockid,
>  				       const struct timespec
> *__restrict __abstime) __THROWNL __nonnull ((1, 3));
> +#  else
> +#   ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_rwlock_clockrdlock,
> +                             (pthread_rwlock_t *__restrict __rwlock,
> +                              clockid_t __clockid,
> +                              const struct timespec *__restrict
> __abstime),
> +                             __pthread_rwlock_clockrdlock64)
> +    __nonnull ((1, 3));
> +#   else
> +#    define pthread_rwlock_clockrdlock __pthread_rwlock_clockrdlock64
> +#   endif
> +#  endif
>  # endif
>  
>  /* Acquire write lock for RWLOCK.  */
> @@ -961,16 +1027,42 @@ extern int pthread_rwlock_trywrlock
> (pthread_rwlock_t *__rwlock) 
>  # ifdef __USE_XOPEN2K
>  /* Try to acquire write lock for RWLOCK or return after specfied
> time.  */ +#  ifndef __USE_TIME_BITS64
>  extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict
> __rwlock, const struct timespec *__restrict
>  				       __abstime) __THROWNL
> __nonnull ((1, 2)); +#  else
> +#   ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock,
> +                             (pthread_rwlock_t *__restrict __rwlock,
> +                              const struct timespec *__restrict
> __abstime),
> +                             __pthread_rwlock_timedwrlock64)
> +    __nonnull ((1, 2));
> +#   else
> +#    define pthread_rwlock_timedwrlock __pthread_rwlock_timedwrlock64
> +#   endif
> +#  endif
>  # endif
>  
>  # ifdef __USE_GNU
> +#  ifndef __USE_TIME_BITS64
>  extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict
> __rwlock, clockid_t __clockid,
>  				       const struct timespec
> *__restrict __abstime) __THROWNL __nonnull ((1, 3));
> +
> +#  else
> +#   ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_rwlock_clockwrlock,
> +                             (pthread_rwlock_t *__restrict __rwlock,
> +                              clockid_t __clockid,
> +                              const struct timespec *__restrict
> __abstime),
> +                             __pthread_rwlock_clockwrlock64)
> +    __nonnull ((1, 3));
> +#   else
> +#    define pthread_rwlock_clockwrlock __pthread_rwlock_clockwrlock64
> +#   endif
> +#  endif
>  # endif
>  
>  /* Unlock RWLOCK.  */
> @@ -1047,10 +1139,23 @@ extern int pthread_cond_wait (pthread_cond_t
> *__restrict __cond, 
>     This function is a cancellation point and therefore not marked
> with __THROW.  */
> +# ifndef __USE_TIME_BITS64
>  extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
>  				   pthread_mutex_t *__restrict
> __mutex, const struct timespec *__restrict __abstime)
>       __nonnull ((1, 2, 3));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (pthread_cond_timedwait,
> +                       (pthread_cond_t *__restrict __cond,
> +                        pthread_mutex_t *__restrict __mutex,
> +                        const struct timespec *__restrict __abstime),
> +                       __pthread_cond_timedwait64)
> +     __nonnull ((1, 2, 3));
> +#  else
> +#   define pthread_cond_timedwait __pthread_cond_timedwait64
> +#  endif
> +# endif
>  
>  # ifdef __USE_GNU
>  /* Wait for condition variable COND to be signaled or broadcast until
> @@ -1060,11 +1165,25 @@ extern int pthread_cond_timedwait
> (pthread_cond_t *__restrict __cond, 
>     This function is a cancellation point and therefore not marked
> with __THROW. */
> +#  ifndef __USE_TIME_BITS64
>  extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
>  				   pthread_mutex_t *__restrict
> __mutex, __clockid_t __clock_id,
>  				   const struct timespec *__restrict
> __abstime) __nonnull ((1, 2, 4));
> +#  else
> +#   ifdef __REDIRECT
> +extern int __REDIRECT (pthread_cond_clockwait,
> +                       (pthread_cond_t *__restrict __cond,
> +                        pthread_mutex_t *__restrict __mutex,
> +                        __clockid_t __clock_id,
> +                        const struct timespec *__restrict __abstime),
> +                       __pthread_cond_clockwait64)
> +     __nonnull ((1, 2, 4));
> +#   else
> +#    define pthread_cond_clockwait __pthread_cond_clockwait64
> +#   endif
> +#  endif
>  # endif
>  
>  /* Functions for handling condition variable attributes.  */
> diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h
> index 7fb0e5c103..35780e7c4e 100644
> --- a/sysdeps/pthread/semaphore.h
> +++ b/sysdeps/pthread/semaphore.h
> @@ -59,16 +59,41 @@ extern int sem_wait (sem_t *__sem) __nonnull
> ((1)); 
>     This function is a cancellation point and therefore not marked
> with __THROW.  */
> +# ifndef __USE_TIME_BITS64
>  extern int sem_timedwait (sem_t *__restrict __sem,
>  			  const struct timespec *__restrict
> __abstime) __nonnull ((1, 2));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (sem_timedwait,
> +                       (sem_t *__restrict __sem,
> +                        const struct timespec *__restrict __abstime),
> +                        __sem_timedwait64)
> +  __nonnull ((1, 2));
> +#  else
> +#   define sem_timedwait __sem_timedwait64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_GNU
> +# ifndef __USE_TIME_BITS64
>  extern int sem_clockwait (sem_t *__restrict __sem,
>  			  clockid_t clock,
>  			  const struct timespec *__restrict
> __abstime) __nonnull ((1, 3));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (sem_clockwait,
> +                       (sem_t *__restrict __sem,
> +                        clockid_t clock,
> +                        const struct timespec *__restrict __abstime),
> +                        __sem_clockwait64)
> +  __nonnull ((1, 3));
> +#  else
> +#   define sem_clockwait __sem_clockwait64
> +#  endif
> +# endif
>  #endif
>  
>  /* Test whether SEM is posted.  */
> diff --git a/sysdeps/pthread/threads.h b/sysdeps/pthread/threads.h
> index 46929a025e..bf251c9db4 100644
> --- a/sysdeps/pthread/threads.h
> +++ b/sysdeps/pthread/threads.h
> @@ -88,8 +88,18 @@ extern thrd_t thrd_current (void);
>     __TIME_POINT.  The current thread may resume if receives a
> signal.  In that case, if __REMAINING is not NULL, the remaining time
> is stored in the object pointed by it.  */
> +#ifndef __USE_TIME_BITS64
>  extern int thrd_sleep (const struct timespec *__time_point,
>  		       struct timespec *__remaining);
> +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT (thrd_sleep, (const struct timespec
> *__time_point,
> +                                    struct timespec *__remaining),
> +                       __thrd_sleep64);
> +# else
> +#  define thrd_sleep __thrd_sleep64
> +# endif
> +#endif
>  
>  /* Terminate current thread execution, cleaning up any thread local
>     storage and freeing resources.  Returns the value specified in
> __RES.  */ @@ -131,8 +141,19 @@ extern int mtx_lock (mtx_t *__mutex);
>  /* Block the current thread until the mutex pointed by __MUTEX is
> unlocked or time pointed by __TIME_POINT is reached.  In case the
> mutex is unlock, the current thread will not be blocked.  */
> +#ifndef __USE_TIME_BITS64
>  extern int mtx_timedlock (mtx_t *__restrict __mutex,
>  			  const struct timespec *__restrict
> __time_point); +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT (mtx_timedlock, (mtx_t *__restrict __mutex,
> +                                       const struct timespec
> *__restrict
> +                                       __time_point),
> +                       __mtx_timedlock64);
> +# else
> +#  define mtx_timedlock __mtx_timedlock64
> +# endif
> +#endif
>  
>  /* Try to lock the mutex pointed by __MUTEX without blocking.  If
> the mutex is free the current threads takes control of it, otherwise
> it returns @@ -171,9 +192,21 @@ extern int cnd_wait (cnd_t *__cond,
> mtx_t *__mutex); /* Block current thread on the condition variable
> until condition variable pointed by __COND is signaled or time
> pointed by __TIME_POINT is reached.  */
> +#ifndef __USE_TIME_BITS64
>  extern int cnd_timedwait (cnd_t *__restrict __cond,
>  			  mtx_t *__restrict __mutex,
>  			  const struct timespec *__restrict
> __time_point); +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT (cnd_timedwait, (cnd_t *__restrict __cond,
> +                                       mtx_t *__restrict __mutex,
> +                                       const struct timespec
> *__restrict
> +                                       __time_point),
> +                       __cnd_timedwait64);
> +# else
> +#  define cnd_timedwait __cnd_timedwait64
> +# endif
> +#endif
>  
>  /* Destroy condition variable pointed by __cond and free all of its
>     resources.  */
> diff --git a/sysdeps/unix/sysv/linux/Versions
> b/sysdeps/unix/sysv/linux/Versions index 148f04c50a..52fedc61f0 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -1,3 +1,4 @@
> +%include <time64-compat.h>
>  libc {
>    GLIBC_2.0 {
>      # functions used in inline functions or macros
> @@ -168,6 +169,81 @@ libc {
>      getdents64; gettid; tgkill;
>    }
>    GLIBC_2.32 {
> +  }
> +  GLIBC_2.34 {
> +%ifdef TIME64_NON_DEFAULT
> +    # 64 bit time_t support
> +    __adjtime64;
> +    ___adjtimex64;
> +    __clock_adjtime64;
> +    __clock_getres64;
> +    __clock_gettime64;
> +    __clock_nanosleep_time64;
> +    __clock_settime64;
> +    __cnd_timedwait64;
> +    __ctime64;
> +    __ctime64_r;
> +    __difftime64;
> +    __fstat64_time64;
> +    __fstatat64_time64;
> +    __futimens64;
> +    __futimes64;
> +    __futimesat64;
> +    __getitimer64;
> +    __getrusage64;
> +    __gettimeofday64;
> +    __gmtime64;
> +    __gmtime64_r;
> +    __localtime64;
> +    __localtime64_r;
> +    __lstat64_time64;
> +    __lutimes64;
> +    __mktime64;
> +    __msgctl64;
> +    __mtx_timedlock64;
> +    __nanosleep64;
> +    __nanosleep64;
> +    __ntp_gettime64;
> +    __ntp_gettimex64;
> +    __ppoll64;
> +    __pselec64;
> +    __pselect64;
> +    __pthread_clockjoin_np64;
> +    __pthread_cond_clockwait64;
> +    __pthread_cond_timedwait64;
> +    __pthread_mutex_clocklock64;
> +    __pthread_mutex_timedlock64;
> +    __pthread_rwlock_clockrdlock64;
> +    __pthread_rwlock_clockwrlock64;
> +    __pthread_rwlock_timedrdlock64;
> +    __pthread_rwlock_timedwrlock64;
> +    __pthread_timedjoin_np64;
> +    __recvmmsg64;
> +    __sched_rr_get_interval64;
> +    __select64;
> +    __sem_clockwait64;
> +    __semctl64;
> +    __semtimedop64;
> +    __sem_timedwait64;
> +    __setitimer64;
> +    __settimeofday64;
> +    __shmctl64;
> +    __sigtimedwait64;
> +    __stat64_time64;
> +    __thrd_sleep64;
> +    __time64;
> +    __timegm64;
> +    __timerfd_gettime64;
> +    __timerfd_settime64;
> +    __timespec_get64;
> +    __timespec_getres64;
> +    __utime64;
> +    __utimensat64;
> +    __utimes64;
> +    __utimes64;
> +    __wait3_time64;
> +    __wait4_time64;
> +%endif
>    }
>    GLIBC_PRIVATE {
>      # functions used in other libraries
> @@ -188,3 +264,24 @@ ld {
>      __nptl_change_stack_perm;
>    }
>  }
> +
> +librt {
> +  GLIBC_2.34 {
> +%ifdef TIME64_NON_DEFAULT
> +    # 64 bit time_t support
> +    __aio_suspend_time64;
> +    __mq_timedsend_time64;
> +    __mq_timedreceive_time64;
> +    __timer_gettime64;
> +    __timer_settime64;
> +%endif
> +  }
> +}
> +
> +libanl {
> +%ifdef TIME64_NON_DEFAULT
> +  GLIBC_2.34 {
> +    __gai_suspend_time64;
> +  }
> +%endif
> +}
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist
> b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist index
> a8fafedb66..37f9b49e52 100644 ---
> a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist @@ -1,3 +1,4 @@
> +GLIBC_2.34 __gai_suspend_time64 F
>  GLIBC_2.4 gai_cancel F
>  GLIBC_2.4 gai_error F
>  GLIBC_2.4 gai_suspend F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index
> 7c3029a7e5..694033a42b 100644 ---
> a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -189,16 +189,83 @@
> GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/librt.abilist
> b/sysdeps/unix/sysv/linux/arm/be/librt.abilist index
> 3c0647b251..8cb1ed626c 100644 ---
> a/sysdeps/unix/sysv/linux/arm/be/librt.abilist +++
> b/sysdeps/unix/sysv/linux/arm/be/librt.abilist @@ -1,3 +1,8 @@
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 aio_cancel F
>  GLIBC_2.4 aio_cancel64 F
>  GLIBC_2.4 aio_error F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist
> b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist index
> a8fafedb66..37f9b49e52 100644 ---
> a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist @@ -1,3 +1,4 @@
> +GLIBC_2.34 __gai_suspend_time64 F
>  GLIBC_2.4 gai_cancel F
>  GLIBC_2.4 gai_error F
>  GLIBC_2.4 gai_suspend F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index
> 24f5b202e8..1ead45904f 100644 ---
> a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -186,16 +186,83 @@
> GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/librt.abilist
> b/sysdeps/unix/sysv/linux/arm/le/librt.abilist index
> 3c0647b251..8cb1ed626c 100644 ---
> a/sysdeps/unix/sysv/linux/arm/le/librt.abilist +++
> b/sysdeps/unix/sysv/linux/arm/le/librt.abilist @@ -1,3 +1,8 @@
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 aio_cancel F
>  GLIBC_2.4 aio_cancel64 F
>  GLIBC_2.4 aio_error F
> diff --git a/sysdeps/unix/sysv/linux/arm/time64-compat.h
> b/sysdeps/unix/sysv/linux/arm/time64-compat.h new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arm/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/bits/msq.h
> b/sysdeps/unix/sysv/linux/bits/msq.h index 3313b69d78..7c9c479551
> 100644 --- a/sysdeps/unix/sysv/linux/bits/msq.h
> +++ b/sysdeps/unix/sysv/linux/bits/msq.h
> @@ -26,6 +26,7 @@ typedef __syscall_ulong_t msgqnum_t;
>  typedef __syscall_ulong_t msglen_t;
>  
>  #include <bits/types/struct_msqid_ds.h>
> +#include <bits/types/struct_msqid64_ds.h>
>  
>  /* Define options for message queue functions.  */
>  #define MSG_NOERROR	010000	/* no error if message is
> too big */ diff --git a/sysdeps/unix/sysv/linux/bits/sem.h
> b/sysdeps/unix/sysv/linux/bits/sem.h index ad13287e66..776524b876
> 100644 --- a/sysdeps/unix/sysv/linux/bits/sem.h
> +++ b/sysdeps/unix/sysv/linux/bits/sem.h
> @@ -22,6 +22,7 @@
>  #include <sys/types.h>
>  #include <bits/timesize.h>
>  #include <bits/types/struct_semid_ds.h>
> +#include <bits/types/struct_semid64_ds.h>
>  
>  /* Flags for `semop'.  */
>  #define SEM_UNDO	0x1000		/* undo the operation
> on exit */ diff --git a/sysdeps/unix/sysv/linux/bits/shm.h
> b/sysdeps/unix/sysv/linux/bits/shm.h index a50c79d7be..454fc3f366
> 100644 --- a/sysdeps/unix/sysv/linux/bits/shm.h
> +++ b/sysdeps/unix/sysv/linux/bits/shm.h
> @@ -43,6 +43,7 @@ __BEGIN_DECLS
>  typedef __syscall_ulong_t shmatt_t;
>  
>  #include <bits/types/struct_shmid_ds.h>
> +#include <bits/types/struct_shmid64_ds.h>
>  
>  #ifdef __USE_MISC
>  
> diff --git a/sysdeps/unix/sysv/linux/bits/time.h
> b/sysdeps/unix/sysv/linux/bits/time.h index ee5a8b3ef4..d0c98a7864
> 100644 --- a/sysdeps/unix/sysv/linux/bits/time.h
> +++ b/sysdeps/unix/sysv/linux/bits/time.h
> @@ -77,6 +77,16 @@ __BEGIN_DECLS
>  /* Tune a POSIX clock.  */
>  extern int clock_adjtime (__clockid_t __clock_id, struct timex
> *__utx) __THROW; 
> +#ifdef __USE_TIME_BITS64
> +# if defined(__REDIRECT_NTH)
> +extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
> +                                           struct timex *__utx),
> +                           __clock_adjtime64);
> +# else
> +# define clock_adjtime __clock_adjtime64
> +# endif
> +#endif
> +
>  __END_DECLS
>  #endif /* use GNU */
>  
> diff --git a/sysdeps/unix/sysv/linux/cnd_timedwait.c
> b/sysdeps/unix/sysv/linux/cnd_timedwait.c index
> 0415c683f9..6e8ce3d61b 100644 ---
> a/sysdeps/unix/sysv/linux/cnd_timedwait.c +++
> b/sysdeps/unix/sysv/linux/cnd_timedwait.c @@ -21,8 +21,8 @@
>  #include "thrd_priv.h"
>  
>  int
> -___cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
> -                    const struct __timespec64 *restrict time_point)
> +__cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
> +                   const struct __timespec64 *restrict time_point)
>  {
>    int err_code = __pthread_cond_timedwait64 ((pthread_cond_t *) cond,
>                                               (pthread_mutex_t *)
> mutex, @@ -31,9 +31,9 @@ ___cnd_timedwait64 (cnd_t *restrict cond,
> mtx_t *restrict mutex, }
>  
>  #if __TIMESIZE == 64
> -strong_alias (___cnd_timedwait64, ___cnd_timedwait)
> +strong_alias (__cnd_timedwait64, ___cnd_timedwait)
>  #else
> -libc_hidden_ver (___cnd_timedwait64, __cnd_timedwait64)
> +libc_hidden_def (__cnd_timedwait64)
>  
>  int
>  ___cnd_timedwait (cnd_t *restrict cond, mtx_t *restrict mutex,
> diff --git a/sysdeps/unix/sysv/linux/csky/libanl.abilist
> b/sysdeps/unix/sysv/linux/csky/libanl.abilist index
> 416a6f8ddb..01f2e6cbf0 100644 ---
> a/sysdeps/unix/sysv/linux/csky/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/csky/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.29 gai_cancel F GLIBC_2.29 gai_error F
>  GLIBC_2.29 gai_suspend F
>  GLIBC_2.29 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist
> b/sysdeps/unix/sysv/linux/csky/libc.abilist index
> 85851c5fca..e8fce124fd 100644 ---
> a/sysdeps/unix/sysv/linux/csky/libc.abilist +++
> b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2266,16 +2266,83 @@
> GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/csky/librt.abilist
> b/sysdeps/unix/sysv/linux/csky/librt.abilist index
> c6690ef7c1..b60deca65a 100644 ---
> a/sysdeps/unix/sysv/linux/csky/librt.abilist +++
> b/sysdeps/unix/sysv/linux/csky/librt.abilist @@ -33,3 +33,8 @@
> GLIBC_2.29 timer_delete F GLIBC_2.29 timer_getoverrun F
>  GLIBC_2.29 timer_gettime F
>  GLIBC_2.29 timer_settime F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/time64-compat.h
> b/sysdeps/unix/sysv/linux/csky/time64-compat.h new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/csky/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/features-time64.h
> b/sysdeps/unix/sysv/linux/features-time64.h new file mode 100644
> index 0000000000..c6a0a1874c
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/features-time64.h
> @@ -0,0 +1,37 @@
> +/* Features part to handle 64-bit time_t support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* We need to know the word size in order to check the time size.  */
> +#include <bits/wordsize.h>
> +#include <bits/timesize.h>
> +
> +#if defined _TIME_BITS
> +# if _TIME_BITS == 64
> +#  if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
> +#   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
> +#  elif __TIMESIZE == 32
> +#   define __USE_TIME_BITS64	1
> +#  endif
> +# elif _TIME_BITS == 32
> +#  if __TIMESIZE > 32
> +#   error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32"
> +#  endif
> +# else
> +#  error Invalid _TIME_BITS value (can only be 32 or 64 bits)
> +# endif
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/hppa/libanl.abilist
> b/sysdeps/unix/sysv/linux/hppa/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/hppa/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist index
> ede69c7ed5..f196d94139 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2219,16 +2219,83 @@
> GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist
> b/sysdeps/unix/sysv/linux/hppa/librt.abilist index
> bb03781dcc..463a88a1df 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/librt.abilist +++
> b/sysdeps/unix/sysv/linux/hppa/librt.abilist @@ -32,6 +32,11 @@
> GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/time64-compat.h
> b/sysdeps/unix/sysv/linux/hppa/time64-compat.h new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/hppa/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/i386/Makefile
> b/sysdeps/unix/sysv/linux/i386/Makefile index da716e2c1b..8d5efb4f65
> 100644 --- a/sysdeps/unix/sysv/linux/i386/Makefile
> +++ b/sysdeps/unix/sysv/linux/i386/Makefile
> @@ -1,6 +1,8 @@
>  # The default ABI is 32.
>  default-abi := 32
>  
> +extra-version := Versions-y2038
> +
>  ifeq ($(subdir),misc)
>  sysdep_routines += ioperm iopl vm86
>  
> diff --git a/sysdeps/unix/sysv/linux/i386/libanl.abilist
> b/sysdeps/unix/sysv/linux/i386/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/i386/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/i386/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist
> b/sysdeps/unix/sysv/linux/i386/libc.abilist index
> c883dc08bc..0687af280c 100644 ---
> a/sysdeps/unix/sysv/linux/i386/libc.abilist +++
> b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2401,17 +2401,84 @@
> GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __isnanf128 F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist
> b/sysdeps/unix/sysv/linux/i386/librt.abilist index
> bb03781dcc..463a88a1df 100644 ---
> a/sysdeps/unix/sysv/linux/i386/librt.abilist +++
> b/sysdeps/unix/sysv/linux/i386/librt.abilist @@ -32,6 +32,11 @@
> GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/i386/time64-compat.h
> b/sysdeps/unix/sysv/linux/i386/time64-compat.h new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/i386/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/include/sys/msg.h
> b/sysdeps/unix/sysv/linux/include/sys/msg.h index
> 522903f818..c460be0dc9 100644 ---
> a/sysdeps/unix/sysv/linux/include/sys/msg.h +++
> b/sysdeps/unix/sysv/linux/include/sys/msg.h @@ -7,8 +7,6 @@ extern
> ssize_t __libc_msgrcv (int msqid, void *msgp, size_t msgsz, extern
> int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int
> msgflg); 
> -# include <bits/types/struct_msqid64_ds.h>
> -
>  # if __TIMESIZE == 64
>  #  define __msgctl64 __msgctl
>  # else
> diff --git a/sysdeps/unix/sysv/linux/include/sys/shm.h
> b/sysdeps/unix/sysv/linux/include/sys/shm.h index
> 530a1cdfc9..85177a632d 100644 ---
> a/sysdeps/unix/sysv/linux/include/sys/shm.h +++
> b/sysdeps/unix/sysv/linux/include/sys/shm.h @@ -3,8 +3,6 @@
>  
>  #ifndef _ISOMAC
>  
> -# include <bits/types/struct_shmid64_ds.h>
> -
>  # if __TIMESIZE == 64
>  #  define __shmctl64 __shmctl
>  # else
> diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h
> b/sysdeps/unix/sysv/linux/include/sys/timex.h index
> e136ed172e..c554248ed9 100644 ---
> a/sysdeps/unix/sysv/linux/include/sys/timex.h +++
> b/sysdeps/unix/sysv/linux/include/sys/timex.h @@ -23,10 +23,12 @@
>  
>  # ifndef _ISOMAC
>  
> +extern int __adjtimex (struct timex *__ntx);
>  libc_hidden_proto (__adjtimex)
>  
>  #  include <time.h>
>  #  include <struct___timeval64.h>
> +
>  /* Local definition of 64 bit time supporting timex struct */
>  #  if __TIMESIZE == 64
>  #   define __timex64 timex
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist index
> a8fafedb66..37f9b49e52 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist @@ -1,3 +1,4 @@
> +GLIBC_2.34 __gai_suspend_time64 F
>  GLIBC_2.4 gai_cancel F
>  GLIBC_2.4 gai_error F
>  GLIBC_2.4 gai_suspend F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index
> 8ee9648828..bfd2b7c135 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -190,16
> +190,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
> b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist index
> 3c0647b251..8cb1ed626c 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist @@ -1,3 +1,8 @@
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 aio_cancel F
>  GLIBC_2.4 aio_cancel64 F
>  GLIBC_2.4 aio_error F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index
> 1c51cb41ec..2bd9f7ab64 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2345,16
> +2345,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
> b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist index
> bb03781dcc..463a88a1df 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist @@ -32,6 +32,11
> @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/time64-compat.h
> b/sysdeps/unix/sysv/linux/m68k/time64-compat.h new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/m68k/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist
> b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist index
> 67c7554803..c06e33a1cf 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist @@ -2,3 +2,4
> @@ GLIBC_2.18 gai_cancel F GLIBC_2.18 gai_error F
>  GLIBC_2.18 gai_suspend F
>  GLIBC_2.18 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index
> f8b67cd170..2436c57b2e 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2317,16
> +2317,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
> b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist index
> 889dfbc0ee..1b8fc10087 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist @@ -33,3 +33,8
> @@ GLIBC_2.18 timer_delete F GLIBC_2.18 timer_getoverrun F
>  GLIBC_2.18 timer_gettime F
>  GLIBC_2.18 timer_settime F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist
> b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist index
> 67c7554803..c06e33a1cf 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist @@ -2,3 +2,4
> @@ GLIBC_2.18 gai_cancel F GLIBC_2.18 gai_error F
>  GLIBC_2.18 gai_suspend F
>  GLIBC_2.18 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index
> edac4a1bb4..1262d01845 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2314,16
> +2314,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
> b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist index
> 889dfbc0ee..1b8fc10087 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist @@ -33,3 +33,8
> @@ GLIBC_2.18 timer_delete F GLIBC_2.18 timer_getoverrun F
>  GLIBC_2.18 timer_gettime F
>  GLIBC_2.18 timer_settime F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/time64-compat.h
> b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h new file mode
> 100644 index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index
> db900c89ab..2812b458c8 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2310,16
> +2310,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist index
> 1539c1cef9..c4dd28e3b2 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist @@ -32,6 +32,11
> @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index
> 4e15f48b6c..782c5470a6 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2308,16
> +2308,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
> b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h new file mode
> 100644 index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist @@ -2,3 +2,4
> @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index
> 616a6076f1..3487d0f4c3 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2316,16
> +2316,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist index
> 1539c1cef9..c4dd28e3b2 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist @@ -32,6
> +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h new file
> mode 100644 index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/mtx_timedlock.c
> b/sysdeps/unix/sysv/linux/mtx_timedlock.c index
> 7715ebb315..8983eb8556 100644 ---
> a/sysdeps/unix/sysv/linux/mtx_timedlock.c +++
> b/sysdeps/unix/sysv/linux/mtx_timedlock.c @@ -21,8 +21,8 @@
>  #include "thrd_priv.h"
>  
>  int
> -___mtx_timedlock64 (mtx_t *restrict mutex,
> -                    const struct __timespec64 *restrict time_point)
> +__mtx_timedlock64 (mtx_t *restrict mutex,
> +                   const struct __timespec64 *restrict time_point)
>  {
>    int err_code = __pthread_mutex_timedlock64 ((pthread_mutex_t
> *)mutex, time_point);
> @@ -30,9 +30,9 @@ ___mtx_timedlock64 (mtx_t *restrict mutex,
>  }
>  
>  #if __TIMESIZE == 64
> -strong_alias (___mtx_timedlock64, ___mtx_timedlock)
> +strong_alias (__mtx_timedlock64, ___mtx_timedlock)
>  #else
> -libc_hidden_ver (___mtx_timedlock64, __mtx_timedlock64)
> +libc_hidden_def (__mtx_timedlock64)
>  
>  int
>  ___mtx_timedlock (mtx_t *restrict mutex,
> diff --git a/sysdeps/unix/sysv/linux/nios2/libanl.abilist
> b/sysdeps/unix/sysv/linux/nios2/libanl.abilist index
> 6ff9c2d94e..6b080bd075 100644 ---
> a/sysdeps/unix/sysv/linux/nios2/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/nios2/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.21 gai_cancel F GLIBC_2.21 gai_error F
>  GLIBC_2.21 gai_suspend F
>  GLIBC_2.21 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist index
> 0fc42897aa..056254475b 100644 ---
> a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2356,16 +2356,83 @@
> GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/nios2/librt.abilist
> b/sysdeps/unix/sysv/linux/nios2/librt.abilist index
> b4ae7a2dc2..2458614125 100644 ---
> a/sysdeps/unix/sysv/linux/nios2/librt.abilist +++
> b/sysdeps/unix/sysv/linux/nios2/librt.abilist @@ -33,3 +33,8 @@
> GLIBC_2.21 timer_delete F GLIBC_2.21 timer_getoverrun F
>  GLIBC_2.21 timer_gettime F
>  GLIBC_2.21 timer_settime F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/time64-compat.h
> b/sysdeps/unix/sysv/linux/nios2/time64-compat.h new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/nios2/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index
> 553ecdabc9..98e1da179b 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@
> -2372,16 +2372,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
> GLIBC_2.33 stat F GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist @@ -2,3
> +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist index
> bb03781dcc..463a88a1df 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist @@ -32,6
> +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index
> 7ec438f7b4..6dc0ecf108 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@
> -2405,16 +2405,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
> GLIBC_2.33 stat F GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h new file
> mode 100644 index 0000000000..700f854597 --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index
> 2274342208..230031f2be 100644 ---
> a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2370,16
> +2370,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist index
> bb03781dcc..463a88a1df 100644 ---
> a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist +++
> b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist @@ -32,6 +32,11
> @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
> b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h new file mode
> 100644 index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/semctl.c
> b/sysdeps/unix/sysv/linux/semctl.c index 1043b2b80d..bb2690d30f 100644
> --- a/sysdeps/unix/sysv/linux/semctl.c
> +++ b/sysdeps/unix/sysv/linux/semctl.c
> @@ -21,7 +21,6 @@
>  #include <ipc_priv.h>
>  #include <sysdep.h>
>  #include <shlib-compat.h>
> -#include <bits/types/struct_semid64_ds.h>  /* For __semid64_ds.  */
>  #include <linux/posix_types.h>             /* For __kernel_mode_t.
> */ 
>  /* The struct used to issue the syscall.  For architectures that
> assume diff --git a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist
> b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index
> 97942ff01a..72073ecc27 100644 ---
> a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2226,16 +2226,83 @@
> GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/librt.abilist
> b/sysdeps/unix/sysv/linux/sh/be/librt.abilist index
> bb03781dcc..463a88a1df 100644 ---
> a/sysdeps/unix/sysv/linux/sh/be/librt.abilist +++
> b/sysdeps/unix/sysv/linux/sh/be/librt.abilist @@ -32,6 +32,11 @@
> GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist
> b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist @@ -2,3 +2,4 @@
> GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index
> 617b673620..e07c4657f9 100644 ---
> a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2223,16 +2223,83 @@
> GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/librt.abilist
> b/sysdeps/unix/sysv/linux/sh/le/librt.abilist index
> bb03781dcc..463a88a1df 100644 ---
> a/sysdeps/unix/sysv/linux/sh/le/librt.abilist +++
> b/sysdeps/unix/sysv/linux/sh/le/librt.abilist @@ -32,6 +32,11 @@
> GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/sh/time64-compat.h
> b/sysdeps/unix/sysv/linux/sh/time64-compat.h new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/sh/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist index
> d9a5ed015d..ff719e7605 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist @@ -2,3 +2,4
> @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index
> 3c6559bb4f..7467677c1b 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2363,16
> +2363,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist index
> 38f0aad791..fb2769e87b 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist @@ -34,6 +34,11
> @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
> b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h new file mode
> 100644 index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h
> b/sysdeps/unix/sysv/linux/sys/timerfd.h index 4ad64c2259..790b9d5be6
> 100644 --- a/sysdeps/unix/sysv/linux/sys/timerfd.h
> +++ b/sysdeps/unix/sysv/linux/sys/timerfd.h
> @@ -47,9 +47,31 @@ extern int timerfd_settime (int __ufd, int __flags,
>  			    const struct itimerspec *__utmr,
>  			    struct itimerspec *__otmr) __THROW;
>  
> +#ifdef __USE_TIME_BITS64
> +# if defined(__REDIRECT_NTH)
> +extern int __REDIRECT_NTH (timerfd_settime,
> +                           (int __ufd, int __flags,
> +                            const struct itimerspec *__restrict
> __value,
> +                            struct itimerspec *__restrict __ovalue),
> +                           __timerfd_settime64);
> +# else
> +# define timerfd_settime __timerfd_settime64
> +# endif
> +#endif
> +
>  /* Return the next expiration time of UFD.  */
>  extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr)
> __THROW; 
> +#ifdef __USE_TIME_BITS64
> +# if defined(__REDIRECT_NTH)
> +extern int __REDIRECT_NTH (timerfd_gettime, (int __ufd,
> +                                             struct itimerspec
> *__otmr),
> +                           __timerfd_gettime64);
> +# else
> +# define timerfd_gettime __timerfd_gettime64
> +# endif
> +#endif
> +
>  __END_DECLS
>  
>  #endif /* sys/timerfd.h */
> diff --git a/sysdeps/unix/sysv/linux/sys/timex.h
> b/sysdeps/unix/sysv/linux/sys/timex.h index eb8d15a806..e17265c607
> 100644 --- a/sysdeps/unix/sysv/linux/sys/timex.h
> +++ b/sysdeps/unix/sysv/linux/sys/timex.h
> @@ -54,17 +54,34 @@ struct ntptimeval
>  
>  __BEGIN_DECLS
>  
> -extern int __adjtimex (struct timex *__ntx) __THROW;
> +#ifndef __USE_TIME_BITS64
>  extern int adjtimex (struct timex *__ntx) __THROW;
>  extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
>  
> -#ifdef __REDIRECT_NTH
> +# ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
> -			   ntp_gettimex);
> +                           ntp_gettimex);
> +# else
> +#  define ntp_gettime ntp_gettimex
> +# endif
> +extern int ntp_adjtime (struct timex *__tntx) __THROW;
>  #else
> -# define ntp_gettime ntp_gettimex
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx),
> +                           ___adjtimex64);
> +extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
> +                           __ntp_gettime64);
> +extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),
> +                           __ntp_gettimex64);
> +extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx),
> +                           ___adjtimex64);
> +# else
> +#  define adjtimex ___adjtimex64
> +#  define ntp_adjtime ___adjtimex64
> +#  define ntp_gettime __ntp_gettime64
> +#  define ntp_gettimex __ntp_gettimex64
> +# endif
>  #endif
> -extern int ntp_adjtime (struct timex *__tntx) __THROW;
>  
>  __END_DECLS
>  
> diff --git a/sysvipc/sys/msg.h b/sysvipc/sys/msg.h
> index 9ddedf5e15..f31a43757d 100644
> --- a/sysvipc/sys/msg.h
> +++ b/sysvipc/sys/msg.h
> @@ -58,7 +58,17 @@ struct msgbuf
>  __BEGIN_DECLS
>  
>  /* Message queue control operation.  */
> +#ifndef __USE_TIME_BITS64
>  extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf)
> __THROW; +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (msgctl,
> +                           (int __msqid, int __cmd, struct msqid_ds
> *__buf),
> +                           __msgctl64);
> +# else
> +#  define msgctl __msgctl64
> +# endif
> +#endif
>  
>  /* Get messages queue.  */
>  extern int msgget (key_t __key, int __msgflg) __THROW;
> diff --git a/sysvipc/sys/sem.h b/sysvipc/sys/sem.h
> index 03b65dff21..4eb4c51bbe 100644
> --- a/sysvipc/sys/sem.h
> +++ b/sysvipc/sys/sem.h
> @@ -48,7 +48,17 @@ struct sembuf
>  __BEGIN_DECLS
>  
>  /* Semaphore control operation.  */
> +#ifndef __USE_TIME_BITS64
>  extern int semctl (int __semid, int __semnum, int __cmd, ...)
> __THROW; +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (semctl,
> +                           (int __semid, int __semnum, int __cmd,
> ...),
> +                           __semctl64);
> +# else
> +#  define semctl __semctl64
> +# endif
> +#endif
>  
>  /* Get semaphore.  */
>  extern int semget (key_t __key, int __nsems, int __semflg) __THROW;
> @@ -58,8 +68,19 @@ extern int semop (int __semid, struct sembuf
> *__sops, size_t __nsops) __THROW; 
>  #ifdef __USE_GNU
>  /* Operate on semaphore with timeout.  */
> +# ifndef __USE_TIME_BITS64
>  extern int semtimedop (int __semid, struct sembuf *__sops, size_t
> __nsops, const struct timespec *__timeout) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (semtimedop, (int __semid, struct sembuf
> *__sops,
> +                                        size_t __nsops,
> +                                        const struct timespec
> *__timeout),
> +                           __semtimedop64);
> +#  else
> +#   define semtimedop __semtimedop64
> +#  endif
> +# endif
>  #endif
>  
>  __END_DECLS
> diff --git a/sysvipc/sys/shm.h b/sysvipc/sys/shm.h
> index 7506ba67bf..b09e0497e6 100644
> --- a/sysvipc/sys/shm.h
> +++ b/sysvipc/sys/shm.h
> @@ -46,7 +46,17 @@ __BEGIN_DECLS
>     facility.  The definition is found in XPG4.2.  */
>  
>  /* Shared memory control operation.  */
> +#ifndef __USE_TIME_BITS64
>  extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf)
> __THROW; +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (shmctl,
> +                           (int __shmid, int __cmd, struct shmid_ds
> *__buf),
> +                           __shmctl64);
> +# else
> +#  define shmctl __shmctl64
> +# endif
> +#endif
>  
>  /* Get shared memory segment.  */
>  extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
> diff --git a/time/sys/time.h b/time/sys/time.h
> index 42f91f186b..d21411c0b4 100644
> --- a/time/sys/time.h
> +++ b/time/sys/time.h
> @@ -63,10 +63,21 @@ struct timezone
>     use localtime etc. instead.
>     This function itself is semi-obsolete;
>     most callers should use time or clock_gettime instead. */
> +#ifndef __USE_TIME_BITS64
>  extern int gettimeofday (struct timeval *__restrict __tv,
>  			 void *__restrict __tz) __THROW __nonnull
> ((1)); +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (gettimeofday, (struct timeval *__restrict
> __tv,
> +                                          void *__restrict __tz),
> +                           __gettimeofday64) __nonnull ((1));
> +# else
> +#  define gettimeofday __gettimeofday64
> +# endif
> +#endif
>  
>  #ifdef __USE_MISC
> +# ifndef __USE_TIME_BITS64
>  /* Set the current time of day and timezone information.
>     This call is restricted to the super-user.
>     Setting the timezone in this way is obsolete, but we don't yet
> @@ -82,6 +93,20 @@ extern int settimeofday (const struct timeval
> *__tv, This call is restricted to the super-user.  */
>  extern int adjtime (const struct timeval *__delta,
>  		    struct timeval *__olddelta) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (settimeofday, (const struct timeval *__tv,
> +                                          const struct timezone
> *__tz),
> +                           __settimeofday64);
> +
> +extern int __REDIRECT_NTH (adjtime, (const struct timeval *__delta,
> +                                     struct timeval *__olddelta),
> +                           __adjtime64);
> +#  else
> +#   define settimeofday __settimeofday64
> +#   define adjtime __adjtime64
> +#  endif
> +# endif
>  #endif
>  
>  
> @@ -118,6 +143,7 @@ typedef enum __itimer_which __itimer_which_t;
>  typedef int __itimer_which_t;
>  #endif
>  
> +#ifndef __USE_TIME_BITS64
>  /* Set *VALUE to the current setting of timer WHICH.
>     Return 0 on success, -1 on errors.  */
>  extern int getitimer (__itimer_which_t __which,
> @@ -136,21 +162,66 @@ extern int setitimer (__itimer_which_t __which,
>  extern int utimes (const char *__file, const struct timeval __tvp[2])
>       __THROW __nonnull ((1));
>  
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (getitimer, (__itimer_which_t __which,
> +                                       struct itimerval *__value),
> +                           __getitimer64);
> +
> +extern int __REDIRECT_NTH (setitimer, (__itimer_which_t __which,
> +                                       const struct itimerval
> *__restrict __new,
> +                                       struct itimerval *__restrict
> __old),
> +                           __setitimer64);
> +
> +extern int __REDIRECT_NTH (utimes, (const char *__file,
> +                                    const struct timeval __tvp[2]),
> +                           __utimes64) __nonnull ((1));
> +# else
> +#  define getitimer __getitimer64
> +#  define setitimer __setitimer64
> +#  define utimes __utimes64
> +# endif
> +#endif
> +
>  #ifdef __USE_MISC
> +# ifndef __USE_TIME_BITS64
>  /* Same as `utimes', but does not follow symbolic links.  */
>  extern int lutimes (const char *__file, const struct timeval
> __tvp[2]) __THROW __nonnull ((1));
>  
>  /* Same as `utimes', but takes an open file descriptor instead of a
> name.  */ extern int futimes (int __fd, const struct timeval
> __tvp[2]) __THROW; +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (lutimes, (const char *__file,
> +                                     const struct timeval __tvp[2]),
> +                           __lutimes64) __nonnull ((1));
> +
> +extern int __REDIRECT_NTH (futimes, (int __fd, const struct timeval
> __tvp[2]),
> +                           __futimes64);
> +#  else
> +#   define lutimes __lutimes64
> +#   define futimes __futimes64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_GNU
> +# ifndef __USE_TIME_BITS64
>  /* Change the access time of FILE relative to FD to TVP[0] and the
>     modification time of FILE to TVP[1].  If TVP is a null pointer,
> use the current time instead.  Returns 0 on success, -1 on errors.  */
>  extern int futimesat (int __fd, const char *__file,
>  		      const struct timeval __tvp[2]) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (futimesat, (int __fd, const char *__file,
> +                                       const struct timeval
> __tvp[2]),
> +                           __futimesat64);
> +#  else
> +#   define futimesat __futimesat64
> +#  endif
> +# endif
>  #endif
>  
>  
> diff --git a/time/time.h b/time/time.h
> index e255db9772..bde870c934 100644
> --- a/time/time.h
> +++ b/time/time.h
> @@ -71,6 +71,7 @@ __BEGIN_DECLS
>     The result / CLOCKS_PER_SEC is program time in seconds.  */
>  extern clock_t clock (void) __THROW;
>  
> +#ifndef __USE_TIME_BITS64
>  /* Return the current time and put it in *TIMER if TIMER is not
> NULL.  */ extern time_t time (time_t *__timer) __THROW;
>  
> @@ -80,7 +81,18 @@ extern double difftime (time_t __time1, time_t
> __time0) 
>  /* Return the `time_t' representation of TP and normalize TP.  */
>  extern time_t mktime (struct tm *__tp) __THROW;
> -
> +#else
> +# ifdef __REDIRECT_NTH
> +extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64);
> +extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t
> __time0),
> +                              __difftime64) __attribute__
> ((__const__)); +extern time_t __REDIRECT_NTH (mktime, (struct tm
> *__tp), __mktime64); +# else
> +#  define time __time64
> +#  define difftime __difftime64
> +#  define mktime __mktime64
> +# endif
> +#endif
>  
>  /* Format TP into S according to FORMAT.
>     Write no more than MAXSIZE characters and return the number
> @@ -114,6 +126,7 @@ extern char *strptime_l (const char *__restrict
> __s, #endif
>  
>  
> +#ifndef __USE_TIME_BITS64
>  /* Return the `struct tm' representation of *TIMER
>     in Universal Coordinated Time (aka Greenwich Mean Time).  */
>  extern struct tm *gmtime (const time_t *__timer) __THROW;
> @@ -122,7 +135,20 @@ extern struct tm *gmtime (const time_t *__timer)
> __THROW; of *TIMER in the local timezone.  */
>  extern struct tm *localtime (const time_t *__timer) __THROW;
>  
> +#else
> +# ifdef __REDIRECT_NTH
> +extern struct tm*__REDIRECT_NTH (gmtime, (const time_t *__timer),
> __gmtime64); +extern struct tm *__REDIRECT_NTH (localtime, (const
> time_t *__timer),
> +				  __localtime64);
> +# else
> +#  define gmtime __gmtime64
> +#  define localtime __localtime64
> +# endif
> +#endif
> +
> +
>  #if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
> +# ifndef __USE_TIME_BITS64
>  /* Return the `struct tm' representation of *TIMER in UTC,
>     using *TP to store the result.  */
>  extern struct tm *gmtime_r (const time_t *__restrict __timer,
> @@ -132,6 +158,20 @@ extern struct tm *gmtime_r (const time_t
> *__restrict __timer, using *TP to store the result.  */
>  extern struct tm *localtime_r (const time_t *__restrict __timer,
>  			       struct tm *__restrict __tp) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern struct tm*__REDIRECT_NTH (gmtime_r, (const time_t *__restrict
> __timer,
> +                                            struct tm *__restrict
> __tp),
> +                                 __gmtime64_r);
> +
> +extern struct tm*__REDIRECT_NTH (localtime_r, (const time_t
> *__restrict __t,
> +                                               struct tm *__restrict
> __tp),
> +                                 __localtime64_r);
> +#  else
> +#   define gmtime_r __gmtime64_r
> +#   define localtime_r __localtime_r
> +#  endif
> +# endif
>  #endif	/* POSIX || C2X */
>  
>  /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n"
> @@ -139,7 +179,15 @@ extern struct tm *localtime_r (const time_t
> *__restrict __timer, extern char *asctime (const struct tm *__tp)
> __THROW; 
>  /* Equivalent to `asctime (localtime (timer))'.  */
> +#ifndef __USE_TIME_BITS64
>  extern char *ctime (const time_t *__timer) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern char *__REDIRECT_NTH (ctime, (const time_t *__timer),
> __ctime64); +# else
> +#  define ctime __ctime64
> +# endif
> +#endif
>  
>  #ifdef __USE_POSIX
>  /* Reentrant versions of the above functions.  */
> @@ -150,8 +198,18 @@ extern char *asctime_r (const struct tm
> *__restrict __tp, char *__restrict __buf) __THROW;
>  
>  /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'.  */
> +#ifndef __USE_TIME_BITS64
>  extern char *ctime_r (const time_t *__restrict __timer,
>  		      char *__restrict __buf) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern char *__REDIRECT_NTH (ctime_r, (const time_t *__restrict
> __timer,
> +                                       char *__restrict __buf),
> __ctime64_r); +# else
> +#  define ctime_r __ctime64_r
> +# endif
> +#endif
> +
>  #endif	/* POSIX */
>  
>  
> @@ -186,11 +244,19 @@ extern long int timezone;
>  /* Miscellaneous functions many Unices inherited from the public
> domain localtime package.  These are included only for compatibility.
>  */ 
> +#ifndef __USE_TIME_BITS64
>  /* Like `mktime', but for TP represents Universal Time, not local
> time.  */ extern time_t timegm (struct tm *__tp) __THROW;
> -
>  /* Another name for `mktime'.  */
>  extern time_t timelocal (struct tm *__tp) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64);
> +extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp),
> __mktime64); +# else
> +#  define timegm __timegm64
> +# endif
> +#endif
>  
>  /* Return the number of days in YEAR.  */
>  extern int dysize (int __year) __THROW  __attribute__ ((__const__));
> @@ -198,6 +264,7 @@ extern int dysize (int __year) __THROW
> __attribute__ ((__const__)); 
>  
>  #ifdef __USE_POSIX199309
> +# ifndef __USE_TIME_BITS64
>  /* Pause execution for a number of nanoseconds.
>  
>     This function is a cancellation point and therefore not marked
> with @@ -205,7 +272,6 @@ extern int dysize (int __year) __THROW
> __attribute__ ((__const__)); extern int nanosleep (const struct
> timespec *__requested_time, struct timespec *__remaining);
>  
> -
>  /* Get resolution of clock CLOCK_ID.  */
>  extern int clock_getres (clockid_t __clock_id, struct timespec
> *__res) __THROW; 
> @@ -215,15 +281,46 @@ extern int clock_gettime (clockid_t __clock_id,
> struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP.  */
>  extern int clock_settime (clockid_t __clock_id, const struct
> timespec *__tp) __THROW;
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (nanosleep, (const struct timespec
> *__requested_time,
> +                                   struct timespec *__remaining),
> +                       __nanosleep64);
> +extern int __REDIRECT_NTH (clock_getres, (clockid_t __clock_id,
> +                                          struct timespec *__res),
> +                           __clock_getres64);
> +extern int __REDIRECT_NTH (clock_gettime, (clockid_t __clock_id,
> struct
> +                                           timespec *__tp),
> __clock_gettime64); +extern int __REDIRECT_NTH (clock_settime,
> (clockid_t __clock_id, const struct
> +                                           timespec *__tp),
> __clock_settime64); +#  else
> +#   define nanosleep __nanosleep64
> +#   define clock_getres __clock_getres64
> +#   define clock_gettime __clock_gettime64
> +#   define clock_settime __clock_settime64
> +#  endif
> +# endif
> +
>  
>  # ifdef __USE_XOPEN2K
>  /* High-resolution sleep with the specified clock.
>  
>     This function is a cancellation point and therefore not marked
> with __THROW.  */
> +#  ifndef __USE_TIME_BITS64
>  extern int clock_nanosleep (clockid_t __clock_id, int __flags,
>  			    const struct timespec *__req,
>  			    struct timespec *__rem);
> +#  else
> +#   ifdef __REDIRECT
> +extern int __REDIRECT (clock_nanosleep, (clockid_t __clock_id, int
> __flags,
> +                                         const struct timespec
> *__req,
> +                                         struct timespec *__rem),
> +                       __clock_nanosleep_time64);
> +#   else
> +#    define clock_nanosleep __clock_nanosleep_time64
> +#   endif
> +#  endif
>  
>  /* Return clock ID for CPU-time clock.  */
>  extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id)
> __THROW; @@ -239,6 +336,7 @@ extern int timer_create (clockid_t
> __clock_id, extern int timer_delete (timer_t __timerid) __THROW;
>  
>  /* Set timer TIMERID to VALUE, returning old value in OVALUE.  */
> +# ifndef __USE_TIME_BITS64
>  extern int timer_settime (timer_t __timerid, int __flags,
>  			  const struct itimerspec *__restrict
> __value, struct itimerspec *__restrict __ovalue) __THROW;
> @@ -246,6 +344,21 @@ extern int timer_settime (timer_t __timerid, int
> __flags, /* Get current value of timer TIMERID and store it in VALUE.
>  */ extern int timer_gettime (timer_t __timerid, struct itimerspec
> *__value) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (timer_settime, (timer_t __timerid, int
> __flags,
> +     const struct itimerspec *__restrict __value,
> +     struct itimerspec *__restrict __ovalue),
> +                          __timer_settime64);
> +
> +extern int __REDIRECT_NTH (timer_gettime, (timer_t __timerid,
> +                                           struct itimerspec
> *__value),
> +                           __timer_gettime64);
> +#  else
> +#   define timer_settime __timer_settime64
> +#   define timer_gettime __timer_gettime64
> +#  endif
> +# endif
>  
>  /* Get expiration overrun for timer TIMERID.  */
>  extern int timer_getoverrun (timer_t __timerid) __THROW;
> @@ -253,16 +366,35 @@ extern int timer_getoverrun (timer_t __timerid)
> __THROW; 
>  
>  #ifdef __USE_ISOC11
> +# ifndef __USE_TIME_BITS64
>  /* Set TS to calendar time based in time base BASE.  */
>  extern int timespec_get (struct timespec *__ts, int __base)
>       __THROW __nonnull ((1));
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (timespec_get, (struct timespec *__ts, int
> __base),
> +                           __timespec_get64) __nonnull ((1));
> +#  else
> +#   define timespec_get __timespec_get64
> +#  endif
> +# endif
>  #endif
>  
>  
>  #if __GLIBC_USE (ISOC2X)
> +# ifndef __USE_TIME_BITS64
>  /* Set TS to resolution of time base BASE.  */
>  extern int timespec_getres (struct timespec *__ts, int __base)
>       __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (timespec_getres, (struct timespec *__ts,
> +                                             int __base),
> +                           __timespec_getres64);
> +#  else
> +#   define timespec_getres __timespec_getres64
> +#  endif
> +# endif
>  #endif
>  
>  



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support
  2021-05-18 20:56 ` [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support Adhemerval Zanella
@ 2021-05-19 10:44   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19 10:44 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 32620 bytes --]

On Tue, 18 May 2021 17:56:08 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The glob might pass a different stat struct for gl_stat and gl_lstat
> when GLOB_ALTDIRFUNC is used.  This requires add a new 64 time
> version that also uses 64 time stat functions.
> 
> Checked on i686-linux-gnu and x86_64-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  include/glob.h                                | 28 +++++++++++
>  posix/Makefile                                |  5 +-
>  posix/glob.c                                  | 46 +++++++++--------
>  posix/glob.h                                  | 22 +++++++++
>  posix/glob64-lstat-compat.c                   |  3 +-
>  posix/glob64-time64.c                         | 49
> +++++++++++++++++++ posix/globfree64-time64.c                     |
> 30 ++++++++++++ sysdeps/gnu/glob64-lstat-compat.c             |  3 +-
>  sysdeps/unix/sysv/linux/Versions              |  2 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 +
>  sysdeps/unix/sysv/linux/glob-lstat-compat.c   |  6 ++-
>  sysdeps/unix/sysv/linux/glob.c                |  6 +++
>  sysdeps/unix/sysv/linux/glob64-lstat-compat.c | 12 ++---
>  sysdeps/unix/sysv/linux/glob64-time64.c       | 44 +++++++++++++++++
>  sysdeps/unix/sysv/linux/glob64.c              |  8 +--
>  sysdeps/unix/sysv/linux/globfree64-time64.c   | 35 +++++++++++++
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  2 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  2 +
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  2 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  2 +
>  .../sysv/linux/microblaze/be/libc.abilist     |  2 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  2 +
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  2 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  2 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 +
>  sysdeps/unix/sysv/linux/oldglob.c             | 11 ++---
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  2 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  2 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  2 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  2 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  2 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  2 +
>  35 files changed, 308 insertions(+), 40 deletions(-)
>  create mode 100644 posix/glob64-time64.c
>  create mode 100644 posix/globfree64-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/glob64-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/globfree64-time64.c
> 
> diff --git a/include/glob.h b/include/glob.h
> index 1d2f78793e..f48c71960d 100644
> --- a/include/glob.h
> +++ b/include/glob.h
> @@ -2,11 +2,39 @@
>  #include <posix/glob.h>
>  
>  #ifndef _ISOMAC
> +# include <sys/types.h>
> +
>  libc_hidden_proto (glob)
>  libc_hidden_proto (glob64)
>  libc_hidden_proto (globfree)
>  libc_hidden_proto (globfree64)
>  
> +# if __TIMESIZE == 64
> +#  define glob64_time64_t glob64_t
> +# else
> +# include <sys/stat.h>
> +
> +typedef struct
> +  {
> +    size_t gl_pathc;
> +    char **gl_pathv;
> +    size_t gl_offs;
> +    int gl_flags;
> +
> +    void (*gl_closedir) (void *);
> +    struct dirent64 *(*gl_readdir) (void *);
> +    void *(*gl_opendir) (const char *);
> +    int (*gl_lstat) (const char *__restrict, struct __stat64_t64
> *__restrict);
> +    int (*gl_stat) (const char *__restrict, struct __stat64_t64
> *__restrict);
> +  } glob64_time64_t;
> +
> +extern int __glob64_time64 (const char *pattern, int flags,
> +			    int (*errfunc) (const char *, int),
> +			    glob64_time64_t *pglob);
> +void __globfree64_time64 (glob64_time64_t *pglob);
> +libc_hidden_proto (__globfree64_time64)
> +# endif
> +
>  /* Now define the internal interfaces.  */
>  extern int __glob_pattern_p (const char *__pattern, int __quote);
>  extern int __glob64 (const char *__pattern, int __flags,
> diff --git a/posix/Makefile b/posix/Makefile
> index fa0dc0ea20..84204b1270 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -67,7 +67,10 @@ routines :=
> 			      \ get_child_max sched_cpucount
> sched_cpualloc sched_cpufree \ streams-compat \
>  	shm-directory
>          \
> -	execveat
> +	execveat \
> +	shm-directory \
> +	glob64-time64 \
> +	globfree64-time64
>  
>  aux		:= init-posix environ
>  tests		:= test-errno tstgetopt testfnm runtests
> runptests \ diff --git a/posix/glob.c b/posix/glob.c
> index 32c88e5d15..593a4c358f 100644
> --- a/posix/glob.c
> +++ b/posix/glob.c
> @@ -59,25 +59,37 @@
>  # define readdir(str) __readdir64 (str)
>  # define getpwnam_r(name, bufp, buf, len, res) \
>      __getpwnam_r (name, bufp, buf, len, res)
> -# define struct_stat64          struct stat64
>  # define FLEXIBLE_ARRAY_MEMBER
> +# ifndef struct_stat
> +#  define struct_stat           struct stat
> +# endif
> +# ifndef struct_stat64
> +#  define struct_stat64         struct stat64
> +# endif
> +# ifndef GLOB_LSTAT
> +#  define GLOB_LSTAT            gl_lstat
> +# endif
> +# ifndef GLOB_STAT64
> +#  define GLOB_STAT64           __stat64
> +# endif
> +# ifndef GLOB_LSTAT64
> +#  define GLOB_LSTAT64          __lstat64
> +# endif
>  # include <shlib-compat.h>
>  #else /* !_LIBC */
>  # define __glob                 glob
>  # define __getlogin_r(buf, len) getlogin_r (buf, len)
> -# define __lstat64(fname, buf)  lstat (fname, buf)
> -# if defined _WIN32 && !defined __CYGWIN__
> -   /* Avoid GCC or clang warning.  The original __stat64 macro is
> unused.  */ -#  undef __stat64
> -# endif
> -# define __stat64(fname, buf)   stat (fname, buf)
>  # define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag)
> -# define struct_stat64          struct stat
>  # ifndef __MVS__
>  #  define __alloca              alloca
>  # endif
>  # define __readdir              readdir
>  # define COMPILE_GLOB64
> +# define struct_stat            struct stat
> +# define struct_stat64          struct stat
> +# define GLOB_LSTAT             gl_lstat
> +# define GLOB_STAT64            stat
> +# define GLOB_LSTAT64           lstat
>  #endif /* _LIBC */
>  
>  #include <fnmatch.h>
> @@ -196,22 +208,14 @@ glob_lstat (glob_t *pglob, int flags, const
> char *fullname) {
>  /* Use on glob-lstat-compat.c to provide a compat symbol which does
> not use lstat / gl_lstat.  */
> -#ifdef GLOB_NO_LSTAT
> -# define GL_LSTAT gl_stat
> -# define LSTAT64 __stat64
> -#else
> -# define GL_LSTAT gl_lstat
> -# define LSTAT64 __lstat64
> -#endif
> -
>    union
>    {
> -    struct stat st;
> +    struct_stat st;
>      struct_stat64 st64;
>    } ust;
>    return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC)
> -          ? pglob->GL_LSTAT (fullname, &ust.st)
> -          : LSTAT64 (fullname, &ust.st64));
> +          ? pglob->GLOB_LSTAT (fullname, &ust.st)
> +          : GLOB_LSTAT64 (fullname, &ust.st64));
>  }
>  
>  /* Set *R = A + B.  Return true if the answer is mathematically
> @@ -249,11 +253,11 @@ static int collated_compare (const void *,
> const void *) __THROWNL; static bool
>  is_dir (char const *filename, int flags, glob_t const *pglob)
>  {
> -  struct stat st;
> +  struct_stat st;
>    struct_stat64 st64;
>    return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC)
>            ? pglob->gl_stat (filename, &st) == 0 && S_ISDIR
> (st.st_mode)
> -          : __stat64 (filename, &st64) == 0 && S_ISDIR
> (st64.st_mode));
> +          : GLOB_STAT64 (filename, &st64) == 0 && S_ISDIR
> (st64.st_mode)); }
>  
>  /* Find the end of the sub-pattern in a brace expression.  */
> diff --git a/posix/glob.h b/posix/glob.h
> index b5686600c7..700aeb2392 100644
> --- a/posix/glob.h
> +++ b/posix/glob.h
> @@ -150,20 +150,42 @@ extern int glob (const char *__restrict
> __pattern, int __flags, /* Free storage allocated in PGLOB by a
> previous `glob' call.  */ extern void globfree (glob_t *__pglob)
> __THROW; #else
> +# ifdef __USE_TIME_BITS64
> +extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
> +				    int __flags,
> +				    int (*__errfunc) (const char *,
> int),
> +				    glob_t *__restrict __pglob),
> +			     __glob64_time64);
> +
> +extern void __REDIRECT_NTH (globfree, (glob_t *__pglob),
> +			    __globfree64_time64);
> +# else
>  extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
>  				    int __flags,
>  				    int (*__errfunc) (const char *,
> int), glob_t *__restrict __pglob), glob64);
>  
>  extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
> +# endif
>  #endif
>  
>  #ifdef __USE_LARGEFILE64
> +# ifdef __USE_TIME_BITS64
> +extern int __REDIRECT_NTHNL (glob64, (const char *__restrict
> __pattern,
> +				      int __flags,
> +				      int (*__errfunc) (const char
> *, int),
> +				      glob64_t *__restrict __pglob),
> +			     __glob64_time64);
> +
> +extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob),
> +			    __globfree64_time64);
> +# else
>  extern int glob64 (const char *__restrict __pattern, int __flags,
>  		   int (*__errfunc) (const char *, int),
>  		   glob64_t *__restrict __pglob) __THROWNL;
>  
>  extern void globfree64 (glob64_t *__pglob) __THROW;
> +# endif
>  #endif
>  
>  
> diff --git a/posix/glob64-lstat-compat.c b/posix/glob64-lstat-compat.c
> index bd81a1e390..e90d4ae93e 100644
> --- a/posix/glob64-lstat-compat.c
> +++ b/posix/glob64-lstat-compat.c
> @@ -28,7 +28,8 @@
>  # define GLOB_ATTRIBUTE attribute_compat_text_section
>  
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -# define GLOB_NO_LSTAT
> +# define GLOB_LSTAT   gl_stat
> +# define GLOB_LSTAT64 __stat64
>  
>  # include <posix/glob64.c>
>  
> diff --git a/posix/glob64-time64.c b/posix/glob64-time64.c
> new file mode 100644
> index 0000000000..04db45f93a
> --- /dev/null
> +++ b/posix/glob64-time64.c
> @@ -0,0 +1,49 @@
> +/* Long File Support glob with 64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <errno.h>
> +#include <glob.h>
> +#include <stddef.h>
> +
> +#if __TIMESIZE != 64
> +
> +/* Do glob searching for PATTERN, placing results in PGLOB.
> +   The bits defined above may be set in FLAGS.
> +   If a directory cannot be opened or read and ERRFUNC is not nil,
> +   it is called with the pathname that caused the error, and the
> +   `errno' value from the failing call; if it returns non-zero
> +   `glob' returns GLOB_ABORTED; if it returns zero, the error is
> ignored.
> +   If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
> +   Otherwise, `glob' returns zero.  */
> +int
> +__glob64_time64 (const char *pattern, int flags,
> +		 int (*errfunc) (const char *, int), glob64_time64_t
> *pglob) +{
> +  if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) !=
> 0)
> +    {
> +      __set_errno (EINVAL);
> +      return -1;
> +    }
> +
> +  __set_errno (ENOSYS);
> +  return GLOB_NOSYS;
> +}
> +
> +stub_warning (glob64)
> +
> +#endif
> diff --git a/posix/globfree64-time64.c b/posix/globfree64-time64.c
> new file mode 100644
> index 0000000000..d815bc6df1
> --- /dev/null
> +++ b/posix/globfree64-time64.c
> @@ -0,0 +1,30 @@
> +/* Long File Support globfree with 64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <glob.h>
> +
> +#if __TIMESIZE != 64
> +
> +/* Free storage allocated in PGLOB by a previous `glob' call.  */
> +void
> +__globfree64_time64 (glob64_time64_t *pglob)
> +{
> +}
> +libc_hidden_def (__globfree64_time64)
> +
> +#endif
> diff --git a/sysdeps/gnu/glob64-lstat-compat.c
> b/sysdeps/gnu/glob64-lstat-compat.c index 6764f1d062..ade4ccac8a
> 100644 --- a/sysdeps/gnu/glob64-lstat-compat.c
> +++ b/sysdeps/gnu/glob64-lstat-compat.c
> @@ -39,7 +39,8 @@
>  #define GLOB_ATTRIBUTE attribute_compat_text_section
>  
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -#define GLOB_NO_LSTAT
> +#define GLOB_LSTAT   gl_stat
> +#define GLOB_LSTAT64 __stat64
>  
>  #include <posix/glob.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/Versions
> b/sysdeps/unix/sysv/linux/Versions index 52fedc61f0..27a464483b 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -192,6 +192,8 @@ libc {
>      __getitimer64;
>      __getrusage64;
>      __gettimeofday64;
> +    __glob64_time64;
> +    __globfree64_time64;
>      __gmtime64;
>      __gmtime64_r;
>      __localtime64;
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index
> 694033a42b..397c97cc16 100644 ---
> a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -208,6 +208,8 @@
> GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index
> 1ead45904f..9bc948703c 100644 ---
> a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -205,6 +205,8 @@
> GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist
> b/sysdeps/unix/sysv/linux/csky/libc.abilist index
> e8fce124fd..0f84021d9f 100644 ---
> a/sysdeps/unix/sysv/linux/csky/libc.abilist +++
> b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2285,6 +2285,8 @@
> GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/glob-lstat-compat.c
> b/sysdeps/unix/sysv/linux/glob-lstat-compat.c index
> 1f502e3299..7729e0dc12 100644 ---
> a/sysdeps/unix/sysv/linux/glob-lstat-compat.c +++
> b/sysdeps/unix/sysv/linux/glob-lstat-compat.c @@ -30,7 +30,11 @@
>  #define GLOB_ATTRIBUTE attribute_compat_text_section
>  
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -#define GLOB_NO_LSTAT
> +#define struct_stat    struct stat
> +#define struct_stat64  struct stat64
> +#define GLOB_LSTAT     gl_stat
> +#define GLOB_STAT64    __stat64
> +#define GLOB_LSTAT64   __stat64
>  
>  #include <posix/glob.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/glob.c
> b/sysdeps/unix/sysv/linux/glob.c index 1be4885b96..89c287d01d 100644
> --- a/sysdeps/unix/sysv/linux/glob.c
> +++ b/sysdeps/unix/sysv/linux/glob.c
> @@ -19,6 +19,12 @@
>  #include <sys/stat.h>
>  #include <kernel_stat.h>
>  
> +#define struct_stat    struct stat
> +#define struct_stat64  struct stat64
> +#define GLOB_LSTAT     gl_lstat
> +#define GLOB_STAT64    __stat64
> +#define GLOB_LSTAT64   __lstat64
> +
>  #define glob64 __no_glob64_decl
>  #define __glob64 __no___glob64_decl
>  #include <posix/glob.c>
> diff --git a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
> b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c index
> 40ad625f58..302a44d3a4 100644 ---
> a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c +++
> b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c @@ -33,15 +33,15 @@
>  # define __glob __glob64_lstat_compat
>  # define globfree globfree64
>  
> -# undef stat
> -# define stat stat64
> -
> -# define COMPILE_GLOB64	1
> -
>  # define GLOB_ATTRIBUTE attribute_compat_text_section
>  
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -# define GLOB_NO_LSTAT
> +# define COMPILE_GLOB64	1
> +# define struct_stat    struct stat64
> +# define struct_stat64  struct stat64
> +# define GLOB_LSTAT     gl_stat
> +# define GLOB_STAT64    __stat64
> +# define GLOB_LSTAT64   __stat64
>  
>  # include <posix/glob.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/glob64-time64.c
> b/sysdeps/unix/sysv/linux/glob64-time64.c new file mode 100644
> index 0000000000..260f067fa4
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/glob64-time64.c
> @@ -0,0 +1,44 @@
> +/* Find pathnames matching a pattern.  Linux version.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +# include <glob.h>
> +# include <dirent.h>
> +# include <sys/stat.h>
> +
> +# define dirent dirent64
> +# define __readdir(dirp) __readdir64 (dirp)
> +
> +# define glob_t glob64_time64_t
> +# define __glob __glob64_time64
> +
> +# define globfree(pglob) __globfree64_time64 (pglob)
> +
> +# define COMPILE_GLOB64  1
> +# define struct_stat     struct __stat64_t64
> +# define struct_stat64   struct __stat64_t64
> +# define GLOB_LSTAT      gl_lstat
> +# define GLOB_STAT64     __stat64_time64
> +# define GLOB_LSTAT64    __lstat64_time64
> +
> +# define COMPILE_GLOB64	1
> +
> +# include <posix/glob.c>
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/glob64.c
> b/sysdeps/unix/sysv/linux/glob64.c index 3cbadf34fb..572ca215df 100644
> --- a/sysdeps/unix/sysv/linux/glob64.c
> +++ b/sysdeps/unix/sysv/linux/glob64.c
> @@ -31,10 +31,12 @@
>  # define __glob __glob64
>  # define globfree(pglob) globfree64 (pglob)
>  
> -# undef stat
> -# define stat stat64
> -
>  # define COMPILE_GLOB64	1
> +# define struct_stat    struct stat64
> +# define struct_stat64  struct stat64
> +# define GLOB_LSTAT     gl_lstat
> +# define GLOB_STAT64    __stat64
> +# define GLOB_LSTAT64   __lstat64
>  
>  # include <posix/glob.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/globfree64-time64.c
> b/sysdeps/unix/sysv/linux/globfree64-time64.c new file mode 100644
> index 0000000000..d6b1e6ac49
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/globfree64-time64.c
> @@ -0,0 +1,35 @@
> +/* Frees the dynamically allocated storage from an earlier call to
> glob.
> +   Linux version.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +# include <glob.h>
> +# include <dirent.h>
> +# include <sys/stat.h>
> +
> +# define glob_t glob64_time64_t
> +# define globfree(pglob) __globfree64_time64 (pglob)
> +
> +# undef stat
> +# define stat __stat64_t64
> +
> +# include <posix/globfree.c>
> +libc_hidden_def (__globfree64_time64)
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist index
> f196d94139..31caf8ebc3 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2238,6 +2238,8 @@
> GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist
> b/sysdeps/unix/sysv/linux/i386/libc.abilist index
> 0687af280c..75b71b8a5b 100644 ---
> a/sysdeps/unix/sysv/linux/i386/libc.abilist +++
> b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2420,6 +2420,8 @@
> GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __isnanf128 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index
> bfd2b7c135..2f93afc071 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -209,6 +209,8
> @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index
> 2bd9f7ab64..dc074cf576 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2364,6 +2364,8
> @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index
> 2436c57b2e..a8b8366c48 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2336,6
> +2336,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index
> 1262d01845..63e3b096e3 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2333,6
> +2333,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index
> 2812b458c8..3d17b78b42 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2329,6
> +2329,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index
> 782c5470a6..ba96f15040 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2327,6
> +2327,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index
> 3487d0f4c3..04cc170344 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2335,6
> +2335,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist index
> 056254475b..ce21e19622 100644 ---
> a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2375,6 +2375,8 @@
> GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/oldglob.c
> b/sysdeps/unix/sysv/linux/oldglob.c index 59bf89dc1d..a9a4439ddb
> 100644 --- a/sysdeps/unix/sysv/linux/oldglob.c
> +++ b/sysdeps/unix/sysv/linux/oldglob.c
> @@ -28,13 +28,12 @@ libc_hidden_proto (__old_glob64);
>  #define convert_dirent __old_convert_dirent
>  #define glob_in_dir __old_glob_in_dir
>  
> -#undef stat
> -#define stat stat64
> -#undef __stat
> -#define __stat(file, buf) __stat64 (file, buf)
> -
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -#define GLOB_NO_LSTAT
> +#define struct_stat    struct stat64
> +#define struct_stat64  struct stat64
> +#define GLOB_LSTAT     gl_stat
> +#define GLOB_STAT64    __stat64
> +#define GLOB_LSTAT64   __stat64
>  
>  #define GLOB_ATTRIBUTE attribute_compat_text_section
>  
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index
> 98e1da179b..4cfae3b735 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@
> -2391,6 +2391,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34
> __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34
> __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index
> 6dc0ecf108..3e03f313b1 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@
> -2424,6 +2424,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34
> __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34
> __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index
> 230031f2be..4dfdc61761 100644 ---
> a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2389,6
> +2389,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index
> 72073ecc27..2c00100dd6 100644 ---
> a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2245,6 +2245,8 @@
> GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index
> e07c4657f9..2bcf38af9b 100644 ---
> a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2242,6 +2242,8 @@
> GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index
> 7467677c1b..dad08de21f 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2382,6
> +2382,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 21/25] io: Add fts64 with 64 bit time_t support
  2021-05-18 20:56 ` [PATCH v2 21/25] io: Add fts64 " Adhemerval Zanella
@ 2021-05-19 10:50   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19 10:50 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 22508 bytes --]

On Tue, 18 May 2021 17:56:09 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> Similar to glob, fts routines passes a stat pointer that might
> differ of size and layout when 64 bit time API is used.
> 
> Checked on i686-linux-gnu and x86_64-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  include/fts.h                                 | 51
> +++++++++++++++++++ io/Makefile                                   |
> 4 +- io/fts.h                                      | 43
> ++++++++++++++-- io/fts64-time64.c                             | 35
> +++++++++++++ sysdeps/unix/sysv/linux/Versions              |  5 ++
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  5 ++
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  5 ++
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  5 ++
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  5 ++
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  5 ++
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  5 ++
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  5 ++
>  .../sysv/linux/microblaze/be/libc.abilist     |  5 ++
>  .../sysv/linux/microblaze/le/libc.abilist     |  5 ++
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  5 ++
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  5 ++
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  5 ++
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  5 ++
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  5 ++
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  5 ++
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  5 ++
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  5 ++
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  5 ++
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  5 ++
>  24 files changed, 227 insertions(+), 6 deletions(-)
>  create mode 100644 io/fts64-time64.c
> 
> diff --git a/include/fts.h b/include/fts.h
> index 145dce6779..ea36a9b9be 100644
> --- a/include/fts.h
> +++ b/include/fts.h
> @@ -1 +1,52 @@
> +#ifndef _FTS_H
>  #include <io/fts.h>
> +
> +#ifndef _ISOMAC
> +# if __TIMESIZE != 64
> +#  include <sys/stat.h>
> +
> +typedef struct
> +{
> +  struct _ftsent64_time64 *fts_cur;
> +  struct _ftsent64_time64 *fts_child;
> +  struct _ftsent64_time64 **fts_array;
> +  dev_t fts_dev;
> +  char *fts_path;
> +  int fts_rfd;
> +  int fts_pathlen;
> +  int fts_nitems;
> +  int (*fts_compar) (const void *, const void *);
> +  int fts_options;
> +} FTS64_TIME64;
> +
> +typedef struct _ftsent64_time64
> +{
> +  struct _ftsent64_time64 *fts_cycle;
> +  struct _ftsent64_time64 *fts_parent;
> +  struct _ftsent64_time64 *fts_link;
> +  long fts_number;
> +  void *fts_pointer;
> +  char *fts_accpath;
> +  char *fts_path;
> +  int fts_errno;
> +  int fts_symfd;
> +  unsigned short fts_pathlen;
> +  unsigned short fts_namelen;
> +
> +  ino64_t fts_ino;
> +  dev_t fts_dev;
> +  nlink_t fts_nlink;
> +
> +  short fts_level;
> +  unsigned short fts_info;
> +  unsigned short fts_flags;
> +  unsigned short fts_instr;
> +
> +  struct __stat64_t64 *fts_statp;
> +  char fts_name[1];
> +} FSTENT64_TIME64;
> +
> +# endif
> +#endif
> +
> +#endif /* _FTS_H  */
> diff --git a/io/Makefile b/io/Makefile
> index a22492f3f3..12c832cfcb 100644
> --- a/io/Makefile
> +++ b/io/Makefile
> @@ -54,7 +54,8 @@ routines :=
> 			\ posix_fadvise posix_fadvise64
> 				\ posix_fallocate
> posix_fallocate64				\ sendfile
> sendfile64 copy_file_range 				\
> -	utimensat futimens file_change_detection
> +	utimensat futimens file_change_detection
> 	\
> +	fts64-time64
>  
>  others		:= pwd
>  test-srcs	:= ftwtest
> @@ -102,6 +103,7 @@ CFLAGS-statvfs.c += -fexceptions
>  CFLAGS-fstatvfs.c += -fexceptions
>  CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
>  CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
> +CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks)
> -fexceptions CFLAGS-ftw.c += $(uses-callbacks) -fexceptions
>  CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions
>  CFLAGS-posix_fallocate.c += -fexceptions
> diff --git a/io/fts.h b/io/fts.h
> index 867677a27e..8d3395fa31 100644
> --- a/io/fts.h
> +++ b/io/fts.h
> @@ -187,6 +187,7 @@ FTSENT	*fts_read (FTS *);
>  int	 fts_set (FTS *, FTSENT *, int) __THROW;
>  #else
>  # ifdef __REDIRECT
> +#  ifndef __USE_TIME_BITS64
>  FTSENT	*__REDIRECT (fts_children, (FTS *, int),
> fts64_children); int	 __REDIRECT (fts_close, (FTS *),
> fts64_close); FTS	*__REDIRECT (fts_open, (char * const *, int,
> @@ -194,21 +195,53 @@ FTS	*__REDIRECT (fts_open, (char * const
> *, int, fts64_open);
>  FTSENT	*__REDIRECT (fts_read, (FTS *), fts64_read);
>  int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),
> fts64_set); +#  else
> +FTSENT	*__REDIRECT (fts_children, (FTS *, int),
> __fts64_children_time64); +int	 __REDIRECT (fts_close, (FTS
> *), __fts64_close_time64); +FTS	*__REDIRECT (fts_open, (char *
> const *, int,
> +				int (*)(const FTSENT **, const
> FTSENT **)),
> +		     __fts64_open_time64);
> +FTSENT	*__REDIRECT (fts_read, (FTS *), __fts64_read_time64);
> +int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),
> +			 __fts64_set_time64);
> +#  endif
>  # else
> -#  define fts_children fts64_children
> -#  define fts_close fts64_close
> -#  define fts_open fts64_open
> -#  define fts_read fts64_read
> -#  define fts_set fts64_set
> +#  ifndef __USE_TIME_BITS64
> +#   define fts_children fts64_children
> +#   define fts_close fts64_close
> +#   define fts_open fts64_open
> +#   define fts_read fts64_read
> +#   define fts_set fts64_set
> +#  else
> +#  endif
>  # endif
>  #endif
>  #ifdef __USE_LARGEFILE64
> +# ifndef __USE_TIME_BITS64
>  FTSENT64 *fts64_children (FTS64 *, int);
>  int	  fts64_close (FTS64 *);
>  FTS64	 *fts64_open (char * const *, int,
>  		      int (*)(const FTSENT64 **, const FTSENT64 **));
>  FTSENT64 *fts64_read (FTS64 *);
>  int	 fts64_set (FTS64 *, FTSENT64 *, int) __THROW;
> +# else
> +#  ifdef __REDIRECT
> +FTSENT	*__REDIRECT (fts64_children, (FTS64 *, int),
> __fts64_children_time64); +int	 __REDIRECT (fts64_close,
> (FTS64 *), __fts64_close_time64); +FTS	*__REDIRECT
> (fts64_open, (char * const *, int,
> +				int (*)(const FTSENT64 **, const
> FTSENT64 **)),
> +		     __fts64_open_time64);
> +FTSENT	*__REDIRECT (fts64_read, (FTS64 *),
> __fts64_read_time64); +int	 __REDIRECT_NTH (fts64_set, (FTS64
> *, FTSENT64 *, int),
> +			 __fts64_set_time64);
> +#  else
> +#   define fts_children __fts64_children_time64
> +#   define fts_close __fts64_close_time64
> +#   define fts_open __fts64_open_time64
> +#   define fts_read __fts64_read_time64
> +#   define fts_set __fts64_set_time64
> +#  endif
> +# endif
>  #endif
>  __END_DECLS
>  
> diff --git a/io/fts64-time64.c b/io/fts64-time64.c
> new file mode 100644
> index 0000000000..c8885ca79b
> --- /dev/null
> +++ b/io/fts64-time64.c
> @@ -0,0 +1,35 @@
> +/* File tree traversal functions LFS version.
> +   Copyright (C) 2015-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <time.h>
> +
> +#if __TIMESIZE != 64
> +# define FTS_OPEN __fts64_open_time64
> +# define FTS_CLOSE __fts64_close_time64
> +# define FTS_READ __fts64_read_time64
> +# define FTS_SET __fts64_set_time64
> +# define FTS_CHILDREN __fts64_children_time64
> +# define FTSOBJ FTS64_TIME64
> +# define FTSENTRY FSTENT64_TIME64
> +# define INO_T ino64_t
> +# define STRUCT_STAT __stat64_t64
> +# define STAT __stat64_time64
> +# define LSTAT __lstat64_time64
> +
> +# include "fts.c"
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/Versions
> b/sysdeps/unix/sysv/linux/Versions index 27a464483b..eb258a7333 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -189,6 +189,11 @@ libc {
>      __futimens64;
>      __futimes64;
>      __futimesat64;
> +    __fts64_open_time64;
> +    __fts64_close_time64;
> +    __fts64_read_time64;
> +    __fts64_set_time64;
> +    __fts64_children_time64;
>      __getitimer64;
>      __getrusage64;
>      __gettimeofday64;
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index
> 397c97cc16..4bdf41cae0 100644 ---
> a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -202,6 +202,11 @@
> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index
> 9bc948703c..e7bd82b036 100644 ---
> a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -199,6 +199,11 @@
> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist
> b/sysdeps/unix/sysv/linux/csky/libc.abilist index
> 0f84021d9f..857bc753e3 100644 ---
> a/sysdeps/unix/sysv/linux/csky/libc.abilist +++
> b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2279,6 +2279,11 @@
> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist index
> 31caf8ebc3..3c94e046c5 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2232,6 +2232,11 @@
> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist
> b/sysdeps/unix/sysv/linux/i386/libc.abilist index
> 75b71b8a5b..6b2f6e3ba9 100644 ---
> a/sysdeps/unix/sysv/linux/i386/libc.abilist +++
> b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2414,6 +2414,11 @@
> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index
> 2f93afc071..9379012dd9 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -203,6
> +203,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index
> dc074cf576..15142aae53 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2358,6
> +2358,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index
> a8b8366c48..fb73ff10d0 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2330,6
> +2330,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index
> 63e3b096e3..fafcf2f255 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2327,6
> +2327,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index
> 3d17b78b42..af82e41244 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2323,6
> +2323,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index
> ba96f15040..9d7afa11f3 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2321,6
> +2321,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index
> 04cc170344..3bbd2468d7 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2329,6
> +2329,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist index
> ce21e19622..e3b4f8bd9d 100644 ---
> a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2369,6 +2369,11 @@
> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index
> 4cfae3b735..f0756a3997 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@
> -2385,6 +2385,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64
> F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index
> 3e03f313b1..9e4bf76ba1 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@
> -2418,6 +2418,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64
> F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index
> 4dfdc61761..56db45a52d 100644 ---
> a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2383,6
> +2383,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index
> 2c00100dd6..dbfdc3571f 100644 ---
> a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2239,6 +2239,11 @@
> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index
> 2bcf38af9b..4b959c0f79 100644 ---
> a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2236,6 +2236,11 @@
> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index
> dad08de21f..95fea73af5 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2376,6
> +2376,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 22/25] io: Add ftw64 with 64 bit time_t support
  2021-05-18 20:56 ` [PATCH v2 22/25] io: Add ftw64 " Adhemerval Zanella
@ 2021-05-19 10:57   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19 10:57 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 25066 bytes --]

On Tue, 18 May 2021 17:56:10 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> Similar to fts, ftw routines passes a stat pointer that might
> differ of size and layout when 64 bit time API is used.
> 
> Checked on i686-linux-gnu and x86_64-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  include/ftw.h                                 | 18 ++++++++
>  io/Makefile                                   |  4 +-
>  io/ftw.c                                      |  5 +-
>  io/ftw.h                                      | 46
> ++++++++++++++++++- io/ftw64-time64.c                             |
> 34 ++++++++++++++ sysdeps/unix/sysv/linux/Versions              |  2 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  2 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  2 +
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  2 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  2 +
>  .../sysv/linux/microblaze/be/libc.abilist     |  2 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  2 +
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  2 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  2 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  2 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  2 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  2 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  2 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  2 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  2 +
>  25 files changed, 141 insertions(+), 6 deletions(-)
>  create mode 100644 io/ftw64-time64.c
> 
> diff --git a/include/ftw.h b/include/ftw.h
> index 4fb654cf22..8fb89c4046 100644
> --- a/include/ftw.h
> +++ b/include/ftw.h
> @@ -1 +1,19 @@
> +#ifndef _FTW_H
>  #include <io/ftw.h>
> +
> +#ifndef _ISOMAC
> +# if __TIMESIZE != 64
> +#  include <sys/stat.h>
> +
> +typedef int (*__ftw64_time64_func_t) (const char *,
> +				      const struct __stat64_t64 *,
> int); +typedef int (*__nftw64_time64_func_t) (const char *,
> +				       const struct __stat64_t64 *,
> int,
> +				       struct FTW *);
> +
> +extern int __ftw64_time64 (const char *, __ftw64_time64_func_t, int);
> +extern int __nftw64_time64 (const char *, __nftw64_time64_func_t,
> int, int); +# endif
> +#endif
> +
> +#endif /* _FTW_H  */
> diff --git a/io/Makefile b/io/Makefile
> index 12c832cfcb..d35e966258 100644
> --- a/io/Makefile
> +++ b/io/Makefile
> @@ -55,7 +55,8 @@ routines :=
> 			\ posix_fallocate posix_fallocate64
> 			\ sendfile sendfile64 copy_file_range
> 			\ utimensat futimens
> file_change_detection			\
> -	fts64-time64
> +	fts64-time64
> 	\
> +	ftw64-time64
>  
>  others		:= pwd
>  test-srcs	:= ftwtest
> @@ -106,6 +107,7 @@ CFLAGS-fts64.c += -Wno-uninitialized
> $(uses-callbacks) -fexceptions CFLAGS-fts64-time64.c +=
> -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-ftw.c +=
> $(uses-callbacks) -fexceptions CFLAGS-ftw64.c += $(uses-callbacks)
> -fexceptions +CFLAGS-ftw64-time64.c += $(uses-callbacks) -fexceptions
>  CFLAGS-posix_fallocate.c += -fexceptions
>  CFLAGS-posix_fallocate64.c += -fexceptions
>  CFLAGS-fallocate.c += -fexceptions
> diff --git a/io/ftw.c b/io/ftw.c
> index baca3deeee..ce1c6a14a3 100644
> --- a/io/ftw.c
> +++ b/io/ftw.c
> @@ -821,7 +821,7 @@ FTW_NAME (const char *path, FTW_FUNC_T func, int
> descriptors) return ftw_startup (path, 0, func, descriptors, 0);
>  }
>  
> -#ifndef _LIBC
> +#ifndef NFTW_OLD_NAME
>  int
>  NFTW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int
> flags) {
> @@ -844,7 +844,6 @@ NFTW_NEW_NAME (const char *path, NFTW_FUNC_T
> func, int descriptors, int flags) }
>    return ftw_startup (path, 1, func, descriptors, flags);
>  }
> -
>  versioned_symbol (libc, NFTW_NEW_NAME, NFTW_NAME, GLIBC_2_3_3);
>  
>  # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_3_3)
> @@ -863,4 +862,4 @@ NFTW_OLD_NAME (const char *path, NFTW_FUNC_T
> func, int descriptors, int flags) 
>  compat_symbol (libc, NFTW_OLD_NAME, NFTW_NAME, GLIBC_2_1);
>  # endif
> -#endif
> +#endif /* NFTW_OLD_NAME  */
> diff --git a/io/ftw.h b/io/ftw.h
> index 751d689cdb..446498856d 100644
> --- a/io/ftw.h
> +++ b/io/ftw.h
> @@ -137,15 +137,36 @@ extern int ftw (const char *__dir, __ftw_func_t
> __func, int __descriptors) __nonnull ((1, 2));
>  #else
>  # ifdef __REDIRECT
> +#  ifndef __USE_TIME_BITS64
>  extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func,
>  			     int __descriptors), ftw64) __nonnull
> ((1, 2)); +#  else
> +extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func,
> +			     int __descriptors), __ftw64_time64)
> +     __nonnull ((1, 2));
> +#  endif
>  # else
> -#  define ftw ftw64
> +#  ifndef __USE_TIME_BITS64
> +#   define ftw ftw64
> +#  else
> +#   define ftw __ftw64_time64
> +#  endif
>  # endif
>  #endif
>  #ifdef __USE_LARGEFILE64
> +# ifndef __USE_TIME_BITS64
>  extern int ftw64 (const char *__dir, __ftw64_func_t __func,
>  		  int __descriptors) __nonnull ((1, 2));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (ftw64, (const char *__dir, __ftw64_func_t
> __func,
> +			       int __descriptors),
> +		       __ftw64_time64)
> +     __nonnull ((1, 2));
> +#  else
> +#   define nftw64 __nftw64_time64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_XOPEN_EXTENDED
> @@ -159,16 +180,37 @@ extern int nftw (const char *__dir,
> __nftw_func_t __func, int __descriptors, int __flag) __nonnull ((1,
> 2)); # else
>  #  ifdef __REDIRECT
> +#   ifndef __USE_TIME_BITS64
>  extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t
> __func, int __descriptors, int __flag), nftw64)
>       __nonnull ((1, 2));
> +#   else
> +extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t
> __func,
> +			      int __descriptors, int __flag),
> __nftw64_time64)
> +     __nonnull ((1, 2));
> +#   endif
>  #  else
> -#   define nftw nftw64
> +#   ifndef __USE_TIME_BITS64
> +#    define nftw nftw64
> +#   else
> +#    define nftw __nftw64_time64
> +#   endif
>  #  endif
>  # endif
>  # ifdef __USE_LARGEFILE64
> +#  ifndef __USE_TIME_BITS64
>  extern int nftw64 (const char *__dir, __nftw64_func_t __func,
>  		   int __descriptors, int __flag) __nonnull ((1, 2));
> +#  else
> +#   ifdef __REDIRECT
> +extern int __REDIRECT (nftw64, (const char *__dir, __nftw64_func_t
> __func,
> +				int __descriptors, int __flag),
> +		       __nftw64_time64)
> +     __nonnull ((1, 2));
> +#   else
> +#    define nftw64 __nftw64_time64
> +#   endif
> +#  endif
>  # endif
>  #endif
>  
> diff --git a/io/ftw64-time64.c b/io/ftw64-time64.c
> new file mode 100644
> index 0000000000..7c9db5448a
> --- /dev/null
> +++ b/io/ftw64-time64.c
> @@ -0,0 +1,34 @@
> +/* File tree walker functions.  LFS version.
> +   Copyright (C) 1996-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/types.h>
> +
> +#if __TIMESIZE != 64
> +# define FTW_NAME       __ftw64_time64
> +# define NFTW_NAME      __nftw64_time64
> +# define INO_T          ino64_t
> +# define STRUCT_STAT    __stat64_t64
> +# define LSTAT          __lstat64_time64
> +# define STAT           __stat64_time64
> +# define FSTATAT        __fstatat64_time64
> +# define FTW_FUNC_T     __ftw64_time64_func_t
> +# define NFTW_FUNC_T    __nftw64_time64_func_t
> +
> +# include "ftw.c"
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/Versions
> b/sysdeps/unix/sysv/linux/Versions index eb258a7333..84063d808c 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -194,6 +194,8 @@ libc {
>      __fts64_read_time64;
>      __fts64_set_time64;
>      __fts64_children_time64;
> +    __ftw64_time64;
> +    __nftw64_time64;
>      __getitimer64;
>      __getrusage64;
>      __gettimeofday64;
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index
> 4bdf41cae0..829ecfec18 100644 ---
> a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -207,6 +207,7 @@
> GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -226,6 +227,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index
> e7bd82b036..5653b99cf0 100644 ---
> a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -204,6 +204,7 @@
> GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -223,6 +224,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist
> b/sysdeps/unix/sysv/linux/csky/libc.abilist index
> 857bc753e3..e158505191 100644 ---
> a/sysdeps/unix/sysv/linux/csky/libc.abilist +++
> b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2284,6 +2284,7 @@
> GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2303,6 +2304,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist index
> 3c94e046c5..788b0fbb29 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2237,6 +2237,7 @@
> GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2256,6 +2257,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist
> b/sysdeps/unix/sysv/linux/i386/libc.abilist index
> 6b2f6e3ba9..2ca1bc3408 100644 ---
> a/sysdeps/unix/sysv/linux/i386/libc.abilist +++
> b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2419,6 +2419,7 @@
> GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2439,6 +2440,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index
> 9379012dd9..5711de528e 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -208,6 +208,7
> @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -227,6 +228,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index
> 15142aae53..514a8f321e 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2363,6 +2363,7
> @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2382,6 +2383,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index
> fb73ff10d0..a68e3e8422 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2335,6
> +2335,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2354,6 +2355,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index
> fafcf2f255..e5412abb67 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2332,6
> +2332,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2351,6 +2352,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index
> af82e41244..836e33db28 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2328,6
> +2328,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2347,6 +2348,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index
> 9d7afa11f3..30fe740a12 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2326,6
> +2326,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2345,6 +2346,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index
> 3bbd2468d7..345a35807e 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2334,6
> +2334,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2353,6 +2354,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist index
> e3b4f8bd9d..aba934d286 100644 ---
> a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2374,6 +2374,7 @@
> GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2393,6 +2394,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index
> f0756a3997..bd0f351037 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@
> -2390,6 +2390,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34
> __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2409,6 +2410,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index
> 9e4bf76ba1..4b613fe9ba 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@
> -2423,6 +2423,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34
> __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2442,6 +2443,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index
> 56db45a52d..8e7ca663e8 100644 ---
> a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2388,6
> +2388,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2407,6 +2408,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index
> dbfdc3571f..74fb49fc37 100644 ---
> a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2244,6 +2244,7 @@
> GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2263,6 +2264,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index
> 4b959c0f79..8b9df6cd1e 100644 ---
> a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2241,6 +2241,7 @@
> GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2260,6 +2261,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index
> 95fea73af5..023232a00b 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2381,6
> +2381,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34
> __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2400,6 +2401,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 23/25] libsupport: Add 64 bit time_t support for time functions
  2021-05-18 20:56 ` [PATCH v2 23/25] libsupport: Add 64 bit time_t support for time functions Adhemerval Zanella
@ 2021-05-19 11:00   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19 11:00 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 16110 bytes --]

On Tue, 18 May 2021 17:56:11 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The patch adds redirections for xclock_gettime, xclock_settime,
> timespec_add, timespec_sub, test_timespec_before_impl,
> test_timespec_equal_or_after_impl, support_timespec_ns,
> support_timespec_normalize, and support_timespec_check_in_range when
> _TIME_BITS=64 is defined.
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Co-authored-by: Lukasz Majewski <lukma@denx.de>
> ---
>  support/Makefile                |  6 ++++
>  support/timespec-add-time64.c   | 27 +++++++++++++++++
>  support/timespec-add.c          |  2 +-
>  support/timespec-sub-time64.c   | 27 +++++++++++++++++
>  support/timespec-sub.c          |  2 +-
>  support/timespec-time64.c       | 40 +++++++++++++++++++++++++
>  support/timespec.c              |  9 +++---
>  support/timespec.h              | 52
> +++++++++++++++++++++++++-------- support/xclock_gettime_time64.c |
> 26 +++++++++++++++++ support/xclock_settime_time64.c | 23
> +++++++++++++++ support/xtime.h                 |  7 +++++
>  11 files changed, 202 insertions(+), 19 deletions(-)
>  create mode 100644 support/timespec-add-time64.c
>  create mode 100644 support/timespec-sub-time64.c
>  create mode 100644 support/timespec-time64.c
>  create mode 100644 support/xclock_gettime_time64.c
>  create mode 100644 support/xclock_settime_time64.c
> 
> diff --git a/support/Makefile b/support/Makefile
> index da6dc58d37..1ee73f81bc 100644
> --- a/support/Makefile
> +++ b/support/Makefile
> @@ -83,8 +83,11 @@ libsupport-routines = \
>    support_test_verify_impl \
>    temp_file \
>    timespec \
> +  timespec-time64 \
>    timespec-add \
> +  timespec-add-time64 \
>    timespec-sub \
> +  timespec-sub-time64 \
>    write_message \
>    xaccept \
>    xaccept4 \
> @@ -94,7 +97,9 @@ libsupport-routines = \
>    xchdir \
>    xchroot \
>    xclock_gettime \
> +  xclock_gettime_time64 \
>    xclock_settime \
> +  xclock_settime_time64 \
>    xclose \
>    xchmod \
>    xconnect \
> @@ -215,6 +220,7 @@ CFLAGS-support_paths.c = \
>  # in support_timespec_check_in_range and for that computation we use
>  # -fexcess-precision=standard.
>  CFLAGS-timespec.c += -fexcess-precision=standard
> +CFLAGS-timespec-time64.c += -fexcess-precision=standard
>  
>  ifeq (,$(CXX))
>  LINKS_DSO_PROGRAM = links-dso-program-c
> diff --git a/support/timespec-add-time64.c
> b/support/timespec-add-time64.c new file mode 100644
> index 0000000000..8574e1602c
> --- /dev/null
> +++ b/support/timespec-add-time64.c
> @@ -0,0 +1,27 @@
> +/* Add two struct __timespec64 values.  64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library and is also part of gnulib.
> +   Patches to this file should be submitted to both projects.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <time.h>
> +
> +#if __TIMESIZE != 64
> +# define timespec      __timespec64
> +# define time_t        __time64_t
> +# define timespec_add  timespec_add_time64
> +# include "timespec-add.c"
> +#endif
> diff --git a/support/timespec-add.c b/support/timespec-add.c
> index cf8bd91291..8ed3acef6d 100644
> --- a/support/timespec-add.c
> +++ b/support/timespec-add.c
> @@ -61,5 +61,5 @@ timespec_add (struct timespec a, struct timespec b)
>          }
>      }
>  
> -  return make_timespec (rs, rns);
> +  return (struct timespec) { .tv_sec = rs, .tv_nsec = rns };
>  }
> diff --git a/support/timespec-sub-time64.c
> b/support/timespec-sub-time64.c new file mode 100644
> index 0000000000..f88307016d
> --- /dev/null
> +++ b/support/timespec-sub-time64.c
> @@ -0,0 +1,27 @@
> +/* Subtract two struct __timespec64 values.  64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library and is also part of gnulib.
> +   Patches to this file should be submitted to both projects.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <time.h>
> +
> +#if __TIMESIZE != 64
> +# define timespec      __timespec64
> +# define time_t        __time64_t
> +# define timespec_sub  timespec_sub_time64
> +# include "timespec-sub.c"
> +#endif
> diff --git a/support/timespec-sub.c b/support/timespec-sub.c
> index 08cc233086..0b8fea042d 100644
> --- a/support/timespec-sub.c
> +++ b/support/timespec-sub.c
> @@ -61,5 +61,5 @@ timespec_sub (struct timespec a, struct timespec b)
>          }
>      }
>  
> -  return make_timespec (rs, rns);
> +  return (struct timespec) { .tv_sec = rs, .tv_nsec = rns };
>  }
> diff --git a/support/timespec-time64.c b/support/timespec-time64.c
> new file mode 100644
> index 0000000000..5bbf8be7e0
> --- /dev/null
> +++ b/support/timespec-time64.c
> @@ -0,0 +1,40 @@
> +/* Support code for timespec checks.  64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <support/timespec.h>
> +#include <stdio.h>
> +#include <stdint.h>
> +#include <assert.h>
> +#include <intprops.h>
> +
> +#if __TIMESIZE != 64
> +struct __timespec64 timespec_sub_time64 (struct __timespec64,
> +					 struct __timespec64);
> +
> +#define test_timespec_before_impl
> test_timespec_before_impl_time64 +#define
> test_timespec_equal_or_after_impl  \
> +  test_timespec_equal_or_after_impl_time64
> +#define support_timespec_ns                support_timespec_ns_time64
> +#define support_timespec_normalize
> support_timespec_normalize_time64 +#define
> support_timespec_check_in_range    \
> +  support_timespec_check_in_range_time64
> +#define timespec                           __timespec64
> +#define timespec_sub                       timespec_sub_time64
> +
> +#include "timespec.c"
> +#endif
> diff --git a/support/timespec.c b/support/timespec.c
> index b02afad9d3..fcc54861b1 100644
> --- a/support/timespec.c
> +++ b/support/timespec.c
> @@ -23,9 +23,8 @@
>  #include <intprops.h>
>  
>  void
> -test_timespec_before_impl (const char *file, int line,
> -			   const struct timespec left,
> -			   const struct timespec right)
> +test_timespec_before_impl (const char *file, int line, struct
> timespec left,
> +			   struct timespec right)
>  {
>    if (left.tv_sec > right.tv_sec
>        || (left.tv_sec == right.tv_sec
> @@ -43,8 +42,8 @@ test_timespec_before_impl (const char *file, int
> line, 
>  void
>  test_timespec_equal_or_after_impl (const char *file, int line,
> -				   const struct timespec left,
> -				   const struct timespec right)
> +				   struct timespec left,
> +				   struct timespec right)
>  {
>    if (left.tv_sec < right.tv_sec
>        || (left.tv_sec == right.tv_sec
> diff --git a/support/timespec.h b/support/timespec.h
> index a3eb72aa01..0478aef51f 100644
> --- a/support/timespec.h
> +++ b/support/timespec.h
> @@ -24,11 +24,6 @@
>  #include <support/check.h>
>  #include <support/xtime.h>
>  
> -struct timespec timespec_add (struct timespec, struct timespec)
> -  __attribute__((const));
> -struct timespec timespec_sub (struct timespec, struct timespec)
> -  __attribute__((const));
> -
>  static inline struct timespec
>  make_timespec (time_t s, long int ns)
>  {
> @@ -40,21 +35,54 @@ make_timespec (time_t s, long int ns)
>  
>  enum { TIMESPEC_HZ = 1000000000 };
>  
> +#ifndef __USE_TIME_BITS64
> +struct timespec timespec_add (struct timespec, struct timespec)
> +  __attribute__((const));
> +struct timespec timespec_sub (struct timespec, struct timespec)
> +  __attribute__((const));
> +
>  void test_timespec_before_impl (const char *file, int line,
> -                                const struct timespec left,
> -                                const struct timespec right);
> +                                struct timespec left,
> +                                struct timespec right);
>  
>  void test_timespec_equal_or_after_impl (const char *file, int line,
> -                                        const struct timespec left,
> -                                        const struct timespec right);
> +                                        struct timespec left,
> +                                        struct timespec right);
>  
>  time_t support_timespec_ns (struct timespec time);
>  
>  struct timespec support_timespec_normalize (struct timespec time);
>  
> -int support_timespec_check_in_range (struct timespec expected,
> struct timespec observed,
> -				  double lower_bound, double
> upper_bound); -
> +int support_timespec_check_in_range (struct timespec expected,
> +				     struct timespec observed,
> +				     double lower_bound, double
> upper_bound); +
> +#else
> +struct timespec __REDIRECT (timespec_add, (struct timespec, struct
> timespec),
> +			    timespec_add_time64);
> +struct timespec __REDIRECT (timespec_sub, (struct timespec, struct
> timespec),
> +			    timespec_sub_time64);
> +void __REDIRECT (test_timespec_before_impl, (const char *file, int
> line,
> +					     struct timespec left,
> +					     struct timespec right),
> +		 test_timespec_before_impl_time64);
> +void __REDIRECT (test_timespec_equal_or_after_impl, (const char *f,
> int line,
> +						     struct timespec
> left,
> +						     struct timespec
> right),
> +		 test_timespec_equal_or_after_impl_time64);
> +
> +time_t __REDIRECT (support_timespec_ns, (struct timespec time),
> +		   support_timespec_ns_time64);
> +
> +struct timespec __REDIRECT (support_timespec_normalize, (struct
> timespec time),
> +			    support_timespec_normalize_time64);
> +
> +int __REDIRECT (support_timespec_check_in_range, (struct timespec
> expected,
> +						  struct timespec
> observed,
> +						  double lower_bound,
> +						  double
> upper_bound),
> +		support_timespec_check_in_range_time64);
> +#endif
>  
>  /* Check that the timespec on the left represents a time before the
>     time on the right. */
> diff --git a/support/xclock_gettime_time64.c
> b/support/xclock_gettime_time64.c new file mode 100644
> index 0000000000..bf9fe9bf9c
> --- /dev/null
> +++ b/support/xclock_gettime_time64.c
> @@ -0,0 +1,26 @@
> +/* clock_settime with error checking.  64 bit time_t support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <support/xtime.h>
> +
> +#if __TIMESIZE != 64
> +# define xclock_gettime  xclock_gettime_time64
> +# define timespec        __timespec64
> +# define clock_gettime   __clock_gettime64
> +# include "xclock_gettime.c"
> +#endif
> diff --git a/support/xclock_settime_time64.c
> b/support/xclock_settime_time64.c new file mode 100644
> index 0000000000..62a8be1815
> --- /dev/null
> +++ b/support/xclock_settime_time64.c
> @@ -0,0 +1,23 @@
> +/* clock_settime helper with error checking - 64 bit time_t support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <support/xtime.h>
> +
> +#if __TIMESIZE != 64
> +# define xclock_settime  xclock_settime_time64
> +# define timespec        __timespec64
> +# define clock_settime   __clock_settime64
> +# include "xclock_settime.c"
> +#endif
> diff --git a/support/xtime.h b/support/xtime.h
> index b4ac3b59e2..25a069d447 100644
> --- a/support/xtime.h
> +++ b/support/xtime.h
> @@ -30,8 +30,15 @@ __BEGIN_DECLS
>  /* The following functions call the corresponding libc functions and
>     terminate the process on error.  */
>  
> +#ifndef __USE_TIME_BITS64
>  void xclock_gettime (clockid_t clock, struct timespec *ts);
>  void xclock_settime (clockid_t clock, const struct timespec *ts);
> +#else
> +void __REDIRECT (xclock_gettime, (clockid_t clock, struct timespec
> *ts),
> +		 xclock_gettime_time64);
> +void __REDIRECT (xclock_settime, (clockid_t clock, const struct
> timespec *ts),
> +		 xclock_settime_time64);
> +#endif
>  
>  /* This helper can often simplify tests by avoiding an explicit
>     variable declaration or allowing that declaration to be const. */



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 24/25] libsupport: Add 64 bit time_t support for stat functions
  2021-05-18 20:56 ` [PATCH v2 24/25] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella
@ 2021-05-19 11:04   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19 11:04 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 7370 bytes --]

On Tue, 18 May 2021 17:56:12 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The patch adds redirections for xstat, xlstat, and xfstat when
> _TIME_BITS=64 is defined.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  support/Makefile                |  3 +++
>  support/support-xfstat-time64.c | 32 ++++++++++++++++++++++++++++++++
>  support/support-xstat-time64.c  | 32 ++++++++++++++++++++++++++++++++
>  support/xlstat-time64.c         | 32 ++++++++++++++++++++++++++++++++
>  support/xunistd.h               | 13 +++++++++++++
>  5 files changed, 112 insertions(+)
>  create mode 100644 support/support-xfstat-time64.c
>  create mode 100644 support/support-xstat-time64.c
>  create mode 100644 support/xlstat-time64.c
> 
> diff --git a/support/Makefile b/support/Makefile
> index 1ee73f81bc..8b8534a3c6 100644
> --- a/support/Makefile
> +++ b/support/Makefile
> @@ -40,7 +40,9 @@ libsupport-routines = \
>    resolv_test \
>    set_fortify_handler \
>    support-xfstat \
> +  support-xfstat-time64 \
>    support-xstat \
> +  support-xstat-time64 \
>    support_become_root \
>    support_can_chroot \
>    support_capture_subprocess \
> @@ -117,6 +119,7 @@ libsupport-routines = \
>    xlisten \
>    xlseek \
>    xlstat \
> +  xlstat-time64 \
>    xmalloc \
>    xmemstream \
>    xmkdir \
> diff --git a/support/support-xfstat-time64.c
> b/support/support-xfstat-time64.c new file mode 100644
> index 0000000000..324c5d20d2
> --- /dev/null
> +++ b/support/support-xfstat-time64.c
> @@ -0,0 +1,32 @@
> +/* 64-bit time_t stat with error checking.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* NB: Non-standard file name to avoid sysdeps override for xstat.
> */ +
> +#include <support/check.h>
> +#include <support/xunistd.h>
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +void
> +xfstat_time64 (int fd, struct __stat64_t64 *result)
> +{
> +  if (__fstat64_time64 (fd, result) != 0)
> +    FAIL_EXIT1 ("__fstat64_time64 (%d): %m", fd);
> +}
> +#endif
> diff --git a/support/support-xstat-time64.c
> b/support/support-xstat-time64.c new file mode 100644
> index 0000000000..7d0194b98a
> --- /dev/null
> +++ b/support/support-xstat-time64.c
> @@ -0,0 +1,32 @@
> +/* 64-bit time_t stat with error checking.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* NB: Non-standard file name to avoid sysdeps override for xstat.
> */ +
> +#include <support/check.h>
> +#include <support/xunistd.h>
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +void
> +xstat_time64 (const char *path, struct __stat64_t64 *result)
> +{
> +  if (__stat64_time64 (path, result) != 0)
> +    FAIL_EXIT1 ("__stat64_time64 (\"%s\"): %m", path);
> +}
> +#endif
> diff --git a/support/xlstat-time64.c b/support/xlstat-time64.c
> new file mode 100644
> index 0000000000..ef4d922635
> --- /dev/null
> +++ b/support/xlstat-time64.c
> @@ -0,0 +1,32 @@
> +/* 64-bit time_t stat with error checking.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* NB: Non-standard file name to avoid sysdeps override for xstat.
> */ +
> +#include <support/check.h>
> +#include <support/xunistd.h>
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +void
> +xlstat_time64 (const char *path, struct __stat64_t64 *result)
> +{
> +  if (__lstat64_time64 (path, result) != 0)
> +    FAIL_EXIT1 ("__lstat64_time64 (\"%s\"): %m", path);
> +}
> +#endif
> diff --git a/support/xunistd.h b/support/xunistd.h
> index c642588c29..e4ade65c85 100644
> --- a/support/xunistd.h
> +++ b/support/xunistd.h
> @@ -24,6 +24,7 @@
>  
>  #include <sys/cdefs.h>
>  #include <sys/types.h>
> +#include <sys/stat.h>
>  #include <unistd.h>
>  
>  __BEGIN_DECLS
> @@ -35,9 +36,21 @@ pid_t xwaitpid (pid_t, int *status, int flags);
>  void xpipe (int[2]);
>  void xdup2 (int, int);
>  int xopen (const char *path, int flags, mode_t);
> +#ifndef __USE_TIME_BITS64
> +# ifdef __USE_FILE_OFFSET64
> +void xstat (const char *path, struct stat *);
> +void xlstat (const char *path, struct stat *);
> +void xfstat (int fd, struct stat *);
> +# else
>  void xstat (const char *path, struct stat64 *);
>  void xlstat (const char *path, struct stat64 *);
>  void xfstat (int fd, struct stat64 *);
> +# endif
> +#else
> +void __REDIRECT (xstat, (const char *path, struct stat *),
> xstat_time64); +void __REDIRECT (xlstat, (const char *path, struct
> stat *), xlstat_time64); +void __REDIRECT (xfstat, (int fd, struct
> stat *), xfstat_time64); +#endif
>  void xmkdir (const char *path, mode_t);
>  void xchroot (const char *path);
>  void xunlink (const char *path);



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 25/25] y2038: Add test coverage
  2021-05-18 20:56 ` [PATCH v2 25/25] y2038: Add test coverage Adhemerval Zanella
@ 2021-05-19 11:08   ` Lukasz Majewski
  2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Lukasz Majewski @ 2021-05-19 11:08 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Carlos O'Donell

[-- Attachment #1: Type: text/plain, Size: 51358 bytes --]

On Tue, 18 May 2021 17:56:13 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> It is enabled through a new rule, tests-y2038, which is built only
> when the ABI supports the comapt 64-bit time_t (defined by the
> header time64-compat.h, which also enables the creation of the
> symbol Version for Linux).  It means the tests are not built
> for ABI which already provide default 64-bit time_t.
> 
> The new rule already adds the required LFS and 64-bit time_t
> compiler flags.
> 
> The current coverage is:
> 
>   * libc:
>     - adjtime                       tst-adjtime-time64
>     - adjtimex                      tst-adjtimex-time64
>     - clock_adjtime                 tst-clock_adjtime-time64
>     - clock_getres                  tst-clock-time64,
> tst-cpuclock1-time64
>     - clock_gettime                 tst-clock-time64,
> tst-clock2-time64, tst-cpuclock1-time64
>     - clock_nanosleep               tst-clock_nanosleep-time64,
> 				    tst-cpuclock1-time64
>     - clock_settime                 tst-clock2-time64
>     - cnd_timedwait                 tst-cnd-timedwait-time64
>     - ctime                         tst-ctime-time64
>     - ctime_r                       tst-ctime-time64
>     - difftime                      tst-difftime-time64
>     - fstat                         tst-stat-time64
>     - fstatat                       tst-stat-time64
>     - futimens                      tst-futimens-time64
>     - futimes                       tst-futimes-time64
>     - futimesat                     tst-futimesat-time64
>     - fts_*                         tst-fts-time64
>     - getitimer                     tst-itimer-timer64
>     - getrusage
>     - gettimeofday                  tst-clock_nanosleep-time64
>     - glob / globfree               tst-gnuglob64-time64
>     - gmtime                        tst-gmtime-time64
>     - gmtime_r                      tst-gmtime-time64
>     - lstat                         tst-stat-time64
>     - localtime                     tst-y2039-time64
>     - localtime_t                   tst-y2039-time64
>     - lutimes                       tst-lutimes-time64
>     - mktime                        tst-mktime4-time64
>     - mq_timedreceive               tst-mqueue{1248}-time64
>     - mq_timedsend                  tst-mqueue{1248}-time64
>     - msgctl                        test-sysvmsg-time64
>     - mtx_timedlock                 tst-mtx-timedlock-time64
>     - nanosleep                     tst-cpuclock{12}-time64,
> 				    tst-mqueue8-time64,
> tst-clock-time64
>     - nftw / ftw                    ftwtest-time64
>     - ntp_adjtime                   tst-ntp_adjtime-time64
>     - ntp_gettime                   tst-ntp_gettime-time64
>     - ntp_gettimex                  tst-ntp_gettimex-time64
>     - ppoll                         tst-ppoll-time64
>     - pselect                       tst-pselect-time64
>     - pthread_clockjoin_np          tst-join14-time64
>     - pthread_cond_clockwait        tst-cond11-time64
>     - pthread_cond_timedwait        tst-abstime-time64
>     - pthread_mutex_clocklock       tst-abstime-time64
>     - pthread_mutex_timedlock       tst-abstime-time64
>     - pthread_rwlock_clockrdlock    tst-abstime-time64,
> tst-rwlock14-time64
>     - pthread_rwlock_clockwrlock    tst-abstime-time64,
> tst-rwlock14-time64
>     - pthread_rwlock_timedrdlock    tst-abstime-time64,
> tst-rwlock14-time64
>     - pthread_rwlock_timedwrlock    tst-abstime-time64,
> tst-rwlock14-time64
>     - pthread_timedjoin_np          tst-join14-time64
>     - recvmmsg                      tst-cancel4_2-time64
>     - sched_rr_get_interval         tst-sched_rr_get_interval-time64
>     - select                        tst-select-time64
>     - sem_clockwait                 tst-sem5-time64
>     - sem_timedwait                 tst-sem5-time64
>     - semctl                        test-sysvsem-time64
>     - semtimedop                    test-sysvsem-time64
>     - setitimer                     tst-mqueue2-time64,
> tst-itimer-timer64
>     - settimeofday                  tst-settimeofday-time64
>     - shmctl                        test-sysvshm-time64
>     - sigtimedwait                  tst-sigtimedwait-time64
>     - stat                          tst-stat-time64
>     - thrd_sleep                    tst-thrd-sleep-time64
>     - time                          tst-mqueue{1248}-time64
>     - timegm                        tst-timegm-time64
>     - timer_gettime                 tst-timer4-time64
>     - timer_settime                 tst-timer4-time64
>     - timerfd_gettime               tst-timerfd-time64
>     - timerfd_settime               tst-timerfd-time64
>     - timespec_get                  tst-timespec_get-time64
>     - timespec_getres               tst-timespec_getres-time64
>     - utime                         tst-utime-time64
>     - utimensat                     tst-utimensat-time64
>     - utimes                        tst-utimes-time64
>     - wait3                         tst-wait3-time64
>     - wait4                         tst-wait4-time64
> 
>   * librt:
>     - aio_suspend                   tst-aio6-time64
>     - mq_timedreceive               tst-mqueue{1248}-time64
>     - mq_timedsend                  tst-mqueue{1248}-time64
>     - timer_gettime                 tst-timer4-time64
>     - timer_settime                 tst-timer4-time64
> 
>   * libanl:
>     - gai_suspend

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  Makeconfig                                    |  14 +++
>  Makerules                                     |  18 +++-
>  io/Makefile                                   |  22 +++-
>  io/ftwtest-time64.c                           |   1 +
>  io/tst-fts-time64.c                           |   1 +
>  io/tst-futimens-time64.c                      |   2 +
>  io/tst-futimens.c                             |   6 +-
>  io/tst-futimes-time64.c                       |   2 +
>  io/tst-futimes.c                              |   6 +-
>  io/tst-futimesat-time64.c                     |   4 +
>  io/tst-futimesat.c                            |  47 +++++---
>  io/tst-lutimes-time64.c                       |   2 +
>  io/tst-lutimes.c                              |  10 +-
>  io/tst-stat-time64.c                          | 102
> ++++++++++++++++++ io/tst-utime-time64.c                         |
> 2 + io/tst-utime.c                                |   6 +-
>  io/tst-utimensat-time64.c                     |   2 +
>  io/tst-utimensat.c                            |  12 ++-
>  io/tst-utimes-time64.c                        |   2 +
>  io/tst-utimes.c                               |   6 +-
>  misc/Makefile                                 |   4 +
>  misc/tst-pselect-time64.c                     |   1 +
>  misc/tst-select-time64.c                      |   1 +
>  nptl/Makefile                                 |   3 +
>  nptl/tst-cancel4_2-time64.c                   |   1 +
>  posix/Makefile                                |   2 +
>  posix/tst-gnuglob64-time64.c                  |   7 ++
>  posix/tst-sched_rr_get_interval-time64.c      |   1 +
>  posix/tst-wait3-time64.c                      |   1 +
>  posix/tst-wait4-time64.c                      |   1 +
>  rt/Makefile                                   |   9 ++
>  rt/tst-aio6-time64.c                          |   1 +
>  rt/tst-cpuclock2-time64.c                     |   1 +
>  rt/tst-cpuclock2.c                            |   9 +-
>  rt/tst-mqueue1-time64.c                       |   1 +
>  rt/tst-mqueue2-time64.c                       |   1 +
>  rt/tst-mqueue4-time64.c                       |   1 +
>  rt/tst-mqueue8-time64.c                       |   1 +
>  rt/tst-timer4-time64.c                        |   1 +
>  sysdeps/pthread/Makefile                      |  10 ++
>  sysdeps/pthread/tst-abstime-time64.c          |   1 +
>  sysdeps/pthread/tst-cnd-timedwait-time64.c    |   1 +
>  sysdeps/pthread/tst-cond11-time64.c           |   1 +
>  sysdeps/pthread/tst-join14-time64.c           |   1 +
>  sysdeps/pthread/tst-mtx-timedlock-time64.c    |   1 +
>  sysdeps/pthread/tst-rwlock14-time64.c         |   1 +
>  sysdeps/pthread/tst-sem5-time64.c             |   1 +
>  sysdeps/pthread/tst-thrd-sleep-time64.c       |   1 +
>  sysdeps/unix/sysv/linux/Makefile              |  10 ++
>  sysdeps/unix/sysv/linux/tst-adjtimex-time64.c |   1 +
>  .../sysv/linux/tst-clock_adjtime-time64.c     |   1 +
>  .../unix/sysv/linux/tst-ntp_adjtime-time64.c  |   1 +
>  .../unix/sysv/linux/tst-ntp_gettime-time64.c  |   1 +
>  .../unix/sysv/linux/tst-ntp_gettimex-time64.c |   1 +
>  sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
>  .../unix/sysv/linux/tst-sigtimedwait-time64.c |   1 +
>  sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
>  sysvipc/Makefile                              |   2 +
>  sysvipc/test-sysvmsg-time64.c                 |   1 +
>  sysvipc/test-sysvsem-time64.c                 |   1 +
>  sysvipc/test-sysvshm-time64.c                 |   1 +
>  time/Makefile                                 |  18 ++++
>  time/tst-adjtime-time64.c                     |   1 +
>  time/tst-clock-time64.c                       |   1 +
>  time/tst-clock2-time64.c                      |   1 +
>  time/tst-clock_nanosleep-time64.c             |   1 +
>  time/tst-clock_settime-time64.c               |   1 +
>  time/tst-cpuclock1-time64.c                   |   1 +
>  time/tst-ctime-time64.c                       |   1 +
>  time/tst-ctime.c                              |  16 +++
>  time/tst-difftime-time64.c                    |   1 +
>  time/tst-gmtime-time64.c                      |   1 +
>  time/tst-itimer-time64.c                      |   1 +
>  time/tst-mktime4-time64.c                     |   1 +
>  time/tst-settimeofday-time64.c                |   1 +
>  time/tst-timegm-time64.c                      |   1 +
>  time/tst-timespec_get-time64.c                |   1 +
>  time/tst-timespec_getres-time64.c             |   1 +
>  time/tst-y2039-time64.c                       |   1 +
>  time/tst-y2039.c                              |  10 ++
>  80 files changed, 385 insertions(+), 30 deletions(-)
>  create mode 100644 io/ftwtest-time64.c
>  create mode 100644 io/tst-fts-time64.c
>  create mode 100644 io/tst-futimens-time64.c
>  create mode 100644 io/tst-futimes-time64.c
>  create mode 100644 io/tst-futimesat-time64.c
>  create mode 100644 io/tst-lutimes-time64.c
>  create mode 100644 io/tst-stat-time64.c
>  create mode 100644 io/tst-utime-time64.c
>  create mode 100644 io/tst-utimensat-time64.c
>  create mode 100644 io/tst-utimes-time64.c
>  create mode 100644 misc/tst-pselect-time64.c
>  create mode 100644 misc/tst-select-time64.c
>  create mode 100644 nptl/tst-cancel4_2-time64.c
>  create mode 100644 posix/tst-gnuglob64-time64.c
>  create mode 100644 posix/tst-sched_rr_get_interval-time64.c
>  create mode 100644 posix/tst-wait3-time64.c
>  create mode 100644 posix/tst-wait4-time64.c
>  create mode 100644 rt/tst-aio6-time64.c
>  create mode 100644 rt/tst-cpuclock2-time64.c
>  create mode 100644 rt/tst-mqueue1-time64.c
>  create mode 100644 rt/tst-mqueue2-time64.c
>  create mode 100644 rt/tst-mqueue4-time64.c
>  create mode 100644 rt/tst-mqueue8-time64.c
>  create mode 100644 rt/tst-timer4-time64.c
>  create mode 100644 sysdeps/pthread/tst-abstime-time64.c
>  create mode 100644 sysdeps/pthread/tst-cnd-timedwait-time64.c
>  create mode 100644 sysdeps/pthread/tst-cond11-time64.c
>  create mode 100644 sysdeps/pthread/tst-join14-time64.c
>  create mode 100644 sysdeps/pthread/tst-mtx-timedlock-time64.c
>  create mode 100644 sysdeps/pthread/tst-rwlock14-time64.c
>  create mode 100644 sysdeps/pthread/tst-sem5-time64.c
>  create mode 100644 sysdeps/pthread/tst-thrd-sleep-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c
>  create mode 100644 sysvipc/test-sysvmsg-time64.c
>  create mode 100644 sysvipc/test-sysvsem-time64.c
>  create mode 100644 sysvipc/test-sysvshm-time64.c
>  create mode 100644 time/tst-adjtime-time64.c
>  create mode 100644 time/tst-clock-time64.c
>  create mode 100644 time/tst-clock2-time64.c
>  create mode 100644 time/tst-clock_nanosleep-time64.c
>  create mode 100644 time/tst-clock_settime-time64.c
>  create mode 100644 time/tst-cpuclock1-time64.c
>  create mode 100644 time/tst-ctime-time64.c
>  create mode 100644 time/tst-difftime-time64.c
>  create mode 100644 time/tst-gmtime-time64.c
>  create mode 100644 time/tst-itimer-time64.c
>  create mode 100644 time/tst-mktime4-time64.c
>  create mode 100644 time/tst-settimeofday-time64.c
>  create mode 100644 time/tst-timegm-time64.c
>  create mode 100644 time/tst-timespec_get-time64.c
>  create mode 100644 time/tst-timespec_getres-time64.c
>  create mode 100644 time/tst-y2039-time64.c
> 
> diff --git a/Makeconfig b/Makeconfig
> index 1d5e45926c..e50d1351a9 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -1235,6 +1235,20 @@ $(common-objpfx)versions.stmp:
> $(common-objpfx)Versions.all \ touch $@
>  endif # avoid-generated
>  endif # $(build-shared) = yes
> +
> +-include $(common-objpfx)time64-compat.mk
> +postclean-generated += time64-compat.mk
> +
> +$(common-objpfx)time64-compat.mk: $(sysd-versions-force) \
> +				  $(common-objpfx)time64-compat.i
> +	sed '/^[        ]*#/d;/^[       ]*$$/d' $< > $@T
> +	mv -f $@T $@
> +$(common-objpfx)time64-compat.i: $(..)Makeconfig
> +	printf "#include <time64-compat.h>\n#ifdef
> TIME64_NON_DEFAULT\nhave-time64-compat = yes\n#endif" \
> +	| $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - > $@T
> +	mv -f $@T $@
> +
> +
>  endif # sysd-sorted-done
>  
>  # The name under which the run-time dynamic linker is installed.
> diff --git a/Makerules b/Makerules
> index ca9885436e..12f1a5cb50 100644
> --- a/Makerules
> +++ b/Makerules
> @@ -771,7 +771,8 @@ endif
>  	     $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
>  	     $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \
>  	     $(patsubst %.o,%.d,$(filter
> %.o,$(extra-test-objs:.os=.o))) \
> -	     $(addsuffix .d,$(tests) $(tests-internal) $(xtests)
> $(test-srcs))
> +	     $(addsuffix .d,$(tests) $(tests-internal) $(xtests) \
> +		$(test-srcs) $(tests-time64) $(xtests-time64))
>  ifeq ($(build-programs),yes)
>  +depfiles += $(addsuffix .d,$(others) $(sysdep-others))
>  endif
> @@ -1286,6 +1287,21 @@ check: tests
>  .PHONY: xcheck
>  xcheck: xtests
>  
> +# Handle tests-time64 and xtests-time64 that should built with LFS
> +# and 64-bit time support.
> +include $(o-iterator)
> +define o-iterator-doit
> +$(foreach f,$(tests-time64) $(xtests-time64),\
> +	    $(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64
> -D_FILE_OFFSET_BITS=64 +endef
> +object-suffixes-left := $(all-object-suffixes)
> +include $(o-iterator)
> +
> +ifeq ($(have-time64-compat),yes)
> +tests += $(foreach t,$(tests-time64),$(t))
> +xtests += $(foreach t,$(xtests-time64),$(t))
> +endif
> +
>  # The only difference between MODULE_NAME=testsuite and
> MODULE_NAME=nonlib is # that almost all internal declarations from
> config.h, libc-symbols.h, and # include/*.h are not available to
> 'testsuite' code, but are to 'nonlib' code. diff --git a/io/Makefile
> b/io/Makefile index d35e966258..ba8bd37355 100644
> --- a/io/Makefile
> +++ b/io/Makefile
> @@ -59,7 +59,7 @@ routines :=
> 			\ ftw64-time64
>  
>  others		:= pwd
> -test-srcs	:= ftwtest
> +test-srcs	:= ftwtest ftwtest-time64
>  tests		:= test-utime test-stat test-stat2 test-lfs
> tst-getcwd \ tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4
> tst-statvfs \ tst-openat tst-unlinkat tst-fstatat tst-futimesat \
> @@ -78,12 +78,24 @@ tests		:= test-utime test-stat
> test-stat2 test-lfs tst-getcwd \ tst-futimens \
>  		   tst-utimensat \
>  
> +tests-time64 := \
> +  tst-futimens-time64 \
> +  tst-futimes-time64\
> +  tst-fts-time64 \
> +  tst-lutimes-time64 \
> +  tst-stat-time64 \
> +  tst-futimesat-time64 \
> +  tst-utime-time64 \
> +  tst-utimensat-time64 \
> +  tst-utimes-time64 \
> +
>  # Likewise for statx, but we do not need static linking here.
>  tests-internal += tst-statx
>  tests-static += tst-statx
>  
>  ifeq ($(run-built-tests),yes)
> -tests-special += $(objpfx)ftwtest.out
> +tests-special += $(objpfx)ftwtest.out \
> +		 $(objpfx)ftwtest-time64.out
>  endif
>  
>  include ../Rules
> @@ -125,8 +137,14 @@ tst-statvfs-ARGS = $(objpfx)tst-statvfs
> tst-statvfs.c /tmp 
>  tst-open-tmpfile-ARGS = --test-dir=$(objpfx)
>  
> +CFLAGS-ftwtest-time64.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
> +
>  ifeq ($(run-built-tests),yes)
>  $(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest
>  	$(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
>  	$(evaluate-test)
> +
> +$(objpfx)ftwtest-time64.out: ftwtest-sh $(objpfx)ftwtest-time64
> +	$(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
> +	$(evaluate-test)
>  endif
> diff --git a/io/ftwtest-time64.c b/io/ftwtest-time64.c
> new file mode 100644
> index 0000000000..67f1c46826
> --- /dev/null
> +++ b/io/ftwtest-time64.c
> @@ -0,0 +1 @@
> +#include "ftwtest.c"
> diff --git a/io/tst-fts-time64.c b/io/tst-fts-time64.c
> new file mode 100644
> index 0000000000..a4a41fe1cf
> --- /dev/null
> +++ b/io/tst-fts-time64.c
> @@ -0,0 +1 @@
> +#include "tst-fts.c"
> diff --git a/io/tst-futimens-time64.c b/io/tst-futimens-time64.c
> new file mode 100644
> index 0000000000..88fcb38489
> --- /dev/null
> +++ b/io/tst-futimens-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-futimens.c"
> diff --git a/io/tst-futimens.c b/io/tst-futimens.c
> index b3e3f3137f..4c18ede573 100644
> --- a/io/tst-futimens.c
> +++ b/io/tst-futimens.c
> @@ -20,13 +20,17 @@
>  #include <support/xunistd.h>
>  #include <sys/stat.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_futimens_helper (const char *file, int fd, const struct
> timespec *ts) {
>    int result = futimens (fd, ts);
>    TEST_VERIFY_EXIT (result == 0);
>  
> -  struct stat64 st;
> +  struct_stat st;
>    xfstat (fd, &st);
>  
>    /* Check if seconds for atime match */
> diff --git a/io/tst-futimes-time64.c b/io/tst-futimes-time64.c
> new file mode 100644
> index 0000000000..d489c265d1
> --- /dev/null
> +++ b/io/tst-futimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-futimes.c"
> diff --git a/io/tst-futimes.c b/io/tst-futimes.c
> index bdef38d7cb..9575a4b08e 100644
> --- a/io/tst-futimes.c
> +++ b/io/tst-futimes.c
> @@ -21,13 +21,17 @@
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_futimens_helper (const char *file, int fd, const struct timeval
> *tv) {
>    int r = futimes (fd, tv);
>    TEST_VERIFY_EXIT (r == 0);
>  
> -  struct stat64 st;
> +  struct_stat st;
>    xfstat (fd, &st);
>  
>    /* Check if seconds for atime match */
> diff --git a/io/tst-futimesat-time64.c b/io/tst-futimesat-time64.c
> new file mode 100644
> index 0000000000..f6c0500eef
> --- /dev/null
> +++ b/io/tst-futimesat-time64.c
> @@ -0,0 +1,4 @@
> +#define struct_stat  struct stat
> +#define fstat        fstat
> +#define fstatat      fstatat
> +#include "io/tst-futimesat.c"
> diff --git a/io/tst-futimesat.c b/io/tst-futimesat.c
> index af58ad06dd..c32ab2b668 100644
> --- a/io/tst-futimesat.c
> +++ b/io/tst-futimesat.c
> @@ -1,4 +1,23 @@
> +/* futimesat basic tests.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
>  #include <dirent.h>
> +#include <errno.h>
>  #include <fcntl.h>
>  #include <stdio.h>
>  #include <stdlib.h>
> @@ -7,19 +26,19 @@
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  
> +#include <support/test-driver.h>
> +#include <support/temp_file.h>
>  
> -static void prepare (void);
> -#define PREPARE(argc, argv) prepare ()
> -
> -static int do_test (void);
> -#define TEST_FUNCTION do_test ()
> -
> -#include "../test-skeleton.c"
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +# define fstat       fstat64
> +# define fstatat     fstatat64
> +#endif
>  
>  static int dir_fd;
>  
>  static void
> -prepare (void)
> +prepare (int argc, char *argv[])
>  {
>    size_t test_dir_len = strlen (test_dir);
>    static const char dir_name[] = "/tst-futimesat.XXXXXX";
> @@ -48,7 +67,7 @@ prepare (void)
>        exit (1);
>      }
>  }
> -
> +#define PREPARE prepare
>  
>  static int
>  do_test (void)
> @@ -98,8 +117,8 @@ do_test (void)
>    write (fd, "hello", 5);
>    puts ("file created");
>  
> -  struct stat64 st1;
> -  if (fstat64 (fd, &st1) != 0)
> +  struct_stat st1;
> +  if (fstat (fd, &st1) != 0)
>      {
>        puts ("fstat64 failed");
>        return 1;
> @@ -118,8 +137,8 @@ do_test (void)
>        return 1;
>      }
>  
> -  struct stat64 st2;
> -  if (fstatat64 (dir_fd, "some-file", &st2, 0) != 0)
> +  struct_stat st2;
> +  if (fstatat (dir_fd, "some-file", &st2, 0) != 0)
>      {
>        puts ("fstatat64 failed");
>        return 1;
> @@ -146,3 +165,5 @@ do_test (void)
>  
>    return 0;
>  }
> +
> +#include <support/test-driver.c>
> diff --git a/io/tst-lutimes-time64.c b/io/tst-lutimes-time64.c
> new file mode 100644
> index 0000000000..06caec0a91
> --- /dev/null
> +++ b/io/tst-lutimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-lutimes.c"
> diff --git a/io/tst-lutimes.c b/io/tst-lutimes.c
> index b2da3c5796..237a870415 100644
> --- a/io/tst-lutimes.c
> +++ b/io/tst-lutimes.c
> @@ -21,23 +21,27 @@
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_lutimes_helper (const char *testfile, int fd, const char
> *testlink, const struct timeval *tv)
>  {
> -  struct stat64 stfile_orig;
> +  struct_stat stfile_orig;
>    xlstat (testfile, &stfile_orig);
>  
>    TEST_VERIFY_EXIT (lutimes (testlink, tv) == 0);
>  
> -  struct stat64 stlink;
> +  struct_stat stlink;
>    xlstat (testlink, &stlink);
>  
>    TEST_COMPARE (stlink.st_atime, tv[0].tv_sec);
>    TEST_COMPARE (stlink.st_mtime, tv[1].tv_sec);
>  
>    /* Check if the timestamp from original file is not changed.  */
> -  struct stat64 stfile;
> +  struct_stat stfile;
>    xlstat (testfile, &stfile);
>  
>    TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
> diff --git a/io/tst-stat-time64.c b/io/tst-stat-time64.c
> new file mode 100644
> index 0000000000..c10fe1284a
> --- /dev/null
> +++ b/io/tst-stat-time64.c
> @@ -0,0 +1,102 @@
> +/* Basic test of stat with 64 bit time_t interfaces.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be
> useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <errno.h>
> +#include <fcntl.h>
> +#include <stdbool.h>
> +#include <support/check.h>
> +#include <support/support.h>
> +#include <support/temp_file.h>
> +#include <support/xunistd.h>
> +#include <stdlib.h>
> +#include <sys/stat.h>
> +#include <sys/sysmacros.h>
> +
> +/* The idea of the test is check whether the 64 bit time_t stat
> implementation
> +   returns the expected value for comparable fields, so it does not
> really
> +   matter whether statx uses a fallback implementation or not.  */
> +
> +static void
> +stat_check (int fd, const char *path, struct stat *st)
> +{
> +  TEST_COMPARE (stat (path, st), 0);
> +}
> +
> +static void
> +lstat_check (int fd, const char *path, struct stat *st)
> +{
> +  TEST_COMPARE (lstat (path, st), 0);
> +}
> +
> +static void
> +fstat_check (int fd, const char *path, struct stat *st)
> +{
> +  TEST_COMPARE (fstat (fd, st), 0);
> +}
> +
> +static void
> +fstatat_check (int fd, const char *path, struct stat *st)
> +{
> +  TEST_COMPARE (fstatat (fd, path, st, 0), 0);
> +}
> +
> +typedef void (*test_t)(int, const char *path, struct stat *);
> +
> +static int
> +do_test (void)
> +{
> +  char *path;
> +  int fd = create_temp_file ("tst-statx-", &path);
> +  TEST_VERIFY_EXIT (fd >= 0);
> +  support_write_file_string (path, "abc");
> +
> +  struct statx stx;
> +  TEST_COMPARE (statx (fd, path, 0, STATX_BASIC_STATS, &stx), 0);
> +
> +  for (test_t *test = (test_t[]) { stat_check, lstat_check,
> fstat_check,
> +				   fstatat_check, NULL };
> +       *test != NULL; test++)
> +  {
> +    struct stat st;
> +    (*test) (fd, path, &st);
> +
> +    TEST_COMPARE (stx.stx_dev_major, major (st.st_dev));
> +    TEST_COMPARE (stx.stx_dev_minor, minor (st.st_dev));
> +    TEST_COMPARE (stx.stx_ino, st.st_ino);
> +    TEST_COMPARE (stx.stx_mode, st.st_mode);
> +    TEST_COMPARE (stx.stx_nlink, st.st_nlink);
> +    TEST_COMPARE (stx.stx_uid, st.st_uid);
> +    TEST_COMPARE (stx.stx_gid, st.st_gid);
> +    TEST_COMPARE (stx.stx_rdev_major, major (st.st_rdev));
> +    TEST_COMPARE (stx.stx_rdev_minor, minor (st.st_rdev));
> +    TEST_COMPARE (stx.stx_blksize, st.st_blksize);
> +    TEST_COMPARE (stx.stx_blocks, st.st_blocks);
> +
> +    TEST_COMPARE (stx.stx_ctime.tv_sec, st.st_ctim.tv_sec);
> +    TEST_COMPARE (stx.stx_ctime.tv_nsec, st.st_ctim.tv_nsec);
> +    TEST_COMPARE (stx.stx_mtime.tv_sec, st.st_mtim.tv_sec);
> +    TEST_COMPARE (stx.stx_mtime.tv_nsec, st.st_mtim.tv_nsec);
> +  }
> +
> +  xclose (fd);
> +  free (path);
> +
> +  return 0;
> +}
> +
> +#include <support/test-driver.c>
> diff --git a/io/tst-utime-time64.c b/io/tst-utime-time64.c
> new file mode 100644
> index 0000000000..eb62f59126
> --- /dev/null
> +++ b/io/tst-utime-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-utime.c"
> diff --git a/io/tst-utime.c b/io/tst-utime.c
> index 6269ef7929..0144e2a22a 100644
> --- a/io/tst-utime.c
> +++ b/io/tst-utime.c
> @@ -21,13 +21,17 @@
>  #include <support/xunistd.h>
>  #include <sys/stat.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_utime_helper (const char *file, int fd, const struct utimbuf
> *ut) {
>    int result = utime (file, ut);
>    TEST_VERIFY_EXIT (result == 0);
>  
> -  struct stat64 st;
> +  struct_stat st;
>    xfstat (fd, &st);
>  
>    /* Check if seconds for actime match */
> diff --git a/io/tst-utimensat-time64.c b/io/tst-utimensat-time64.c
> new file mode 100644
> index 0000000000..7ac7d8df1d
> --- /dev/null
> +++ b/io/tst-utimensat-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-utimensat.c"
> diff --git a/io/tst-utimensat.c b/io/tst-utimensat.c
> index 0c7c8470bc..062abdd8d3 100644
> --- a/io/tst-utimensat.c
> +++ b/io/tst-utimensat.c
> @@ -22,6 +22,10 @@
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_utimesat_helper (const char *testfile, int fd, const char
> *testlink, const struct timespec *ts)
> @@ -29,7 +33,7 @@ test_utimesat_helper (const char *testfile, int fd,
> const char *testlink, {
>      TEST_VERIFY_EXIT (utimensat (fd, testfile, ts, 0) == 0);
>  
> -    struct stat64 st;
> +    struct_stat st;
>      xfstat (fd, &st);
>  
>      /* Check if seconds for atime match */
> @@ -40,20 +44,20 @@ test_utimesat_helper (const char *testfile, int
> fd, const char *testlink, }
>  
>    {
> -    struct stat64 stfile_orig;
> +    struct_stat stfile_orig;
>      xlstat (testfile, &stfile_orig);
>  
>      TEST_VERIFY_EXIT (utimensat (0 /* ignored  */, testlink, ts,
>  				 AT_SYMLINK_NOFOLLOW)
>  		       == 0);
> -    struct stat64 stlink;
> +    struct_stat stlink;
>      xlstat (testlink, &stlink);
>  
>      TEST_COMPARE (stlink.st_atime, ts[0].tv_sec);
>      TEST_COMPARE (stlink.st_mtime, ts[1].tv_sec);
>  
>      /* Check if the timestamp from original file is not changed.  */
> -    struct stat64 stfile;
> +    struct_stat stfile;
>      xlstat (testfile, &stfile);
>  
>      TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
> diff --git a/io/tst-utimes-time64.c b/io/tst-utimes-time64.c
> new file mode 100644
> index 0000000000..234ec02541
> --- /dev/null
> +++ b/io/tst-utimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-utimes.c"
> diff --git a/io/tst-utimes.c b/io/tst-utimes.c
> index 991ab0c7d3..e88efff45b 100644
> --- a/io/tst-utimes.c
> +++ b/io/tst-utimes.c
> @@ -22,13 +22,17 @@
>  #include <sys/time.h>
>  #include <time.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_utimes_helper (const char *file, int fd, const struct timeval
> *tv) {
>    int result = utimes (file, tv);
>    TEST_VERIFY_EXIT (result == 0);
>  
> -  struct stat64 st;
> +  struct_stat st;
>    xfstat (fd, &st);
>  
>    /* Check if seconds for atime match */
> diff --git a/misc/Makefile b/misc/Makefile
> index 38dad737f2..7f51f7163d 100644
> --- a/misc/Makefile
> +++ b/misc/Makefile
> @@ -90,6 +90,10 @@ tests := tst-dirname tst-tsearch tst-fdset
> tst-mntent tst-hsearch \ tst-ldbl-warn tst-ldbl-error tst-dbl-efgcvt
> tst-ldbl-efgcvt \ tst-mntent-autofs tst-syscalls tst-mntent-escape
> tst-select 
> +tests-time64 := \
> +  tst-select-time64 \
> +  tst-pselect-time64
> +
>  # Tests which need libdl.
>  ifeq (yes,$(build-shared))
>  tests += tst-gethostid
> diff --git a/misc/tst-pselect-time64.c b/misc/tst-pselect-time64.c
> new file mode 100644
> index 0000000000..15a1e49292
> --- /dev/null
> +++ b/misc/tst-pselect-time64.c
> @@ -0,0 +1 @@
> +#include "tst-pselect.c"
> diff --git a/misc/tst-select-time64.c b/misc/tst-select-time64.c
> new file mode 100644
> index 0000000000..13120bfe31
> --- /dev/null
> +++ b/misc/tst-select-time64.c
> @@ -0,0 +1 @@
> +#include "tst-select.c"
> diff --git a/nptl/Makefile b/nptl/Makefile
> index bd5a9ce51f..50dde03ba8 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -329,6 +329,9 @@ xtests = tst-setuid1 tst-setuid1-static
> tst-setuid2 \ tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 tst-setgroups \
>  	tst-mutexpp5 tst-mutexpp9
>  
> +tests-time64 := \
> +  tst-cancel4_2-time64
> +
>  # This test can run into task limits because of a linux kernel bug
>  # and then cause the make process to fail too, see bug 24537.
>  xtests += tst-eintr1
> diff --git a/nptl/tst-cancel4_2-time64.c b/nptl/tst-cancel4_2-time64.c
> new file mode 100644
> index 0000000000..4ac086a312
> --- /dev/null
> +++ b/nptl/tst-cancel4_2-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cancel4_2.c"
> diff --git a/posix/Makefile b/posix/Makefile
> index 84204b1270..31e745fadc 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -123,7 +123,9 @@ endif
>  tests-internal	:= bug-regex5 bug-regex20 bug-regex33 \
>  		   tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3
>  tests-container := bug-ga2
> +tests-time64	:= tst-wait4-time64 tst-wait3-time64
> tst-gnuglob64-time64 xtests		:= tst-getaddrinfo4
> tst-getaddrinfo5 tst-sched_rr_get_interval +xtests-time64	:=
> tst-sched_rr_get_interval-time64 ifeq (yes,$(build-shared))
>  test-srcs	:= globtest
>  tests           += wordexp-test tst-exec tst-spawn tst-spawn2
> tst-spawn3 diff --git a/posix/tst-gnuglob64-time64.c
> b/posix/tst-gnuglob64-time64.c new file mode 100644
> index 0000000000..00922bcdc6
> --- /dev/null
> +++ b/posix/tst-gnuglob64-time64.c
> @@ -0,0 +1,7 @@
> +#define GLOB_FUNC glob
> +#define GLOB_TYPE glob_t
> +#define GLOBFREE_FUNC globfree
> +#define DIRENT_STRUCT dirent
> +#define STAT_STRUCT stat
> +
> +#include "tst-gnuglob-skeleton.c"
> diff --git a/posix/tst-sched_rr_get_interval-time64.c
> b/posix/tst-sched_rr_get_interval-time64.c new file mode 100644
> index 0000000000..f4e66d2939
> --- /dev/null
> +++ b/posix/tst-sched_rr_get_interval-time64.c
> @@ -0,0 +1 @@
> +#include "tst-sched_rr_get_interval.c"
> diff --git a/posix/tst-wait3-time64.c b/posix/tst-wait3-time64.c
> new file mode 100644
> index 0000000000..2837bc7a9e
> --- /dev/null
> +++ b/posix/tst-wait3-time64.c
> @@ -0,0 +1 @@
> +#include "tst-wait3.c"
> diff --git a/posix/tst-wait4-time64.c b/posix/tst-wait4-time64.c
> new file mode 100644
> index 0000000000..12543b270f
> --- /dev/null
> +++ b/posix/tst-wait4-time64.c
> @@ -0,0 +1 @@
> +#include "tst-wait4.c"
> diff --git a/rt/Makefile b/rt/Makefile
> index 97c9bbd9de..797f2da51e 100644
> --- a/rt/Makefile
> +++ b/rt/Makefile
> @@ -51,6 +51,15 @@ tests := tst-shm tst-timer tst-timer2 \
>  	 tst-shm-cancel
>  tests-internal := tst-timer-sigmask
>  
> +tests-time64 := \
> +  tst-aio6-time64 \
> +  tst-cpuclock2-time64 \
> +  tst-mqueue1-time64 \
> +  tst-mqueue2-time64 \
> +  tst-mqueue4-time64 \
> +  tst-mqueue8-time64 \
> +  tst-timer4-time64
> +
>  extra-libs := librt
>  extra-libs-others := $(extra-libs)
>  
> diff --git a/rt/tst-aio6-time64.c b/rt/tst-aio6-time64.c
> new file mode 100644
> index 0000000000..a386a577ec
> --- /dev/null
> +++ b/rt/tst-aio6-time64.c
> @@ -0,0 +1 @@
> +#include "tst-aio6.c"
> diff --git a/rt/tst-cpuclock2-time64.c b/rt/tst-cpuclock2-time64.c
> new file mode 100644
> index 0000000000..05775522bb
> --- /dev/null
> +++ b/rt/tst-cpuclock2-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cpuclock2.c"
> diff --git a/rt/tst-cpuclock2.c b/rt/tst-cpuclock2.c
> index c1c7ed2ad8..eebc3609d0 100644
> --- a/rt/tst-cpuclock2.c
> +++ b/rt/tst-cpuclock2.c
> @@ -21,7 +21,11 @@
>  
>  #if (_POSIX_THREADS - 0) <= 0
>  
> -# define TEST_FUNCTION 0
> +static int
> +do_test ()
> +{
> +  return 0;
> +}
>  
>  #else
>  
> @@ -330,7 +334,6 @@ do_test (void)
>  
>    return result;
>  }
> -# define TEST_FUNCTION do_test ()
>  #endif
>  
> -#include "../test-skeleton.c"
> +#include <support/test-driver.c>
> diff --git a/rt/tst-mqueue1-time64.c b/rt/tst-mqueue1-time64.c
> new file mode 100644
> index 0000000000..9c600a9a97
> --- /dev/null
> +++ b/rt/tst-mqueue1-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mqueue1.c"
> diff --git a/rt/tst-mqueue2-time64.c b/rt/tst-mqueue2-time64.c
> new file mode 100644
> index 0000000000..9d49f0b196
> --- /dev/null
> +++ b/rt/tst-mqueue2-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mqueue2.c"
> diff --git a/rt/tst-mqueue4-time64.c b/rt/tst-mqueue4-time64.c
> new file mode 100644
> index 0000000000..c23a228dc4
> --- /dev/null
> +++ b/rt/tst-mqueue4-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mqueue4.c"
> diff --git a/rt/tst-mqueue8-time64.c b/rt/tst-mqueue8-time64.c
> new file mode 100644
> index 0000000000..972637f7f5
> --- /dev/null
> +++ b/rt/tst-mqueue8-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mqueue8.c"
> diff --git a/rt/tst-timer4-time64.c b/rt/tst-timer4-time64.c
> new file mode 100644
> index 0000000000..e47a593f10
> --- /dev/null
> +++ b/rt/tst-timer4-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timer4.c"
> diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
> index b15d085f51..0ae241209d 100644
> --- a/sysdeps/pthread/Makefile
> +++ b/sysdeps/pthread/Makefile
> @@ -125,6 +125,16 @@ tests += tst-cnd-basic tst-mtx-trylock
> tst-cnd-broadcast \ tst-unwind-thread \
>  	 tst-pt-vfork1 tst-pt-vfork2 tst-vfork1x tst-vfork2x \
>  
> +tests-time64 := \
> +  tst-abstime-time64 \
> +  tst-cnd-timedwait-time64 \
> +  tst-cond11-time64 \
> +  tst-join14-time64 \
> +  tst-mtx-timedlock-time64 \
> +  tst-rwlock14-time64 \
> +  tst-sem5-time64 \
> +  tst-thrd-sleep-time64 \
> +
>  
>  # Files which must not be linked with libpthread.
>  tests-nolibpthread += tst-unload
> diff --git a/sysdeps/pthread/tst-abstime-time64.c
> b/sysdeps/pthread/tst-abstime-time64.c new file mode 100644
> index 0000000000..2fc77cb365
> --- /dev/null
> +++ b/sysdeps/pthread/tst-abstime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-abstime.c"
> diff --git a/sysdeps/pthread/tst-cnd-timedwait-time64.c
> b/sysdeps/pthread/tst-cnd-timedwait-time64.c new file mode 100644
> index 0000000000..9b2abfd277
> --- /dev/null
> +++ b/sysdeps/pthread/tst-cnd-timedwait-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cnd-timedwait.c"
> diff --git a/sysdeps/pthread/tst-cond11-time64.c
> b/sysdeps/pthread/tst-cond11-time64.c new file mode 100644
> index 0000000000..9bccb8ec8b
> --- /dev/null
> +++ b/sysdeps/pthread/tst-cond11-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cond11.c"
> diff --git a/sysdeps/pthread/tst-join14-time64.c
> b/sysdeps/pthread/tst-join14-time64.c new file mode 100644
> index 0000000000..bed784ee24
> --- /dev/null
> +++ b/sysdeps/pthread/tst-join14-time64.c
> @@ -0,0 +1 @@
> +#include "tst-join14.c"
> diff --git a/sysdeps/pthread/tst-mtx-timedlock-time64.c
> b/sysdeps/pthread/tst-mtx-timedlock-time64.c new file mode 100644
> index 0000000000..b3393c99ef
> --- /dev/null
> +++ b/sysdeps/pthread/tst-mtx-timedlock-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mtx-timedlock.c"
> diff --git a/sysdeps/pthread/tst-rwlock14-time64.c
> b/sysdeps/pthread/tst-rwlock14-time64.c new file mode 100644
> index 0000000000..ae9b1912cf
> --- /dev/null
> +++ b/sysdeps/pthread/tst-rwlock14-time64.c
> @@ -0,0 +1 @@
> +#include "tst-rwlock14.c"
> diff --git a/sysdeps/pthread/tst-sem5-time64.c
> b/sysdeps/pthread/tst-sem5-time64.c new file mode 100644
> index 0000000000..89c2a14f94
> --- /dev/null
> +++ b/sysdeps/pthread/tst-sem5-time64.c
> @@ -0,0 +1 @@
> +#include "tst-sem5.c"
> diff --git a/sysdeps/pthread/tst-thrd-sleep-time64.c
> b/sysdeps/pthread/tst-thrd-sleep-time64.c new file mode 100644
> index 0000000000..02837bd19f
> --- /dev/null
> +++ b/sysdeps/pthread/tst-thrd-sleep-time64.c
> @@ -0,0 +1 @@
> +#include "tst-thrd-sleep.c"
> diff --git a/sysdeps/unix/sysv/linux/Makefile
> b/sysdeps/unix/sysv/linux/Makefile index 747d1083e0..27716e53b7 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -122,6 +122,16 @@ endif
>  
>  tests-internal += tst-sigcontext-get_pc
>  
> +tests-time64 += \
> +  tst-adjtimex-time64 \
> +  tst-clock_adjtime-time64 \
> +  tst-ntp_adjtime-time64 \
> +  tst-ntp_gettime-time64 \
> +  tst-ntp_gettimex-time64 \
> +  tst-ppoll-time64 \
> +  tst-sigtimedwait-time64 \
> +  tst-timerfd-time64 \
> +
>  CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
>  
>  # Generate the list of SYS_* macros for the system calls (__NR_*
> diff --git a/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
> b/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c new file mode 100644
> index 0000000000..2b6988b7c4
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
> @@ -0,0 +1 @@
> +#include "tst-adjtimex.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
> b/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c new file mode
> 100644 index 0000000000..9691e81229
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-clock_adjtime.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
> b/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c new file mode
> 100644 index 0000000000..30e7380b02
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ntp_adjtime.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
> b/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c new file mode
> 100644 index 0000000000..42caa66301
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ntp_gettime.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
> b/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c new file mode
> 100644 index 0000000000..3f017b3c22
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ntp_gettimex.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-ppoll-time64.c
> b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c new file mode 100644
> index 0000000000..96ee2faee3
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ppoll.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
> b/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c new file mode
> 100644 index 0000000000..1513e81749
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
> @@ -0,0 +1 @@
> +#include "tst-sigtimedwait.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-timerfd-time64.c
> b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c new file mode 100644
> index 0000000000..bb17f48139
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timerfd.c"
> diff --git a/sysvipc/Makefile b/sysvipc/Makefile
> index a534791928..86911803b5 100644
> --- a/sysvipc/Makefile
> +++ b/sysvipc/Makefile
> @@ -32,6 +32,8 @@ routines := ftok \
>  
>  tests    := test-sysvmsg test-sysvsem test-sysvshm
>  
> +tests-time64 := test-sysvmsg-time64 test-sysvsem-time64
> test-sysvshm-time64 +
>  include ../Rules
>  
>  CFLAGS-msgrcv.c += -fexceptions -fasynchronous-unwind-tables
> diff --git a/sysvipc/test-sysvmsg-time64.c
> b/sysvipc/test-sysvmsg-time64.c new file mode 100644
> index 0000000000..c23e0c337e
> --- /dev/null
> +++ b/sysvipc/test-sysvmsg-time64.c
> @@ -0,0 +1 @@
> +#include "test-sysvmsg.c"
> diff --git a/sysvipc/test-sysvsem-time64.c
> b/sysvipc/test-sysvsem-time64.c new file mode 100644
> index 0000000000..05c95068cd
> --- /dev/null
> +++ b/sysvipc/test-sysvsem-time64.c
> @@ -0,0 +1 @@
> +#include "test-sysvsem.c"
> diff --git a/sysvipc/test-sysvshm-time64.c
> b/sysvipc/test-sysvshm-time64.c new file mode 100644
> index 0000000000..8e2963f563
> --- /dev/null
> +++ b/sysvipc/test-sysvshm-time64.c
> @@ -0,0 +1 @@
> +#include "test-sysvshm.c"
> diff --git a/time/Makefile b/time/Makefile
> index 805c79c4d0..c84bd5d3ec 100644
> --- a/time/Makefile
> +++ b/time/Makefile
> @@ -52,6 +52,24 @@ tests	:= test_time clocktest tst-posixtz
> tst-strptime tst_wcsftime \ tst-settimeofday tst-itimer tst-gmtime
> tst-timegm \ tst-timespec_get tst-timespec_getres
>  
> +tests-time64 := \
> +  tst-adjtime-time64 \
> +  tst-clock-time64 \
> +  tst-clock2-time64 \
> +  tst-clock_nanosleep-time64 \
> +  tst-clock_settime-time64 \
> +  tst-cpuclock1-time64 \
> +  tst-ctime-time64 \
> +  tst-difftime-time64 \
> +  tst-gmtime-time64 \
> +  tst-itimer-time64 \
> +  tst-mktime4-time64 \
> +  tst-settimeofday-time64 \
> +  tst-timegm-time64 \
> +  tst-timespec_get-time64 \
> +  tst-timespec_getres-time64 \
> +  tst-y2039-time64
> +
>  include ../Rules
>  
>  ifeq ($(run-built-tests),yes)
> diff --git a/time/tst-adjtime-time64.c b/time/tst-adjtime-time64.c
> new file mode 100644
> index 0000000000..097d6efc4b
> --- /dev/null
> +++ b/time/tst-adjtime-time64.c
> @@ -0,0 +1 @@
> +#include <tst-adjtime.c>
> diff --git a/time/tst-clock-time64.c b/time/tst-clock-time64.c
> new file mode 100644
> index 0000000000..a1349678c8
> --- /dev/null
> +++ b/time/tst-clock-time64.c
> @@ -0,0 +1 @@
> +#include "tst-clock.c"
> diff --git a/time/tst-clock2-time64.c b/time/tst-clock2-time64.c
> new file mode 100644
> index 0000000000..897f47b287
> --- /dev/null
> +++ b/time/tst-clock2-time64.c
> @@ -0,0 +1 @@
> +#include "tst-clock2.c"
> diff --git a/time/tst-clock_nanosleep-time64.c
> b/time/tst-clock_nanosleep-time64.c new file mode 100644
> index 0000000000..c8638aa3d2
> --- /dev/null
> +++ b/time/tst-clock_nanosleep-time64.c
> @@ -0,0 +1 @@
> +#include "tst-clock_nanosleep.c"
> diff --git a/time/tst-clock_settime-time64.c
> b/time/tst-clock_settime-time64.c new file mode 100644
> index 0000000000..328b04a030
> --- /dev/null
> +++ b/time/tst-clock_settime-time64.c
> @@ -0,0 +1 @@
> +#include <tst-clock_settime.c>
> diff --git a/time/tst-cpuclock1-time64.c b/time/tst-cpuclock1-time64.c
> new file mode 100644
> index 0000000000..5a7ffa27ac
> --- /dev/null
> +++ b/time/tst-cpuclock1-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cpuclock1.c"
> diff --git a/time/tst-ctime-time64.c b/time/tst-ctime-time64.c
> new file mode 100644
> index 0000000000..24a5ae98ed
> --- /dev/null
> +++ b/time/tst-ctime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ctime.c"
> diff --git a/time/tst-ctime.c b/time/tst-ctime.c
> index e89a906bf8..884d69bfa0 100644
> --- a/time/tst-ctime.c
> +++ b/time/tst-ctime.c
> @@ -24,6 +24,7 @@ static int
>  do_test (void)
>  {
>    char *str;
> +  char strb[32];
>    time_t t;
>  
>    /* Use glibc time zone extension "TZ=:" to to guarantee that UTC
> @@ -36,11 +37,21 @@ do_test (void)
>    str = ctime (&t);
>    TEST_COMPARE_STRING (str, "Thu Jan  1 00:00:00 1970\n");
>  
> +  /* Same as before but with ctime_r.  */
> +  str = ctime_r (&t, strb);
> +  TEST_VERIFY (str == strb);
> +  TEST_COMPARE_STRING (str, "Thu Jan  1 00:00:00 1970\n");
> +
>    /* Check if the max time value for 32 bit time_t can be converted.
>  */ t = 0x7fffffff;
>    str = ctime (&t);
>    TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n");
>  
> +  /* Same as before but with ctime_r.  */
> +  str = ctime_r (&t, strb);
> +  TEST_VERIFY (str == strb);
> +  TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n");
> +
>    /* Check if we run on port with 32 bit time_t size */
>    time_t tov;
>    if (__builtin_add_overflow (t, 1, &tov))
> @@ -50,6 +61,11 @@ do_test (void)
>    str = ctime (&tov);
>    TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n");
>  
> +  /* Same as before but with ctime_r.  */
> +  str = ctime_r (&tov, strb);
> +  TEST_VERIFY (str == strb);
> +  TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n");
> +
>    return 0;
>  }
>  
> diff --git a/time/tst-difftime-time64.c b/time/tst-difftime-time64.c
> new file mode 100644
> index 0000000000..751ce6c483
> --- /dev/null
> +++ b/time/tst-difftime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-difftime.c"
> diff --git a/time/tst-gmtime-time64.c b/time/tst-gmtime-time64.c
> new file mode 100644
> index 0000000000..0df11c1913
> --- /dev/null
> +++ b/time/tst-gmtime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-gmtime.c"
> diff --git a/time/tst-itimer-time64.c b/time/tst-itimer-time64.c
> new file mode 100644
> index 0000000000..ddd2efa175
> --- /dev/null
> +++ b/time/tst-itimer-time64.c
> @@ -0,0 +1 @@
> +#include <time/tst-itimer.c>
> diff --git a/time/tst-mktime4-time64.c b/time/tst-mktime4-time64.c
> new file mode 100644
> index 0000000000..bf5197c6f3
> --- /dev/null
> +++ b/time/tst-mktime4-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mktime4.c"
> diff --git a/time/tst-settimeofday-time64.c
> b/time/tst-settimeofday-time64.c new file mode 100644
> index 0000000000..185d167a22
> --- /dev/null
> +++ b/time/tst-settimeofday-time64.c
> @@ -0,0 +1 @@
> +#include <tst-settimeofday.c>
> diff --git a/time/tst-timegm-time64.c b/time/tst-timegm-time64.c
> new file mode 100644
> index 0000000000..8e3084f74e
> --- /dev/null
> +++ b/time/tst-timegm-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timegm.c"
> diff --git a/time/tst-timespec_get-time64.c
> b/time/tst-timespec_get-time64.c new file mode 100644
> index 0000000000..48f336385d
> --- /dev/null
> +++ b/time/tst-timespec_get-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timespec_get.c"
> diff --git a/time/tst-timespec_getres-time64.c
> b/time/tst-timespec_getres-time64.c new file mode 100644
> index 0000000000..59a0f36103
> --- /dev/null
> +++ b/time/tst-timespec_getres-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timespec_getres.c"
> diff --git a/time/tst-y2039-time64.c b/time/tst-y2039-time64.c
> new file mode 100644
> index 0000000000..3c8a504186
> --- /dev/null
> +++ b/time/tst-y2039-time64.c
> @@ -0,0 +1 @@
> +#include "tst-y2039.c"
> diff --git a/time/tst-y2039.c b/time/tst-y2039.c
> index ef024c0a77..66a22d4c2c 100644
> --- a/time/tst-y2039.c
> +++ b/time/tst-y2039.c
> @@ -37,6 +37,16 @@ do_test (void)
>  			> 0);  
>        puts (buf);
>        TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
> +
> +      /* Same as before but for localtime_r.  */
> +      struct tm tmd;
> +      tm = localtime_r (&ouch, &tmd);
> +      TEST_VERIFY_EXIT (tm == &tmd);
> +
> +      TEST_VERIFY_EXIT (strftime (buf, sizeof buf, "%Y-%m-%d
> %H:%M:%S %Z", tm)
> +			> 0);
> +      puts (buf);
> +      TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
>      }
>    else
>      FAIL_UNSUPPORTED ("32-bit time_t");



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64
  2021-05-18 20:55 ` [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
  2021-05-19  8:24   ` Lukasz Majewski
@ 2021-05-20  6:38   ` Florian Weimer
  2021-05-20 10:43     ` Adhemerval Zanella
  2021-06-04 19:29   ` Carlos O'Donell
  2 siblings, 1 reply; 92+ messages in thread
From: Florian Weimer @ 2021-05-20  6:38 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> The n32 will require the 64 bit time symbols for y2038 support.
> ---
>  .../mips/mips64/{ => n32}/libpthread.abilist      |  0
>  .../sysv/linux/mips/mips64/n64/libpthread.abilist | 15 +++++++++++++++
>  2 files changed, 15 insertions(+)
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
>
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> new file mode 100644
> index 0000000000..a5f3d5ce2a
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> @@ -0,0 +1,15 @@
> +GLIBC_2.0 __errno_location F
> +GLIBC_2.0 pthread_create F
> +GLIBC_2.11 __libpthread_version_placeholder F
> +GLIBC_2.12 __libpthread_version_placeholder F
> +GLIBC_2.18 __libpthread_version_placeholder F
> +GLIBC_2.2 pthread_create F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
> +GLIBC_2.2.6 __libpthread_version_placeholder F
> +GLIBC_2.28 thrd_create F
> +GLIBC_2.3.2 __libpthread_version_placeholder F
> +GLIBC_2.3.3 __libpthread_version_placeholder F
> +GLIBC_2.3.4 __libpthread_version_placeholder F
> +GLIBC_2.30 __libpthread_version_placeholder F
> +GLIBC_2.31 __libpthread_version_placeholder F
> +GLIBC_2.4 __libpthread_version_placeholder F

That looks wrong, there are no time-dependent symbols left in
libpthread, so the split isn't needed.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO
  2021-05-18 20:55 ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella
  2021-05-19  8:36   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO Lukasz Majewski
@ 2021-05-20  6:44   ` Florian Weimer
  2021-05-20 18:01     ` Adhemerval Zanella
  2021-06-04 19:30   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO Carlos O'Donell
  2 siblings, 1 reply; 92+ messages in thread
From: Florian Weimer @ 2021-05-20  6:44 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> +#ifndef __ASSUME_TIME64_SYSCALLS
> +static int
> +getsockopt32 (int fd, int level, int optname, void *optval,
> +	      socklen_t *len)
> +{
> +  int r = -1;
> +
> +  if (level != SOL_SOCKET)
> +    return r;
> +
> +  switch (optname)
> +    {
> +    case COMPAT_SO_RCVTIMEO_NEW:
> +    case COMPAT_SO_SNDTIMEO_NEW:
> +      {
> +        if (*len < sizeof (struct __timeval64))
> +	  {
> +	    __set_errno (EINVAL);
> +	    break;
> +	  }
> +
> +	if (optname == COMPAT_SO_RCVTIMEO_NEW)
> +	  optname = COMPAT_SO_RCVTIMEO_OLD;
> +	if (optname == COMPAT_SO_SNDTIMEO_NEW)
> +	  optname = COMPAT_SO_SNDTIMEO_OLD;
> +
> +	struct __timeval32 tv32;
> +	r = getsockopt_syscall (fd, level, optname, &tv32,
> +				(socklen_t[]) { sizeof tv32 });
> +	if (r < 0)
> +	  break;
> +	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
> +	*tv64 = valid_timeval32_to_timeval64 (tv32);
> +	*len = sizeof (*tv64);
> +      }

I think POSIX requires checking the incoming *len value and truncating
the output.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-18 20:55 ` [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella
  2021-05-19  8:50   ` Lukasz Majewski
@ 2021-05-20  6:50   ` Florian Weimer
  2021-05-20 18:46     ` Adhemerval Zanella
  2021-06-04 19:30   ` Carlos O'Donell
  2 siblings, 1 reply; 92+ messages in thread
From: Florian Weimer @ 2021-05-20  6:50 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> Calls with __TIMESIZE=32 will see the converted 64-bit time control
> messages as spurious control message of unknown type.  Calls with
> __TIMESIZE=64 running on pre-time64 kernels will see the original
> message as a spurious control ones of unknown typ while running on
> kernel with native 64-bit time support will only see the time64 version
> of the control message.

Does the mirror what the kernel does?  I have some concerns about
backwards compatibility here, but if the kernel does it as well, that is
likely a non-issue.

I think this kind of emulation goes against our general guidance of not
emulating system calls in userspace.  It would probably be necessary if
we switch an existing 32-bit target to 64-bit time_t by default, though.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs
  2021-05-18 20:56 ` [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella
  2021-05-19  9:18   ` Lukasz Majewski
@ 2021-05-20  6:58   ` Florian Weimer
  2021-05-20 10:37     ` Adhemerval Zanella
  2021-06-04 19:38   ` Carlos O'Donell
  2 siblings, 1 reply; 92+ messages in thread
From: Florian Weimer @ 2021-05-20  6:58 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
> index da716e2c1b..8d5efb4f65 100644
> --- a/sysdeps/unix/sysv/linux/i386/Makefile
> +++ b/sysdeps/unix/sysv/linux/i386/Makefile
> @@ -1,6 +1,8 @@
>  # The default ABI is 32.
>  default-abi := 32
>  
> +extra-version := Versions-y2038
> +
>  ifeq ($(subdir),misc)
>  sysdep_routines += ioperm iopl vm86

Where does this come from?

Thanks,
Florian


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs
  2021-05-20  6:58   ` Florian Weimer
@ 2021-05-20 10:37     ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-20 10:37 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 20/05/2021 03:58, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
>> index da716e2c1b..8d5efb4f65 100644
>> --- a/sysdeps/unix/sysv/linux/i386/Makefile
>> +++ b/sysdeps/unix/sysv/linux/i386/Makefile
>> @@ -1,6 +1,8 @@
>>  # The default ABI is 32.
>>  default-abi := 32
>>  
>> +extra-version := Versions-y2038
>> +
>>  ifeq ($(subdir),misc)
>>  sysdep_routines += ioperm iopl vm86
> 
> Where does this come from?

It is a leftover from development, I will remove it.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64
  2021-05-20  6:38   ` Florian Weimer
@ 2021-05-20 10:43     ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-20 10:43 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 20/05/2021 03:38, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> The n32 will require the 64 bit time symbols for y2038 support.
>> ---
>>  .../mips/mips64/{ => n32}/libpthread.abilist      |  0
>>  .../sysv/linux/mips/mips64/n64/libpthread.abilist | 15 +++++++++++++++
>>  2 files changed, 15 insertions(+)
>>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
>>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
>>
>> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
>> similarity index 100%
>> rename from sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
>> rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
>> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
>> new file mode 100644
>> index 0000000000..a5f3d5ce2a
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
>> @@ -0,0 +1,15 @@
>> +GLIBC_2.0 __errno_location F
>> +GLIBC_2.0 pthread_create F
>> +GLIBC_2.11 __libpthread_version_placeholder F
>> +GLIBC_2.12 __libpthread_version_placeholder F
>> +GLIBC_2.18 __libpthread_version_placeholder F
>> +GLIBC_2.2 pthread_create F
>> +GLIBC_2.2.3 __libpthread_version_placeholder F
>> +GLIBC_2.2.6 __libpthread_version_placeholder F
>> +GLIBC_2.28 thrd_create F
>> +GLIBC_2.3.2 __libpthread_version_placeholder F
>> +GLIBC_2.3.3 __libpthread_version_placeholder F
>> +GLIBC_2.3.4 __libpthread_version_placeholder F
>> +GLIBC_2.30 __libpthread_version_placeholder F
>> +GLIBC_2.31 __libpthread_version_placeholder F
>> +GLIBC_2.4 __libpthread_version_placeholder F
> 
> That looks wrong, there are no time-dependent symbols left in
> libpthread, so the split isn't needed.
> 
> Thanks,
> Florian
> 

Indeed this patch is not required anymore (the libpthread files are not updated
for n32 when the 64-bit time symbols).

I will remove it.

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO
  2021-05-20  6:44   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Florian Weimer
@ 2021-05-20 18:01     ` Adhemerval Zanella
  2021-05-21 18:37       ` Florian Weimer
  0 siblings, 1 reply; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-20 18:01 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 20/05/2021 03:44, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> +#ifndef __ASSUME_TIME64_SYSCALLS
>> +static int
>> +getsockopt32 (int fd, int level, int optname, void *optval,
>> +	      socklen_t *len)
>> +{
>> +  int r = -1;
>> +
>> +  if (level != SOL_SOCKET)
>> +    return r;
>> +
>> +  switch (optname)
>> +    {
>> +    case COMPAT_SO_RCVTIMEO_NEW:
>> +    case COMPAT_SO_SNDTIMEO_NEW:
>> +      {
>> +        if (*len < sizeof (struct __timeval64))
>> +	  {
>> +	    __set_errno (EINVAL);
>> +	    break;
>> +	  }
>> +
>> +	if (optname == COMPAT_SO_RCVTIMEO_NEW)
>> +	  optname = COMPAT_SO_RCVTIMEO_OLD;
>> +	if (optname == COMPAT_SO_SNDTIMEO_NEW)
>> +	  optname = COMPAT_SO_SNDTIMEO_OLD;
>> +
>> +	struct __timeval32 tv32;
>> +	r = getsockopt_syscall (fd, level, optname, &tv32,
>> +				(socklen_t[]) { sizeof tv32 });
>> +	if (r < 0)
>> +	  break;
>> +	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
>> +	*tv64 = valid_timeval32_to_timeval64 (tv32);
>> +	*len = sizeof (*tv64);
>> +      }
> 
> I think POSIX requires checking the incoming *len value and truncating
> the output.

The kernel will fail with EINVAL if the input argument is smaller than
the expected one, so I think as QoI the truncation here should mean
to return a timeout value clamped to 32 bits (instead of a truncated
memory).
 

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-20  6:50   ` Florian Weimer
@ 2021-05-20 18:46     ` Adhemerval Zanella
  2021-05-21 18:38       ` Florian Weimer
  0 siblings, 1 reply; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-20 18:46 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 20/05/2021 03:50, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> Calls with __TIMESIZE=32 will see the converted 64-bit time control
>> messages as spurious control message of unknown type.  Calls with
>> __TIMESIZE=64 running on pre-time64 kernels will see the original
>> message as a spurious control ones of unknown typ while running on
>> kernel with native 64-bit time support will only see the time64 version
>> of the control message.
> 
> Does the mirror what the kernel does?  I have some concerns about
> backwards compatibility here, but if the kernel does it as well, that is
> likely a non-issue.

The SO_TIMESTAMP{NS}_OLD to SO_TIMESTAMP{NS}_NEW for _TIME_BITS=64 is
what this patch does to add some compatibility. From kernel code:
net/socket.c

 772 void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
 773         struct sk_buff *skb)
 774 {
 775         int need_software_tstamp = sock_flag(sk, SOCK_RCVTSTAMP);
 776         int new_tstamp = sock_flag(sk, SOCK_TSTAMP_NEW);

[...]
 790         if (need_software_tstamp) {
 791                 if (!sock_flag(sk, SOCK_RCVTSTAMPNS)) {
 792                         if (new_tstamp) {
 793                                 struct __kernel_sock_timeval tv;
 794 
 795                                 skb_get_new_timestamp(skb, &tv);
 796                                 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP_NEW,
 797                                          sizeof(tv), &tv);
 798                         } else {
 799                                 struct __kernel_old_timeval tv;
 800 
 801                                 skb_get_timestamp(skb, &tv);
 802                                 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP_OLD,
 803                                          sizeof(tv), &tv);
 804                         }
 805                 } else {
 806                         if (new_tstamp) {
 807                                 struct __kernel_timespec ts;
 808 
 809                                 skb_get_new_timestampns(skb, &ts);
 810                                 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPNS_NEW,
 811                                          sizeof(ts), &ts);
 812                         } else {
 813                                 struct __kernel_old_timespec ts;
 814 
 815                                 skb_get_timestampns(skb, &ts);
 816                                 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPNS_OLD,
 817                                          sizeof(ts), &ts);
 818                         }
 819                 }
 820         }

For _TIME_BITS=32, SO_TIMESTAMP{NS} will be exported as the 
SO_TIMESTAMP{NS}_OLD and if the process sets a SO_TIMESTAMPING{NS}_NEW 
somehow the control message will be unknown.

For _TIME_BITS=64, SO_TIMESTAMP will be exported as the SO_TIMESTAMP_NEW.
Programs that set SO_TIMESTAMP{NS}_OLD will be converted to 
SO_TIMESTAMP{NS}_NEW.  This translation is *not* done by the kernel,
but the conversion should be safe as long CMSG_SPACE is large enough (and
the __convert_scm_timestamps does check for it).

> 
> I think this kind of emulation goes against our general guidance of not
> emulating system calls in userspace.  It would probably be necessary if
> we switch an existing 32-bit target to 64-bit time_t by default, though.

I am not sure this characterize as emulation, but rather fall in what we
do for 64 time support. Otherwise newer code won't see SO_TIMESTAMP{NS}_OLD
values and I think it might be a more difficult breakage than getting
32-bit timestamp values.

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO
  2021-05-20 18:01     ` Adhemerval Zanella
@ 2021-05-21 18:37       ` Florian Weimer
  2021-05-21 19:17         ` Adhemerval Zanella
  0 siblings, 1 reply; 92+ messages in thread
From: Florian Weimer @ 2021-05-21 18:37 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella:

> On 20/05/2021 03:44, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>> 
>>> +#ifndef __ASSUME_TIME64_SYSCALLS
>>> +static int
>>> +getsockopt32 (int fd, int level, int optname, void *optval,
>>> +	      socklen_t *len)
>>> +{
>>> +  int r = -1;
>>> +
>>> +  if (level != SOL_SOCKET)
>>> +    return r;
>>> +
>>> +  switch (optname)
>>> +    {
>>> +    case COMPAT_SO_RCVTIMEO_NEW:
>>> +    case COMPAT_SO_SNDTIMEO_NEW:
>>> +      {
>>> +        if (*len < sizeof (struct __timeval64))
>>> +	  {
>>> +	    __set_errno (EINVAL);
>>> +	    break;
>>> +	  }
>>> +
>>> +	if (optname == COMPAT_SO_RCVTIMEO_NEW)
>>> +	  optname = COMPAT_SO_RCVTIMEO_OLD;
>>> +	if (optname == COMPAT_SO_SNDTIMEO_NEW)
>>> +	  optname = COMPAT_SO_SNDTIMEO_OLD;
>>> +
>>> +	struct __timeval32 tv32;
>>> +	r = getsockopt_syscall (fd, level, optname, &tv32,
>>> +				(socklen_t[]) { sizeof tv32 });
>>> +	if (r < 0)
>>> +	  break;
>>> +	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
>>> +	*tv64 = valid_timeval32_to_timeval64 (tv32);
>>> +	*len = sizeof (*tv64);
>>> +      }
>> 
>> I think POSIX requires checking the incoming *len value and truncating
>> the output.
>
> The kernel will fail with EINVAL if the input argument is smaller than
> the expected one, so I think as QoI the truncation here should mean
> to return a timeout value clamped to 32 bits (instead of a truncated
> memory).

Wow, that EINVAL behavior is not POSIX-compliant at all.

If the kernel behaves that way, I guess glibc should as well.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-20 18:46     ` Adhemerval Zanella
@ 2021-05-21 18:38       ` Florian Weimer
  2021-05-21 19:02         ` Adhemerval Zanella
  0 siblings, 1 reply; 92+ messages in thread
From: Florian Weimer @ 2021-05-21 18:38 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella:

> On 20/05/2021 03:50, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>> 
>>> Calls with __TIMESIZE=32 will see the converted 64-bit time control
>>> messages as spurious control message of unknown type.  Calls with
>>> __TIMESIZE=64 running on pre-time64 kernels will see the original
>>> message as a spurious control ones of unknown typ while running on
>>> kernel with native 64-bit time support will only see the time64 version
>>> of the control message.
>> 
>> Does the mirror what the kernel does?  I have some concerns about
>> backwards compatibility here, but if the kernel does it as well, that is
>> likely a non-issue.
>
> The SO_TIMESTAMP{NS}_OLD to SO_TIMESTAMP{NS}_NEW for _TIME_BITS=64 is
> what this patch does to add some compatibility. From kernel code:
> net/socket.c

Will anything new show up for _TIME_BITS=32 on legacy architectures?

Thanks,
Florian


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-21 18:38       ` Florian Weimer
@ 2021-05-21 19:02         ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-21 19:02 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha



On 21/05/2021 15:38, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 20/05/2021 03:50, Florian Weimer wrote:
>>> * Adhemerval Zanella via Libc-alpha:
>>>
>>>> Calls with __TIMESIZE=32 will see the converted 64-bit time control
>>>> messages as spurious control message of unknown type.  Calls with
>>>> __TIMESIZE=64 running on pre-time64 kernels will see the original
>>>> message as a spurious control ones of unknown typ while running on
>>>> kernel with native 64-bit time support will only see the time64 version
>>>> of the control message.
>>>
>>> Does the mirror what the kernel does?  I have some concerns about
>>> backwards compatibility here, but if the kernel does it as well, that is
>>> likely a non-issue.
>>
>> The SO_TIMESTAMP{NS}_OLD to SO_TIMESTAMP{NS}_NEW for _TIME_BITS=64 is
>> what this patch does to add some compatibility. From kernel code:
>> net/socket.c
> 
> Will anything new show up for _TIME_BITS=32 on legacy architectures?

It will if a library setup a SO_TIMESTAMP{NS}_NEW (assuming running on
newer kernels), since afaik the timestamp is set on socket buffer within 
kernel (so my understanding is in theory one can see multiple different 
timestamps formats on same socket). 

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO
  2021-05-21 18:37       ` Florian Weimer
@ 2021-05-21 19:17         ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-05-21 19:17 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha



On 21/05/2021 15:37, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 20/05/2021 03:44, Florian Weimer wrote:
>>> * Adhemerval Zanella via Libc-alpha:
>>>
>>>> +#ifndef __ASSUME_TIME64_SYSCALLS
>>>> +static int
>>>> +getsockopt32 (int fd, int level, int optname, void *optval,
>>>> +	      socklen_t *len)
>>>> +{
>>>> +  int r = -1;
>>>> +
>>>> +  if (level != SOL_SOCKET)
>>>> +    return r;
>>>> +
>>>> +  switch (optname)
>>>> +    {
>>>> +    case COMPAT_SO_RCVTIMEO_NEW:
>>>> +    case COMPAT_SO_SNDTIMEO_NEW:
>>>> +      {
>>>> +        if (*len < sizeof (struct __timeval64))
>>>> +	  {
>>>> +	    __set_errno (EINVAL);
>>>> +	    break;
>>>> +	  }
>>>> +
>>>> +	if (optname == COMPAT_SO_RCVTIMEO_NEW)
>>>> +	  optname = COMPAT_SO_RCVTIMEO_OLD;
>>>> +	if (optname == COMPAT_SO_SNDTIMEO_NEW)
>>>> +	  optname = COMPAT_SO_SNDTIMEO_OLD;
>>>> +
>>>> +	struct __timeval32 tv32;
>>>> +	r = getsockopt_syscall (fd, level, optname, &tv32,
>>>> +				(socklen_t[]) { sizeof tv32 });
>>>> +	if (r < 0)
>>>> +	  break;
>>>> +	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
>>>> +	*tv64 = valid_timeval32_to_timeval64 (tv32);
>>>> +	*len = sizeof (*tv64);
>>>> +      }
>>>
>>> I think POSIX requires checking the incoming *len value and truncating
>>> the output.
>>
>> The kernel will fail with EINVAL if the input argument is smaller than
>> the expected one, so I think as QoI the truncation here should mean
>> to return a timeout value clamped to 32 bits (instead of a truncated
>> memory).
> 
> Wow, that EINVAL behavior is not POSIX-compliant at all.
> 
> If the kernel behaves that way, I guess glibc should as well.

In fact, checking again the source it does seem that silently truncated 
the result:

net/core/sock.c

1420         case SO_RCVTIMEO_OLD:
1421         case SO_RCVTIMEO_NEW:
1422                 lv = sock_get_timeout(sk->sk_rcvtimeo, &v, SO_RCVTIMEO_OLD == optname);
1423                 break;
[...]
1624         if (len > lv)
1625                 len = lv;
1626         if (copy_to_user(optval, &v, len))
1627                 return -EFAULT;

So I think maybe we should do the same here, not sure if this is really
an improvement over compatibility.

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 00/25] Add 64 bit time support on legacy ABIs
  2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
                   ` (24 preceding siblings ...)
  2021-05-18 20:56 ` [PATCH v2 25/25] y2038: Add test coverage Adhemerval Zanella
@ 2021-06-04 19:29 ` Carlos O'Donell
  25 siblings, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:29 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> This is an updated version of my previous patchset [1].  Based on
> the reviews and weekly call discussions, I dropped the utmp and
> lastlogin fixes and the also the internal time64 usage.

Overall this looks very good.

I tested this across i686, x86_64, ppc64le, aarch64, and s390x looking
for any inconsistencies that might impact the existing 64-bit targets
that are most important to me downstream. I didn't see any regressions
or test failures in the targets that were related.

Thank you for championing this work.

> The former requires further discussion, since we might just deprecate
> the interface since its hard to fix issues (such as BZ#24492).  The
> later is not really required and simplifies the patchset (I plan to
> resend it once we get the 64 bit time support upstream).
> 
> I also rebased against master to get the newer pthread move in sync
> (which should not interfere with the 64 bit time_t anymore) and fixes
> some issues.
> 
> As before this patchset add support for 64 bit time on ABIs which only
> support 32 bit time.  It is done through a new build flags,
> _TIME_BITS=64, which is supported only when Long File Support is also
> used (_FILE_OFFSET_BITS=64).  The new flag redefine the required
> structures and redirected the required symbols to newer exported ones.
> 
> However, different then LFS support, the new 64 bit time_t symbols
> are only exported for the ABI that require them.  ABIs that provides
> 64 bit time as the default ABI are unaffected.
> 
> On Linux, to fully support 64 bit time_t it requires a minimum of
> kernel v5.1 due the newer syscalls.
> 
> To make the patch review easier, it is divided in 3 subparts:
> 
>   1. Patches from 01/23 to 04/52 are changes requires which is
>      indepedent of 64 bit time support.
> 
>   2. Patches from 04/23 to 19/23 export the newer 64 bit time symbols
>      and enable the _TImE_BITS on installed headers.
> 
>   3. Patches from 20/23 to 23/23 enables basic test coverage.  It covers
>      now all but two symbols (getrusage and gai_suspend).
> 
> I checked for i686-linux-gnu running on a x86_64 5.4 kernel,
> powerpc-linux-gnu running on ppc64 5.10 kernel, and on
> arm-linux-gnueabihf running on arm64 5.4 kernel.  The new 64 bit time_t
> tests when running on older kernels shows as unsupported.
> 
> [1] https://patchwork.sourceware.org/project/glibc/list/?series=1783
> 
> Adhemerval Zanella (23):
>   linux: mips: Split libpthread.abilist in n32 and n64
>   linux: mips: Split librt.abilist in n32 and n64
>   linux: mips: Split libanl.abilist in n32 and n64
>   linux: s390: Add libanl.abilist in s390 and s390x
>   linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO
>   linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
>   linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}
>   y2038: Add __USE_TIME_BITS64 support for time_t
>   y2038: Add __USE_TIME_BITS64 support for struct timeval
>   y2038: Add __USE_TIME_BITS64 support for struct timespec
>   y2038: Add __USE_TIME_BITS64 support for struct utimbuf
>   y2038: linux: Add __USE_TIME_BITS64 support for struct timex
>   y2038: Use a common definition for semid_ds
>   y2038: Use a common definition for shmid_ds
>   y2038: Add __USE_TIME_BITS64 support for socket-constants.h
>   time: Add 64 bit time support for getdate
>   y2038: Add support for 64 bit time on legacy ABIs
>   posix: Add glob64 with 64 bit time_t support
>   io: Add fts64 with 64 bit time_t support
>   io: Add ftw64 with 64 bit time_t support
>   libsupport: Add 64 bit time_t support for time functions
>   libsupport: Add 64 bit time_t support for stat functions
>   y2038: Add test coverage
> 
> Lukasz Majewski (2):
>   y2038: Use a common definition for stat
>   y2038: Use a common definition for msqid_ds
> 
>  Makeconfig                                    |  14 ++
>  Makefile                                      |   2 +-
>  Makerules                                     |  18 ++-
>  NEWS                                          |   5 +
>  include/features-time64.h                     |   1 +
>  include/features.h                            |   2 +
>  include/fts.h                                 |  51 +++++++
>  include/ftw.h                                 |  18 +++
>  include/glob.h                                |  28 ++++
>  include/sys/socket.h                          |   5 +
>  include/sys/stat.h                            |   2 +-
>  include/time.h                                |  12 +-
>  io/Makefile                                   |  28 +++-
>  io/fts.h                                      |  43 +++++-
>  io/fts64-time64.c                             |  35 +++++
>  io/ftw.c                                      |   5 +-
>  io/ftw.h                                      |  46 +++++-
>  io/ftw64-time64.c                             |  34 +++++
>  io/ftwtest-time64.c                           |   1 +
>  io/sys/poll.h                                 |  11 ++
>  io/sys/stat.h                                 | 113 ++++++++++++--
>  io/tst-fts-time64.c                           |   1 +
>  io/tst-futimens-time64.c                      |   2 +
>  io/tst-futimens.c                             |   6 +-
>  io/tst-futimes-time64.c                       |   2 +
>  io/tst-futimes.c                              |   6 +-
>  io/tst-futimesat-time64.c                     |   4 +
>  io/tst-futimesat.c                            |  47 ++++--
>  io/tst-lutimes-time64.c                       |   2 +
>  io/tst-lutimes.c                              |  10 +-
>  io/tst-stat-time64.c                          | 102 +++++++++++++
>  io/tst-utime-time64.c                         |   2 +
>  io/tst-utime.c                                |   6 +-
>  io/tst-utimensat-time64.c                     |   2 +
>  io/tst-utimensat.c                            |  12 +-
>  io/tst-utimes-time64.c                        |   2 +
>  io/tst-utimes.c                               |   6 +-
>  io/utime.h                                    |  16 ++
>  manual/creature.texi                          |  44 ++++++
>  misc/Makefile                                 |   4 +
>  misc/sys/select.h                             |  27 ++++
>  misc/tst-pselect-time64.c                     |   1 +
>  misc/tst-select-time64.c                      |   1 +
>  nptl/Makefile                                 |   3 +
>  nptl/pthread_clockjoin.c                      |   3 +-
>  nptl/pthread_cond_wait.c                      |   9 +-
>  nptl/pthread_mutex_timedlock.c                |   8 +-
>  nptl/pthread_rwlock_clockrdlock.c             |   4 +-
>  nptl/pthread_rwlock_clockwrlock.c             |   4 +-
>  nptl/pthread_rwlock_timedrdlock.c             |   4 +-
>  nptl/pthread_rwlock_timedwrlock.c             |   4 +-
>  nptl/pthread_timedjoin.c                      |   3 +-
>  nptl/sem_clockwait.c                          |   3 +-
>  nptl/sem_timedwait.c                          |   4 +-
>  nptl/tst-cancel4_2-time64.c                   |   1 +
>  posix/Makefile                                |   7 +-
>  posix/glob.c                                  |  46 +++---
>  posix/glob.h                                  |  22 +++
>  posix/glob64-lstat-compat.c                   |   3 +-
>  posix/glob64-time64.c                         |  49 +++++++
>  posix/globfree64-time64.c                     |  30 ++++
>  posix/sched.h                                 |  11 +-
>  posix/sys/wait.h                              |  20 +++
>  posix/tst-gnuglob64-time64.c                  |   7 +
>  posix/tst-sched_rr_get_interval-time64.c      |   1 +
>  posix/tst-wait3-time64.c                      |   1 +
>  posix/tst-wait4-time64.c                      |   1 +
>  resolv/netdb.h                                |  11 ++
>  resource/sys/resource.h                       |  10 ++
>  rt/Makefile                                   |   9 ++
>  rt/aio.h                                      |  15 +-
>  rt/mqueue.h                                   |  22 +++
>  rt/tst-aio6-time64.c                          |   1 +
>  rt/tst-cpuclock2-time64.c                     |   1 +
>  rt/tst-cpuclock2.c                            |   9 +-
>  rt/tst-mqueue1-time64.c                       |   1 +
>  rt/tst-mqueue2-time64.c                       |   1 +
>  rt/tst-mqueue4-time64.c                       |   1 +
>  rt/tst-mqueue8-time64.c                       |   1 +
>  rt/tst-timer4-time64.c                        |   1 +
>  signal/signal.h                               |  13 ++
>  socket/sys/socket.h                           |  11 ++
>  support/Makefile                              |   9 ++
>  support/support-xfstat-time64.c               |  32 ++++
>  support/support-xstat-time64.c                |  32 ++++
>  support/timespec-add-time64.c                 |  27 ++++
>  support/timespec-add.c                        |   2 +-
>  support/timespec-sub-time64.c                 |  27 ++++
>  support/timespec-sub.c                        |   2 +-
>  support/timespec-time64.c                     |  40 +++++
>  support/timespec.c                            |   9 +-
>  support/timespec.h                            |  52 +++++--
>  support/xclock_gettime_time64.c               |  26 ++++
>  support/xclock_settime_time64.c               |  23 +++
>  support/xlstat-time64.c                       |  32 ++++
>  support/xtime.h                               |   7 +
>  support/xunistd.h                             |  13 ++
>  sysdeps/generic/features-time64.h             |  19 +++
>  sysdeps/generic/time64-compat.h               |   3 +
>  sysdeps/gnu/glob64-lstat-compat.c             |   3 +-
>  sysdeps/nptl/pthread.h                        | 119 +++++++++++++++
>  sysdeps/pthread/Makefile                      |  10 ++
>  sysdeps/pthread/semaphore.h                   |  25 ++++
>  sysdeps/pthread/threads.h                     |  33 +++++
>  sysdeps/pthread/tst-abstime-time64.c          |   1 +
>  sysdeps/pthread/tst-cnd-timedwait-time64.c    |   1 +
>  sysdeps/pthread/tst-cond11-time64.c           |   1 +
>  sysdeps/pthread/tst-join14-time64.c           |   1 +
>  sysdeps/pthread/tst-mtx-timedlock-time64.c    |   1 +
>  sysdeps/pthread/tst-rwlock14-time64.c         |   1 +
>  sysdeps/pthread/tst-sem5-time64.c             |   1 +
>  sysdeps/pthread/tst-thrd-sleep-time64.c       |   1 +
>  sysdeps/unix/sysv/linux/Makefile              |  18 ++-
>  sysdeps/unix/sysv/linux/Versions              | 107 ++++++++++++++
>  sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  76 ++++++++++
>  sysdeps/unix/sysv/linux/arm/be/librt.abilist  |   5 +
>  sysdeps/unix/sysv/linux/arm/le/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  76 ++++++++++
>  sysdeps/unix/sysv/linux/arm/le/librt.abilist  |   5 +
>  sysdeps/unix/sysv/linux/arm/time64-compat.h   |   2 +
>  sysdeps/unix/sysv/linux/bits/msq.h            |   1 +
>  sysdeps/unix/sysv/linux/bits/sem.h            |   1 +
>  sysdeps/unix/sysv/linux/bits/shm.h            |   1 +
>  .../unix/sysv/linux/bits/socket-constants.h   |  47 +++++-
>  sysdeps/unix/sysv/linux/bits/struct_stat.h    |  51 ++++---
>  .../linux/bits/struct_stat_time64_helper.h    |  63 ++++++++
>  sysdeps/unix/sysv/linux/bits/time.h           |  10 ++
>  sysdeps/unix/sysv/linux/bits/timex.h          |  31 ++++
>  .../sysv/linux/bits/types/struct_msqid64_ds.h |  10 +-
>  .../bits/types/struct_msqid64_ds_helper.h     |  28 ++++
>  .../sysv/linux/bits/types/struct_msqid_ds.h   |  12 +-
>  .../sysv/linux/bits/types/struct_semid64_ds.h |   5 +-
>  .../bits/types/struct_semid64_ds_helper.h     |  23 +++
>  .../sysv/linux/bits/types/struct_semid_ds.h   |  10 +-
>  .../sysv/linux/bits/types/struct_shmid64_ds.h |   9 +-
>  .../bits/types/struct_shmid64_ds_helper.h     |  26 ++++
>  .../sysv/linux/bits/types/struct_shmid_ds.h   |  10 +-
>  sysdeps/unix/sysv/linux/cnd_timedwait.c       |   8 +-
>  .../unix/sysv/linux/convert_scm_timestamps.c  |  96 ++++++++++++
>  sysdeps/unix/sysv/linux/csky/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  76 ++++++++++
>  sysdeps/unix/sysv/linux/csky/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/csky/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/features-time64.h     |  37 +++++
>  sysdeps/unix/sysv/linux/getsockopt.c          |  79 +++++++++-
>  sysdeps/unix/sysv/linux/glob-lstat-compat.c   |   6 +-
>  sysdeps/unix/sysv/linux/glob.c                |   6 +
>  sysdeps/unix/sysv/linux/glob64-lstat-compat.c |  12 +-
>  sysdeps/unix/sysv/linux/glob64-time64.c       |  44 ++++++
>  sysdeps/unix/sysv/linux/glob64.c              |   8 +-
>  sysdeps/unix/sysv/linux/globfree64-time64.c   |  35 +++++
>  .../sysv/linux/hppa/bits/socket-constants.h   |  36 ++++-
>  .../linux/hppa/bits/types/struct_msqid_ds.h   |  12 +-
>  .../linux/hppa/bits/types/struct_semid_ds.h   |   4 +
>  .../linux/hppa/bits/types/struct_shmid_ds.h   |  10 +-
>  sysdeps/unix/sysv/linux/hppa/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  76 ++++++++++
>  sysdeps/unix/sysv/linux/hppa/librt.abilist    |   5 +
>  .../sysv/linux/hppa/socket-constants-time64.h |  35 +++++
>  sysdeps/unix/sysv/linux/hppa/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/i386/Makefile         |   2 +
>  sysdeps/unix/sysv/linux/i386/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  76 ++++++++++
>  sysdeps/unix/sysv/linux/i386/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/i386/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/include/sys/msg.h     |   2 -
>  sysdeps/unix/sysv/linux/include/sys/shm.h     |   2 -
>  sysdeps/unix/sysv/linux/include/sys/timex.h   |   2 +
>  .../unix/sysv/linux/m68k/bits/struct_stat.h   |  50 ++++---
>  .../sysv/linux/m68k/coldfire/libanl.abilist   |   1 +
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  76 ++++++++++
>  .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
>  .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  76 ++++++++++
>  .../unix/sysv/linux/m68k/m680x0/librt.abilist |   5 +
>  sysdeps/unix/sysv/linux/m68k/time64-compat.h  |   2 +
>  .../sysv/linux/microblaze/be/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/be/libc.abilist     |  76 ++++++++++
>  .../sysv/linux/microblaze/be/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/bits/struct_stat.h  |  48 +++---
>  .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  76 ++++++++++
>  .../sysv/linux/microblaze/le/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/time64-compat.h     |   2 +
>  .../sysv/linux/mips/bits/socket-constants.h   |  36 ++++-
>  .../unix/sysv/linux/mips/bits/struct_stat.h   |  89 ++++++-----
>  .../linux/mips/bits/types/struct_msqid_ds.h   |  18 ++-
>  .../linux/mips/bits/types/struct_semid_ds.h   |   4 +
>  .../linux/mips/bits/types/struct_shmid_ds.h   |  14 +-
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  76 ++++++++++
>  .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
>  .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  76 ++++++++++
>  .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
>  .../sysv/linux/mips/mips64/n32/libanl.abilist |   5 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  76 ++++++++++
>  .../mips/mips64/{ => n32}/libpthread.abilist  |   0
>  .../sysv/linux/mips/mips64/n32/librt.abilist  |  42 ++++++
>  .../linux/mips/mips64/n32/time64-compat.h     |   2 +
>  .../mips/mips64/{ => n64}/libanl.abilist      |   0
>  .../linux/mips/mips64/n64/libpthread.abilist  |  15 ++
>  .../linux/mips/mips64/{ => n64}/librt.abilist |   0
>  .../sysv/linux/mips/socket-constants-time64.h |  35 +++++
>  sysdeps/unix/sysv/linux/mtx_timedlock.c       |   8 +-
>  sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  76 ++++++++++
>  sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
>  sysdeps/unix/sysv/linux/oldglob.c             |  11 +-
>  .../linux/powerpc/bits/socket-constants.h     |  36 ++++-
>  .../sysv/linux/powerpc/bits/struct_stat.h     |  52 ++++---
>  .../powerpc/bits/types/struct_msqid_ds.h      |  12 +-
>  .../powerpc/bits/types/struct_semid_ds.h      |  10 +-
>  .../powerpc/bits/types/struct_shmid_ds.h      |  10 +-
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  76 ++++++++++
>  .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
>  .../linux/powerpc/powerpc32/librt.abilist     |   5 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  76 ++++++++++
>  .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
>  .../linux/powerpc/socket-constants-time64.h   |  35 +++++
>  sysdeps/unix/sysv/linux/recvmmsg.c            |  17 ++-
>  sysdeps/unix/sysv/linux/recvmsg.c             |  23 ++-
>  .../unix/sysv/linux/s390/bits/struct_stat.h   |  56 ++++---
>  .../sysv/linux/s390/s390-32/libanl.abilist    |   5 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  76 ++++++++++
>  .../sysv/linux/s390/s390-32/librt.abilist     |   5 +
>  .../sysv/linux/s390/s390-32/time64-compat.h   |   2 +
>  .../linux/s390/{ => s390-64}/libanl.abilist   |   0
>  sysdeps/unix/sysv/linux/semctl.c              |   1 -
>  sysdeps/unix/sysv/linux/setsockopt.c          |  83 ++++++++++-
>  sysdeps/unix/sysv/linux/sh/be/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  76 ++++++++++
>  sysdeps/unix/sysv/linux/sh/be/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/sh/le/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  76 ++++++++++
>  sysdeps/unix/sysv/linux/sh/le/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/sh/time64-compat.h    |   2 +
>  .../unix/sysv/linux/socket-constants-time64.h |  35 +++++
>  .../sysv/linux/sparc/bits/socket-constants.h  |  36 ++++-
>  .../linux/sparc/bits/types/struct_msqid_ds.h  |  12 +-
>  .../linux/sparc/bits/types/struct_semid_ds.h  |  10 +-
>  .../linux/sparc/bits/types/struct_shmid_ds.h  |  10 +-
>  .../linux/sparc/socket-constants-time64.h     |  35 +++++
>  .../sysv/linux/sparc/sparc32/libanl.abilist   |   1 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  76 ++++++++++
>  .../sysv/linux/sparc/sparc32/librt.abilist    |   5 +
>  .../sysv/linux/sparc/sparc32/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/struct_stat_time64.h  |  59 +-------
>  sysdeps/unix/sysv/linux/sys/timerfd.h         |  22 +++
>  sysdeps/unix/sysv/linux/sys/timex.h           |  27 +++-
>  sysdeps/unix/sysv/linux/tst-adjtimex-time64.c |   1 +
>  .../sysv/linux/tst-clock_adjtime-time64.c     |   1 +
>  .../unix/sysv/linux/tst-ntp_adjtime-time64.c  |   1 +
>  .../unix/sysv/linux/tst-ntp_gettime-time64.c  |   1 +
>  .../unix/sysv/linux/tst-ntp_gettimex-time64.c |   1 +
>  sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
>  .../unix/sysv/linux/tst-sigtimedwait-time64.c |   1 +
>  sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
>  .../unix/sysv/linux/x86/bits/struct_stat.h    |  90 ++++++------
>  .../linux/x86/bits/types/struct_semid_ds.h    |   4 +
>  sysvipc/Makefile                              |   2 +
>  sysvipc/sys/msg.h                             |  10 ++
>  sysvipc/sys/sem.h                             |  21 +++
>  sysvipc/sys/shm.h                             |  10 ++
>  sysvipc/test-sysvmsg-time64.c                 |   1 +
>  sysvipc/test-sysvsem-time64.c                 |   1 +
>  sysvipc/test-sysvshm-time64.c                 |   1 +
>  time/Makefile                                 |  18 +++
>  time/bits/types/struct_timespec.h             |  12 +-
>  time/bits/types/struct_timeval.h              |   5 +
>  time/bits/types/time_t.h                      |   4 +
>  time/getdate.c                                |  22 ++-
>  time/sys/time.h                               |  71 +++++++++
>  time/time.h                                   | 138 +++++++++++++++++-
>  time/tst-adjtime-time64.c                     |   1 +
>  time/tst-clock-time64.c                       |   1 +
>  time/tst-clock2-time64.c                      |   1 +
>  time/tst-clock_nanosleep-time64.c             |   1 +
>  time/tst-clock_settime-time64.c               |   1 +
>  time/tst-cpuclock1-time64.c                   |   1 +
>  time/tst-ctime-time64.c                       |   1 +
>  time/tst-ctime.c                              |  16 ++
>  time/tst-difftime-time64.c                    |   1 +
>  time/tst-getdate.c                            |  14 +-
>  time/tst-gmtime-time64.c                      |   1 +
>  time/tst-itimer-time64.c                      |   1 +
>  time/tst-mktime4-time64.c                     |   1 +
>  time/tst-settimeofday-time64.c                |   1 +
>  time/tst-timegm-time64.c                      |   1 +
>  time/tst-timespec_get-time64.c                |   1 +
>  time/tst-timespec_getres-time64.c             |   1 +
>  time/tst-y2039-time64.c                       |   1 +
>  time/tst-y2039.c                              |  10 ++
>  294 files changed, 5048 insertions(+), 538 deletions(-)
>  create mode 100644 include/features-time64.h
>  create mode 100644 io/fts64-time64.c
>  create mode 100644 io/ftw64-time64.c
>  create mode 100644 io/ftwtest-time64.c
>  create mode 100644 io/tst-fts-time64.c
>  create mode 100644 io/tst-futimens-time64.c
>  create mode 100644 io/tst-futimes-time64.c
>  create mode 100644 io/tst-futimesat-time64.c
>  create mode 100644 io/tst-lutimes-time64.c
>  create mode 100644 io/tst-stat-time64.c
>  create mode 100644 io/tst-utime-time64.c
>  create mode 100644 io/tst-utimensat-time64.c
>  create mode 100644 io/tst-utimes-time64.c
>  create mode 100644 misc/tst-pselect-time64.c
>  create mode 100644 misc/tst-select-time64.c
>  create mode 100644 nptl/tst-cancel4_2-time64.c
>  create mode 100644 posix/glob64-time64.c
>  create mode 100644 posix/globfree64-time64.c
>  create mode 100644 posix/tst-gnuglob64-time64.c
>  create mode 100644 posix/tst-sched_rr_get_interval-time64.c
>  create mode 100644 posix/tst-wait3-time64.c
>  create mode 100644 posix/tst-wait4-time64.c
>  create mode 100644 rt/tst-aio6-time64.c
>  create mode 100644 rt/tst-cpuclock2-time64.c
>  create mode 100644 rt/tst-mqueue1-time64.c
>  create mode 100644 rt/tst-mqueue2-time64.c
>  create mode 100644 rt/tst-mqueue4-time64.c
>  create mode 100644 rt/tst-mqueue8-time64.c
>  create mode 100644 rt/tst-timer4-time64.c
>  create mode 100644 support/support-xfstat-time64.c
>  create mode 100644 support/support-xstat-time64.c
>  create mode 100644 support/timespec-add-time64.c
>  create mode 100644 support/timespec-sub-time64.c
>  create mode 100644 support/timespec-time64.c
>  create mode 100644 support/xclock_gettime_time64.c
>  create mode 100644 support/xclock_settime_time64.c
>  create mode 100644 support/xlstat-time64.c
>  create mode 100644 sysdeps/generic/features-time64.h
>  create mode 100644 sysdeps/generic/time64-compat.h
>  create mode 100644 sysdeps/pthread/tst-abstime-time64.c
>  create mode 100644 sysdeps/pthread/tst-cnd-timedwait-time64.c
>  create mode 100644 sysdeps/pthread/tst-cond11-time64.c
>  create mode 100644 sysdeps/pthread/tst-join14-time64.c
>  create mode 100644 sysdeps/pthread/tst-mtx-timedlock-time64.c
>  create mode 100644 sysdeps/pthread/tst-rwlock14-time64.c
>  create mode 100644 sysdeps/pthread/tst-sem5-time64.c
>  create mode 100644 sysdeps/pthread/tst-thrd-sleep-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/arm/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
>  create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
>  create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
>  create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
>  create mode 100644 sysdeps/unix/sysv/linux/convert_scm_timestamps.c
>  create mode 100644 sysdeps/unix/sysv/linux/csky/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/features-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/glob64-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/globfree64-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/hppa/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/i386/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/m68k/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/microblaze/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n64}/libanl.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n64}/librt.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/nios2/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
>  create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
>  rename sysdeps/unix/sysv/linux/s390/{ => s390-64}/libanl.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/sh/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c
>  create mode 100644 sysvipc/test-sysvmsg-time64.c
>  create mode 100644 sysvipc/test-sysvsem-time64.c
>  create mode 100644 sysvipc/test-sysvshm-time64.c
>  create mode 100644 time/tst-adjtime-time64.c
>  create mode 100644 time/tst-clock-time64.c
>  create mode 100644 time/tst-clock2-time64.c
>  create mode 100644 time/tst-clock_nanosleep-time64.c
>  create mode 100644 time/tst-clock_settime-time64.c
>  create mode 100644 time/tst-cpuclock1-time64.c
>  create mode 100644 time/tst-ctime-time64.c
>  create mode 100644 time/tst-difftime-time64.c
>  create mode 100644 time/tst-gmtime-time64.c
>  create mode 100644 time/tst-itimer-time64.c
>  create mode 100644 time/tst-mktime4-time64.c
>  create mode 100644 time/tst-settimeofday-time64.c
>  create mode 100644 time/tst-timegm-time64.c
>  create mode 100644 time/tst-timespec_get-time64.c
>  create mode 100644 time/tst-timespec_getres-time64.c
>  create mode 100644 time/tst-y2039-time64.c
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64
  2021-05-18 20:55 ` [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
  2021-05-19  8:24   ` Lukasz Majewski
  2021-05-20  6:38   ` Florian Weimer
@ 2021-06-04 19:29   ` Carlos O'Donell
  2 siblings, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:29 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The n32 will require the 64 bit time symbols for y2038 support.
> ---
>  .../mips/mips64/{ => n32}/libpthread.abilist      |  0
>  .../sysv/linux/mips/mips64/n64/libpthread.abilist | 15 +++++++++++++++
>  2 files changed, 15 insertions(+)
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> 
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> new file mode 100644
> index 0000000000..a5f3d5ce2a
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> @@ -0,0 +1,15 @@
> +GLIBC_2.0 __errno_location F
> +GLIBC_2.0 pthread_create F
> +GLIBC_2.11 __libpthread_version_placeholder F
> +GLIBC_2.12 __libpthread_version_placeholder F
> +GLIBC_2.18 __libpthread_version_placeholder F
> +GLIBC_2.2 pthread_create F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
> +GLIBC_2.2.6 __libpthread_version_placeholder F
> +GLIBC_2.28 thrd_create F
> +GLIBC_2.3.2 __libpthread_version_placeholder F
> +GLIBC_2.3.3 __libpthread_version_placeholder F
> +GLIBC_2.3.4 __libpthread_version_placeholder F
> +GLIBC_2.30 __libpthread_version_placeholder F
> +GLIBC_2.31 __libpthread_version_placeholder F
> +GLIBC_2.4 __libpthread_version_placeholder F
 
This file is dropped per Florian's review.

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 02/25] linux: mips: Split librt.abilist in n32 and n64
  2021-05-18 20:55 ` [PATCH v2 02/25] linux: mips: Split librt.abilist " Adhemerval Zanella
  2021-05-19  8:25   ` Lukasz Majewski
@ 2021-06-04 19:29   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:29 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The n32 will require the 64 bit time symbols for y2038 support.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>


> ---
>  .../linux/mips/mips64/{ => n32}/librt.abilist |  0
>  .../sysv/linux/mips/mips64/n64/librt.abilist  | 37 +++++++++++++++++++
>  2 files changed, 37 insertions(+)
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/librt.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
> 
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
> rename to sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
> new file mode 100644
> index 0000000000..1539c1cef9
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
> @@ -0,0 +1,37 @@
> +GLIBC_2.2 aio_cancel F
> +GLIBC_2.2 aio_cancel64 F
> +GLIBC_2.2 aio_error F
> +GLIBC_2.2 aio_error64 F
> +GLIBC_2.2 aio_fsync F
> +GLIBC_2.2 aio_fsync64 F
> +GLIBC_2.2 aio_init F
> +GLIBC_2.2 aio_read F
> +GLIBC_2.2 aio_read64 F
> +GLIBC_2.2 aio_return F
> +GLIBC_2.2 aio_return64 F
> +GLIBC_2.2 aio_suspend F
> +GLIBC_2.2 aio_suspend64 F
> +GLIBC_2.2 aio_write F
> +GLIBC_2.2 aio_write64 F
> +GLIBC_2.2 lio_listio F
> +GLIBC_2.2 lio_listio64 F
> +GLIBC_2.2 shm_open F
> +GLIBC_2.2 shm_unlink F
> +GLIBC_2.2 timer_create F
> +GLIBC_2.2 timer_delete F
> +GLIBC_2.2 timer_getoverrun F
> +GLIBC_2.2 timer_gettime F
> +GLIBC_2.2 timer_settime F
> +GLIBC_2.3.4 mq_close F
> +GLIBC_2.3.4 mq_getattr F
> +GLIBC_2.3.4 mq_notify F
> +GLIBC_2.3.4 mq_open F
> +GLIBC_2.3.4 mq_receive F
> +GLIBC_2.3.4 mq_send F
> +GLIBC_2.3.4 mq_setattr F
> +GLIBC_2.3.4 mq_timedreceive F
> +GLIBC_2.3.4 mq_timedsend F
> +GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.4 lio_listio F
> +GLIBC_2.4 lio_listio64 F
> +GLIBC_2.7 __mq_open_2 F
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 03/25] linux: mips: Split libanl.abilist in n32 and n64
  2021-05-18 20:55 ` [PATCH v2 03/25] linux: mips: Split libanl.abilist " Adhemerval Zanella
  2021-05-19  8:25   ` Lukasz Majewski
@ 2021-06-04 19:30   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:30 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The n32 will require the 64 bit time symbols for y2038 support.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist | 0
>  sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist       | 4 ++++
>  2 files changed, 4 insertions(+)
>  rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
> 
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist
> rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
> new file mode 100644
> index 0000000000..d9a5ed015d
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
> @@ -0,0 +1,4 @@
> +GLIBC_2.2.3 gai_cancel F
> +GLIBC_2.2.3 gai_error F
> +GLIBC_2.2.3 gai_suspend F
> +GLIBC_2.2.3 getaddrinfo_a F
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 04/25] linux: s390: Add libanl.abilist in s390 and s390x
  2021-05-18 20:55 ` [PATCH v2 04/25] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella
  2021-05-19  8:26   ` Lukasz Majewski
@ 2021-06-04 19:30   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:30 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The s390 will require the 64 bit time symbols for y2038 support.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist | 0
>  sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist       | 4 ++++
>  2 files changed, 4 insertions(+)
>  rename sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
> 
> diff --git a/sysdeps/unix/sysv/linux/s390/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/s390/libanl.abilist
> rename to sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
> new file mode 100644
> index 0000000000..d9a5ed015d
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
> @@ -0,0 +1,4 @@
> +GLIBC_2.2.3 gai_cancel F
> +GLIBC_2.2.3 gai_error F
> +GLIBC_2.2.3 gai_suspend F
> +GLIBC_2.2.3 getaddrinfo_a F
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO
  2021-05-18 20:55 ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella
  2021-05-19  8:36   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO Lukasz Majewski
  2021-05-20  6:44   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Florian Weimer
@ 2021-06-04 19:30   ` Carlos O'Donell
  2021-06-07 17:52     ` Adhemerval Zanella
  2 siblings, 1 reply; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:30 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The constant values will be changed for __TIMESIZE=64, so binaries built
> with 64-bit time support might fail to work properly on old kernels.
> Both {get,set}sockopt will retry the syscall with the old constant
> values and the timeout value adjusted when kernel returns ENOTPROTOPT.
> 
> It also adds an internal only SO_{RCV,SND}TIMEO where
> COMPAT_SO_{RCV,SND}TIMEO_OLD indicates pre 32 bit time support and
> COMPAT_SO_{RCV,SND}TIMEO_NEW indicates time64 support.  It allows to
> refer to constant independently of the time_t ABI and kernel version
> used.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
> kernel).

Requesting a v3 please.

This needs fixing to match POSIX requirements for silent truncation.

I agree with Florian, if POSIX requires it, and the Kernel truncates,
then we should keep doing the same. There don't seem to be much better
alternatives that don't themselves have corner cases that break existing
code that expects these behaviours.

> ---
>  sysdeps/unix/sysv/linux/getsockopt.c          | 67 +++++++++++++++--
>  .../sysv/linux/hppa/socket-constants-time64.h | 30 ++++++++
>  .../sysv/linux/mips/socket-constants-time64.h | 30 ++++++++
>  .../linux/powerpc/socket-constants-time64.h   | 30 ++++++++
>  sysdeps/unix/sysv/linux/setsockopt.c          | 71 ++++++++++++++++---
>  .../unix/sysv/linux/socket-constants-time64.h | 30 ++++++++
>  .../linux/sparc/socket-constants-time64.h     | 30 ++++++++
>  7 files changed, 273 insertions(+), 15 deletions(-)
>  create mode 100644 sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/socket-constants-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> 
> diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c
> index 76ee8a94d6..c8e502d976 100644
> --- a/sysdeps/unix/sysv/linux/getsockopt.c
> +++ b/sysdeps/unix/sysv/linux/getsockopt.c
> @@ -15,16 +15,15 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#include <errno.h>
> -#include <signal.h>
>  #include <sys/socket.h>
> -
> +#include <time.h>
> +#include <sysdep.h>
>  #include <socketcall.h>
> -#include <kernel-features.h>
> -#include <sys/syscall.h>
> +#include <socket-constants-time64.h>
>  
> -int
> -__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len)
> +static int
> +getsockopt_syscall (int fd, int level, int optname, void *optval,
> +		    socklen_t *len)
>  {
>  #ifdef __ASSUME_GETSOCKOPT_SYSCALL
>    return INLINE_SYSCALL (getsockopt, 5, fd, level, optname, optval, len);
> @@ -32,4 +31,58 @@ __getsockopt (int fd, int level, int optname, void *optval, socklen_t *len)
>    return SOCKETCALL (getsockopt, fd, level, optname, optval, len);
>  #endif
>  }
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +static int
> +getsockopt32 (int fd, int level, int optname, void *optval,
> +	      socklen_t *len)
> +{
> +  int r = -1;
> +
> +  if (level != SOL_SOCKET)
> +    return r;
> +
> +  switch (optname)
> +    {
> +    case COMPAT_SO_RCVTIMEO_NEW:
> +    case COMPAT_SO_SNDTIMEO_NEW:
> +      {
> +        if (*len < sizeof (struct __timeval64))
> +	  {
> +	    __set_errno (EINVAL);
> +	    break;


https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html
~~~
If the size of the option value is greater than option_len,
the value stored in the object pointed to by the option_value
argument shall be silently truncated.
~~~

> +	  }
> +
> +	if (optname == COMPAT_SO_RCVTIMEO_NEW)
> +	  optname = COMPAT_SO_RCVTIMEO_OLD;
> +	if (optname == COMPAT_SO_SNDTIMEO_NEW)
> +	  optname = COMPAT_SO_SNDTIMEO_OLD;
> +
> +	struct __timeval32 tv32;
> +	r = getsockopt_syscall (fd, level, optname, &tv32,
> +				(socklen_t[]) { sizeof tv32 });
> +	if (r < 0)
> +	  break;
> +	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
> +	*tv64 = valid_timeval32_to_timeval64 (tv32);
> +	*len = sizeof (*tv64);
> +      }
> +    }
> +
> +  return r;
> +}
> +#endif
> +
> +int
> +__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len)
> +{
> +  int r = getsockopt_syscall (fd, level, optname, optval, len);
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +  if (r == -1 && errno == ENOPROTOOPT)
> +    r = getsockopt32 (fd, level, optname, optval, len);
> +#endif
> +
> + return r;
> +}
>  weak_alias (__getsockopt, getsockopt)
> diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
> new file mode 100644
> index 0000000000..ea721e0fc2
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 4102
> +#define COMPAT_SO_SNDTIMEO_OLD 4101
> +#define COMPAT_SO_RCVTIMEO_NEW 16448
> +#define COMPAT_SO_SNDTIMEO_NEW 16449
> +
> +#endif

OK.

> diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
> new file mode 100644
> index 0000000000..ab8bd62853
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 4102
> +#define COMPAT_SO_SNDTIMEO_OLD 4101
> +#define COMPAT_SO_RCVTIMEO_NEW 66
> +#define COMPAT_SO_SNDTIMEO_NEW 67
> +
> +#endif

OK.

> diff --git a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> new file mode 100644
> index 0000000000..1e48dcca8d
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 18
> +#define COMPAT_SO_SNDTIMEO_OLD 19
> +#define COMPAT_SO_RCVTIMEO_NEW 66
> +#define COMPAT_SO_SNDTIMEO_NEW 67

OK.

> +
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
> index 12fd7bdcde..6505202265 100644
> --- a/sysdeps/unix/sysv/linux/setsockopt.c
> +++ b/sysdeps/unix/sysv/linux/setsockopt.c
> @@ -15,21 +15,76 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#include <errno.h>
> -#include <signal.h>
>  #include <sys/socket.h>
> -
> +#include <time.h>
> +#include <sysdep.h>
>  #include <socketcall.h>
> -#include <kernel-features.h>
> -#include <sys/syscall.h>
> +#include <socket-constants-time64.h>
>  
> -int
> -setsockopt (int fd, int level, int optname, const void *optval, socklen_t len)
> +static int
> +setsockopt_syscall (int fd, int level, int optname, const void *optval,
> +		    socklen_t len)
>  {
>  #ifdef __ASSUME_SETSOCKOPT_SYSCALL
> -  return INLINE_SYSCALL (setsockopt, 5, fd, level, optname, optval, len);
> +  return INLINE_SYSCALL_CALL (setsockopt, fd, level, optname, optval, len);
>  #else
>    return SOCKETCALL (setsockopt, fd, level, optname, optval, len);
>  #endif
>  }
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +static int
> +setsockopt32 (int fd, int level, int optname, const void *optval,
> +	      socklen_t len)
> +{
> +  int r = -1;
> +
> +  if (level != SOL_SOCKET)
> +    return r;
> +
> +  switch (optname)
> +    {
> +    case COMPAT_SO_RCVTIMEO_NEW:
> +    case COMPAT_SO_SNDTIMEO_NEW:
> +      {
> +        if (len < sizeof (struct __timeval64))
> +	  {
> +	    __set_errno (EINVAL);
> +	    break;

Same issue as above with size. Silent truncation required.


> +	  }
> +
> +	struct __timeval64 *tv64 = (struct __timeval64 *) optval;
> +	if (! in_time_t_range (tv64->tv_sec))
> +	  {
> +	    __set_errno (EOVERFLOW);
> +	    break;
> +	  }
> +
> +	if (optname == COMPAT_SO_RCVTIMEO_NEW)
> +	  optname = COMPAT_SO_RCVTIMEO_OLD;
> +	if (optname == COMPAT_SO_SNDTIMEO_NEW)
> +	  optname = COMPAT_SO_SNDTIMEO_OLD;
> +
> +	struct __timeval32 tv32 = valid_timeval64_to_timeval32 (*tv64);
> +
> +	r = setsockopt_syscall (fd, level, optname, &tv32, sizeof (tv32));
> +      }
> +    }
> +
> +  return r;
> +}
> +#endif
> +
> +int
> +setsockopt (int fd, int level, int optname, const void *optval, socklen_t len)
> +{
> +  int r = setsockopt_syscall (fd, level, optname, optval, len);
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +  if (r == -1 && errno == ENOPROTOOPT)
> +    r = setsockopt32 (fd, level, optname, optval, len);
> +#endif
> +
> +  return r;

OK.

> +}
>  weak_alias (setsockopt, __setsockopt)
> diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h b/sysdeps/unix/sysv/linux/socket-constants-time64.h
> new file mode 100644
> index 0000000000..e5a3777f28
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 20
> +#define COMPAT_SO_SNDTIMEO_OLD 21

OK. Verified 20, 21.

> +#define COMPAT_SO_RCVTIMEO_NEW 66
> +#define COMPAT_SO_SNDTIMEO_NEW 67

OK. Verified 66, 67.

> +
> +#endif

OK.

> diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> new file mode 100644
> index 0000000000..b137abdeea
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> @@ -0,0 +1,30 @@
> +/* Compat socket constants used in 64 bit compat code.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _SOCKET_CONSTANTS_TIME64_H
> +#define _SOCKET_CONSTANTS_TIME64_H
> +
> +/* The compat code requires the SO_* constants used for both 32 and 64 bit
> +   time_t, however they were only added on v5.1 kernel.  */
> +
> +#define COMPAT_SO_RCVTIMEO_OLD 8192
> +#define COMPAT_SO_SNDTIMEO_OLD 16384

OK. Verified 0x2000, 0x4000.

> +#define COMPAT_SO_RCVTIMEO_NEW 68
> +#define COMPAT_SO_SNDTIMEO_NEW 69

OK. Verified 0x44, 0x45.

> +
> +#endif

OK.

> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-18 20:55 ` [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella
  2021-05-19  8:50   ` Lukasz Majewski
  2021-05-20  6:50   ` Florian Weimer
@ 2021-06-04 19:30   ` Carlos O'Donell
  2 siblings, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:30 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The recvmsg handling is more complicated because it requires check the
> returned kernel control message and make some convertions.  For
> !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP
> or SO_TIMESTAMPNS and appends it to the control buffer if has extra
> space or returns MSG_CTRUNC otherwise.  The 32-bit time field is kept
> as-is.
> 
> Calls with __TIMESIZE=32 will see the converted 64-bit time control
> messages as spurious control message of unknown type.  Calls with
> __TIMESIZE=64 running on pre-time64 kernels will see the original
> message as a spurious control ones of unknown typ while running on
> kernel with native 64-bit time support will only see the time64 version
> of the control message.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
> kernel).

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  include/sys/socket.h                          |  5 +
>  sysdeps/unix/sysv/linux/Makefile              |  2 +-
>  sysdeps/unix/sysv/linux/Versions              |  1 +
>  .../unix/sysv/linux/convert_scm_timestamps.c  | 96 +++++++++++++++++++
>  sysdeps/unix/sysv/linux/getsockopt.c          | 12 +++
>  .../sysv/linux/hppa/socket-constants-time64.h |  5 +
>  .../sysv/linux/mips/socket-constants-time64.h |  5 +
>  .../linux/powerpc/socket-constants-time64.h   |  5 +
>  sysdeps/unix/sysv/linux/recvmsg.c             | 23 +++--
>  sysdeps/unix/sysv/linux/setsockopt.c          | 12 +++
>  .../unix/sysv/linux/socket-constants-time64.h |  5 +
>  .../linux/sparc/socket-constants-time64.h     |  5 +
>  12 files changed, 169 insertions(+), 7 deletions(-)
>  create mode 100644 sysdeps/unix/sysv/linux/convert_scm_timestamps.c
> 
> diff --git a/include/sys/socket.h b/include/sys/socket.h
> index 0e39dd2a3a..15d4a62b26 100644
> --- a/include/sys/socket.h
> +++ b/include/sys/socket.h
> @@ -164,5 +164,10 @@ libc_hidden_proto (__libc_sa_len)
>  
>  libc_hidden_proto (__cmsg_nxthdr)
>  
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +extern void __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize) ;
> +libc_hidden_proto (__convert_scm_timestamps)
> +#endif
> +
>  #endif
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index fb155cf856..e28f6470e3 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -64,7 +64,7 @@ sysdep_routines += adjtimex clone umount umount2 readahead sysctl \
>  		   time64-support pselect32 \
>  		   xstat fxstat lxstat xstat64 fxstat64 lxstat64 \
>  		   fxstatat fxstatat64 \
> -		   xmknod xmknodat
> +		   xmknod xmknodat convert_scm_timestamps
>  
>  CFLAGS-gethostid.c = -fexceptions
>  CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
> diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
> index 220bb2dffe..148f04c50a 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -177,6 +177,7 @@ libc {
>      __pread64_nocancel;
>      __close_nocancel;
>      __sigtimedwait;
> +    __convert_scm_timestamps;
>      # functions used by nscd
>      __netlink_assert_response;
>    }
> diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
> new file mode 100644
> index 0000000000..3c123c28ce
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
> @@ -0,0 +1,96 @@
> +/* Socket timestamp conversion routines.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <kernel-features.h>
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +# include <stdint.h>
> +# include <string.h>
> +# include <sys/socket.h>
> +# include <socket-constants-time64.h>
> +
> +/* It converts the first SO_TIMESTAMP or SO_TIMESTAMPNS with 32-bit time and
> +   appends it to the control buffer.  The 32-bit time field is kept as-is.
> +
> +   Calls with __TIMESIZE=32 will see the converted 64-bit time control
> +   messages as spurious control message of unknown type.
> +
> +   Calls with __TIMESIZE=64 running on pre-time64 kernels will see the
> +   original message as a spurious control ones of unknown typ while running
> +   on kernel with native 64-bit time support will only see the time64 version
> +   of the control message.  */
> +void
> +__convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
> +{
> +  if (msg->msg_control == NULL || msg->msg_controllen == 0)
> +    return;
> +
> +  /* The returned control message format for SO_TIMESTAMP_NEW is a
> +     'struct __kernel_sock_timeval' while for SO_TIMESTAMPNS_NEW is a
> +     'struct __kernel_timespec'.  In either case it is two uint64_t
> +     members.  */
> +  uint64_t tvts[2];
> +
> +  struct cmsghdr *cmsg, *last = NULL;
> +  int type = 0;
> +
> +  for (cmsg = CMSG_FIRSTHDR (msg);
> +       cmsg != NULL;
> +       cmsg = CMSG_NXTHDR (msg, cmsg))
> +    {
> +      if (cmsg->cmsg_level != SOL_SOCKET)
> +	continue;
> +
> +      switch (cmsg->cmsg_type)
> +	{
> +	case COMPAT_SO_TIMESTAMP_OLD:
> +	  if (type != 0)
> +	    break;
> +	  type = COMPAT_SO_TIMESTAMP_NEW;
> +	  goto common;
> +
> +	case COMPAT_SO_TIMESTAMPNS_OLD:
> +	  type = COMPAT_SO_TIMESTAMPNS_NEW;
> +
> +	/* fallthrough  */
> +	common:
> +	  memcpy (tvts, CMSG_DATA (cmsg), sizeof (tvts));
> +	  break;
> +	}
> +
> +      last = cmsg;
> +    }
> +
> +  if (last == NULL || type == 0)
> +    return;
> +
> +  if (CMSG_SPACE (sizeof tvts) > msgsize - msg->msg_controllen)
> +    {
> +      msg->msg_flags |= MSG_CTRUNC;
> +      return;
> +    }
> +
> +  msg->msg_controllen += CMSG_SPACE (sizeof tvts);
> +  cmsg = CMSG_NXTHDR(msg, last);
> +  cmsg->cmsg_level = SOL_SOCKET;
> +  cmsg->cmsg_type = type;
> +  cmsg->cmsg_len = CMSG_LEN (sizeof tvts);
> +  memcpy (CMSG_DATA (cmsg), tvts, sizeof tvts);
> +}
> +libc_hidden_def (__convert_scm_timestamps)
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c
> index c8e502d976..14b782d0da 100644
> --- a/sysdeps/unix/sysv/linux/getsockopt.c
> +++ b/sysdeps/unix/sysv/linux/getsockopt.c
> @@ -67,6 +67,18 @@ getsockopt32 (int fd, int level, int optname, void *optval,
>  	*tv64 = valid_timeval32_to_timeval64 (tv32);
>  	*len = sizeof (*tv64);
>        }
> +      break;
> +
> +    case COMPAT_SO_TIMESTAMP_NEW:
> +    case COMPAT_SO_TIMESTAMPNS_NEW:
> +      {
> +	if (optname == COMPAT_SO_TIMESTAMP_NEW)
> +	  optname = COMPAT_SO_TIMESTAMP_OLD;
> +	if (optname == COMPAT_SO_TIMESTAMPNS_NEW)
> +	  optname = COMPAT_SO_TIMESTAMPNS_OLD;
> +	r = getsockopt_syscall (fd, level, optname, optval, len);
> +      }
> +      break;
>      }
>  
>    return r;
> diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
> index ea721e0fc2..f3b98012d5 100644
> --- a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
> +++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h
> @@ -27,4 +27,9 @@
>  #define COMPAT_SO_RCVTIMEO_NEW 16448
>  #define COMPAT_SO_SNDTIMEO_NEW 16449
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 0x4012
> +#define COMPAT_SO_TIMESTAMPNS_OLD 0x4013
> +#define COMPAT_SO_TIMESTAMP_NEW 0x4038
> +#define COMPAT_SO_TIMESTAMPNS_NEW 0x4039
> +
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
> index ab8bd62853..31fa69fa9f 100644
> --- a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
> +++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h
> @@ -27,4 +27,9 @@
>  #define COMPAT_SO_RCVTIMEO_NEW 66
>  #define COMPAT_SO_SNDTIMEO_NEW 67
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 29
> +#define COMPAT_SO_TIMESTAMPNS_OLD 35
> +#define COMPAT_SO_TIMESTAMP_NEW 63
> +#define COMPAT_SO_TIMESTAMPNS_NEW 64
> +
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> index 1e48dcca8d..889251895b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h
> @@ -27,4 +27,9 @@
>  #define COMPAT_SO_RCVTIMEO_NEW 66
>  #define COMPAT_SO_SNDTIMEO_NEW 67
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 29
> +#define COMPAT_SO_TIMESTAMPNS_OLD 35
> +#define COMPAT_SO_TIMESTAMP_NEW 63
> +#define COMPAT_SO_TIMESTAMPNS_NEW 64
> +
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/recvmsg.c b/sysdeps/unix/sysv/linux/recvmsg.c
> index b209b4ad99..a2a600228b 100644
> --- a/sysdeps/unix/sysv/linux/recvmsg.c
> +++ b/sysdeps/unix/sysv/linux/recvmsg.c
> @@ -19,16 +19,27 @@
>  #include <sys/socket.h>
>  #include <sysdep-cancel.h>
>  #include <socketcall.h>
> -#include <shlib-compat.h>
>  
>  ssize_t
>  __libc_recvmsg (int fd, struct msghdr *msg, int flags)
>  {
> -# ifdef __ASSUME_RECVMSG_SYSCALL
> -  return SYSCALL_CANCEL (recvmsg, fd, msg, flags);
> -# else
> -  return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
> -# endif
> +  ssize_t r;
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +  socklen_t orig_controllen = msg->msg_controllen;
> +#endif
> +
> +#ifdef __ASSUME_RECVMSG_SYSCALL
> +  r = SYSCALL_CANCEL (recvmsg, fd, msg, flags);
> +#else
> +  r = SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
> +#endif
> +
> +#ifndef __ASSUME_TIME64_SYSCALLS
> +  if (r >= 0)
> +    __convert_scm_timestamps (msg, orig_controllen);
> +#endif
> +
> +  return r;
>  }
>  weak_alias (__libc_recvmsg, recvmsg)
>  weak_alias (__libc_recvmsg, __recvmsg)
> diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
> index 6505202265..a4780a9d33 100644
> --- a/sysdeps/unix/sysv/linux/setsockopt.c
> +++ b/sysdeps/unix/sysv/linux/setsockopt.c
> @@ -69,6 +69,18 @@ setsockopt32 (int fd, int level, int optname, const void *optval,
>  
>  	r = setsockopt_syscall (fd, level, optname, &tv32, sizeof (tv32));
>        }
> +      break;
> +
> +    case COMPAT_SO_TIMESTAMP_NEW:
> +    case COMPAT_SO_TIMESTAMPNS_NEW:
> +      {
> +	if (optname == COMPAT_SO_TIMESTAMP_NEW)
> +	  optname = COMPAT_SO_TIMESTAMP_OLD;
> +	if (optname == COMPAT_SO_TIMESTAMPNS_NEW)
> +	  optname = COMPAT_SO_TIMESTAMPNS_OLD;
> +	r = setsockopt_syscall (fd, level, optname, NULL, 0);
> +      }
> +      break;
>      }
>  
>    return r;
> diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h b/sysdeps/unix/sysv/linux/socket-constants-time64.h
> index e5a3777f28..7f7ca05504 100644
> --- a/sysdeps/unix/sysv/linux/socket-constants-time64.h
> +++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h
> @@ -27,4 +27,9 @@
>  #define COMPAT_SO_RCVTIMEO_NEW 66
>  #define COMPAT_SO_SNDTIMEO_NEW 67
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 29
> +#define COMPAT_SO_TIMESTAMPNS_OLD 35
> +#define COMPAT_SO_TIMESTAMP_NEW 63
> +#define COMPAT_SO_TIMESTAMPNS_NEW 64
> +
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> index b137abdeea..56358923e1 100644
> --- a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> +++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h
> @@ -27,4 +27,9 @@
>  #define COMPAT_SO_RCVTIMEO_NEW 68
>  #define COMPAT_SO_SNDTIMEO_NEW 69
>  
> +#define COMPAT_SO_TIMESTAMP_OLD 0x001d
> +#define COMPAT_SO_TIMESTAMPNS_OLD 0x0021
> +#define COMPAT_SO_TIMESTAMP_NEW 0x0046
> +#define COMPAT_SO_TIMESTAMPNS_NEW 0x0042
> +
>  #endif
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 07/25] linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-05-18 20:55 ` [PATCH v2 07/25] linux: Add recvvmsg " Adhemerval Zanella
  2021-05-19  9:02   ` Lukasz Majewski
@ 2021-06-04 19:30   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:30 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> Handle the SO_TIMESTAMP{NS} similar to recvmsg: for
> !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP
> or SO_TIMESTAMPNS and appends it to the control buffer if has extra
> space or returns MSG_CTRUNC otherwise.  The 32-bit time field is kept
> as-is.
> 
> Also for !__ASSUME_TIME64_SYSCALLS it limits the maximum number of
> 'struct mmsghdr *' to IOV_MAX (and also increases the stack size
> requirement to IOV_MAX times sizeof (socklen_t)).  The Linux imposes
> a similar limit to sendmmsg, so bound the array size on recvmmsg is not
> unreasonable.  And this will be used only on older when building with
> 32-bit time support.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
> kernel).

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  sysdeps/unix/sysv/linux/recvmmsg.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c
> index 672ba20332..5cd107ffa9 100644
> --- a/sysdeps/unix/sysv/linux/recvmmsg.c
> +++ b/sysdeps/unix/sysv/linux/recvmmsg.c
> @@ -44,13 +44,26 @@ __recvmmsg64 (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
>        ts32 = valid_timespec64_to_timespec (*timeout);
>        pts32 = &ts32;
>      }
> +
> +  socklen_t csize[IOV_MAX];
> +  if (vlen > IOV_MAX)
> +    vlen = IOV_MAX;
> +  for (int i = 0; i < vlen; i++)
> +    csize[i] = vmessages[i].msg_hdr.msg_controllen;
> +
>  # ifdef __ASSUME_RECVMMSG_SYSCALL
>    r = SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32);
>  # else
>    r = SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32);
>  # endif
> -  if (r >= 0 && timeout != NULL)
> -    *timeout = valid_timespec_to_timespec64 (ts32);
> +  if (r >= 0)
> +    {
> +      if (timeout != NULL)
> +        *timeout = valid_timespec_to_timespec64 (ts32);
> +
> +      for (int i=0; i < r; i++)
> +        __convert_scm_timestamps (&vmessages[i].msg_hdr, csize[i]);

OK. Use existing __convert_scm_timestamps (908d356af09284fbfedd25da3deb6af8898947e8).

> +    }
>  #endif /* __ASSUME_TIME64_SYSCALLS  */
>    return r;
>  }
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 08/25] y2038: Add __USE_TIME_BITS64 support for time_t
  2021-05-18 20:55 ` [PATCH v2 08/25] y2038: Add __USE_TIME_BITS64 support for time_t Adhemerval Zanella
  2021-05-19  9:02   ` Lukasz Majewski
@ 2021-06-04 19:30   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:30 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The __USE_TIME_BITS64 is not defined internally yet.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  time/bits/types/time_t.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/time/bits/types/time_t.h b/time/bits/types/time_t.h
> index ab8287c6fe..84d67f6ac3 100644
> --- a/time/bits/types/time_t.h
> +++ b/time/bits/types/time_t.h
> @@ -4,6 +4,10 @@
>  #include <bits/types.h>
>  
>  /* Returned by `time'.  */
> +#ifdef __USE_TIME_BITS64
> +typedef __time64_t time_t;
> +#else
>  typedef __time_t time_t;
> +#endif
>  
>  #endif
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 09/25] y2038: Add __USE_TIME_BITS64 support for struct timeval
  2021-05-18 20:55 ` [PATCH v2 09/25] y2038: Add __USE_TIME_BITS64 support for struct timeval Adhemerval Zanella
  2021-05-19  9:03   ` Lukasz Majewski
@ 2021-06-04 19:31   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:31 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The __USE_TIME_BITS64 is not defined internally yet.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>


> ---
>  time/bits/types/struct_timeval.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/time/bits/types/struct_timeval.h b/time/bits/types/struct_timeval.h
> index 70394ce886..3466137c35 100644
> --- a/time/bits/types/struct_timeval.h
> +++ b/time/bits/types/struct_timeval.h
> @@ -7,7 +7,12 @@
>     microsecond but also has a range of years.  */
>  struct timeval
>  {
> +#ifdef __USE_TIME_BITS64
> +  __time64_t tv_sec;		/* Seconds.  */
> +  __suseconds64_t tv_usec;	/* Microseconds.  */

OK.

> +#else
>    __time_t tv_sec;		/* Seconds.  */
>    __suseconds_t tv_usec;	/* Microseconds.  */
> +#endif
>  };
>  #endif
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 10/25] y2038: Add __USE_TIME_BITS64 support for struct timespec
  2021-05-18 20:55 ` [PATCH v2 10/25] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella
  2021-05-19  9:03   ` Lukasz Majewski
@ 2021-06-04 19:31   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:31 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The __USE_TIME_BITS64 is not defined internally yet.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  time/bits/types/struct_timespec.h | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h
> index d11c69cfd3..4fe47a0d25 100644
> --- a/time/bits/types/struct_timespec.h
> +++ b/time/bits/types/struct_timespec.h
> @@ -1,18 +1,22 @@
> -/* NB: Include guard matches what <linux/time.h> uses.  */
> -#ifndef _STRUCT_TIMESPEC
> -#define _STRUCT_TIMESPEC 1
> +#ifndef __struct_timespec_defined
> +#define __struct_timespec_defined 1
>  
>  #include <bits/types.h>
>  #include <bits/endian.h>
> +#include <bits/types/time_t.h>
>  
>  /* POSIX.1b structure for a time value.  This is like a `struct timeval' but
>     has nanoseconds instead of microseconds.  */
>  struct timespec
>  {
> +#ifdef __USE_TIME_BITS64
> +  __time64_t tv_sec;		/* Seconds.  */

OK. Use 64-bit seconds.

> +#else
>    __time_t tv_sec;		/* Seconds.  */
> +#endif
>  #if __WORDSIZE == 64 \
>    || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
> -  || __TIMESIZE == 32
> +  || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
>    __syscall_slong_t tv_nsec;	/* Nanoseconds.  */

OK.

>  #else
>  # if __BYTE_ORDER == __BIG_ENDIAN
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 11/25] y2038: Add __USE_TIME_BITS64 support for struct utimbuf
  2021-05-18 20:55 ` [PATCH v2 11/25] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Adhemerval Zanella
  2021-05-19  9:04   ` Lukasz Majewski
@ 2021-06-04 19:31   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:31 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:55 PM, Adhemerval Zanella wrote:
> The __USE_TIME_BITS64 is not defined internally yet.

LGTM. Reviewed utime usage in this case.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  io/utime.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/io/utime.h b/io/utime.h
> index df2299e406..c7612d0838 100644
> --- a/io/utime.h
> +++ b/io/utime.h
> @@ -35,8 +35,13 @@ __BEGIN_DECLS
>  /* Structure describing file times.  */
>  struct utimbuf
>    {
> +#ifdef __USE_TIME_BITS64
> +    __time64_t actime;		/* Access time.  */
> +    __time64_t modtime;		/* Modification time.  */

OK.

> +#else
>      __time_t actime;		/* Access time.  */
>      __time_t modtime;		/* Modification time.  */
> +#endif
>    };
>  
>  /* Set the access and modification times of FILE to those given in
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex
  2021-05-18 20:56 ` [PATCH v2 12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Adhemerval Zanella
  2021-05-19  9:04   ` Lukasz Majewski
@ 2021-06-04 19:31   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:31 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> The __USE_TIME_BITS64 is not defined internally yet.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  sysdeps/unix/sysv/linux/bits/timex.h | 31 ++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h
> index 9b2e30f3e0..ee37694e8f 100644
> --- a/sysdeps/unix/sysv/linux/bits/timex.h
> +++ b/sysdeps/unix/sysv/linux/bits/timex.h
> @@ -25,6 +25,36 @@
>  
>  struct timex
>  {

Checking against Linux kernel...

> +# ifdef __USE_TIME_BITS64
> +  unsigned int modes;          /* mode selector */

OK.

> +  int :32;                     /* pad */
> +  long long offset;            /* time offset (usec) */
> +  long long freq;              /* frequency offset (scaled ppm) */
> +  long long maxerror;          /* maximum error (usec) */
> +  long long esterror;          /* estimated error (usec) */

OK.

> +  int status;                  /* clock command/status */
> +  int :32;                     /* pad */

OK.

> +  long long constant;          /* pll time constant */
> +  long long precision;         /* clock precision (usec) (read only) */
> +  long long tolerance;         /* clock frequency tolerance (ppm) (ro) */

OK.

> +  struct timeval time;     /* (read only, except for ADJ_SETOFFSET) */

OK.

> +  long long tick;              /* (modified) usecs between clock ticks */
> +  long long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
> +  long long jitter;            /* pps jitter (us) (ro) */
> +  int shift;                   /* interval duration (s) (shift) (ro) */

OK.

> +  int :32;                     /* pad */

OK.

> +  long long stabil;            /* pps stability (scaled ppm) (ro) */
> +  long long jitcnt;            /* jitter limit exceeded (ro) */
> +  long long calcnt;            /* calibration intervals (ro) */
> +  long long errcnt;            /* calibration errors (ro) */
> +  long long stbcnt;            /* stability limit exceeded (ro) */

OK.

> +
> +  int tai;                     /* TAI offset (ro) */
> +
> +  int  :32; int  :32; int  :32; int  :32;
> +  int  :32; int  :32; int  :32; int  :32;
> +  int  :32; int  :32; int  :32;

OK. 12x

> +# else
>    unsigned int modes;		/* mode selector */
>    __syscall_slong_t offset;	/* time offset (usec) */
>    __syscall_slong_t freq;	/* frequency offset (scaled ppm) */
> @@ -51,6 +81,7 @@ struct timex
>    int  :32; int  :32; int  :32; int  :32;
>    int  :32; int  :32; int  :32; int  :32;
>    int  :32; int  :32; int  :32;
> +# endif
>  };
>  
>  /* Mode codes (timex.mode) */
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 13/25] y2038: Use a common definition for stat
  2021-05-18 20:56 ` [PATCH v2 13/25] y2038: Use a common definition for stat Adhemerval Zanella
@ 2021-06-04 19:37   ` Carlos O'Donell
  2021-06-07 18:07     ` Adhemerval Zanella
  0 siblings, 1 reply; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:37 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> From: Lukasz Majewski <lukma@denx.de>
> 
> Instead of replicate the same definitions from struct_stat_time64.h
> on the multiple struct_stat.h, use a common header which is included
> when required (struct_stat_time64_helper.h).  The 64-bit time support
> is added only for LFS support.
> 
> The __USE_TIME_BITS64 is not defined internally yet, although the
> internal header is used when building the 64-bit stat implementations.

Requesting a v3 please.

Please add the __glibc_reserved* members to the structures to preserve
maximum compatibility with the kernel structure.

See review of patch 14/25 for more general details.

I am almost OK with this change as-is because in general everyone
should be using statx at this point with the ability to extend and
provide more information.

However because the kernel contains:

 24 struct stat {
 25         unsigned long   st_dev;         /* Device.  */
 26         unsigned long   st_ino;         /* File serial number.  */
 27         unsigned int    st_mode;        /* File mode.  */
 28         unsigned int    st_nlink;       /* Link count.  */
 29         unsigned int    st_uid;         /* User ID of the file's owner.  */
 30         unsigned int    st_gid;         /* Group ID of the file's group. */
 31         unsigned long   st_rdev;        /* Device number, if device.  */
 32         unsigned long   __pad1;
 33         long            st_size;        /* Size of file, in bytes.  */
 34         int             st_blksize;     /* Optimal block size for I/O.  */
 35         int             __pad2;
 36         long            st_blocks;      /* Number 512-byte blocks allocated. */
 37         long            st_atime;       /* Time of last access.  */
 38         unsigned long   st_atime_nsec;
 39         long            st_mtime;       /* Time of last modification.  */
 40         unsigned long   st_mtime_nsec;
 41         long            st_ctime;       /* Time of last status change.  */
 42         unsigned long   st_ctime_nsec;
 43         unsigned int    __unused4;
 44         unsigned int    __unused5;
 45 };

With __unused4 and __unused5. I think we should match this ABI as closely as we can
to avoid future compatibility issues with legacy APIs.

> ---
>  sysdeps/unix/sysv/linux/Makefile              |  3 +-
>  sysdeps/unix/sysv/linux/bits/struct_stat.h    | 51 ++++++-----
>  .../linux/bits/struct_stat_time64_helper.h    | 63 +++++++++++++
>  .../unix/sysv/linux/m68k/bits/struct_stat.h   | 50 ++++++-----
>  .../sysv/linux/microblaze/bits/struct_stat.h  | 48 ++++++----
>  .../unix/sysv/linux/mips/bits/struct_stat.h   | 89 ++++++++++--------
>  .../sysv/linux/powerpc/bits/struct_stat.h     | 52 ++++++-----
>  .../unix/sysv/linux/s390/bits/struct_stat.h   | 56 +++++++-----
>  sysdeps/unix/sysv/linux/struct_stat_time64.h  | 59 +-----------
>  .../unix/sysv/linux/x86/bits/struct_stat.h    | 90 ++++++++++---------
>  10 files changed, 317 insertions(+), 244 deletions(-)
>  create mode 100644 sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
> 
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index e28f6470e3..f83f147ed1 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -100,7 +100,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
>  		  bits/types/struct_msqid_ds.h \
>  		  bits/types/struct_shmid_ds.h \
>  		  bits/ipc-perm.h \
> -		  bits/struct_stat.h
> +		  bits/struct_stat.h \
> +		  bits/struct_stat_time64_helper.h

OK. Add new helper header.

>  
>  tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
>  	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
> diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h
> index b852ee256e..ba41f86142 100644
> --- a/sysdeps/unix/sysv/linux/bits/struct_stat.h
> +++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h
> @@ -28,32 +28,35 @@
>  
>  struct stat
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +#else
>      __dev_t st_dev;			/* Device.  */
>      unsigned short int __pad1;
> -#ifndef __USE_FILE_OFFSET64
> +# ifndef __USE_FILE_OFFSET64
>      __ino_t st_ino;			/* File serial number.	*/
> -#else
> +# else
>      __ino_t __st_ino;			/* 32bit file serial number.	*/
> -#endif
> +# endif
>      __mode_t st_mode;			/* File mode.  */
>      __nlink_t st_nlink;			/* Link count.  */
>      __uid_t st_uid;			/* User ID of the file's owner.	*/
>      __gid_t st_gid;			/* Group ID of the file's group.*/
>      __dev_t st_rdev;			/* Device number, if device.  */
>      unsigned short int __pad2;
> -#ifndef __USE_FILE_OFFSET64
> +# ifndef __USE_FILE_OFFSET64
>      __off_t st_size;			/* Size of file, in bytes.  */
> -#else
> +# else
>      __off64_t st_size;			/* Size of file, in bytes.  */
> -#endif
> +# endif
>      __blksize_t st_blksize;		/* Optimal block size for I/O.  */
>  
> -#ifndef __USE_FILE_OFFSET64
> +# ifndef __USE_FILE_OFFSET64
>      __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#else
> +# else
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#endif
> -#ifdef __USE_XOPEN2K8
> +# endif
> +# ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -63,28 +66,32 @@ struct stat
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> -# define st_mtime st_mtim.tv_sec
> -# define st_ctime st_ctim.tv_sec
> -#else
> +#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> +#  define st_mtime st_mtim.tv_sec
> +#  define st_ctime st_ctim.tv_sec
> +# else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -#endif
> -#ifndef __USE_FILE_OFFSET64
> +# endif
> +# ifndef __USE_FILE_OFFSET64
>      unsigned long int __glibc_reserved4;
>      unsigned long int __glibc_reserved5;
> -#else
> +# else
>      __ino64_t st_ino;			/* File serial number.	*/
> -#endif
> +# endif
> +#endif /* __USE_TIME_BITS64  */
>    };
>  
>  #ifdef __USE_LARGEFILE64
>  struct stat64
>    {
> +# ifdef __USE_TIME_BITS64
> +#  include <bits/struct_stat_time64_helper.h>
> +# else
>      __dev_t st_dev;			/* Device.  */
>      unsigned int __pad1;
>  
> @@ -99,7 +106,7 @@ struct stat64
>      __blksize_t st_blksize;		/* Optimal block size for I/O.  */
>  
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -# ifdef __USE_XOPEN2K8
> +#  ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -109,15 +116,16 @@ struct stat64
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -# else
> +#  else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -# endif
> +#  endif
>      __ino64_t st_ino;			/* File serial number.		*/
> +# endif /* __USE_TIME_BITS64  */

OK. Reindent.

>    };
>  #endif
>  
> @@ -127,5 +135,4 @@ struct stat64
>  /* Nanosecond resolution time values are supported.  */
>  #define _STATBUF_ST_NSEC
>  
> -

Please avoid spurious empty line removal when not related to the patch at hand.

>  #endif /* _BITS_STRUCT_STAT_H  */
> diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
> new file mode 100644
> index 0000000000..77385e9073
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
> @@ -0,0 +1,63 @@
> +/* Definition for helper to define struct stat with 64 bit time.

OK.

> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library.  If not, see
> +   <https://www.gnu.org/licenses/>.  */
> +

Reviewing...

> +  /* Content of internal __stat64_t64 struct.  */
> +  __dev_t st_dev;		/* Device.  */

OK.

> +  __ino64_t st_ino;		/* file serial number.	*/

OK.

> +  __mode_t st_mode;		/* File mode.  */

OK.

> +  __nlink_t st_nlink;		/* Link count.  */

OK.

> +  __uid_t st_uid;		/* User ID of the file's owner.  */
> +  __gid_t st_gid;		/* Group ID of the file's group.  */

OK uid/gid.

> +  __dev_t st_rdev;		/* Device number, if device.  */

OK.

> +  __off64_t st_size;		/* Size of file, in bytes.  */

OK.

> +  __blksize_t st_blksize;	/* Optimal block size for I/O.  */
> +  __blkcnt64_t st_blocks;	/* Number 512-byte blocks allocated. */

OK.

Plase add __glibc_reserved4 and __glibc_reserved5 here.

> +#ifdef __USE_XOPEN2K8
> +# ifndef __struct_timespec
> +#  define __struct_timespec struct timespec
> +# endif
> +  /* Nanosecond resolution timestamps are stored in a format
> +     equivalent to 'struct timespec'.  This is the type used
> +     whenever possible but the Unix namespace rules do not allow the
> +     identifier 'timespec' to appear in the <sys/stat.h> header.
> +     Therefore we have to handle the use of this header in strictly
> +     standard-compliant sources special.  */
> +  __struct_timespec st_atim;
> +  __struct_timespec st_mtim;
> +  __struct_timespec st_ctim;
> +# define st_atime st_atim.tv_sec
> +# define st_mtime st_mtim.tv_sec
> +# define st_ctime st_ctim.tv_sec
> +# undef __struct_timespec

OK.

> +#else
> +/* The definition should be equal to the 'struct __timespec64' internal
> +   layout.  */
> +# if __BYTE_ORDER == __BIG_ENDIAN
> +#  define __fieldts64(name)					\
> +   __time64_t name; __int32_t :32; __int32_t name ## nsec
> +# else
> +#  define __fieldts64(name)					\
> +   __time64_t name; __int32_t name ## nsec; __int32_t :32
> +# endif
> +
> +  __fieldts64 (st_atime);
> +  __fieldts64 (st_mtime);
> +  __fieldts64 (st_ctime);

OK.

> +
> +# undef __fieldts64
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h b/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h
> index 4ae7506eb5..0512ecc3bc 100644
> --- a/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h
> +++ b/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h
> @@ -25,32 +25,35 @@
>  
>  struct stat
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +#else
>      __dev_t st_dev;			/* Device.  */
>      unsigned short int __pad1;
> -#ifndef __USE_FILE_OFFSET64
> +# ifndef __USE_FILE_OFFSET64
>      __ino_t st_ino;			/* File serial number.	*/
> -#else
> +# else
>      __ino_t __st_ino;			/* 32bit file serial number.	*/
> -#endif
> +# endif
>      __mode_t st_mode;			/* File mode.  */
>      __nlink_t st_nlink;			/* Link count.  */
>      __uid_t st_uid;			/* User ID of the file's owner.	*/
>      __gid_t st_gid;			/* Group ID of the file's group.*/
>      __dev_t st_rdev;			/* Device number, if device.  */
>      unsigned short int __pad2;
> -#ifndef __USE_FILE_OFFSET64
> +# ifndef __USE_FILE_OFFSET64
>      __off_t st_size;			/* Size of file, in bytes.  */
> -#else
> +# else
>      __off64_t st_size;			/* Size of file, in bytes.  */
> -#endif
> +# endif
>      __blksize_t st_blksize;		/* Optimal block size for I/O.  */
>  
> -#ifndef __USE_FILE_OFFSET64
> +# ifndef __USE_FILE_OFFSET64
>      __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#else
> +# else
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#endif
> -#ifdef __USE_XOPEN2K8
> +# endif
> +# ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -60,28 +63,32 @@ struct stat
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> -# define st_mtime st_mtim.tv_sec
> -# define st_ctime st_ctim.tv_sec
> -#else
> +#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> +#  define st_mtime st_mtim.tv_sec
> +#  define st_ctime st_ctim.tv_sec
> +# else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -#endif
> -#ifndef __USE_FILE_OFFSET64
> +# endif
> +# ifndef __USE_FILE_OFFSET64
>      unsigned long int __glibc_reserved4;
>      unsigned long int __glibc_reserved5;
> -#else
> +# else
>      __ino64_t st_ino;			/* File serial number.	*/
> -#endif
> +# endif
> +#endif /* __USE_TIME_BITS64  */
>    };
>  
>  #ifdef __USE_LARGEFILE64
>  struct stat64
>    {
> +# ifdef __USE_TIME_BITS64
> +#  include <bits/struct_stat_time64_helper.h>

OK. Use helper again.

> +# else
>      __dev_t st_dev;			/* Device.  */
>      unsigned short int __pad1;
>  
> @@ -96,7 +103,7 @@ struct stat64
>      __blksize_t st_blksize;		/* Optimal block size for I/O.  */
>  
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -# ifdef __USE_XOPEN2K8
> +#  ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -106,15 +113,16 @@ struct stat64
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -# else
> +#  else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -# endif
> +#  endif
>      __ino64_t st_ino;			/* File serial number.		*/
> +# endif /* __USE_TIME_BITS64 */
>    };
>  #endif
>  
> diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h
> index be1bdc3557..0284d4b2b2 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h
> +++ b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h
> @@ -26,6 +26,9 @@
>  #ifndef __USE_FILE_OFFSET64
>  struct stat
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +#else
>          __dev_t         st_dev;     /* Device.  */
>          __ino_t         st_ino;     /* File serial number.  */
>          __mode_t        st_mode;    /* File mode.  */
> @@ -38,7 +41,7 @@ struct stat
>          __blksize_t     st_blksize; /* Optimal block size for I/O.  */
>          int             __pad3;
>          __blkcnt_t      st_blocks;  /* Number 512-byte blocks allocated.  */
> -#ifdef __USE_XOPEN2K8
> +# ifdef __USE_XOPEN2K8
>          /* Nanosecond resolution timestamps are stored in a format
>           * equivalent to 'struct timespec'. This is the type used
>           * whenever possible but the Unix namespace rules do not allow the
> @@ -48,19 +51,20 @@ struct stat
>          struct timespec         st_atim; /* Time of last access.  */
>          struct timespec         st_mtim; /* Time of last modification.  */
>          struct timespec         st_ctim; /* Time of last status change.  */
> -# define st_atime st_atim.tv_sec         /* Backward compatibility.  */
> -# define st_mtime st_mtim.tv_sec
> -# define st_ctime st_ctim.tv_sec
> -#else
> +#  define st_atime st_atim.tv_sec         /* Backward compatibility.  */
> +#  define st_mtime st_mtim.tv_sec
> +#  define st_ctime st_ctim.tv_sec
> +# else
>          __time_t                st_atime;     /* Time of last access.  */
>          unsigned long int       st_atimensec; /* Nscecs of last access.  */
>          __time_t                st_mtime;     /* Time of last modification.  */
>          unsigned long int       st_mtimensec; /* Nsecs of last modification.  */
>          __time_t                st_ctime;     /* Time of last status change.  */
>          unsigned long int       st_ctimensec; /* Nsecs of last status change.  */
> -#endif
> +# endif
>          unsigned int            __glibc_reserved4;
>          unsigned int            __glibc_reserved5;
> +#endif /* __USE_TIME_BITS64  */
>  };
>  #else /* __USE_FILE_OFFSET64 */
>  /* MS: If __USE_FILE_OFFSET64 is setup then struct stat should match stat64
> @@ -70,6 +74,9 @@ struct stat
>   * create one ifdef to separate stats structures.  */
>  struct stat
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +#else
>          unsigned long long      st_dev;     /* Device.  */
>          __ino64_t               st_ino;     /* 32bit file serial number.  */
>          __mode_t                st_mode;    /* File mode.  */
> @@ -82,7 +89,7 @@ struct stat
>          __blksize_t             st_blksize; /* Optimal block size for I/O.  */
>          int                     __pad3;
>          __blkcnt64_t            st_blocks;  /* Number 512-byte blocks allocated.  */
> -#ifdef __USE_MISC
> +# ifdef __USE_MISC
>          /* Nanosecond resolution timestamps are stored in a format
>           * equivalent to 'struct timespec'. This is the type used
>           * whenever possible but the Unix namespace rules do not allow the
> @@ -92,25 +99,29 @@ struct stat
>          struct timespec         st_atim;      /* Time of last access.  */
>          struct timespec         st_mtim;      /* Time of last modification.  */
>          struct timespec         st_ctim;      /* Time of last status change.  */
> -# define st_atime st_atim.tv_sec              /* Backward compatibility.  */
> -# define st_mtime st_mtim.tv_sec
> -# define st_ctime st_ctim.tv_sec
> -#else
> +#  define st_atime st_atim.tv_sec              /* Backward compatibility.  */
> +#  define st_mtime st_mtim.tv_sec
> +#  define st_ctime st_ctim.tv_sec
> +# else
>          __time_t                st_atime;     /* Time of last access.  */
>          unsigned long int       st_atimensec; /* Nscecs of last access.  */
>          __time_t                st_mtime;     /* Time of last modification.  */
>          unsigned long int       st_mtimensec; /* Nsecs of last modification.  */
>          __time_t                st_ctime;     /* Time of last status change.  */
>          unsigned long int       st_ctimensec; /* Nsecs of last status change.  */
> -#endif
> +# endif
>          unsigned int            __glibc_reserved4;
>          unsigned int            __glibc_reserved5;
> +# endif /* __USE_TIME_BITS64 */
>  };
>  #endif /* __USE_FILE_OFFSET64 */
>  
>  #ifdef __USE_LARGEFILE64
>  struct stat64
>  {
> +# ifdef __USE_TIME_BITS64
> +#  include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +# else
>          unsigned long long      st_dev;     /* Device.  */
>          __ino64_t               st_ino;     /* 32bit file serial number.  */
>          __mode_t                st_mode;    /* File mode.  */
> @@ -123,7 +134,7 @@ struct stat64
>          __blksize_t             st_blksize; /* Optimal block size for I/O.  */
>          int                     __pad3;
>          __blkcnt64_t            st_blocks;  /* Number 512-byte blocks allocated.  */
> -#ifdef __USE_XOPEN2K8
> +#  ifdef __USE_XOPEN2K8
>          /* Nanosecond resolution timestamps are stored in a format
>           * equivalent to 'struct timespec'. This is the type used
>           * whenever possible but the Unix namespace rules do not allow the
> @@ -133,19 +144,20 @@ struct stat64
>          struct timespec         st_atim;    /* Time of last access.  */
>          struct timespec         st_mtim;    /* Time of last modification.  */
>          struct timespec         st_ctim;    /* Time of last status change.  */
> -# define st_atime st_atim.tv_sec            /* Backward compatibility.  */
> -# define st_mtime st_mtim.tv_sec
> -# define st_ctime st_ctim.tv_sec
> -#else
> +#   define st_atime st_atim.tv_sec           /* Backward compatibility.  */
> +#   define st_mtime st_mtim.tv_sec
> +#   define st_ctime st_ctim.tv_sec
> +#  else
>          __time_t                st_atime;     /* Time of last access.  */
>          unsigned long int       st_atimensec; /* Nscecs of last access.  */
>          __time_t                st_mtime;     /* Time of last modification.  */
>          unsigned long int       st_mtimensec; /* Nsecs of last modification.  */
>          __time_t                st_ctime;     /* Time of last status change.  */
>          unsigned long int       st_ctimensec; /* Nsecs of last status change.  */
> -#endif
> +#  endif
>          unsigned int            __glibc_reserved4;
>          unsigned int            __glibc_reserved5;
> +# endif /* __USE_TIME_BITS64 */
>  };
>  #endif
>  
> diff --git a/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h b/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
> index 7ae4c10827..ab9f474cbc 100644
> --- a/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
> +++ b/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
> @@ -29,28 +29,31 @@
>  /* Structure describing file characteristics.  */
>  struct stat
>    {
> +# ifdef __USE_TIME_BITS64
> +#  include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +# else
>      unsigned long int st_dev;
>      long int st_pad1[3];
> -#ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      __ino_t st_ino;		/* File serial number.		*/
> -#else
> +#  else
>      __ino64_t st_ino;		/* File serial number.		*/
> -#endif
> +#  endif
>      __mode_t st_mode;		/* File mode.  */
>      __nlink_t st_nlink;		/* Link count.  */
>      __uid_t st_uid;		/* User ID of the file's owner.	*/
>      __gid_t st_gid;		/* Group ID of the file's group.*/
>      unsigned long int st_rdev;	/* Device number, if device.  */
> -#ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      long int st_pad2[2];
>      __off_t st_size;		/* Size of file, in bytes.  */
>      /* SVR4 added this extra long to allow for expansion of off_t.  */
>      long int st_pad3;
> -#else
> +#  else
>      long int st_pad2[3];
>      __off64_t st_size;		/* Size of file, in bytes.  */
> -#endif
> -#ifdef __USE_XOPEN2K8
> +#  endif
> +#  ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -60,30 +63,34 @@ struct stat
>      struct timespec st_atim;            /* Time of last access.  */
>      struct timespec st_mtim;            /* Time of last modification.  */
>      struct timespec st_ctim;            /* Time of last status change.  */
> -# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
> -# define st_mtime st_mtim.tv_sec
> -# define st_ctime st_ctim.tv_sec
> -#else
> +#   define st_atime st_atim.tv_sec        /* Backward compatibility.  */
> +#   define st_mtime st_mtim.tv_sec
> +#   define st_ctime st_ctim.tv_sec
> +#  else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -#endif
> +#  endif
>      __blksize_t st_blksize;	/* Optimal block size for I/O.  */
> -#ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
> -#else
> +#  else
>      long int st_pad4;
>      __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.  */
> -#endif
> +#  endif
>      long int st_pad5[14];
> +# endif /* __USE_TIME_BITS64  */
>    };
>  
> -#ifdef __USE_LARGEFILE64
> +# ifdef __USE_LARGEFILE64
>  struct stat64
>    {
> +#  ifdef __USE_TIME_BITS64
> +#   include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +#  else
>      unsigned long int st_dev;
>      long int st_pad1[3];
>      __ino64_t st_ino;		/* File serial number.		*/
> @@ -94,7 +101,7 @@ struct stat64
>      unsigned long int st_rdev;	/* Device number, if device.  */
>      long int st_pad2[3];
>      __off64_t st_size;		/* Size of file, in bytes.  */
> -# ifdef __USE_XOPEN2K8
> +#   ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -104,44 +111,47 @@ struct stat64
>      struct timespec st_atim;            /* Time of last access.  */
>      struct timespec st_mtim;            /* Time of last modification.  */
>      struct timespec st_ctim;            /* Time of last status change.  */
> -# else
> +#   else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -# endif
> +#   endif
>      __blksize_t st_blksize;	/* Optimal block size for I/O.  */
>      long int st_pad3;
>      __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.  */
>      long int st_pad4[14];
> +#  endif /* __USE_TIME_BITS64  */
>    };
> -#endif
> -#else
> +# endif /* __USE_LARGEFILE64  */
> +
> +#else /* _MIPS_SIM != _ABIO32  */
> +
>  struct stat
>    {
>      __dev_t st_dev;
>      int	st_pad1[3];		/* Reserved for st_dev expansion  */
> -#ifndef __USE_FILE_OFFSET64
> +# ifndef __USE_FILE_OFFSET64
>      __ino_t st_ino;
> -#else
> +# else
>      __ino64_t st_ino;
> -#endif
> +# endif
>      __mode_t st_mode;
>      __nlink_t st_nlink;
>      __uid_t st_uid;
>      __gid_t st_gid;
>      __dev_t st_rdev;
> -#if !defined __USE_FILE_OFFSET64
> +# if !defined __USE_FILE_OFFSET64
>      unsigned int st_pad2[2];	/* Reserved for st_rdev expansion  */
>      __off_t st_size;
>      int st_pad3;
> -#else
> +# else
>      unsigned int st_pad2[3];	/* Reserved for st_rdev expansion  */
>      __off64_t st_size;
> -#endif
> -#ifdef __USE_XOPEN2K8
> +# endif
> +# ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -151,24 +161,24 @@ struct stat
>      struct timespec st_atim;            /* Time of last access.  */
>      struct timespec st_mtim;            /* Time of last modification.  */
>      struct timespec st_ctim;            /* Time of last status change.  */
> -# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
> -# define st_mtime st_mtim.tv_sec
> -# define st_ctime st_ctim.tv_sec
> -#else
> +#  define st_atime st_atim.tv_sec        /* Backward compatibility.  */
> +#  define st_mtime st_mtim.tv_sec
> +#  define st_ctime st_ctim.tv_sec
> +# else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -#endif
> +# endif
>      __blksize_t st_blksize;
>      unsigned int st_pad4;
> -#ifndef __USE_FILE_OFFSET64
> +# ifndef __USE_FILE_OFFSET64
>      __blkcnt_t st_blocks;
> -#else
> +# else
>      __blkcnt64_t st_blocks;
> -#endif
> +# endif
>      int st_pad5[14];
>    };
>  
> @@ -185,7 +195,7 @@ struct stat64
>      __dev_t st_rdev;
>      unsigned int st_pad2[3];	/* Reserved for st_rdev expansion  */
>      __off64_t st_size;
> -# ifdef __USE_XOPEN2K8
> +#  ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -195,20 +205,21 @@ struct stat64
>      struct timespec st_atim;            /* Time of last access.  */
>      struct timespec st_mtim;            /* Time of last modification.  */
>      struct timespec st_ctim;            /* Time of last status change.  */
> -# else
> +#  else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -# endif
> +#  endif
>      __blksize_t st_blksize;
>      unsigned int st_pad3;
>      __blkcnt64_t st_blocks;
>      int st_pad4[14];
>  };
>  #endif
> +
>  #endif
>  
>  /* Tell code we have these members.  */
> diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
> index 12caab2790..f55eb658a2 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
> @@ -26,35 +26,37 @@
>  #include <bits/wordsize.h>
>  
>  #if __WORDSIZE == 32
> -
>  struct stat
>    {
> +# ifdef __USE_TIME_BITS64
> +#  include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +# else
>      __dev_t st_dev;			/* Device.  */
> -# ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      unsigned short int __pad1;
>      __ino_t st_ino;			/* File serial number.	*/
> -# else
> +#  else
>      __ino64_t st_ino;			/* File serial number.	*/
> -# endif
> +#  endif
>      __mode_t st_mode;			/* File mode.  */
>      __nlink_t st_nlink;			/* Link count.  */
>      __uid_t st_uid;			/* User ID of the file's owner.	*/
>      __gid_t st_gid;			/* Group ID of the file's group.*/
>      __dev_t st_rdev;			/* Device number, if device.  */
>      unsigned short int __pad2;
> -# ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      __off_t st_size;			/* Size of file, in bytes.  */
> -# else
> +#  else
>      __off64_t st_size;			/* Size of file, in bytes.  */
> -# endif
> +#  endif
>      __blksize_t st_blksize;		/* Optimal block size for I/O.  */
>  
> -# ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
> -# else
> +#  else
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -# endif
> -# ifdef __USE_XOPEN2K8
> +#  endif
> +#  ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -64,25 +66,28 @@ struct stat
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> -#  define st_mtime st_mtim.tv_sec
> -#  define st_ctime st_ctim.tv_sec
> -# else
> +#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> +#   define st_mtime st_mtim.tv_sec
> +#   define st_ctime st_ctim.tv_sec
> +#  else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -# endif
> +#  endif
>      unsigned long int __glibc_reserved4;
>      unsigned long int __glibc_reserved5;
> +# endif /* __USE_TIME_BITS64 */
>    };
>  
> -
>  # ifdef __USE_LARGEFILE64
>  struct stat64
>    {
> +#  ifdef __USE_TIME_BITS64
> +#   include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +#  else
>      __dev_t st_dev;			/* Device.  */
>      __ino64_t st_ino;			/* File serial number.	*/
>      __mode_t st_mode;			/* File mode.  */
> @@ -94,7 +99,7 @@ struct stat64
>      __off64_t st_size;			/* Size of file, in bytes.  */
>      __blksize_t st_blksize;		/* Optimal block size for I/O.  */
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#  ifdef __USE_XOPEN2K8
> +#   ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -104,19 +109,20 @@ struct stat64
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> -#   define st_mtime st_mtim.tv_sec
> -#   define st_ctime st_ctim.tv_sec
> -#  else
> +#    define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> +#    define st_mtime st_mtim.tv_sec
> +#    define st_ctime st_ctim.tv_sec
> +#   else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -#  endif
> +#   endif
>      unsigned long int __glibc_reserved4;
>      unsigned long int __glibc_reserved5;
> +#  endif /* __USE_TIME_BITS64 */
>    };
>  # endif /* __USE_LARGEFILE64 */
>  
> diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h b/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h
> index a733622cf5..f2933b8b12 100644
> --- a/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h
> +++ b/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h
> @@ -65,32 +65,35 @@ struct stat
>  #else
>  struct stat
>    {
> +# ifdef __USE_TIME_BITS64
> +#  include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +# else
>      __dev_t st_dev;			/* Device.  */
>      unsigned int __pad1;
> -# ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      __ino_t st_ino;			/* File serial number.	*/
> -# else
> +#  else
>      __ino_t __st_ino;			/* 32bit file serial number.	*/
> -# endif
> +#  endif
>      __mode_t st_mode;			/* File mode.  */
>      __nlink_t st_nlink;			/* Link count.  */
>      __uid_t st_uid;			/* User ID of the file's owner.	*/
>      __gid_t st_gid;			/* Group ID of the file's group.*/
>      __dev_t st_rdev;			/* Device number, if device.  */
>      unsigned int __pad2;
> -# ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      __off_t st_size;			/* Size of file, in bytes.  */
> -# else
> +#  else
>      __off64_t st_size;			/* Size of file, in bytes.  */
> -# endif
> +#  endif
>      __blksize_t st_blksize;		/* Optimal block size for I/O.  */
>  
> -# ifndef __USE_FILE_OFFSET64
> +#  ifndef __USE_FILE_OFFSET64
>      __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
> -# else
> +#  else
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -# endif
> -# ifdef __USE_XOPEN2K8
> +#  endif
> +#  ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -100,25 +103,26 @@ struct stat
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> -#  define st_mtime st_mtim.tv_sec
> -#  define st_ctime st_ctim.tv_sec
> -# else
> +#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> +#   define st_mtime st_mtim.tv_sec
> +#   define st_ctime st_ctim.tv_sec
> +#  else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -# endif
> -# ifndef __USE_FILE_OFFSET64
> +#  endif
> +#  ifndef __USE_FILE_OFFSET64
>      unsigned long int __glibc_reserved4;
>      unsigned long int __glibc_reserved5;
> -# else
> +#  else
>      __ino64_t st_ino;			/* File serial number.	*/
> +#  endif
>  # endif
>    };
> -#endif
> +# endif
>  
>  #ifdef __USE_LARGEFILE64
>  # if __WORDSIZE == 64
> @@ -162,6 +166,9 @@ struct stat64
>  # else
>  struct stat64
>    {
> +#  ifdef __USE_TIME_BITS64
> +#   include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +#  else
>      __dev_t st_dev;			/* Device.  */
>      unsigned int __pad1;
>  
> @@ -176,7 +183,7 @@ struct stat64
>      __blksize_t st_blksize;		/* Optimal block size for I/O.  */
>  
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#  ifdef __USE_XOPEN2K8
> +#   ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -186,18 +193,19 @@ struct stat64
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> -#   define st_mtime st_mtim.tv_sec
> -#   define st_ctime st_ctim.tv_sec
> -#  else
> +#    define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> +#    define st_mtime st_mtim.tv_sec
> +#    define st_ctime st_ctim.tv_sec
> +#   else
>      __time_t st_atime;			/* Time of last access.  */
>      unsigned long int st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
> -#  endif
> +#   endif
>      __ino64_t st_ino;			/* File serial number.		*/
> +#  endif
>    };
>  # endif
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/struct_stat_time64.h b/sysdeps/unix/sysv/linux/struct_stat_time64.h
> index f0a29d7fe5..260d1812be 100644
> --- a/sysdeps/unix/sysv/linux/struct_stat_time64.h
> +++ b/sysdeps/unix/sysv/linux/struct_stat_time64.h
> @@ -22,64 +22,13 @@
>  #if __TIMESIZE == 64
>  # define __stat64_t64 stat64
>  #else

OK. We should be removing much of this file because it was refactored into the helper.

> -# ifdef __USE_LARGEFILE64
> -#  include <endian.h>
> -
> -/* The definition should be equal to the 'struct __timespec64' internal
> -   layout.  */
> -#  if BYTE_ORDER == BIG_ENDIAN
> -#   define __fieldts64(name) 					\
> -     __time64_t name; __int32_t :32; __int32_t name ## nsec
> -#  else
> -#   define __fieldts64(name)					\
> -     __time64_t name; __int32_t name ## nsec; __int32_t :32
> -#  endif
> -
> -/* Workaround for the definition from struct_stat.h  */
> -#  undef st_atime
> -#  undef st_mtime
> -#  undef st_ctime
> +# include <struct___timespec64.h>
>  
>  struct __stat64_t64
>    {
> -    __dev_t st_dev;			/* Device.  */
> -    __ino64_t st_ino;			/* file serial number.	*/
> -    __mode_t st_mode;			/* File mode.  */
> -    __nlink_t st_nlink;			/* Link count.  */
> -    __uid_t st_uid;			/* User ID of the file's owner.	*/
> -    __gid_t st_gid;			/* Group ID of the file's group.*/
> -    __dev_t st_rdev;			/* Device number, if device.  */
> -    __off64_t st_size;			/* Size of file, in bytes.  */
> -    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
> -    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#   ifdef __USE_XOPEN2K8
> -    /* Nanosecond resolution timestamps are stored in a format
> -       equivalent to 'struct timespec'.  This is the type used
> -       whenever possible but the Unix namespace rules do not allow the
> -       identifier 'timespec' to appear in the <sys/stat.h> header.
> -       Therefore we have to handle the use of this header in strictly
> -       standard-compliant sources special.  */
> -    struct __timespec64 st_atim;	/* Time of last access.  */
> -    struct __timespec64 st_mtim;	/* Time of last modification.  */
> -    struct __timespec64 st_ctim;	/* Time of last status change.  */
> -#    define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> -#    define st_mtime st_mtim.tv_sec
> -#    define st_ctime st_ctim.tv_sec
> -#   else
> -    __fieldts64 (st_atime);
> -    __fieldts64 (st_mtime);
> -    __fieldts64 (st_ctime);
> -#   endif /* __USE_XOPEN2K8  */
> +# define __struct_timespec struct __timespec64
> +# include <bits/struct_stat_time64_helper.h>

OK. As expected, refactored away.

>    };
> -
> -#   define _STATBUF_ST_BLKSIZE
> -#   define _STATBUF_ST_RDEV
> -#   define _STATBUF_ST_NSEC
> -
> -#   undef __fieldts64
> -
> -#  endif /* __USE_LARGEFILE64  */
> -
> -# endif /* __TIMESIZE == 64  */
> +#endif /* __TIMESIZE == 64  */
>  
>  #endif /* _BITS_STRUCT_STAT_TIME64_H  */
> diff --git a/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h b/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
> index 6ddd01db46..01ee7ff6b3 100644
> --- a/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
> +++ b/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
> @@ -25,43 +25,46 @@
>  
>  struct stat
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +#else
>      __dev_t st_dev;		/* Device.  */
> -#ifndef __x86_64__
> +# ifndef __x86_64__
>      unsigned short int __pad1;
> -#endif
> -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
> +# endif
> +# if defined __x86_64__ || !defined __USE_FILE_OFFSET64
>      __ino_t st_ino;		/* File serial number.	*/
> -#else
> +# else
>      __ino_t __st_ino;			/* 32bit file serial number.	*/
> -#endif
> -#ifndef __x86_64__
> +# endif
> +# ifndef __x86_64__
>      __mode_t st_mode;			/* File mode.  */
>      __nlink_t st_nlink;			/* Link count.  */
> -#else
> +# else
>      __nlink_t st_nlink;		/* Link count.  */
>      __mode_t st_mode;		/* File mode.  */
> -#endif
> +# endif
>      __uid_t st_uid;		/* User ID of the file's owner.	*/
>      __gid_t st_gid;		/* Group ID of the file's group.*/
> -#ifdef __x86_64__
> +# ifdef __x86_64__
>      int __pad0;
> -#endif
> +# endif
>      __dev_t st_rdev;		/* Device number, if device.  */
> -#ifndef __x86_64__
> +# ifndef __x86_64__
>      unsigned short int __pad2;
> -#endif
> -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
> +# endif
> +# if defined __x86_64__ || !defined __USE_FILE_OFFSET64
>      __off_t st_size;			/* Size of file, in bytes.  */
> -#else
> +# else
>      __off64_t st_size;			/* Size of file, in bytes.  */
> -#endif
> +# endif
>      __blksize_t st_blksize;	/* Optimal block size for I/O.  */
> -#if defined __x86_64__  || !defined __USE_FILE_OFFSET64
> +# if defined __x86_64__  || !defined __USE_FILE_OFFSET64
>      __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#else
> +# else
>      __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
> -#endif
> -#ifdef __USE_XOPEN2K8
> +# endif
> +# ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -71,58 +74,62 @@ struct stat
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> -# define st_mtime st_mtim.tv_sec
> -# define st_ctime st_ctim.tv_sec
> -#else
> +#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
> +#  define st_mtime st_mtim.tv_sec
> +#  define st_ctime st_ctim.tv_sec
> +# else
>      __time_t st_atime;			/* Time of last access.  */
>      __syscall_ulong_t st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change.  */
> -#endif
> -#ifdef __x86_64__
> +# endif
> +# ifdef __x86_64__
>      __syscall_slong_t __glibc_reserved[3];
> -#else
> -# ifndef __USE_FILE_OFFSET64
> +# else
> +#  ifndef __USE_FILE_OFFSET64
>      unsigned long int __glibc_reserved4;
>      unsigned long int __glibc_reserved5;
> -# else
> +#  else
>      __ino64_t st_ino;			/* File serial number.	*/
> +#  endif
>  # endif
> -#endif
> +#endif /* __USE_TIME_BITS64  */
>    };
>  
>  #ifdef __USE_LARGEFILE64
>  /* Note stat64 has the same shape as stat for x86-64.  */
>  struct stat64
>    {
> +# ifdef __USE_TIME_BITS64
> +#  include <bits/struct_stat_time64_helper.h>

OK. Use helper.

> +# else
>      __dev_t st_dev;		/* Device.  */
> -# ifdef __x86_64__
> +#  ifdef __x86_64__
>      __ino64_t st_ino;		/* File serial number.  */
>      __nlink_t st_nlink;		/* Link count.  */
>      __mode_t st_mode;		/* File mode.  */
> -# else
> +#  else
>      unsigned int __pad1;
>      __ino_t __st_ino;			/* 32bit file serial number.	*/
>      __mode_t st_mode;			/* File mode.  */
>      __nlink_t st_nlink;			/* Link count.  */
> -# endif
> +#  endif
>      __uid_t st_uid;		/* User ID of the file's owner.	*/
>      __gid_t st_gid;		/* Group ID of the file's group.*/
> -# ifdef __x86_64__
> +#  ifdef __x86_64__
>      int __pad0;
>      __dev_t st_rdev;		/* Device number, if device.  */
>      __off_t st_size;		/* Size of file, in bytes.  */
> -# else
> +#  else
>      __dev_t st_rdev;			/* Device number, if device.  */
>      unsigned int __pad2;
>      __off64_t st_size;			/* Size of file, in bytes.  */
> -# endif
> +#  endif
>      __blksize_t st_blksize;	/* Optimal block size for I/O.  */
>      __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
> -# ifdef __USE_XOPEN2K8
> +#  ifdef __USE_XOPEN2K8
>      /* Nanosecond resolution timestamps are stored in a format
>         equivalent to 'struct timespec'.  This is the type used
>         whenever possible but the Unix namespace rules do not allow the
> @@ -132,19 +139,20 @@ struct stat64
>      struct timespec st_atim;		/* Time of last access.  */
>      struct timespec st_mtim;		/* Time of last modification.  */
>      struct timespec st_ctim;		/* Time of last status change.  */
> -# else
> +#  else
>      __time_t st_atime;			/* Time of last access.  */
>      __syscall_ulong_t st_atimensec;	/* Nscecs of last access.  */
>      __time_t st_mtime;			/* Time of last modification.  */
>      __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification.  */
>      __time_t st_ctime;			/* Time of last status change.  */
>      __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change.  */
> -# endif
> -# ifdef __x86_64__
> +#  endif
> +#  ifdef __x86_64__
>      __syscall_slong_t __glibc_reserved[3];
> -# else
> +#  else
>      __ino64_t st_ino;			/* File serial number.		*/
> -# endif
> +#  endif
> +# endif /* __USE_TIME_BITS64  */
>    };
>  #endif
>  
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 14/25] y2038: Use a common definition for msqid_ds
  2021-05-18 20:56 ` [PATCH v2 14/25] y2038: Use a common definition for msqid_ds Adhemerval Zanella
@ 2021-06-04 19:38   ` Carlos O'Donell
  2021-06-07 18:29     ` Adhemerval Zanella
  0 siblings, 1 reply; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:38 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> From: Lukasz Majewski <lukma@denx.de>
> 
> Instead of replicate the same definitions from struct_msqid64_ds.h
> on the multiple struct_msqid_ds.h, use a common header which is included
> when required (struct_msqid64_ds_helper.h).
> 
> The __USE_TIME_BITS64 is not defined internally yet, although the
> internal header is used when building the 64-bit stat implementations.

Requesting a v3 please.

Please add the __glibc_reserved* members to the structures to preserve
maximum compatibility with the kernel structure.

What I would like to see is that __glibc_reserved4 and __glibc_reserved5
are *preserved* for both ABIs in the dual-time case. The kernel for msqid
still has the following:

 26 struct msqid64_ds {
 27         struct ipc64_perm msg_perm;
 28 #if __BITS_PER_LONG == 64
 29         long             msg_stime;     /* last msgsnd time */
 30         long             msg_rtime;     /* last msgrcv time */
 31         long             msg_ctime;     /* last change time */
 32 #else
 33         unsigned long   msg_stime;      /* last msgsnd time */
 34         unsigned long   msg_stime_high;
 35         unsigned long   msg_rtime;      /* last msgrcv time */
 36         unsigned long   msg_rtime_high;
 37         unsigned long   msg_ctime;      /* last change time */
 38         unsigned long   msg_ctime_high;
 39 #endif
 40         unsigned long   msg_cbytes;     /* current number of bytes on queue */
 41         unsigned long   msg_qnum;       /* number of messages in queue */
 42         unsigned long    msg_qbytes;    /* max number of bytes on queue */
 43         __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
 44         __kernel_pid_t msg_lrpid;       /* last receive pid */
 45         unsigned long    __unused4;
 46         unsigned long    __unused5;
 47 };

For maximum compatibility with future kernel changes we should keep
the unused fields in the glibc equivalent structure. If the values are
ever used then they would already be allocated as part of the size of
the structure without the need for an ABI change. Given that these are
somewhat legacy APIs we should be aiming for preserving existing behaviour
rather than aiming for the smallest possible size structure.

On i686 the new 64-bit time_t struct is only 80 bytes, while the original
struct size is 88 bytes. Adding the reserved entries brings this back to
88 bytes in the new ABI. We can add static asserts if we think we need to
check exactly for alignment of 64-bit time_t, but since we copy from a
kernel structure I'm largely worried about the ABI being too small to cary
the information that we might need to copy from the matching kernel struct.

See my suggestions below for changes.

> ---
>  sysdeps/unix/sysv/linux/Makefile              |  3 +-
>  .../linux/bits/struct_stat_time64_helper.h    |  2 +-
>  .../sysv/linux/bits/types/struct_msqid64_ds.h | 10 +------
>  .../bits/types/struct_msqid64_ds_helper.h     | 28 +++++++++++++++++++
>  .../sysv/linux/bits/types/struct_msqid_ds.h   | 12 ++++++--
>  .../linux/hppa/bits/types/struct_msqid_ds.h   | 12 ++++++--
>  .../linux/mips/bits/types/struct_msqid_ds.h   | 18 ++++++++----
>  .../powerpc/bits/types/struct_msqid_ds.h      | 12 ++++++--
>  .../linux/sparc/bits/types/struct_msqid_ds.h  | 12 ++++++--
>  9 files changed, 80 insertions(+), 29 deletions(-)
>  create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
> 
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index f83f147ed1..193b7c46b9 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -101,7 +101,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
>  		  bits/types/struct_shmid_ds.h \
>  		  bits/ipc-perm.h \
>  		  bits/struct_stat.h \
> -		  bits/struct_stat_time64_helper.h
> +		  bits/struct_stat_time64_helper.h \
> +		  bits/types/struct_msqid64_ds_helper.h

OK. Create new helper.

>  
>  tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
>  	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
> diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
> index 77385e9073..b37056f5c4 100644
> --- a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
> +++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
> @@ -1,4 +1,4 @@
> -/* Definition for helper to define struct stat with 64 bit time.
> +/* Common defitions for struct stat with 64 bit time.

This is a spurious cleanup from the last patch IMO. If possible please move it
into the previous commit.

s/defitions/definitions/g

>     Copyright (C) 2021 Free Software Foundation, Inc.
>     This file is part of the GNU C Library.
>  
> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
> index 43e8cd7cfc..992734914a 100644
> --- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
> @@ -25,14 +25,6 @@
>  #else
>  struct __msqid64_ds
>  {
> -  struct ipc_perm msg_perm;	/* structure describing operation permission */
> -  __time64_t msg_stime;		/* time of last msgsnd command */
> -  __time64_t msg_rtime;		/* time of last msgsnd command */
> -  __time64_t msg_ctime;		/* time of last change */
> -  __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
> -  msgqnum_t msg_qnum;		/* number of messages currently on queue */
> -  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
> -  __pid_t msg_lspid;		/* pid of last msgsnd() */
> -  __pid_t msg_lrpid;		/* pid of last msgrcv() */
> +# include <bits/types/struct_msqid64_ds_helper.h>

OK. Used unconditionally since this is 64-bit time_t.

>  };
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
> new file mode 100644
> index 0000000000..02dfddaa2b
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
> @@ -0,0 +1,28 @@
> +/* Common defintions for struct msqid_ds with 64 bit time.

s/defintions/definitions/g

> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library.  If not, see
> +   <https://www.gnu.org/licenses/>.  */
> +

Reviewing...

> +  /* Content of internal __msqid64_ds.  */
> +  struct ipc_perm msg_perm;	/* structure describing operation permission */

OK.

> +  __time64_t msg_stime;		/* time of last msgsnd command */
> +  __time64_t msg_rtime;		/* time of last msgsnd command */
> +  __time64_t msg_ctime;		/* time of last change */

OK. Usually a tuple of * and *_high (endian swapping for order applied).

> +  __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */

OK.

> +  msgqnum_t msg_qnum;		/* number of messages currently on queue */

OK.

> +  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */

OK.

> +  __pid_t msg_lspid;		/* pid of last msgsnd() */
> +  __pid_t msg_lrpid;		/* pid of last msgrcv() */

OK.

Add __glibc_reserved4/5 entries here.

> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h
> index 1ed041ae30..ae10a48452 100644
> --- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h
> @@ -20,23 +20,28 @@
>  # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
>  #endif
>  
> +#include <bits/types/time_t.h>
> +
>  /* Structure of record for one message inside the kernel.
>     The type `struct msg' is opaque.  */
>  struct msqid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_msqid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm msg_perm;	/* structure describing operation permission */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    __time_t msg_stime;		/* time of last msgsnd command */
>    unsigned long int __msg_stime_high;
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    unsigned long int __msg_rtime_high;
>    __time_t msg_ctime;		/* time of last change */
>    unsigned long int __msg_ctime_high;
> -#else
> +# else
>    __time_t msg_stime;		/* time of last msgsnd command */
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    __time_t msg_ctime;		/* time of last change */
> -#endif
> +# endif
>    __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
>    msgqnum_t msg_qnum;		/* number of messages currently on queue */
>    msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
> @@ -44,4 +49,5 @@ struct msqid_ds
>    __pid_t msg_lrpid;		/* pid of last msgrcv() */
>    __syscall_ulong_t __glibc_reserved4;
>    __syscall_ulong_t __glibc_reserved5;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h
> index d943edeb78..5b82dd7f5e 100644
> --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h
> +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h
> @@ -20,23 +20,28 @@
>  # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
>  #endif
>  
> +#include <bits/types/time_t.h>
> +
>  /* Structure of record for one message inside the kernel.
>     The type `struct msg' is opaque.  */
>  struct msqid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_msqid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm msg_perm;	/* structure describing operation permission */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    unsigned long int __msg_stime_high;
>    __time_t msg_stime;		/* time of last msgsnd command */
>    unsigned long int __msg_rtime_high;
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    unsigned long int __msg_ctime_high;
>    __time_t msg_ctime;		/* time of last change */
> -#else
> +# else
>    __time_t msg_stime;		/* time of last msgsnd command */
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    __time_t msg_ctime;		/* time of last change */
> -#endif
> +# endif
>    __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
>    msgqnum_t msg_qnum;		/* number of messages currently on queue */
>    msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
> @@ -44,4 +49,5 @@ struct msqid_ds
>    __pid_t msg_lrpid;		/* pid of last msgrcv() */
>    __syscall_ulong_t __glibc_reserved4;
>    __syscall_ulong_t __glibc_reserved5;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h
> index bdca5e5fe2..00c1804245 100644
> --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h
> +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h
> @@ -20,32 +20,37 @@
>  # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
>  #endif
>  
> +#include <bits/types/time_t.h>
> +
>  /* Structure of record for one message inside the kernel.
>     The type `struct msg' is opaque.  */
>  struct msqid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_msqid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm msg_perm;	/* structure describing operation permission */
> -#if __TIMESIZE == 32
> -# ifdef __MIPSEL__
> +# if __TIMESIZE == 32
> +#  ifdef __MIPSEL__
>    __time_t msg_stime;		/* time of last msgsnd command */
>    unsigned long int __msg_stime_high;
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    unsigned long int __msg_rtime_high;
>    __time_t msg_ctime;		/* time of last change */
>    unsigned long int __msg_ctime_high;
> -# else
> +#  else
>    unsigned long int __msg_stime_high;
>    __time_t msg_stime;		/* time of last msgsnd command */
>    unsigned long int __msg_rtime_high;
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    unsigned long int __msg_ctime_high;
>    __time_t msg_ctime;		/* time of last change */
> -# endif
> -#else
> +#  endif
> +# else
>    __time_t msg_stime;		/* time of last msgsnd command */
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    __time_t msg_ctime;		/* time of last change */
> -#endif
> +# endif
>    __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
>    msgqnum_t msg_qnum;		/* number of messages currently on queue */
>    msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
> @@ -53,4 +58,5 @@ struct msqid_ds
>    __pid_t msg_lrpid;		/* pid of last msgrcv() */
>    __syscall_ulong_t __glibc_reserved4;
>    __syscall_ulong_t __glibc_reserved5;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h
> index 72842ed747..8c296d2342 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h
> @@ -20,23 +20,28 @@
>  # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
>  #endif
>  
> +#include <bits/types/time_t.h>
> +
>  /* Structure of record for one message inside the kernel.
>     The type `struct msg' is opaque.  */
>  struct msqid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_msqid64_ds_helper.h>

OK.

> +#else
>    struct ipc_perm msg_perm;	/* structure describing operation permission */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    unsigned long int __msg_stime_high;
>    __time_t msg_stime;		/* time of last msgsnd command */
>    unsigned long int __msg_rtime_high;
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    unsigned long int __msg_ctime_high;
>    __time_t msg_ctime;		/* time of last change */
> -#else
> +# else
>    __time_t msg_stime;		/* time of last msgsnd command */
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    __time_t msg_ctime;		/* time of last change */
> -#endif
> +# endif
>    __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
>    msgqnum_t msg_qnum;		/* number of messages currently on queue */
>    msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
> @@ -44,4 +49,5 @@ struct msqid_ds
>    __pid_t msg_lrpid;		/* pid of last msgrcv() */
>    __syscall_ulong_t __glibc_reserved4;
>    __syscall_ulong_t __glibc_reserved5;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h
> index 22e1839de1..3c1b68ccc0 100644
> --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h
> +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h
> @@ -20,23 +20,28 @@
>  # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
>  #endif
>  
> +#include <bits/types/time_t.h>
> +
>  /* Structure of record for one message inside the kernel.
>     The type `struct msg' is opaque.  */
>  struct msqid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_msqid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm msg_perm;	/* structure describing operation permission */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    unsigned long int __msg_stime_high;
>    __time_t msg_stime;		/* time of last msgsnd command */
>    unsigned long int __msg_rtime_high;
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    unsigned long int __msg_ctime_high;
>    __time_t msg_ctime;		/* time of last change */
> -#else
> +# else
>    __time_t msg_stime;		/* time of last msgsnd command */
>    __time_t msg_rtime;		/* time of last msgsnd command */
>    __time_t msg_ctime;		/* time of last change */
> -#endif
> +# endif
>    __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
>    msgqnum_t msg_qnum;		/* number of messages currently on queue */
>    msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
> @@ -44,4 +49,5 @@ struct msqid_ds
>    __pid_t msg_lrpid;		/* pid of last msgrcv() */
>    __syscall_ulong_t __glibc_reserved4;
>    __syscall_ulong_t __glibc_reserved5;
> +#endif
>  };
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 15/25] y2038: Use a common definition for semid_ds
  2021-05-18 20:56 ` [PATCH v2 15/25] y2038: Use a common definition for semid_ds Adhemerval Zanella
  2021-05-19  9:09   ` Lukasz Majewski
@ 2021-06-04 19:38   ` Carlos O'Donell
  2021-06-07 18:46     ` Adhemerval Zanella
  1 sibling, 1 reply; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:38 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> Instead of replicate the same definitions from struct_semid64_ds.h
> on the multiple struct_semid_ds.h, use a common header which is included
> when required (struct_semid64_ds_helper.h).
> 
> The __USE_TIME_BITS64 is not defined internally yet, although the
> internal header is used when building the 64-bit semctl implementation.

Requesting a v3 please.

Similar to 14/25, we should add the __glibc_reserved* members to the
structure to preserve maximum compatibility with the kernel structure.

The original struct semid_ds is 64 bytes on i686 with high-low time pairs
and only 56 bytes in the 64-bit time_t version. With the two reserved
members added back it's 64 bytes in both ABIs.

We could add some static asserts if we really want to be thorough about
the alignment of __time64_t.

> ---
>  sysdeps/unix/sysv/linux/Makefile              |  3 ++-
>  .../sysv/linux/bits/types/struct_semid64_ds.h |  5 +---
>  .../bits/types/struct_semid64_ds_helper.h     | 23 +++++++++++++++++++
>  .../sysv/linux/bits/types/struct_semid_ds.h   | 10 +++++---
>  .../linux/hppa/bits/types/struct_semid_ds.h   |  4 ++++
>  .../linux/mips/bits/types/struct_semid_ds.h   |  4 ++++
>  .../powerpc/bits/types/struct_semid_ds.h      | 10 +++++---
>  .../linux/sparc/bits/types/struct_semid_ds.h  | 10 +++++---
>  .../linux/x86/bits/types/struct_semid_ds.h    |  4 ++++
>  9 files changed, 59 insertions(+), 14 deletions(-)
>  create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
> 
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 193b7c46b9..b599c423ed 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -102,7 +102,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
>  		  bits/ipc-perm.h \
>  		  bits/struct_stat.h \
>  		  bits/struct_stat_time64_helper.h \
> -		  bits/types/struct_msqid64_ds_helper.h
> +		  bits/types/struct_msqid64_ds_helper.h \
> +		  bits/types/struct_semid64_ds_helper.h

OK. Add helper.

>  
>  tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
>  	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
> index 7263e50bbf..adaee3eb9e 100644
> --- a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
> @@ -25,9 +25,6 @@
>  #else
>  struct __semid64_ds
>  {
> -  struct ipc_perm sem_perm;		/* operation permission struct */
> -  __time64_t sem_otime;			/* last semop() time */
> -  __time64_t sem_ctime;			/* last time changed by semctl() */
> -  __syscall_ulong_t sem_nsems;		/* number of semaphores in set */
> +# include <bits/types/struct_semid64_ds_helper.h>

OK. Use helper.

>  };
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
> new file mode 100644
> index 0000000000..ea60b671f1
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
> @@ -0,0 +1,23 @@
> +/* Common definitions for struct semid_ds with 64 bit time.
> +   Copyright (C) 2020-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +  /* Content of internal __semid64_ds.  */
> +  struct ipc_perm sem_perm;		/* operation permission struct */
> +  __time64_t sem_otime;			/* last semop() time */
> +  __time64_t sem_ctime;			/* last time changed by semctl() */
> +  __syscall_ulong_t sem_nsems;		/* number of semaphores in set */

Definitions look good.

Needs __glibc_reserved3 and __glibc_reserved4.

> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h
> index 2f32fa500e..a7b2c9022e 100644
> --- a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h
> @@ -23,17 +23,21 @@
>  /* Data structure describing a set of semaphores.  */
>  struct semid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>

OK. Use in new abi.

> +#else
>    struct ipc_perm sem_perm;        /* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    __time_t sem_otime;              /* last semop() time */
>    __syscall_ulong_t __sem_otime_high;
>    __time_t sem_ctime;             /* last time changed by semctl() */
>    __syscall_ulong_t __sem_ctime_high;
> -#else
> +# else
>    __time_t sem_otime;
>    __time_t sem_ctime;
> -#endif
> +# endif
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h
> index 16a9735e7b..5067fb1572 100644
> --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h
> +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h
> @@ -23,6 +23,9 @@
>  /* Data structure describing a set of semaphores.  */
>  struct semid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm sem_perm;   /* operation permission struct */
>    __syscall_ulong_t __sem_otime_high;
>    __time_t sem_otime;         /* last semop() time */
> @@ -31,4 +34,5 @@ struct semid_ds
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h
> index 73587ea634..ee9a1e5e61 100644
> --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h
> +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h
> @@ -23,10 +23,14 @@
>  /* Data structure describing a set of semaphores.  */
>  struct semid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm sem_perm;		/* operation permission struct */
>    __time_t sem_otime;	/* last semop() time */
>    __time_t sem_ctime;	/* last time changed by semctl() */
>    __syscall_ulong_t sem_nsems;		/* number of semaphores in set */
>    __syscall_ulong_t __sem_otime_high;
>    __syscall_ulong_t __sem_ctime_high;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h
> index 8fdbc5d776..0c080fed61 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h
> @@ -23,17 +23,21 @@
>  /* Data structure describing a set of semaphores.  */
>  struct semid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm sem_perm;   /* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    __syscall_ulong_t __sem_otime_high;
>    __time_t sem_otime;         /* last semop() time */
>    __syscall_ulong_t __sem_ctime_high;
>    __time_t sem_ctime;        /* last time changed by semctl() */
> -#else
> +# else
>    __time_t sem_otime;         /* last semop() time */
>    __time_t sem_ctime;         /* last time changed by semctl() */
> -#endif
> +# endif
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h
> index 6b9b3639b2..76810427f6 100644
> --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h
> +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h
> @@ -23,17 +23,21 @@
>  /* Data structure describing a set of semaphores.  */
>  struct semid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm sem_perm;   /* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>    __syscall_ulong_t __sem_otime_high;
>    __time_t sem_otime;         /* last semop() time */
>    __syscall_ulong_t __sem_ctime_high;
>    __time_t sem_ctime;        /* last time changed by semctl() */
> -#else
> +# else
>    __time_t sem_otime;         /* last semop() time */
>    __time_t sem_ctime;         /* last time changed by semctl() */
> -#endif
> +# endif
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> diff --git a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h
> index 90f03b2407..affd38b6bd 100644
> --- a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h
> +++ b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h
> @@ -23,6 +23,9 @@
>  /* Data structure describing a set of semaphores.  */
>  struct semid_ds
>  {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_semid64_ds_helper.h>

OK. Use helper.

> +#else
>    struct ipc_perm sem_perm;   /* operation permission struct */
>    __time_t sem_otime;  /* last semop() time */
>    __syscall_ulong_t __sem_otime_high;
> @@ -31,4 +34,5 @@ struct semid_ds
>    __syscall_ulong_t sem_nsems;    /* number of semaphores in set */
>    __syscall_ulong_t __glibc_reserved3;
>    __syscall_ulong_t __glibc_reserved4;
> +#endif
>  };
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 16/25] y2038: Use a common definition for shmid_ds
  2021-05-18 20:56 ` [PATCH v2 16/25] y2038: Use a common definition for shmid_ds Adhemerval Zanella
  2021-05-19  9:09   ` Lukasz Majewski
@ 2021-06-04 19:38   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:38 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> Instead of replicate the same definitions from struct_shmid64_ds.h
> on the multiple struct_shmid_ds.h, use a common header which is included
> when required (struct_shmid64_ds_helper.h).
> 
> The __USE_TIME_BITS64 is not defined internally yet, although the
> internal header is used when building the 64-bit semctl implementation.

Requesting a v3 please.

Similar to 14/25, we should add the __glibc_reserved* members to the
structures to preserve maximum compatibility with the kernel structure.

Before adding the reserved members the 64-bit time_t struct shmid_ds
is only 76 bytes on i686, and 84 bytes in the original when the types
should not really change in size. Adding the reserved entries makes
them match again.

We could add some static asserts if we really want to be thorough about
the alignment of __time64_t.

> ---
>  sysdeps/unix/sysv/linux/Makefile              |  3 ++-
>  .../sysv/linux/bits/types/struct_shmid64_ds.h |  9 +------
>  .../bits/types/struct_shmid64_ds_helper.h     | 26 +++++++++++++++++++
>  .../sysv/linux/bits/types/struct_shmid_ds.h   | 10 ++++---
>  .../linux/hppa/bits/types/struct_shmid_ds.h   | 10 ++++---
>  .../linux/mips/bits/types/struct_shmid_ds.h   | 14 ++++++----
>  .../powerpc/bits/types/struct_shmid_ds.h      | 10 ++++---
>  .../linux/sparc/bits/types/struct_shmid_ds.h  | 10 ++++---
>  8 files changed, 66 insertions(+), 26 deletions(-)
>  create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
> 
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index b599c423ed..747d1083e0 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -103,7 +103,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
>  		  bits/struct_stat.h \
>  		  bits/struct_stat_time64_helper.h \
>  		  bits/types/struct_msqid64_ds_helper.h \
> -		  bits/types/struct_semid64_ds_helper.h
> +		  bits/types/struct_semid64_ds_helper.h \
> +		  bits/types/struct_shmid64_ds_helper.h

OK. Add new helper.

>  
>  tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
>  	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h
> index 71100db1b5..a4af8cc5f4 100644
> --- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h
> @@ -25,13 +25,6 @@
>  #else
>  struct __shmid64_ds
>  {
> -  struct ipc_perm shm_perm;	/* operation permission struct */
> -  size_t shm_segsz;		/* size of segment in bytes */
> -  __time64_t shm_atime;		/* time of last shmat() */
> -  __time64_t shm_dtime;		/* time of last shmdt() */
> -  __time64_t shm_ctime;		/* time of last change by shmctl() */
> -  __pid_t shm_cpid;		/* pid of creator */
> -  __pid_t shm_lpid;		/* pid of last shmop */
> -  shmatt_t shm_nattch;		/* number of current attaches */
> +# include <bits/types/struct_shmid64_ds_helper.h>

OK. Use helper.

>  };
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
> new file mode 100644
> index 0000000000..8ab0937c4d
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
> @@ -0,0 +1,26 @@
> +/* Common definitions for struct semid_ds with 64 bit time.
> +   Copyright (C) 2020-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +  struct ipc_perm shm_perm;	/* operation permission struct */
> +  size_t shm_segsz;		/* size of segment in bytes */
> +  __time64_t shm_atime;		/* time of last shmat() */
> +  __time64_t shm_dtime;		/* time of last shmdt() */
> +  __time64_t shm_ctime;		/* time of last change by shmctl() */
> +  __pid_t shm_cpid;		/* pid of creator */
> +  __pid_t shm_lpid;		/* pid of last shmop */
> +  shmatt_t shm_nattch;		/* number of current attaches */

This looks good but needs __glibc_reserved5 and __glibc_reserved6 entries.

> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h
> index 2bd587d2b0..5f8ac6257b 100644
> --- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h
> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h
> @@ -23,23 +23,27 @@
>  /* Data structure describing a shared memory segment.  */
>  struct shmid_ds
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>

OK. Use helper.

> +#else
>      struct ipc_perm shm_perm;		/* operation permission struct */
>      size_t shm_segsz;			/* size of segment in bytes */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      __time_t shm_atime;			/* time of last shmat() */
>      unsigned long int __shm_atime_high;
>      __time_t shm_dtime;			/* time of last shmdt() */
>      unsigned long int __shm_dtime_high;
>      __time_t shm_ctime;			/* time of last change by shmctl() */
>      unsigned long int __shm_ctime_high;
> -#else
> +# else
>      __time_t shm_atime;			/* time of last shmat() */
>      __time_t shm_dtime;			/* time of last shmdt() */
>      __time_t shm_ctime;			/* time of last change by shmctl() */
> -#endif
> +# endif
>      __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current attaches */
>      __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +#endif
>    };
> diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h
> index 47ff80ebb0..7831fd7340 100644
> --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h
> +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h
> @@ -23,8 +23,11 @@
>  /* Data structure describing a shared memory segment.  */
>  struct shmid_ds
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>

OK. Use helper.

> +#else
>      struct ipc_perm shm_perm;		/* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      unsigned long int __shm_atime_high;
>      __time_t shm_atime;			/* time of last shmat() */
>      unsigned long int __shm_dtime_high;
> @@ -32,15 +35,16 @@ struct shmid_ds
>      unsigned long int __shm_ctime_high;
>      __time_t shm_ctime;			/* time of last change by shmctl() */
>      unsigned long int __glibc_reserved4;
> -#else
> +# else
>      __time_t shm_atime;			/* time of last shmat() */
>      __time_t shm_dtime;			/* time of last shmdt() */
>      __time_t shm_ctime;			/* time of last change by shmctl() */
> -#endif
> +# endif
>      size_t shm_segsz;			/* size of segment in bytes */
>      __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current attaches */
>      __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +#endif
>    };
> diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h
> index 7f8f3b9c51..0691a610ae 100644
> --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h
> +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h
> @@ -23,27 +23,31 @@
>  /* Data structure describing a shared memory segment.  */
>  struct shmid_ds
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>

OK. Use helper.

> +#else
>      struct ipc_perm shm_perm;		/* operation permission struct */
>      size_t shm_segsz;			/* size of segment in bytes */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      __time_t shm_atime;			/* time of last shmat() */
>      __time_t shm_dtime;			/* time of last shmdt() */
>      __time_t shm_ctime;			/* time of last change by shmctl() */
> -#else
> +# else
>      __time_t shm_atime;			/* time of last shmat() */
>      __time_t shm_dtime;			/* time of last shmdt() */
>      __time_t shm_ctime;			/* time of last change by shmctl() */
> -#endif
> +# endif
>      __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current attaches */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      unsigned short int __shm_atime_high;
>      unsigned short int __shm_dtime_high;
>      unsigned short int __shm_ctime_high;
>      unsigned short int __glibc_reserved4;
> -#else
> +# else
>      __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +# endif
>  #endif
>    };
> diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h
> index d71bdf1ecf..316d43ec99 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h
> @@ -23,8 +23,11 @@
>  /* Data structure describing a shared memory segment.  */
>  struct shmid_ds
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>

OK. Use helper.

> +#else
>      struct ipc_perm shm_perm;		/* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      unsigned long int __shm_atime_high;
>      __time_t shm_atime;			/* time of last shmat() */
>      unsigned long int __shm_dtime_high;
> @@ -32,15 +35,16 @@ struct shmid_ds
>      unsigned long int __shm_ctime_high;
>      __time_t shm_ctime;			/* time of last change by shmctl() */
>      unsigned long int __glibc_reserved4;
> -#else
> +# else
>      __time_t shm_atime;			/* time of last shmat() */
>      __time_t shm_dtime;			/* time of last shmdt() */
>      __time_t shm_ctime;			/* time of last change by shmctl() */
> -#endif
> +# endif
>      size_t shm_segsz;			/* size of segment in bytes */
>      __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current attaches */
>      __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +#endif
>    };
> diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h
> index 767099803f..86f0cedac3 100644
> --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h
> +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h
> @@ -23,23 +23,27 @@
>  /* Data structure describing a shared memory segment.  */
>  struct shmid_ds
>    {
> +#ifdef __USE_TIME_BITS64
> +# include <bits/types/struct_shmid64_ds_helper.h>

OK. Use helper.

> +#else
>      struct ipc_perm shm_perm;		/* operation permission struct */
> -#if __TIMESIZE == 32
> +# if __TIMESIZE == 32
>      unsigned long int __shm_atime_high;
>      __time_t shm_atime;			/* time of last shmat() */
>      unsigned long int __shm_dtime_high;
>      __time_t shm_dtime;			/* time of last shmdt() */
>      unsigned long int __shm_ctime_high;
>      __time_t shm_ctime;			/* time of last change by shmctl() */
> -#else
> +# else
>      __time_t shm_atime;			/* time of last shmat() */
>      __time_t shm_dtime;			/* time of last shmdt() */
>      __time_t shm_ctime;			/* time of last change by shmctl() */
> -#endif
> +# endif
>      size_t shm_segsz;			/* size of segment in bytes */
>      __pid_t shm_cpid;			/* pid of creator */
>      __pid_t shm_lpid;			/* pid of last shmop */
>      shmatt_t shm_nattch;		/* number of current attaches */
>      __syscall_ulong_t __glibc_reserved5;
>      __syscall_ulong_t __glibc_reserved6;
> +#endif
>    };
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 17/25] y2038: Add __USE_TIME_BITS64 support for socket-constants.h
  2021-05-18 20:56 ` [PATCH v2 17/25] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Adhemerval Zanella
  2021-05-19  9:13   ` Lukasz Majewski
@ 2021-06-04 19:38   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:38 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> It is only used for !__USE_MISC, the default way uses the kernel
> headers.  The patch also adds the SO_TIMESTAMP, SO_TIMESTAMPNS, and
> SO_TIMESTAMPING which uses new values for 64 bit time_t kernel
> interfaces.
> 
> The __USE_TIME_BITS64 is not defined internally yet, although the
> internal header is used when building the 64-bit stat implementations.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  .../unix/sysv/linux/bits/socket-constants.h   | 47 +++++++++++++++----
>  .../sysv/linux/hppa/bits/socket-constants.h   | 36 +++++++++++++-
>  .../sysv/linux/mips/bits/socket-constants.h   | 36 +++++++++++++-
>  .../linux/powerpc/bits/socket-constants.h     | 36 +++++++++++++-
>  .../sysv/linux/sparc/bits/socket-constants.h  | 36 +++++++++++++-
>  5 files changed, 175 insertions(+), 16 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/bits/socket-constants.h b/sysdeps/unix/sysv/linux/bits/socket-constants.h
> index 84f7a333a2..c52e72bb73 100644
> --- a/sysdeps/unix/sysv/linux/bits/socket-constants.h
> +++ b/sysdeps/unix/sysv/linux/bits/socket-constants.h
> @@ -32,19 +32,50 @@
>  #define SO_OOBINLINE 10
>  #define SO_RCVBUF 8
>  #define SO_RCVLOWAT 18
> -#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
> -     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
> -# define SO_RCVTIMEO 66
> -#else
> -# define SO_RCVTIMEO 20
> -#endif
>  #define SO_REUSEADDR 2
>  #define SO_SNDBUF 7
>  #define SO_SNDLOWAT 19
> +#define SO_TYPE 3
> +
>  #if (__TIMESIZE == 64 && __WORDSIZE == 32 \
>       && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
> +# define SO_RCVTIMEO 66
>  # define SO_SNDTIMEO 67
> +# define SO_TIMESTAMP 63
> +# define SO_TIMESTAMPNS 64
> +# define SO_TIMESTAMPING 65
>  #else
> -# define SO_SNDTIMEO 21
> +# if __TIMESIZE == 64
> +#  define SO_RCVTIMEO 20
> +#  define SO_SNDTIMEO 21
> +#  define SO_TIMESTAMP 29
> +#  define SO_TIMESTAMPNS 35
> +#  define SO_TIMESTAMPING 37
> +# else
> +#  define SO_RCVTIMEO_OLD 20
> +#  define SO_SNDTIMEO_OLD 21
> +#  define SO_RCVTIMEO_NEW 66
> +#  define SO_SNDTIMEO_NEW 67
> +
> +#  define SO_TIMESTAMP_OLD 29
> +#  define SO_TIMESTAMPNS_OLD 35
> +#  define SO_TIMESTAMPING_OLD 37
> +#  define SO_TIMESTAMP_NEW 63
> +#  define SO_TIMESTAMPNS_NEW 64
> +#  define SO_TIMESTAMPING_NEW 65
> +
> +#  ifdef __USE_TIME_BITS64
> +#   define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#   define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#   define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#   define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#   define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +#  else
> +#   define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#   define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#   define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#   define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#   define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +#  endif
> +# endif

OK.

>  #endif
> -#define SO_TYPE 3
> diff --git a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h
> index b4fb65b9f1..68b42d4606 100644
> --- a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h
> +++ b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h
> @@ -30,9 +30,41 @@
>  #define SO_OOBINLINE 256
>  #define SO_RCVBUF 4098
>  #define SO_RCVLOWAT 4100
> -#define SO_RCVTIMEO 4102
>  #define SO_REUSEADDR 4
>  #define SO_SNDBUF 4097
>  #define SO_SNDLOWAT 4099
> -#define SO_SNDTIMEO 4101
>  #define SO_TYPE 4104
> +
> +#if __TIMESIZE == 64
> +# define SO_RCVTIMEO 4102
> +# define SO_SNDTIMEO 4101
> +# define SO_TIMESTAMP 16402
> +# define SO_TIMESTAMPNS 16403
> +# define SO_TIMESTAMPING 16416
> +#else
> +# define SO_RCVTIMEO_OLD 4102
> +# define SO_SNDTIMEO_OLD 4101
> +# define SO_RCVTIMEO_NEW 16448
> +# define SO_SNDTIMEO_NEW 16449
> +
> +# define SO_TIMESTAMP_OLD 0x4012
> +# define SO_TIMESTAMPNS_OLD 0x4013
> +# define SO_TIMESTAMPING_OLD 0x4020
> +# define SO_TIMESTAMP_NEW 0x4038
> +# define SO_TIMESTAMPNS_NEW 0x4039
> +# define SO_TIMESTAMPING_NEW 0x403A
> +
> +# ifdef __USE_TIME_BITS64
> +#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +# else
> +#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +# endif

OK.

> +#endif
> diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h
> index a5264536e9..b18a854e99 100644
> --- a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h
> +++ b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h
> @@ -30,9 +30,41 @@
>  #define SO_OOBINLINE 256
>  #define SO_RCVBUF 4098
>  #define SO_RCVLOWAT 4100
> -#define SO_RCVTIMEO 4102
>  #define SO_REUSEADDR 4
>  #define SO_SNDBUF 4097
>  #define SO_SNDLOWAT 4099
> -#define SO_SNDTIMEO 4101
>  #define SO_TYPE 4104
> +
> +#if __TIMESIZE == 64
> +# define SO_RCVTIMEO 4102
> +# define SO_SNDTIMEO 4101
> +# define SO_TIMESTAMP 29
> +# define SO_TIMESTAMPNS 35
> +# define SO_TIMESTAMPING 37
> +#else
> +# define SO_RCVTIMEO_OLD 4102
> +# define SO_SNDTIMEO_OLD 4101
> +# define SO_RCVTIMEO_NEW 66
> +# define SO_SNDTIMEO_NEW 67
> +
> +# define SO_TIMESTAMP_OLD 29
> +# define SO_TIMESTAMPNS_OLD 35
> +# define SO_TIMESTAMPING_OLD 37
> +# define SO_TIMESTAMP_NEW 63
> +# define SO_TIMESTAMPNS_NEW 64
> +# define SO_TIMESTAMPING_NEW 65
> +
> +# ifdef __USE_TIME_BITS64
> +#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +# else
> +#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +# endif
> +#endif

OK.

> diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h
> index f35488b375..c03141bb8c 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h
> @@ -30,9 +30,41 @@
>  #define SO_OOBINLINE 10
>  #define SO_RCVBUF 8
>  #define SO_RCVLOWAT 16
> -#define SO_RCVTIMEO 18
>  #define SO_REUSEADDR 2
>  #define SO_SNDBUF 7
>  #define SO_SNDLOWAT 17
> -#define SO_SNDTIMEO 19
>  #define SO_TYPE 3
> +
> +#if __TIMESIZE == 64
> +# define SO_RCVTIMEO 18
> +# define SO_SNDTIMEO 19
> +# define SO_TIMESTAMP 29
> +# define SO_TIMESTAMPNS 35
> +# define SO_TIMESTAMPING 37
> +#else
> +# define SO_RCVTIMEO_OLD 18
> +# define SO_SNDTIMEO_OLD 19
> +# define SO_RCVTIMEO_NEW 66
> +# define SO_SNDTIMEO_NEW 67
> +
> +# define SO_TIMESTAMP_OLD 29
> +# define SO_TIMESTAMPNS_OLD 35
> +# define SO_TIMESTAMPING_OLD 37
> +# define SO_TIMESTAMP_NEW 63
> +# define SO_TIMESTAMPNS_NEW 64
> +# define SO_TIMESTAMPING_NEW 65
> +
> +# ifdef __USE_TIME_BITS64
> +#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +# else
> +#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
> +# endif
> +#endif

OK.

> diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
> index a58d0b5f96..5c4ed76c8c 100644
> --- a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
> +++ b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h
> @@ -30,9 +30,41 @@
>  #define SO_OOBINLINE 256
>  #define SO_RCVBUF 4098
>  #define SO_RCVLOWAT 2048
> -#define SO_RCVTIMEO 8192
>  #define SO_REUSEADDR 4
>  #define SO_SNDBUF 4097
>  #define SO_SNDLOWAT 4096
> -#define SO_SNDTIMEO 16384
>  #define SO_TYPE 4104
> +
> +#if __TIMESIZE == 64
> +# define SO_RCVTIMEO 8192
> +# define SO_SNDTIMEO 16384
> +# define SO_TIMESTAMP 29
> +# define SO_TIMESTAMPNS 33
> +# define SO_TIMESTAMPING 35
> +#else
> +# define SO_RCVTIMEO_OLD 8192
> +# define SO_SNDTIMEO_OLD 16384
> +# define SO_RCVTIMEO_NEW 68
> +# define SO_SNDTIMEO_NEW 69
> +
> +# define SO_TIMESTAMP_OLD 0x001d
> +# define SO_TIMESTAMPNS_OLD 0x0021
> +# define SO_TIMESTAMPING_OLD 0x0023
> +# define SO_TIMESTAMP_NEW 0x0046
> +# define SO_TIMESTAMPNS_NEW 0x0042
> +# define SO_TIMESTAMPING_NEW 0x0043
> +
> +# ifdef __USE_TIME_BITS64
> +#  define SO_RCVTIMEO SO_RCVTIMEO_NEW
> +#  define SO_SNDTIMEO SO_SNDTIMEO_NEW
> +#  define SO_TIMESTAMP SO_TIMESTAMP_NEW
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_NEW
> +# else
> +#  define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#  define SO_SNDTIMEO SO_SNDTIMEO_OLD
> +#  define SO_TIMESTAMP SO_TIMESTAMP_OLD
> +#  define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
> +#  define SO_TIMESTAMPING SO_TIMESTAMPING_OLD

OK.

> +# endif
> +#endif
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 18/25] time: Add 64 bit time support for getdate
  2021-05-18 20:56 ` [PATCH v2 18/25] time: Add 64 bit time support for getdate Adhemerval Zanella
  2021-05-19  9:15   ` Lukasz Majewski
@ 2021-06-04 19:38   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:38 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> The getdate is basically a wrapper localtime and mktime.  The 64 bit
> time support is done calling the 64 bit internal functions, there is
> no need to add a new symbol version.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  include/sys/stat.h |  2 +-
>  include/time.h     | 12 ++++++++++--
>  time/getdate.c     | 22 ++++++++++------------
>  time/tst-getdate.c | 14 ++++----------
>  4 files changed, 25 insertions(+), 25 deletions(-)
> 
> diff --git a/include/sys/stat.h b/include/sys/stat.h
> index b4c9344628..13e777b3c7 100644
> --- a/include/sys/stat.h
> +++ b/include/sys/stat.h
> @@ -46,7 +46,7 @@ hidden_proto (__lstat64)
>  hidden_proto (__fstatat64)
>  # endif
>  
> -# if __TIMESIZE == 64
> +# if __TIMESIZE == 64 || defined NO_RTLD_HIDDEN

OK. For hurd.

>  #  define __stat64_time64  __stat64
>  #  define __fstat64_time64  __fstat64
>  #  define __lstat64_time64  __lstat64
> diff --git a/include/time.h b/include/time.h
> index 4372bfbd96..980c6bd924 100644
> --- a/include/time.h
> +++ b/include/time.h
> @@ -283,8 +283,8 @@ hidden_proto (__nanosleep64)
>  #endif
>  
>  
> -extern int __getdate_r (const char *__string, struct tm *__resbufp)
> -  attribute_hidden;
> +extern int __getdate_r (const char *__string, struct tm *__resbufp);
> +libc_hidden_proto (__getdate_r);

OK.

>  
>  
>  /* Determine CLK_TCK value.  */
> @@ -509,6 +509,14 @@ time_now (void)
>    return ts.tv_sec;
>  }
>  
> +static inline __time64_t
> +time64_now (void)
> +{
> +  struct __timespec64 ts;
> +  __clock_gettime64 (TIME_CLOCK_GETTIME_CLOCKID, &ts);
> +  return ts.tv_sec;
> +}

OK.

> +
>  #define NSEC_PER_SEC    1000000000L  /* Nanoseconds per second.  */
>  #define USEC_PER_SEC    1000000L     /* Microseconds per second.  */
>  #define NSEC_PER_USEC   1000L        /* Nanoseconds per microsecond.  */
> diff --git a/time/getdate.c b/time/getdate.c
> index 6e2f75566b..cdcc898517 100644
> --- a/time/getdate.c
> +++ b/time/getdate.c
> @@ -112,16 +112,16 @@ __getdate_r (const char *string, struct tm *tp)
>    size_t len;
>    char *datemsk;
>    char *result = NULL;
> -  time_t timer;
> +  __time64_t timer;
>    struct tm tm;
> -  struct stat64 st;
> -  int mday_ok = 0;
> +  struct __stat64_t64 st;
> +  bool mday_ok = false;
>  
>    datemsk = getenv ("DATEMSK");
>    if (datemsk == NULL || *datemsk == '\0')
>      return 1;
>  
> -  if (__stat64 (datemsk, &st) < 0)
> +  if (__stat64_time64 (datemsk, &st) < 0)
>      return 3;
>  
>    if (!S_ISREG (st.st_mode))
> @@ -219,8 +219,8 @@ __getdate_r (const char *string, struct tm *tp)
>      return 7;
>  
>    /* Get current time.  */
> -  timer = time_now ();
> -  __localtime_r (&timer, &tm);
> +  timer = time64_now ();
> +  __localtime64_r (&timer, &tm);
>  
>    /* If only the weekday is given, today is assumed if the given day
>       is equal to the current day and next week if it is less.  */
> @@ -230,7 +230,7 @@ __getdate_r (const char *string, struct tm *tp)
>        tp->tm_year = tm.tm_year;
>        tp->tm_mon = tm.tm_mon;
>        tp->tm_mday = tm.tm_mday + (tp->tm_wday - tm.tm_wday + 7) % 7;
> -      mday_ok = 1;
> +      mday_ok = true;
>      }
>  
>    /* If only the month is given, the current month is assumed if the
> @@ -242,7 +242,7 @@ __getdate_r (const char *string, struct tm *tp)
>        if (tp->tm_year == INT_MIN)
>  	tp->tm_year = tm.tm_year + (((tp->tm_mon - tm.tm_mon) < 0) ? 1 : 0);
>        tp->tm_mday = first_wday (tp->tm_year, tp->tm_mon, tp->tm_wday);
> -      mday_ok = 1;
> +      mday_ok = true;
>      }
>  
>    /* If no hour, minute and second are given the current hour, minute
> @@ -285,15 +285,13 @@ __getdate_r (const char *string, struct tm *tp)
>       call normalizes the struct tm.  */
>    if ((!mday_ok && !check_mday (TM_YEAR_BASE + tp->tm_year, tp->tm_mon,
>  				tp->tm_mday))
> -      || mktime (tp) == (time_t) -1)
> +      || __mktime64 (tp) == (time_t) -1)
>      return 8;
>  
>    return 0;
>  }
> -#ifdef weak_alias
>  weak_alias (__getdate_r, getdate_r)
> -#endif
> -
> +libc_hidden_def (__getdate_r)
>  

OK.

>  struct tm *
>  getdate (const char *string)
> diff --git a/time/tst-getdate.c b/time/tst-getdate.c
> index c37ba3083a..3bb0e96707 100644
> --- a/time/tst-getdate.c
> +++ b/time/tst-getdate.c
> @@ -115,20 +115,14 @@ do_test (void)
>      {
>        setenv ("TZ", tests[i].tz, 1);
>  
> -      int expected_err;
> -      if (sizeof (time_t) == 4 && tests[i].time64)
> -	expected_err = 8;
> -      else
> -	expected_err = 0;

OK.

> -
>        tm = getdate (tests[i].str);
> -      TEST_COMPARE (getdate_err, expected_err);
> -      if (getdate_err != expected_err)
> +      TEST_COMPARE (getdate_err, 0);
> +      if (getdate_err != 0)
>  	{
>  	  support_record_failure ();
>  	  printf ("%s\n", report_date_error ());
>  	}
> -      else if (getdate_err == 0)
> +      else
>  	{
>  	  TEST_COMPARE (tests[i].tm.tm_mon, tm->tm_mon);
>  	  TEST_COMPARE (tests[i].tm.tm_year, tm->tm_year);
> @@ -139,7 +133,7 @@ do_test (void)
>  	}
>  
>        struct tm tms;
> -      TEST_COMPARE (getdate_r (tests[i].str, &tms), expected_err);
> +      TEST_COMPARE (getdate_r (tests[i].str, &tms), 0);
>        if (getdate_err == 0)
>  	{
>  	  TEST_COMPARE (tests[i].tm.tm_mon, tms.tm_mon);
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs
  2021-05-18 20:56 ` [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella
  2021-05-19  9:18   ` Lukasz Majewski
  2021-05-20  6:58   ` Florian Weimer
@ 2021-06-04 19:38   ` Carlos O'Donell
  2 siblings, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:38 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> A new build flag, _TIME_BITS, enables the usage of the newer 64 bit
> time symbols for legacy ABI (where 32 bit time_t is default).  The 64
> bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is
> also used.
> 
> Different than LFS support, the y2038 symbols are added only for the
> required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32,
> mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh).  The ABIs with
> 64 bit time support are unchanged, both for symbol and types
> redirection.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
 
> On Linux the full 64 bit time support requires a minimum of kernel
> version v5.1.  Otherwise, the 32 bit fallbacks are used and might
> results in error with overflow return code (EOVERFLOW).
> 
> The i686-gnu does not yet support 64 bit time.

OK.

> 
> This patch exports following rediretions to support 64 bit time:
> 
>   * libc:
>     adjtime;
>     adjtimex;
>     clock_adjtime;
>     clock_getres;
>     clock_gettime;
>     clock_nanosleep;
>     clock_settime;
>     cnd_timedwait;
>     ctime;
>     ctime_r;
>     difftime;
>     fstat;
>     fstatat;
>     futimens;
>     futimes;
>     futimesat;
>     getitimer;
>     getrusage;
>     gettimeofday;
>     gmtime;
>     gmtime_r;
>     localtime;
>     localtime_r;
>     lstat_time;
>     lutimes;
>     mktime;
>     msgctl;
>     mtx_timedlock;
>     nanosleep;
>     nanosleep;
>     ntp_gettime;
>     ntp_gettimex;
>     ppoll;
>     pselec;
>     pselect;
>     pthread_clockjoin_np;
>     pthread_cond_clockwait;
>     pthread_cond_timedwait;
>     pthread_mutex_clocklock;
>     pthread_mutex_timedlock;
>     pthread_rwlock_clockrdlock;
>     pthread_rwlock_clockwrlock;
>     pthread_rwlock_timedrdlock;
>     pthread_rwlock_timedwrlock;
>     pthread_timedjoin_np;
>     recvmmsg;
>     sched_rr_get_interval;
>     select;
>     sem_clockwait;
>     semctl;
>     semtimedop;
>     sem_timedwait;
>     setitimer;
>     settimeofday;
>     shmctl;
>     sigtimedwait;
>     stat_time;
>     thrd_sleep;
>     time;
>     timegm;
>     timerfd_gettime;
>     timerfd_settime;
>     timespec_get;
>     utime;
>     utimensat;
>     utimes;
>     utimes;
>     wait3;
>     wait4;
> 
>   * librt:
>     - aio_suspend
>     - mq_timedreceive
>     - mq_timedsend
>     - timer_gettime
>     - timer_settime

OK.

> 
>   * libanl:
>     - gai_suspend
> ---
>  Makefile                                      |   2 +-
>  NEWS                                          |   5 +
>  include/features-time64.h                     |   1 +
>  include/features.h                            |   2 +
>  io/sys/poll.h                                 |  11 ++
>  io/sys/stat.h                                 | 113 ++++++++++++--
>  io/utime.h                                    |  11 ++
>  manual/creature.texi                          |  44 ++++++
>  misc/sys/select.h                             |  27 ++++
>  nptl/pthread_clockjoin.c                      |   3 +-
>  nptl/pthread_cond_wait.c                      |   9 +-
>  nptl/pthread_mutex_timedlock.c                |   8 +-
>  nptl/pthread_rwlock_clockrdlock.c             |   4 +-
>  nptl/pthread_rwlock_clockwrlock.c             |   4 +-
>  nptl/pthread_rwlock_timedrdlock.c             |   4 +-
>  nptl/pthread_rwlock_timedwrlock.c             |   4 +-
>  nptl/pthread_timedjoin.c                      |   3 +-
>  nptl/sem_clockwait.c                          |   3 +-
>  nptl/sem_timedwait.c                          |   4 +-
>  posix/sched.h                                 |  11 +-
>  posix/sys/wait.h                              |  20 +++
>  resolv/netdb.h                                |  11 ++
>  resource/sys/resource.h                       |  10 ++
>  rt/aio.h                                      |  15 +-
>  rt/mqueue.h                                   |  22 +++
>  signal/signal.h                               |  13 ++
>  socket/sys/socket.h                           |  11 ++
>  sysdeps/generic/features-time64.h             |  19 +++
>  sysdeps/generic/time64-compat.h               |   3 +
>  sysdeps/nptl/pthread.h                        | 119 +++++++++++++++
>  sysdeps/pthread/semaphore.h                   |  25 ++++
>  sysdeps/pthread/threads.h                     |  33 +++++
>  sysdeps/unix/sysv/linux/Versions              |  97 ++++++++++++
>  sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  67 +++++++++
>  sysdeps/unix/sysv/linux/arm/be/librt.abilist  |   5 +
>  sysdeps/unix/sysv/linux/arm/le/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  67 +++++++++
>  sysdeps/unix/sysv/linux/arm/le/librt.abilist  |   5 +
>  sysdeps/unix/sysv/linux/arm/time64-compat.h   |   2 +
>  sysdeps/unix/sysv/linux/bits/msq.h            |   1 +
>  sysdeps/unix/sysv/linux/bits/sem.h            |   1 +
>  sysdeps/unix/sysv/linux/bits/shm.h            |   1 +
>  sysdeps/unix/sysv/linux/bits/time.h           |  10 ++
>  sysdeps/unix/sysv/linux/cnd_timedwait.c       |   8 +-
>  sysdeps/unix/sysv/linux/csky/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  67 +++++++++
>  sysdeps/unix/sysv/linux/csky/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/csky/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/features-time64.h     |  37 +++++
>  sysdeps/unix/sysv/linux/hppa/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  67 +++++++++
>  sysdeps/unix/sysv/linux/hppa/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/hppa/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/i386/Makefile         |   2 +
>  sysdeps/unix/sysv/linux/i386/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  67 +++++++++
>  sysdeps/unix/sysv/linux/i386/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/i386/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/include/sys/msg.h     |   2 -
>  sysdeps/unix/sysv/linux/include/sys/shm.h     |   2 -
>  sysdeps/unix/sysv/linux/include/sys/timex.h   |   2 +
>  .../sysv/linux/m68k/coldfire/libanl.abilist   |   1 +
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  67 +++++++++
>  .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
>  .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  67 +++++++++
>  .../unix/sysv/linux/m68k/m680x0/librt.abilist |   5 +
>  sysdeps/unix/sysv/linux/m68k/time64-compat.h  |   2 +
>  .../sysv/linux/microblaze/be/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/be/libc.abilist     |  67 +++++++++
>  .../sysv/linux/microblaze/be/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  67 +++++++++
>  .../sysv/linux/microblaze/le/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/time64-compat.h     |   2 +
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  67 +++++++++
>  .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
>  .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  67 +++++++++
>  .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
>  .../sysv/linux/mips/mips64/n32/libanl.abilist |   1 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  67 +++++++++
>  .../sysv/linux/mips/mips64/n32/librt.abilist  |   5 +
>  .../linux/mips/mips64/n32/time64-compat.h     |   2 +
>  sysdeps/unix/sysv/linux/mtx_timedlock.c       |   8 +-
>  sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  67 +++++++++
>  sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  67 +++++++++
>  .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
>  .../linux/powerpc/powerpc32/librt.abilist     |   5 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  67 +++++++++
>  .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
>  .../sysv/linux/s390/s390-32/libanl.abilist    |   1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  67 +++++++++
>  .../sysv/linux/s390/s390-32/librt.abilist     |   5 +
>  .../sysv/linux/s390/s390-32/time64-compat.h   |   2 +
>  sysdeps/unix/sysv/linux/semctl.c              |   1 -
>  sysdeps/unix/sysv/linux/sh/be/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  67 +++++++++
>  sysdeps/unix/sysv/linux/sh/be/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/sh/le/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  67 +++++++++
>  sysdeps/unix/sysv/linux/sh/le/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/sh/time64-compat.h    |   2 +
>  .../sysv/linux/sparc/sparc32/libanl.abilist   |   1 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  67 +++++++++
>  .../sysv/linux/sparc/sparc32/librt.abilist    |   5 +
>  .../sysv/linux/sparc/sparc32/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/sys/timerfd.h         |  22 +++
>  sysdeps/unix/sysv/linux/sys/timex.h           |  27 +++-
>  sysvipc/sys/msg.h                             |  10 ++
>  sysvipc/sys/sem.h                             |  21 +++
>  sysvipc/sys/shm.h                             |  10 ++
>  time/sys/time.h                               |  71 +++++++++
>  time/time.h                                   | 138 +++++++++++++++++-
>  118 files changed, 2386 insertions(+), 60 deletions(-)
>  create mode 100644 include/features-time64.h
>  create mode 100644 sysdeps/generic/features-time64.h
>  create mode 100644 sysdeps/generic/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/arm/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/csky/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/features-time64.h
>  create mode 100644 sysdeps/unix/sysv/linux/hppa/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/i386/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/m68k/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/microblaze/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/nios2/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/sh/time64-compat.h
>  create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
> 
> diff --git a/Makefile b/Makefile
> index 50f99ca611..6cc93efc27 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -68,7 +68,7 @@ endif # $(AUTOCONF) = no
>  		   subdir_objs subdir_stubs subdir_testclean		\
>  		   $(addprefix install-, no-libc.a bin lib data headers others)
>  \f
> -headers := limits.h values.h features.h gnu-versions.h \
> +headers := limits.h values.h features.h features-time64.h gnu-versions.h \
>  	   bits/xopen_lim.h gnu/libc-version.h stdc-predef.h \
>  	   bits/libc-header-start.h
>  
> diff --git a/NEWS b/NEWS
> index 266837bf2d..3bb122ec3c 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -25,6 +25,11 @@ Major new features:
>  
>  * The ISO C2X function timespec_getres has been added.
>  
> +* Add support for 64 bit time_t for ABIs with defaults to 32 bit time_t.
> +  This is enabled with the _TIME_BITS preprocessor set to 64 and only
> +  supported when LFS (_FILE_OFFSET_BITS=64) is also enabled.  It is only
> +  enabled for Linux and the full support requires a minimum version of 5.1.

OK.

> +
>  Deprecated and removed features, and other changes affecting compatibility:
>  
>  * The function pthread_mutex_consistent_np has been deprecated; programs
> diff --git a/include/features-time64.h b/include/features-time64.h
> new file mode 100644
> index 0000000000..06115b7c86
> --- /dev/null
> +++ b/include/features-time64.h
> @@ -0,0 +1 @@
> +#include_next <features-time64.h>
> diff --git a/include/features.h b/include/features.h
> index eb97470afa..9d39e11345 100644
> --- a/include/features.h
> +++ b/include/features.h
> @@ -387,6 +387,8 @@
>  # define __USE_FILE_OFFSET64	1
>  #endif
>  
> +#include <features-time64.h>
> +
>  #if defined _DEFAULT_SOURCE
>  # define __USE_MISC	1
>  #endif
> diff --git a/io/sys/poll.h b/io/sys/poll.h
> index 08f29df540..e640efb2bc 100644
> --- a/io/sys/poll.h
> +++ b/io/sys/poll.h
> @@ -66,6 +66,17 @@ extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
>  		  const __sigset_t *__ss)
>      __attr_access ((__write_only__, 1, 2));
>  
> +# ifdef __USE_TIME_BITS64
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (ppoll, (struct pollfd *__fds, nfds_t __nfds,
> +                               const struct timespec *__timeout,
> +                               const __sigset_t *__ss),
> +                       __ppoll64)
> +    __attr_access ((__write_only__, 1, 2));
> +#  else
> +#  define ppoll __ppoll64
> +#  endif
> +# endif
>  #endif
>  
>  __END_DECLS
> diff --git a/io/sys/stat.h b/io/sys/stat.h
> index 549375c087..f7874ec5ba 100644
> --- a/io/sys/stat.h
> +++ b/io/sys/stat.h
> @@ -209,21 +209,51 @@ extern int stat (const char *__restrict __file,
>     that file descriptor FD is open on and put them in BUF.  */
>  extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
>  #else
> -# ifdef __REDIRECT_NTH
> +# ifdef __USE_TIME_BITS64
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
> +				  struct stat *__restrict __buf),
> +				  __stat64_time64)
> +     __nonnull ((1, 2));
> +extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf),
> +				   __fstat64_time64)
> +     __nonnull ((2));
> +#  else
> +#   define stat __stat64_time64
> +#   define fstat __fstat64_time64
> +#  endif
> +# else
> +#  ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
>  				  struct stat *__restrict __buf), stat64)
>       __nonnull ((1, 2));
>  extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
>       __nonnull ((2));
> -# else
> -#  define stat stat64
> -#  define fstat fstat64
> +#  else
> +#   define stat stat64
> +#   define fstat fstat64
> +#  endif
>  # endif
>  #endif
>  #ifdef __USE_LARGEFILE64
> +# ifndef __USE_TIME_BITS64
>  extern int stat64 (const char *__restrict __file,
>  		   struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
>  extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (stat64, (const char *__restrict __file,
> +				    struct stat64 *__restrict __buf),
> +			   __stat64_time64)
> +     __nonnull ((1, 2));
> +extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf),
> +			   __fstat64_time64)
> +     __nonnull ((2));
> +#  else
> +#   define stat64 __stat64_time64
> +#   define fstat64 __fstat64_time
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_ATFILE
> @@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char *__restrict __file,
>  		    struct stat *__restrict __buf, int __flag)
>       __THROW __nonnull ((2, 3));
>  # else
> -#  ifdef __REDIRECT_NTH
> +#  ifdef __USE_TIME_BITS64
> +#   ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
>  				     struct stat *__restrict __buf,
>  				     int __flag),
> -			   fstatat64) __nonnull ((2, 3));
> +			   __fstatat64_time64) __nonnull ((2, 3));
> +#   else
> +#    define fstatat __fstatat64_time64
> +#   endif
>  #  else
> -#   define fstatat fstatat64
> +#   ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
> +				     struct stat *__restrict __buf,
> +				     int __flag),
> +			   fstatat64) __nonnull ((2, 3));
> +#   else
> +#    define fstatat fstatat64
> +#   endif
>  #  endif
>  # endif
>  
>  # ifdef __USE_LARGEFILE64
> +#  ifndef __USE_TIME_BITS64
>  extern int fstatat64 (int __fd, const char *__restrict __file,
>  		      struct stat64 *__restrict __buf, int __flag)
>       __THROW __nonnull ((2, 3));
> +#  else
> +#   ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (fstatat64, (int __fd,
> +				       const char *__restrict __file,
> +				       struct stat64 *__restrict __buf,
> +				       int __flag),
> +			   __fstatat64_time64)
> +     __nonnull ((2, 3));
> +#   else
> +#    define fstatat64 __fstatat64_time64
> +#   endif
> +#  endif
>  # endif
>  #endif
>  
> @@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char *__restrict __file,
>  extern int lstat (const char *__restrict __file,
>  		  struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
>  # else
> -#  ifdef __REDIRECT_NTH
> +#  ifdef __USE_TIME_BITS64
> +#   ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (lstat,
>  			   (const char *__restrict __file,
> -			    struct stat *__restrict __buf), lstat64)
> +			    struct stat *__restrict __buf), __lstat64_time64)
>       __nonnull ((1, 2));
> +#   else
> +#    define lstat __lstat64_time64
> +#   endif
>  #  else
> -#   define lstat lstat64
> +#   ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (lstat,
> +			   (const char *__restrict __file,
> +			    struct stat *__restrict __buf), lstat64)
> +     __nonnull ((1, 2));
> +#   else
> +#    define lstat lstat64
> +#   endif
>  #  endif
>  # endif
>  # ifdef __USE_LARGEFILE64
> +#  ifndef __USE_TIME_BITS64
>  extern int lstat64 (const char *__restrict __file,
>  		    struct stat64 *__restrict __buf)
>       __THROW __nonnull ((1, 2));
> +#  else
> +extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file,
> +				     struct stat64 *__restrict __buf),
> +			   __lstat64_time64)
> +     __nonnull ((1, 2));
> +#  endif
>  # endif
>  #endif
>  
> @@ -355,17 +427,38 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
>  #endif
>  \f
>  #ifdef __USE_ATFILE
> +# ifndef __USE_TIME_BITS64
>  /* Set file access and modification times relative to directory file
>     descriptor.  */
>  extern int utimensat (int __fd, const char *__path,
>  		      const struct timespec __times[2],
>  		      int __flags)
>       __THROW __nonnull ((2));
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path,
> +                                       const struct timespec __times[2],
> +                                       int flags),
> +                           __utimensat64) __nonnull ((2));
> +#  else
> +#   define utimensat __utimensat64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_XOPEN2K8
> +# ifndef __USE_TIME_BITS64
>  /* Set file access and modification times of the file associated with FD.  */
>  extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
> +
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]),
> +                           __futimens64);
> +#  else
> +#   define futimens __futimens64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_GNU
> diff --git a/io/utime.h b/io/utime.h
> index c7612d0838..1a645a3fff 100644
> --- a/io/utime.h
> +++ b/io/utime.h
> @@ -46,10 +46,21 @@ struct utimbuf
>  
>  /* Set the access and modification times of FILE to those given in
>     *FILE_TIMES.  If FILE_TIMES is NULL, set them to the current time.  */
> +#ifndef __USE_TIME_BITS64
>  extern int utime (const char *__file,
>  		  const struct utimbuf *__file_times)
>       __THROW __nonnull ((1));
>  
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (utime, (const char *__file,
> +                                   const struct utimbuf *__file_times),
> +                           __utime64);
> +# else
> +#  define utime __utime64
> +# endif
> +#endif
> +
>  __END_DECLS
>  
>  #endif /* utime.h */
> diff --git a/manual/creature.texi b/manual/creature.texi
> index 5090735e4f..606b73d184 100644
> --- a/manual/creature.texi
> +++ b/manual/creature.texi
> @@ -165,6 +165,50 @@ This macro was introduced as part of the Large File Support extension
>  (LFS).
>  @end defvr
>  
> +@defvr Macro _TIME_BITS
> +This macro determines the bit size of @code{time_t} (and therefore the
> +bit size of all @code{time_t} derived types and the prototypes of all
> +related functions).  If @code{_TIME_BITS} is undefined, the bit size of
> +@code{time_t} is architecture dependent.
> +
> +Possible values of @code{_TIME_BITS}:
> +@enumerate
> +@item
> +@code{_TIME_BITS=64} and port from the outset uses 64-bit
> +@code{time_t} and word size equals to @w{64 bits} (e.g. x86_64) - no
> +action
> +
> +@item
> +@code{_TIME_BITS=32} and port from the outset uses 32-bit
> +@code{time_t} and word size equals to @w{64 bits} (e.g. ARM) - no
> +action
> +
> +@item
> +@code{_TIME_BITS=64} and port from the outset uses 64-bit
> +@code{time_t} and word size equals to @w{32 bits} (e.g. ARC, RV32)
> +- no action
> +
> +@item
> +@code{_TIME_BITS=64} and port from the outset uses 32-bit
> +@code{time_t} and word size equals to @w{32 bits} (e.g. ARM)
> +- the @code{time_t} is modified to be able to hold 64-bit time.
> +
> +@item
> +For any other use case the compile-time error is emitted.
> +@end enumerate
> +
> +The @code{_TIME_BITS} can be only used when @code{_FILE_OFFSET_BITS=64}
> +is also defined.
> +
> +For the point @b{4} above, calls to proper syscalls depend on the
> +Linux kernel version on which the system is running. For Linux kernel
> +version above @b{5.1} syscalls supporting 64-bit time are used. Otherwise,
> +a fallback code is used with legacy (i.e. 32-bit) syscalls.
> +
> +By using this macro certain ports gain support for 64-bit time and as
> +a result become immune to Y2038 problem.
> +@end defvr
> +
>  @defvr Macro _ISOC99_SOURCE
>  @standards{GNU, (none)}
>  If this macro is defined, features from ISO C99 are included.  Since
> diff --git a/misc/sys/select.h b/misc/sys/select.h
> index 188a7fe607..e9c0e8fc20 100644
> --- a/misc/sys/select.h
> +++ b/misc/sys/select.h
> @@ -98,10 +98,23 @@ __BEGIN_DECLS
>  
>     This function is a cancellation point and therefore not marked with
>     __THROW.  */
> +#ifndef __USE_TIME_BITS64
>  extern int select (int __nfds, fd_set *__restrict __readfds,
>  		   fd_set *__restrict __writefds,
>  		   fd_set *__restrict __exceptfds,
>  		   struct timeval *__restrict __timeout);
> +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT (select,
> +                       (int __nfds, fd_set *__restrict __readfds,
> +                        fd_set *__restrict __writefds,
> +                        fd_set *__restrict __exceptfds,
> +                        struct timeval *__restrict __timeout),
> +                       __select64);
> +# else
> +#  define select __select64
> +# endif
> +#endif
>  
>  #ifdef __USE_XOPEN2K
>  /* Same as above only that the TIMEOUT value is given with higher
> @@ -110,11 +123,25 @@ extern int select (int __nfds, fd_set *__restrict __readfds,
>  
>     This function is a cancellation point and therefore not marked with
>     __THROW.  */
> +# ifndef __USE_TIME_BITS64
>  extern int pselect (int __nfds, fd_set *__restrict __readfds,
>  		    fd_set *__restrict __writefds,
>  		    fd_set *__restrict __exceptfds,
>  		    const struct timespec *__restrict __timeout,
>  		    const __sigset_t *__restrict __sigmask);
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (pselect,
> +                       (int __nfds, fd_set *__restrict __readfds,
> +                        fd_set *__restrict __writefds,
> +                        fd_set *__restrict __exceptfds,
> +                        const struct timespec *__restrict __timeout,
> +                        const __sigset_t *__restrict __sigmask),
> +                       __pselect64);
> +#  else
> +#   define pselect __pselect64
> +#  endif
> +# endif
>  #endif
>  
>  
> diff --git a/nptl/pthread_clockjoin.c b/nptl/pthread_clockjoin.c
> index f5007d7831..2d01ba03a2 100644
> --- a/nptl/pthread_clockjoin.c
> +++ b/nptl/pthread_clockjoin.c
> @@ -36,7 +36,8 @@ ___pthread_clockjoin_np64 (pthread_t threadid, void **thread_return,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_clockjoin_np64, ___pthread_clockjoin_np)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_clockjoin_np64, __pthread_clockjoin_np64)
> +strong_alias (___pthread_clockjoin_np64, __pthread_clockjoin_np64)
> +libc_hidden_def (__pthread_clockjoin_np64)
>  
>  int
>  ___pthread_clockjoin_np (pthread_t threadid, void **thread_return,
> diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
> index 54e504a6b5..9a5897700b 100644
> --- a/nptl/pthread_cond_wait.c
> +++ b/nptl/pthread_cond_wait.c
> @@ -644,10 +644,8 @@ ___pthread_cond_timedwait64 (pthread_cond_t *cond, pthread_mutex_t *mutex,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_cond_timedwait64, ___pthread_cond_timedwait)
>  #else
> -libc_hidden_ver (___pthread_cond_timedwait64, __pthread_cond_timedwait64)
> -#ifndef SHARED
>  strong_alias (___pthread_cond_timedwait64, __pthread_cond_timedwait64)
> -#endif
> +libc_hidden_def (__pthread_cond_timedwait64)
>  
>  int
>  ___pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
> @@ -685,9 +683,8 @@ ___pthread_cond_clockwait64 (pthread_cond_t *cond, pthread_mutex_t *mutex,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_cond_clockwait64, ___pthread_cond_clockwait)
>  #else
> -versioned_symbol (libc, ___pthread_cond_clockwait64,
> -		  __pthread_cond_clockwait64, GLIBC_PRIVATE);
> -libc_hidden_ver (___pthread_cond_clockwait64, __pthread_cond_clockwait64)
> +strong_alias (___pthread_cond_clockwait64, __pthread_cond_clockwait64);
> +libc_hidden_def (__pthread_cond_clockwait64)
>  
>  int
>  ___pthread_cond_clockwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
> diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c
> index acd78131b2..5afd6222d6 100644
> --- a/nptl/pthread_mutex_timedlock.c
> +++ b/nptl/pthread_mutex_timedlock.c
> @@ -585,7 +585,8 @@ ___pthread_mutex_clocklock64 (pthread_mutex_t *mutex,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_mutex_clocklock64, ___pthread_mutex_clocklock)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_mutex_clocklock64, __pthread_mutex_clocklock64)
> +strong_alias (___pthread_mutex_clocklock64, __pthread_mutex_clocklock64)
> +libc_hidden_def (__pthread_mutex_clocklock64)
>  
>  int
>  ___pthread_mutex_clocklock (pthread_mutex_t *mutex,
> @@ -618,9 +619,8 @@ ___pthread_mutex_timedlock64 (pthread_mutex_t *mutex,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_mutex_timedlock64, ___pthread_mutex_timedlock)
>  #else /* __TIMESPEC64 != 64 */
> -versioned_symbol (libc, ___pthread_mutex_timedlock64,
> -		  __pthread_mutex_timedlock64, GLIBC_PRIVATE);
> -libc_hidden_ver (___pthread_mutex_timedlock64, __pthread_mutex_timedlock64)
> +strong_alias (___pthread_mutex_timedlock64, __pthread_mutex_timedlock64);
> +libc_hidden_def (__pthread_mutex_timedlock64)
>  
>  int
>  ___pthread_mutex_timedlock (pthread_mutex_t *mutex,
> diff --git a/nptl/pthread_rwlock_clockrdlock.c b/nptl/pthread_rwlock_clockrdlock.c
> index 9db96b9904..83ae1d1823 100644
> --- a/nptl/pthread_rwlock_clockrdlock.c
> +++ b/nptl/pthread_rwlock_clockrdlock.c
> @@ -31,8 +31,8 @@ ___pthread_rwlock_clockrdlock64 (pthread_rwlock_t *rwlock, clockid_t clockid,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_rwlock_clockrdlock64, ___pthread_rwlock_clockrdlock)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_rwlock_clockrdlock64,
> -		 __pthread_rwlock_clockrdlock64)
> +strong_alias (___pthread_rwlock_clockrdlock64, __pthread_rwlock_clockrdlock64)
> +libc_hidden_def (__pthread_rwlock_clockrdlock64)
>  
>  int
>  ___pthread_rwlock_clockrdlock (pthread_rwlock_t *rwlock, clockid_t clockid,
> diff --git a/nptl/pthread_rwlock_clockwrlock.c b/nptl/pthread_rwlock_clockwrlock.c
> index ca0ebe2a65..08a2276da5 100644
> --- a/nptl/pthread_rwlock_clockwrlock.c
> +++ b/nptl/pthread_rwlock_clockwrlock.c
> @@ -31,8 +31,8 @@ ___pthread_rwlock_clockwrlock64 (pthread_rwlock_t *rwlock, clockid_t clockid,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_rwlock_clockwrlock64, ___pthread_rwlock_clockwrlock)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_rwlock_clockwrlock64,
> -		 __pthread_rwlock_clockwrlock64)
> +strong_alias (___pthread_rwlock_clockwrlock64, __pthread_rwlock_clockwrlock64)
> +libc_hidden_def (__pthread_rwlock_clockwrlock64)
>  
>  int
>  ___pthread_rwlock_clockwrlock (pthread_rwlock_t *rwlock, clockid_t clockid,
> diff --git a/nptl/pthread_rwlock_timedrdlock.c b/nptl/pthread_rwlock_timedrdlock.c
> index dd9b7cb0a2..8c73af26fb 100644
> --- a/nptl/pthread_rwlock_timedrdlock.c
> +++ b/nptl/pthread_rwlock_timedrdlock.c
> @@ -30,8 +30,8 @@ ___pthread_rwlock_timedrdlock64 (pthread_rwlock_t *rwlock,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_rwlock_timedrdlock64, ___pthread_rwlock_timedrdlock)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_rwlock_timedrdlock64,
> -		 __pthread_rwlock_timedrdlock64)
> +strong_alias (___pthread_rwlock_timedrdlock64, __pthread_rwlock_timedrdlock64)
> +libc_hidden_def (__pthread_rwlock_timedrdlock64)
>  
>  int
>  ___pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock,
> diff --git a/nptl/pthread_rwlock_timedwrlock.c b/nptl/pthread_rwlock_timedwrlock.c
> index e660a544cd..890da92968 100644
> --- a/nptl/pthread_rwlock_timedwrlock.c
> +++ b/nptl/pthread_rwlock_timedwrlock.c
> @@ -30,8 +30,8 @@ ___pthread_rwlock_timedwrlock64 (pthread_rwlock_t *rwlock,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_rwlock_timedwrlock64, ___pthread_rwlock_timedwrlock)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_rwlock_timedwrlock64,
> -		 __pthread_rwlock_timedwrlock64)
> +strong_alias (___pthread_rwlock_timedwrlock64, __pthread_rwlock_timedwrlock64)
> +libc_hidden_def (__pthread_rwlock_timedwrlock64)
>  
>  int
>  ___pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock,
> diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c
> index ebc31f935a..0b4026612f 100644
> --- a/nptl/pthread_timedjoin.c
> +++ b/nptl/pthread_timedjoin.c
> @@ -31,7 +31,8 @@ ___pthread_timedjoin_np64 (pthread_t threadid, void **thread_return,
>  #if __TIMESIZE == 64
>  strong_alias (___pthread_timedjoin_np64, ___pthread_timedjoin_np)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___pthread_timedjoin_np64, __pthread_timedjoin_np64)
> +strong_alias (___pthread_timedjoin_np64, __pthread_timedjoin_np64)
> +libc_hidden_def (__pthread_timedjoin_np64)
>  
>  int
>    ___pthread_timedjoin_np (pthread_t threadid, void **thread_return,
> diff --git a/nptl/sem_clockwait.c b/nptl/sem_clockwait.c
> index 2739799e26..19751aff04 100644
> --- a/nptl/sem_clockwait.c
> +++ b/nptl/sem_clockwait.c
> @@ -49,7 +49,8 @@ ___sem_clockwait64 (sem_t *sem, clockid_t clockid,
>  #if __TIMESIZE == 64
>  strong_alias (___sem_clockwait64, ___sem_clockwait)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___sem_clockwait64, __sem_clockwait64)
> +strong_alias (___sem_clockwait64, __sem_clockwait64)
> +libc_hidden_def (__sem_clockwait64)
>  
>  int
>  ___sem_clockwait (sem_t *sem, clockid_t clockid, const struct timespec *abstime)
> diff --git a/nptl/sem_timedwait.c b/nptl/sem_timedwait.c
> index 584546c706..5c8f37d3bb 100644
> --- a/nptl/sem_timedwait.c
> +++ b/nptl/sem_timedwait.c
> @@ -45,10 +45,8 @@ ___sem_timedwait64 (sem_t *sem, const struct __timespec64 *abstime)
>  #if __TIMESIZE == 64
>  strong_alias (___sem_timedwait64, ___sem_timedwait)
>  #else /* __TIMESPEC64 != 64 */
> -libc_hidden_ver (___sem_timedwait64, __sem_timedwait64)
> -#ifndef SHARED
>  strong_alias (___sem_timedwait64, __sem_timedwait64)
> -#endif
> +libc_hidden_def (__sem_timedwait64)
>  
>  int
>  ___sem_timedwait (sem_t *sem, const struct timespec *abstime)
> diff --git a/posix/sched.h b/posix/sched.h
> index d8ce08a3ea..7dd97a49b2 100644
> --- a/posix/sched.h
> +++ b/posix/sched.h
> @@ -74,8 +74,17 @@ extern int sched_get_priority_max (int __algorithm) __THROW;
>  extern int sched_get_priority_min (int __algorithm) __THROW;
>  
>  /* Get the SCHED_RR interval for the named process.  */
> +#ifndef __USE_TIME_BITS64
>  extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
> -
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (sched_rr_get_interval,
> +                           (__pid_t __pid, struct timespec *__t),
> +                           __sched_rr_get_interval64);
> +# else
> +#  define sched_rr_get_interval __sched_rr_get_interval64
> +# endif
> +#endif
>  
>  #ifdef __USE_GNU
>  /* Access macros for `cpu_set'.  */
> diff --git a/posix/sys/wait.h b/posix/sys/wait.h
> index 9e7bb7f154..5325bfa4d2 100644
> --- a/posix/sys/wait.h
> +++ b/posix/sys/wait.h
> @@ -144,14 +144,34 @@ struct rusage;
>     nil, store information about the child's resource usage there.  If the
>     WUNTRACED bit is set in OPTIONS, return status for stopped children;
>     otherwise don't.  */
> +# ifndef __USE_TIME_BITS64
>  extern __pid_t wait3 (int *__stat_loc, int __options,
>  		      struct rusage * __usage) __THROWNL;
> +# else
> +#  ifdef __REDIRECT_NTHNL
> +extern __pid_t __REDIRECT_NTHNL (wait3, (int *__stat_loc, int __options,
> +                                         struct rusage * __usage),
> +                                 __wait3_time64);
> +#  else
> +#   define wait3 __wait3_time64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_MISC
> +# ifndef __USE_TIME_BITS64
>  /* PID is like waitpid.  Other args are like wait3.  */
>  extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
>  		      struct rusage *__usage) __THROWNL;
> +# else
> +#  ifdef __REDIRECT_NTHNL
> +extern __pid_t __REDIRECT_NTHNL (wait4, (__pid_t __pid, int *__stat_loc,
> +                                         int __options, struct rusage *__usage),
> +                                 __wait4_time64);
> +#  else
> +#   define wait4 __wait4_time64
> +#  endif
> +# endif
>  #endif /* Use misc.  */
>  
>  
> diff --git a/resolv/netdb.h b/resolv/netdb.h
> index 1f36f25d4a..9b242ce3d1 100644
> --- a/resolv/netdb.h
> +++ b/resolv/netdb.h
> @@ -701,6 +701,17 @@ extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
>  extern int gai_suspend (const struct gaicb *const __list[], int __ent,
>  			const struct timespec *__timeout);
>  
> +# ifdef __USE_TIME_BITS64
> +#  if defined(__REDIRECT)
> +extern int __REDIRECT (gai_suspend, (const struct gaicb *const __list[],
> +                                     int __ent,
> +                                     const struct timespec *__timeout),
> +                       __gai_suspend_time64);
> +#  else
> +#   define gai_suspend __gai_suspend_time64
> +#  endif
> +# endif
> +
>  /* Get the error status of the request REQ.  */
>  extern int gai_error (struct gaicb *__req) __THROW;
>  
> diff --git a/resource/sys/resource.h b/resource/sys/resource.h
> index d30379d085..551d25e275 100644
> --- a/resource/sys/resource.h
> +++ b/resource/sys/resource.h
> @@ -88,6 +88,16 @@ extern int setrlimit64 (__rlimit_resource_t __resource,
>     and put it in *USAGE.  Returns 0 for success, -1 for failure.  */
>  extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
>  
> +#ifdef __USE_TIME_BITS64
> +# if defined(__REDIRECT_NTH)
> +extern int __REDIRECT_NTH (getrusage, (__rusage_who_t __who,
> +                                       struct rusage *__usage),
> +                           __getrusage64);
> +# else
> +# define getrusage __getrusage64
> +# endif
> +#endif
> +
>  /* Return the highest priority of any process specified by WHICH and WHO
>     (see above); if WHO is zero, the current process, process group, or user
>     (as specified by WHO) is used.  A lower priority number means higher
> diff --git a/rt/aio.h b/rt/aio.h
> index 3a107b2783..72cf626690 100644
> --- a/rt/aio.h
> +++ b/rt/aio.h
> @@ -193,12 +193,17 @@ extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp),
>  extern int __REDIRECT_NTH (aio_cancel,
>  			   (int __fildes, struct aiocb *__aiocbp),
>  			   aio_cancel64);
> -
> +#  ifdef __USE_TIME_BITS64
> +extern int __REDIRECT_NTH (aio_suspend,
> +			   (const struct aiocb *const __list[], int __nent,
> +			    const struct timespec *__restrict __timeout),
> +			   __aio_suspend_time64) __nonnull ((1));
> +#  else
>  extern int __REDIRECT_NTH (aio_suspend,
>  			   (const struct aiocb *const __list[], int __nent,
>  			    const struct timespec *__restrict __timeout),
>  			   aio_suspend64) __nonnull ((1));
> -
> +#  endif
>  extern int __REDIRECT_NTH (aio_fsync,
>  			   (int __operation, struct aiocb *__aiocbp),
>  			   aio_fsync64) __nonnull ((2));
> @@ -210,7 +215,11 @@ extern int __REDIRECT_NTH (aio_fsync,
>  #  define aio_error aio_error64
>  #  define aio_return aio_return64
>  #  define aio_cancel aio_cancel64
> -#  define aio_suspend aio_suspend64
> +#  ifdef __USE_TIME_BITS64
> +#   define aio_suspend __aio_suspend_time64
> +#  else
> +#   define aio_suspend aio_suspend64
> +#  endif
>  #  define aio_fsync aio_fsync64
>  # endif
>  #endif
> diff --git a/rt/mqueue.h b/rt/mqueue.h
> index 8a62d99f50..e8a85637e4 100644
> --- a/rt/mqueue.h
> +++ b/rt/mqueue.h
> @@ -71,6 +71,7 @@ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len,
>  		    unsigned int __msg_prio) __nonnull ((2));
>  
>  #ifdef __USE_XOPEN2K
> +# ifndef __USE_TIME_BITS64
>  /* Receive the oldest from highest priority messages in message queue
>     MQDES, stop waiting if ABS_TIMEOUT expires.  */
>  extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr,
> @@ -85,6 +86,27 @@ extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr,
>  			 size_t __msg_len, unsigned int __msg_prio,
>  			 const struct timespec *__abs_timeout)
>    __nonnull ((2, 5));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (mq_timedreceive, (mqd_t __mqdes,
> +                               char *__restrict __msg_ptr,
> +                               size_t __msg_len,
> +                               unsigned int *__restrict __msg_prio,
> +                               const struct timespec *__restrict __abs_timeout),
> +                       __mq_timedreceive_time64)
> +  __nonnull ((2, 5));
> +
> +extern int __REDIRECT (mq_timedsend, (mqd_t __mqdes,
> +                       const char *__msg_ptr, size_t __msg_len,
> +                       unsigned int __msg_prio,
> +                       const struct timespec *__abs_timeout),
> +		       __mq_timedsend_time64)
> +  __nonnull ((2, 5));
> +#  else
> +#   define mq_timedreceive __mq_timedreceive_time64
> +#   define mq_timedsend __mq_timedsend_time64
> +#  endif
> +# endif
>  #endif
>  
>  /* Define some inlines helping to catch common problems.  */
> diff --git a/signal/signal.h b/signal/signal.h
> index b17203c99c..5fd93382fc 100644
> --- a/signal/signal.h
> +++ b/signal/signal.h
> @@ -269,10 +269,23 @@ extern int sigwaitinfo (const sigset_t *__restrict __set,
>  
>     This function is a cancellation point and therefore not marked with
>     __THROW.  */
> +#  ifndef __USE_TIME_BITS64
>  extern int sigtimedwait (const sigset_t *__restrict __set,
>  			 siginfo_t *__restrict __info,
>  			 const struct timespec *__restrict __timeout)
>       __nonnull ((1));
> +#  else
> +#   ifdef __REDIRECT
> +extern int __REDIRECT (sigtimedwait,
> +                       (const sigset_t *__restrict __set,
> +                        siginfo_t *__restrict __info,
> +                        const struct timespec *__restrict __timeout),
> +                       __sigtimedwait64)
> +     __nonnull ((1));
> +#   else
> +#    define sigtimedwait __sigtimedwait64
> +#   endif
> +#  endif
>  
>  /* Send signal SIG to the process PID.  Associate data in VAL with the
>     signal.  */
> diff --git a/socket/sys/socket.h b/socket/sys/socket.h
> index 949851a6ce..5577e75b80 100644
> --- a/socket/sys/socket.h
> +++ b/socket/sys/socket.h
> @@ -196,9 +196,20 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
>  
>     This function is a cancellation point and therefore not marked with
>     __THROW.  */
> +# ifndef __USE_TIME_BITS64
>  extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
>  		     unsigned int __vlen, int __flags,
>  		     struct timespec *__tmo);
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (recvmmsg, (int __fd, struct mmsghdr *__vmessages,
> +                                  unsigned int __vlen, int __flags,
> +                                  struct timespec *__tmo),
> +                       __recvmmsg64);
> +#  else
> +#   define recvmmsg __recvmmsg64
> +#  endif
> +# endif
>  #endif
>  
>  
> diff --git a/sysdeps/generic/features-time64.h b/sysdeps/generic/features-time64.h
> new file mode 100644
> index 0000000000..a5a677f837
> --- /dev/null
> +++ b/sysdeps/generic/features-time64.h
> @@ -0,0 +1,19 @@
> +/* Features part to handle 64-bit time_t support.  Generic version.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* The generic configuration only support _TIME_BITS=32.  */
> diff --git a/sysdeps/generic/time64-compat.h b/sysdeps/generic/time64-compat.h
> new file mode 100644
> index 0000000000..e44b6b68e3
> --- /dev/null
> +++ b/sysdeps/generic/time64-compat.h
> @@ -0,0 +1,3 @@
> +/* Header included by Versions to generate the 64 bit time_t compat symbols.
> +   Legacy ABIs with default 32 bit time support define TIME64_NON_DEFAULT to
> +   generate the 64 bit symbols.  */
> diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
> index 22e037dcb4..52e2eadbfc 100644
> --- a/sysdeps/nptl/pthread.h
> +++ b/sysdeps/nptl/pthread.h
> @@ -221,6 +221,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return);
>     the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL.  */
>  extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
>  
> +# ifndef __USE_TIME_BITS64
>  /* Make calling thread wait for termination of the thread TH, but only
>     until TIMEOUT.  The exit status of the thread is stored in
>     *THREAD_RETURN, if THREAD_RETURN is not NULL.
> @@ -240,6 +241,23 @@ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
>  extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return,
>                                   clockid_t __clockid,
>  				 const struct timespec *__abstime);
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (pthread_timedjoin_np,
> +                       (pthread_t __th, void **__thread_return,
> +                        const struct timespec *__abstime),
> +                       __pthread_timedjoin_np64);
> +
> +extern int __REDIRECT (pthread_clockjoin_np,
> +                       (pthread_t __th, void **__thread_return,
> +                        clockid_t __clockid,
> +                        const struct timespec *__abstime),
> +                       __pthread_clockjoin_np64);
> +#  else
> +#   define pthread_timedjoin_np __pthread_timedjoin_np64
> +#   define pthread_clockjoin_np __pthread_clockjoin_np64
> +#  endif
> +# endif
>  #endif
>  
>  /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
> @@ -776,16 +794,39 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
>  
>  #ifdef __USE_XOPEN2K
>  /* Wait until lock becomes available, or specified time passes. */
> +# ifndef __USE_TIME_BITS64
>  extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
>  				    const struct timespec *__restrict
>  				    __abstime) __THROWNL __nonnull ((1, 2));
> +# else
> +#  ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_mutex_timedlock,
> +                             (pthread_mutex_t *__restrict __mutex,
> +                              const struct timespec *__restrict __abstime),
> +                             __pthread_mutex_timedlock64) __nonnull ((1, 2));
> +#  else
> +#   define pthread_mutex_timedlock __pthread_mutex_timedlock64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_GNU
> +# ifndef __USE_TIME_BITS64
>  extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex,
>  				    clockid_t __clockid,
>  				    const struct timespec *__restrict
>  				    __abstime) __THROWNL __nonnull ((1, 3));
> +# else
> +#  ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_mutex_clocklock,
> +                             (pthread_mutex_t *__restrict __mutex,
> +                              clockid_t __clockid,
> +                              const struct timespec *__restrict __abstime),
> +                             __pthread_mutex_clocklock64) __nonnull ((1, 3));
> +#  else
> +#   define pthread_mutex_clocklock __pthread_mutex_clocklock64
> +#  endif
> +# endif
>  #endif
>  
>  /* Unlock a mutex.  */
> @@ -939,16 +980,41 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
>  
>  # ifdef __USE_XOPEN2K
>  /* Try to acquire read lock for RWLOCK or return after specfied time.  */
> +#  ifndef __USE_TIME_BITS64
>  extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
>  				       const struct timespec *__restrict
>  				       __abstime) __THROWNL __nonnull ((1, 2));
> +#  else
> +#   ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock,
> +                             (pthread_rwlock_t *__restrict __rwlock,
> +                              const struct timespec *__restrict __abstime),
> +                             __pthread_rwlock_timedrdlock64)
> +    __nonnull ((1, 2));
> +#   else
> +#    define pthread_rwlock_timedrdlock __pthread_rwlock_timedrdlock64
> +#   endif
> +#  endif
>  # endif
>  
>  # ifdef __USE_GNU
> +#  ifndef __USE_TIME_BITS64
>  extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock,
>  				       clockid_t __clockid,
>  				       const struct timespec *__restrict
>  				       __abstime) __THROWNL __nonnull ((1, 3));
> +#  else
> +#   ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_rwlock_clockrdlock,
> +                             (pthread_rwlock_t *__restrict __rwlock,
> +                              clockid_t __clockid,
> +                              const struct timespec *__restrict __abstime),
> +                             __pthread_rwlock_clockrdlock64)
> +    __nonnull ((1, 3));
> +#   else
> +#    define pthread_rwlock_clockrdlock __pthread_rwlock_clockrdlock64
> +#   endif
> +#  endif
>  # endif
>  
>  /* Acquire write lock for RWLOCK.  */
> @@ -961,16 +1027,42 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
>  
>  # ifdef __USE_XOPEN2K
>  /* Try to acquire write lock for RWLOCK or return after specfied time.  */
> +#  ifndef __USE_TIME_BITS64
>  extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
>  				       const struct timespec *__restrict
>  				       __abstime) __THROWNL __nonnull ((1, 2));
> +#  else
> +#   ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock,
> +                             (pthread_rwlock_t *__restrict __rwlock,
> +                              const struct timespec *__restrict __abstime),
> +                             __pthread_rwlock_timedwrlock64)
> +    __nonnull ((1, 2));
> +#   else
> +#    define pthread_rwlock_timedwrlock __pthread_rwlock_timedwrlock64
> +#   endif
> +#  endif
>  # endif
>  
>  # ifdef __USE_GNU
> +#  ifndef __USE_TIME_BITS64
>  extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock,
>  				       clockid_t __clockid,
>  				       const struct timespec *__restrict
>  				       __abstime) __THROWNL __nonnull ((1, 3));
> +
> +#  else
> +#   ifdef __REDIRECT_NTHNL
> +extern int __REDIRECT_NTHNL (pthread_rwlock_clockwrlock,
> +                             (pthread_rwlock_t *__restrict __rwlock,
> +                              clockid_t __clockid,
> +                              const struct timespec *__restrict __abstime),
> +                             __pthread_rwlock_clockwrlock64)
> +    __nonnull ((1, 3));
> +#   else
> +#    define pthread_rwlock_clockwrlock __pthread_rwlock_clockwrlock64
> +#   endif
> +#  endif
>  # endif
>  
>  /* Unlock RWLOCK.  */
> @@ -1047,10 +1139,23 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
>  
>     This function is a cancellation point and therefore not marked with
>     __THROW.  */
> +# ifndef __USE_TIME_BITS64
>  extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
>  				   pthread_mutex_t *__restrict __mutex,
>  				   const struct timespec *__restrict __abstime)
>       __nonnull ((1, 2, 3));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (pthread_cond_timedwait,
> +                       (pthread_cond_t *__restrict __cond,
> +                        pthread_mutex_t *__restrict __mutex,
> +                        const struct timespec *__restrict __abstime),
> +                       __pthread_cond_timedwait64)
> +     __nonnull ((1, 2, 3));
> +#  else
> +#   define pthread_cond_timedwait __pthread_cond_timedwait64
> +#  endif
> +# endif
>  
>  # ifdef __USE_GNU
>  /* Wait for condition variable COND to be signaled or broadcast until
> @@ -1060,11 +1165,25 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
>  
>     This function is a cancellation point and therefore not marked with
>     __THROW. */
> +#  ifndef __USE_TIME_BITS64
>  extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
>  				   pthread_mutex_t *__restrict __mutex,
>  				   __clockid_t __clock_id,
>  				   const struct timespec *__restrict __abstime)
>       __nonnull ((1, 2, 4));
> +#  else
> +#   ifdef __REDIRECT
> +extern int __REDIRECT (pthread_cond_clockwait,
> +                       (pthread_cond_t *__restrict __cond,
> +                        pthread_mutex_t *__restrict __mutex,
> +                        __clockid_t __clock_id,
> +                        const struct timespec *__restrict __abstime),
> +                       __pthread_cond_clockwait64)
> +     __nonnull ((1, 2, 4));
> +#   else
> +#    define pthread_cond_clockwait __pthread_cond_clockwait64
> +#   endif
> +#  endif
>  # endif
>  
>  /* Functions for handling condition variable attributes.  */
> diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h
> index 7fb0e5c103..35780e7c4e 100644
> --- a/sysdeps/pthread/semaphore.h
> +++ b/sysdeps/pthread/semaphore.h
> @@ -59,16 +59,41 @@ extern int sem_wait (sem_t *__sem) __nonnull ((1));
>  
>     This function is a cancellation point and therefore not marked with
>     __THROW.  */
> +# ifndef __USE_TIME_BITS64
>  extern int sem_timedwait (sem_t *__restrict __sem,
>  			  const struct timespec *__restrict __abstime)
>    __nonnull ((1, 2));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (sem_timedwait,
> +                       (sem_t *__restrict __sem,
> +                        const struct timespec *__restrict __abstime),
> +                        __sem_timedwait64)
> +  __nonnull ((1, 2));
> +#  else
> +#   define sem_timedwait __sem_timedwait64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_GNU
> +# ifndef __USE_TIME_BITS64
>  extern int sem_clockwait (sem_t *__restrict __sem,
>  			  clockid_t clock,
>  			  const struct timespec *__restrict __abstime)
>    __nonnull ((1, 3));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (sem_clockwait,
> +                       (sem_t *__restrict __sem,
> +                        clockid_t clock,
> +                        const struct timespec *__restrict __abstime),
> +                        __sem_clockwait64)
> +  __nonnull ((1, 3));
> +#  else
> +#   define sem_clockwait __sem_clockwait64
> +#  endif
> +# endif
>  #endif
>  
>  /* Test whether SEM is posted.  */
> diff --git a/sysdeps/pthread/threads.h b/sysdeps/pthread/threads.h
> index 46929a025e..bf251c9db4 100644
> --- a/sysdeps/pthread/threads.h
> +++ b/sysdeps/pthread/threads.h
> @@ -88,8 +88,18 @@ extern thrd_t thrd_current (void);
>     __TIME_POINT.  The current thread may resume if receives a signal.  In
>     that case, if __REMAINING is not NULL, the remaining time is stored in
>     the object pointed by it.  */
> +#ifndef __USE_TIME_BITS64
>  extern int thrd_sleep (const struct timespec *__time_point,
>  		       struct timespec *__remaining);
> +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT (thrd_sleep, (const struct timespec *__time_point,
> +                                    struct timespec *__remaining),
> +                       __thrd_sleep64);
> +# else
> +#  define thrd_sleep __thrd_sleep64
> +# endif
> +#endif
>  
>  /* Terminate current thread execution, cleaning up any thread local
>     storage and freeing resources.  Returns the value specified in __RES.  */
> @@ -131,8 +141,19 @@ extern int mtx_lock (mtx_t *__mutex);
>  /* Block the current thread until the mutex pointed by __MUTEX is unlocked
>     or time pointed by __TIME_POINT is reached.  In case the mutex is unlock,
>     the current thread will not be blocked.  */
> +#ifndef __USE_TIME_BITS64
>  extern int mtx_timedlock (mtx_t *__restrict __mutex,
>  			  const struct timespec *__restrict __time_point);
> +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT (mtx_timedlock, (mtx_t *__restrict __mutex,
> +                                       const struct timespec *__restrict
> +                                       __time_point),
> +                       __mtx_timedlock64);
> +# else
> +#  define mtx_timedlock __mtx_timedlock64
> +# endif
> +#endif
>  
>  /* Try to lock the mutex pointed by __MUTEX without blocking.  If the mutex
>     is free the current threads takes control of it, otherwise it returns
> @@ -171,9 +192,21 @@ extern int cnd_wait (cnd_t *__cond, mtx_t *__mutex);
>  /* Block current thread on the condition variable until condition variable
>     pointed by __COND is signaled or time pointed by __TIME_POINT is
>     reached.  */
> +#ifndef __USE_TIME_BITS64
>  extern int cnd_timedwait (cnd_t *__restrict __cond,
>  			  mtx_t *__restrict __mutex,
>  			  const struct timespec *__restrict __time_point);
> +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT (cnd_timedwait, (cnd_t *__restrict __cond,
> +                                       mtx_t *__restrict __mutex,
> +                                       const struct timespec *__restrict
> +                                       __time_point),
> +                       __cnd_timedwait64);
> +# else
> +#  define cnd_timedwait __cnd_timedwait64
> +# endif
> +#endif
>  
>  /* Destroy condition variable pointed by __cond and free all of its
>     resources.  */
> diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
> index 148f04c50a..52fedc61f0 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -1,3 +1,4 @@
> +%include <time64-compat.h>
>  libc {
>    GLIBC_2.0 {
>      # functions used in inline functions or macros
> @@ -168,6 +169,81 @@ libc {
>      getdents64; gettid; tgkill;
>    }
>    GLIBC_2.32 {
> +  }
> +  GLIBC_2.34 {
> +%ifdef TIME64_NON_DEFAULT
> +    # 64 bit time_t support
> +    __adjtime64;
> +    ___adjtimex64;
> +    __clock_adjtime64;
> +    __clock_getres64;
> +    __clock_gettime64;
> +    __clock_nanosleep_time64;
> +    __clock_settime64;
> +    __cnd_timedwait64;
> +    __ctime64;
> +    __ctime64_r;
> +    __difftime64;
> +    __fstat64_time64;
> +    __fstatat64_time64;
> +    __futimens64;
> +    __futimes64;
> +    __futimesat64;
> +    __getitimer64;
> +    __getrusage64;
> +    __gettimeofday64;
> +    __gmtime64;
> +    __gmtime64_r;
> +    __localtime64;
> +    __localtime64_r;
> +    __lstat64_time64;
> +    __lutimes64;
> +    __mktime64;
> +    __msgctl64;
> +    __mtx_timedlock64;
> +    __nanosleep64;
> +    __nanosleep64;
> +    __ntp_gettime64;
> +    __ntp_gettimex64;
> +    __ppoll64;
> +    __pselec64;
> +    __pselect64;
> +    __pthread_clockjoin_np64;
> +    __pthread_cond_clockwait64;
> +    __pthread_cond_timedwait64;
> +    __pthread_mutex_clocklock64;
> +    __pthread_mutex_timedlock64;
> +    __pthread_rwlock_clockrdlock64;
> +    __pthread_rwlock_clockwrlock64;
> +    __pthread_rwlock_timedrdlock64;
> +    __pthread_rwlock_timedwrlock64;
> +    __pthread_timedjoin_np64;
> +    __recvmmsg64;
> +    __sched_rr_get_interval64;
> +    __select64;
> +    __sem_clockwait64;
> +    __semctl64;
> +    __semtimedop64;
> +    __sem_timedwait64;
> +    __setitimer64;
> +    __settimeofday64;
> +    __shmctl64;
> +    __sigtimedwait64;
> +    __stat64_time64;
> +    __thrd_sleep64;
> +    __time64;
> +    __timegm64;
> +    __timerfd_gettime64;
> +    __timerfd_settime64;
> +    __timespec_get64;
> +    __timespec_getres64;
> +    __utime64;
> +    __utimensat64;
> +    __utimes64;
> +    __utimes64;
> +    __wait3_time64;
> +    __wait4_time64;
> +%endif
>    }
>    GLIBC_PRIVATE {
>      # functions used in other libraries
> @@ -188,3 +264,24 @@ ld {
>      __nptl_change_stack_perm;
>    }
>  }
> +
> +librt {
> +  GLIBC_2.34 {
> +%ifdef TIME64_NON_DEFAULT
> +    # 64 bit time_t support
> +    __aio_suspend_time64;
> +    __mq_timedsend_time64;
> +    __mq_timedreceive_time64;
> +    __timer_gettime64;
> +    __timer_settime64;
> +%endif
> +  }
> +}
> +
> +libanl {
> +%ifdef TIME64_NON_DEFAULT
> +  GLIBC_2.34 {
> +    __gai_suspend_time64;
> +  }
> +%endif
> +}
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist
> index a8fafedb66..37f9b49e52 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist
> @@ -1,3 +1,4 @@
> +GLIBC_2.34 __gai_suspend_time64 F
>  GLIBC_2.4 gai_cancel F
>  GLIBC_2.4 gai_error F
>  GLIBC_2.4 gai_suspend F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index 7c3029a7e5..694033a42b 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -189,16 +189,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/librt.abilist b/sysdeps/unix/sysv/linux/arm/be/librt.abilist
> index 3c0647b251..8cb1ed626c 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/librt.abilist
> @@ -1,3 +1,8 @@
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 aio_cancel F
>  GLIBC_2.4 aio_cancel64 F
>  GLIBC_2.4 aio_error F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist
> index a8fafedb66..37f9b49e52 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist
> @@ -1,3 +1,4 @@
> +GLIBC_2.34 __gai_suspend_time64 F
>  GLIBC_2.4 gai_cancel F
>  GLIBC_2.4 gai_error F
>  GLIBC_2.4 gai_suspend F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 24f5b202e8..1ead45904f 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -186,16 +186,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/librt.abilist b/sysdeps/unix/sysv/linux/arm/le/librt.abilist
> index 3c0647b251..8cb1ed626c 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/librt.abilist
> @@ -1,3 +1,8 @@
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 aio_cancel F
>  GLIBC_2.4 aio_cancel64 F
>  GLIBC_2.4 aio_error F
> diff --git a/sysdeps/unix/sysv/linux/arm/time64-compat.h b/sysdeps/unix/sysv/linux/arm/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arm/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/bits/msq.h b/sysdeps/unix/sysv/linux/bits/msq.h
> index 3313b69d78..7c9c479551 100644
> --- a/sysdeps/unix/sysv/linux/bits/msq.h
> +++ b/sysdeps/unix/sysv/linux/bits/msq.h
> @@ -26,6 +26,7 @@ typedef __syscall_ulong_t msgqnum_t;
>  typedef __syscall_ulong_t msglen_t;
>  
>  #include <bits/types/struct_msqid_ds.h>
> +#include <bits/types/struct_msqid64_ds.h>
>  
>  /* Define options for message queue functions.  */
>  #define MSG_NOERROR	010000	/* no error if message is too big */
> diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h
> index ad13287e66..776524b876 100644
> --- a/sysdeps/unix/sysv/linux/bits/sem.h
> +++ b/sysdeps/unix/sysv/linux/bits/sem.h
> @@ -22,6 +22,7 @@
>  #include <sys/types.h>
>  #include <bits/timesize.h>
>  #include <bits/types/struct_semid_ds.h>
> +#include <bits/types/struct_semid64_ds.h>
>  
>  /* Flags for `semop'.  */
>  #define SEM_UNDO	0x1000		/* undo the operation on exit */
> diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h
> index a50c79d7be..454fc3f366 100644
> --- a/sysdeps/unix/sysv/linux/bits/shm.h
> +++ b/sysdeps/unix/sysv/linux/bits/shm.h
> @@ -43,6 +43,7 @@ __BEGIN_DECLS
>  typedef __syscall_ulong_t shmatt_t;
>  
>  #include <bits/types/struct_shmid_ds.h>
> +#include <bits/types/struct_shmid64_ds.h>
>  
>  #ifdef __USE_MISC
>  
> diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h
> index ee5a8b3ef4..d0c98a7864 100644
> --- a/sysdeps/unix/sysv/linux/bits/time.h
> +++ b/sysdeps/unix/sysv/linux/bits/time.h
> @@ -77,6 +77,16 @@ __BEGIN_DECLS
>  /* Tune a POSIX clock.  */
>  extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW;
>  
> +#ifdef __USE_TIME_BITS64
> +# if defined(__REDIRECT_NTH)
> +extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
> +                                           struct timex *__utx),
> +                           __clock_adjtime64);
> +# else
> +# define clock_adjtime __clock_adjtime64
> +# endif
> +#endif
> +
>  __END_DECLS
>  #endif /* use GNU */
>  
> diff --git a/sysdeps/unix/sysv/linux/cnd_timedwait.c b/sysdeps/unix/sysv/linux/cnd_timedwait.c
> index 0415c683f9..6e8ce3d61b 100644
> --- a/sysdeps/unix/sysv/linux/cnd_timedwait.c
> +++ b/sysdeps/unix/sysv/linux/cnd_timedwait.c
> @@ -21,8 +21,8 @@
>  #include "thrd_priv.h"
>  
>  int
> -___cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
> -                    const struct __timespec64 *restrict time_point)
> +__cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
> +                   const struct __timespec64 *restrict time_point)
>  {
>    int err_code = __pthread_cond_timedwait64 ((pthread_cond_t *) cond,
>                                               (pthread_mutex_t *) mutex,
> @@ -31,9 +31,9 @@ ___cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
>  }
>  
>  #if __TIMESIZE == 64
> -strong_alias (___cnd_timedwait64, ___cnd_timedwait)
> +strong_alias (__cnd_timedwait64, ___cnd_timedwait)
>  #else
> -libc_hidden_ver (___cnd_timedwait64, __cnd_timedwait64)
> +libc_hidden_def (__cnd_timedwait64)
>  
>  int
>  ___cnd_timedwait (cnd_t *restrict cond, mtx_t *restrict mutex,
> diff --git a/sysdeps/unix/sysv/linux/csky/libanl.abilist b/sysdeps/unix/sysv/linux/csky/libanl.abilist
> index 416a6f8ddb..01f2e6cbf0 100644
> --- a/sysdeps/unix/sysv/linux/csky/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.29 gai_cancel F
>  GLIBC_2.29 gai_error F
>  GLIBC_2.29 gai_suspend F
>  GLIBC_2.29 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index 85851c5fca..e8fce124fd 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2266,16 +2266,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/csky/librt.abilist b/sysdeps/unix/sysv/linux/csky/librt.abilist
> index c6690ef7c1..b60deca65a 100644
> --- a/sysdeps/unix/sysv/linux/csky/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/librt.abilist
> @@ -33,3 +33,8 @@ GLIBC_2.29 timer_delete F
>  GLIBC_2.29 timer_getoverrun F
>  GLIBC_2.29 timer_gettime F
>  GLIBC_2.29 timer_settime F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/time64-compat.h b/sysdeps/unix/sysv/linux/csky/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/csky/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/features-time64.h b/sysdeps/unix/sysv/linux/features-time64.h
> new file mode 100644
> index 0000000000..c6a0a1874c
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/features-time64.h
> @@ -0,0 +1,37 @@
> +/* Features part to handle 64-bit time_t support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* We need to know the word size in order to check the time size.  */
> +#include <bits/wordsize.h>
> +#include <bits/timesize.h>
> +
> +#if defined _TIME_BITS
> +# if _TIME_BITS == 64
> +#  if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
> +#   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
> +#  elif __TIMESIZE == 32
> +#   define __USE_TIME_BITS64	1
> +#  endif
> +# elif _TIME_BITS == 32
> +#  if __TIMESIZE > 32
> +#   error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32"
> +#  endif
> +# else
> +#  error Invalid _TIME_BITS value (can only be 32 or 64 bits)
> +# endif
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/hppa/libanl.abilist b/sysdeps/unix/sysv/linux/hppa/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index ede69c7ed5..f196d94139 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2219,16 +2219,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist b/sysdeps/unix/sysv/linux/hppa/librt.abilist
> index bb03781dcc..463a88a1df 100644
> --- a/sysdeps/unix/sysv/linux/hppa/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/time64-compat.h b/sysdeps/unix/sysv/linux/hppa/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/hppa/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
> index da716e2c1b..8d5efb4f65 100644
> --- a/sysdeps/unix/sysv/linux/i386/Makefile
> +++ b/sysdeps/unix/sysv/linux/i386/Makefile
> @@ -1,6 +1,8 @@
>  # The default ABI is 32.
>  default-abi := 32
>  
> +extra-version := Versions-y2038
> +
>  ifeq ($(subdir),misc)
>  sysdep_routines += ioperm iopl vm86
>  
> diff --git a/sysdeps/unix/sysv/linux/i386/libanl.abilist b/sysdeps/unix/sysv/linux/i386/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/i386/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index c883dc08bc..0687af280c 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2401,17 +2401,84 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __isnanf128 F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist b/sysdeps/unix/sysv/linux/i386/librt.abilist
> index bb03781dcc..463a88a1df 100644
> --- a/sysdeps/unix/sysv/linux/i386/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/i386/time64-compat.h b/sysdeps/unix/sysv/linux/i386/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/i386/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/include/sys/msg.h b/sysdeps/unix/sysv/linux/include/sys/msg.h
> index 522903f818..c460be0dc9 100644
> --- a/sysdeps/unix/sysv/linux/include/sys/msg.h
> +++ b/sysdeps/unix/sysv/linux/include/sys/msg.h
> @@ -7,8 +7,6 @@ extern ssize_t __libc_msgrcv (int msqid, void *msgp, size_t msgsz,
>  extern int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz,
>  			  int msgflg);
>  
> -# include <bits/types/struct_msqid64_ds.h>
> -
>  # if __TIMESIZE == 64
>  #  define __msgctl64 __msgctl
>  # else
> diff --git a/sysdeps/unix/sysv/linux/include/sys/shm.h b/sysdeps/unix/sysv/linux/include/sys/shm.h
> index 530a1cdfc9..85177a632d 100644
> --- a/sysdeps/unix/sysv/linux/include/sys/shm.h
> +++ b/sysdeps/unix/sysv/linux/include/sys/shm.h
> @@ -3,8 +3,6 @@
>  
>  #ifndef _ISOMAC
>  
> -# include <bits/types/struct_shmid64_ds.h>
> -
>  # if __TIMESIZE == 64
>  #  define __shmctl64 __shmctl
>  # else
> diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h
> index e136ed172e..c554248ed9 100644
> --- a/sysdeps/unix/sysv/linux/include/sys/timex.h
> +++ b/sysdeps/unix/sysv/linux/include/sys/timex.h
> @@ -23,10 +23,12 @@
>  
>  # ifndef _ISOMAC
>  
> +extern int __adjtimex (struct timex *__ntx);
>  libc_hidden_proto (__adjtimex)
>  
>  #  include <time.h>
>  #  include <struct___timeval64.h>
> +
>  /* Local definition of 64 bit time supporting timex struct */
>  #  if __TIMESIZE == 64
>  #   define __timex64 timex
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
> index a8fafedb66..37f9b49e52 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
> @@ -1,3 +1,4 @@
> +GLIBC_2.34 __gai_suspend_time64 F
>  GLIBC_2.4 gai_cancel F
>  GLIBC_2.4 gai_error F
>  GLIBC_2.4 gai_suspend F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index 8ee9648828..bfd2b7c135 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -190,16 +190,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
> index 3c0647b251..8cb1ed626c 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
> @@ -1,3 +1,8 @@
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 aio_cancel F
>  GLIBC_2.4 aio_cancel64 F
>  GLIBC_2.4 aio_error F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 1c51cb41ec..2bd9f7ab64 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2345,16 +2345,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
> index bb03781dcc..463a88a1df 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/time64-compat.h b/sysdeps/unix/sysv/linux/m68k/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/m68k/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist
> index 67c7554803..c06e33a1cf 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.18 gai_cancel F
>  GLIBC_2.18 gai_error F
>  GLIBC_2.18 gai_suspend F
>  GLIBC_2.18 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index f8b67cd170..2436c57b2e 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2317,16 +2317,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
> index 889dfbc0ee..1b8fc10087 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist
> @@ -33,3 +33,8 @@ GLIBC_2.18 timer_delete F
>  GLIBC_2.18 timer_getoverrun F
>  GLIBC_2.18 timer_gettime F
>  GLIBC_2.18 timer_settime F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist
> index 67c7554803..c06e33a1cf 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.18 gai_cancel F
>  GLIBC_2.18 gai_error F
>  GLIBC_2.18 gai_suspend F
>  GLIBC_2.18 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index edac4a1bb4..1262d01845 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2314,16 +2314,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
> index 889dfbc0ee..1b8fc10087 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
> @@ -33,3 +33,8 @@ GLIBC_2.18 timer_delete F
>  GLIBC_2.18 timer_getoverrun F
>  GLIBC_2.18 timer_gettime F
>  GLIBC_2.18 timer_settime F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/time64-compat.h b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index db900c89ab..2812b458c8 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2310,16 +2310,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
> index 1539c1cef9..c4dd28e3b2 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index 4e15f48b6c..782c5470a6 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2308,16 +2308,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 616a6076f1..3487d0f4c3 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2316,16 +2316,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
> index 1539c1cef9..c4dd28e3b2 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/mtx_timedlock.c b/sysdeps/unix/sysv/linux/mtx_timedlock.c
> index 7715ebb315..8983eb8556 100644
> --- a/sysdeps/unix/sysv/linux/mtx_timedlock.c
> +++ b/sysdeps/unix/sysv/linux/mtx_timedlock.c
> @@ -21,8 +21,8 @@
>  #include "thrd_priv.h"
>  
>  int
> -___mtx_timedlock64 (mtx_t *restrict mutex,
> -                    const struct __timespec64 *restrict time_point)
> +__mtx_timedlock64 (mtx_t *restrict mutex,
> +                   const struct __timespec64 *restrict time_point)
>  {
>    int err_code = __pthread_mutex_timedlock64 ((pthread_mutex_t *)mutex,
>                                                time_point);
> @@ -30,9 +30,9 @@ ___mtx_timedlock64 (mtx_t *restrict mutex,
>  }
>  
>  #if __TIMESIZE == 64
> -strong_alias (___mtx_timedlock64, ___mtx_timedlock)
> +strong_alias (__mtx_timedlock64, ___mtx_timedlock)
>  #else
> -libc_hidden_ver (___mtx_timedlock64, __mtx_timedlock64)
> +libc_hidden_def (__mtx_timedlock64)
>  
>  int
>  ___mtx_timedlock (mtx_t *restrict mutex,
> diff --git a/sysdeps/unix/sysv/linux/nios2/libanl.abilist b/sysdeps/unix/sysv/linux/nios2/libanl.abilist
> index 6ff9c2d94e..6b080bd075 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.21 gai_cancel F
>  GLIBC_2.21 gai_error F
>  GLIBC_2.21 gai_suspend F
>  GLIBC_2.21 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index 0fc42897aa..056254475b 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2356,16 +2356,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/nios2/librt.abilist b/sysdeps/unix/sysv/linux/nios2/librt.abilist
> index b4ae7a2dc2..2458614125 100644
> --- a/sysdeps/unix/sysv/linux/nios2/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/librt.abilist
> @@ -33,3 +33,8 @@ GLIBC_2.21 timer_delete F
>  GLIBC_2.21 timer_getoverrun F
>  GLIBC_2.21 timer_gettime F
>  GLIBC_2.21 timer_settime F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/time64-compat.h b/sysdeps/unix/sysv/linux/nios2/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/nios2/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 553ecdabc9..98e1da179b 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2372,16 +2372,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
> index bb03781dcc..463a88a1df 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 7ec438f7b4..6dc0ecf108 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2405,16 +2405,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 2274342208..230031f2be 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2370,16 +2370,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
> index bb03781dcc..463a88a1df 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
> index 1043b2b80d..bb2690d30f 100644
> --- a/sysdeps/unix/sysv/linux/semctl.c
> +++ b/sysdeps/unix/sysv/linux/semctl.c
> @@ -21,7 +21,6 @@
>  #include <ipc_priv.h>
>  #include <sysdep.h>
>  #include <shlib-compat.h>
> -#include <bits/types/struct_semid64_ds.h>  /* For __semid64_ds.  */
>  #include <linux/posix_types.h>             /* For __kernel_mode_t.  */
>  
>  /* The struct used to issue the syscall.  For architectures that assume
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index 97942ff01a..72073ecc27 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2226,16 +2226,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/librt.abilist b/sysdeps/unix/sysv/linux/sh/be/librt.abilist
> index bb03781dcc..463a88a1df 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index 617b673620..e07c4657f9 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2223,16 +2223,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/librt.abilist b/sysdeps/unix/sysv/linux/sh/le/librt.abilist
> index bb03781dcc..463a88a1df 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/librt.abilist
> @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/sh/time64-compat.h b/sysdeps/unix/sysv/linux/sh/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/sh/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
> index d9a5ed015d..ff719e7605 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F
>  GLIBC_2.2.3 gai_error F
>  GLIBC_2.2.3 gai_suspend F
>  GLIBC_2.2.3 getaddrinfo_a F
> +GLIBC_2.34 __gai_suspend_time64 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index 3c6559bb4f..7467677c1b 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2363,16 +2363,83 @@ GLIBC_2.33 mknod F
>  GLIBC_2.33 mknodat F
>  GLIBC_2.33 stat F
>  GLIBC_2.33 stat64 F
> +GLIBC_2.34 ___adjtimex64 F
> +GLIBC_2.34 __adjtime64 F
> +GLIBC_2.34 __clock_adjtime64 F
> +GLIBC_2.34 __clock_getres64 F
> +GLIBC_2.34 __clock_gettime64 F
> +GLIBC_2.34 __clock_nanosleep_time64 F
> +GLIBC_2.34 __clock_settime64 F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __ctime64 F
> +GLIBC_2.34 __ctime64_r F
> +GLIBC_2.34 __difftime64 F
> +GLIBC_2.34 __fstat64_time64 F
> +GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __futimens64 F
> +GLIBC_2.34 __futimes64 F
> +GLIBC_2.34 __futimesat64 F
> +GLIBC_2.34 __getitimer64 F
> +GLIBC_2.34 __getrusage64 F
> +GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __gmtime64 F
> +GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> +GLIBC_2.34 __localtime64 F
> +GLIBC_2.34 __localtime64_r F
> +GLIBC_2.34 __lstat64_time64 F
> +GLIBC_2.34 __lutimes64 F
> +GLIBC_2.34 __mktime64 F
> +GLIBC_2.34 __msgctl64 F
> +GLIBC_2.34 __mtx_timedlock64 F
> +GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __ntp_gettime64 F
> +GLIBC_2.34 __ntp_gettimex64 F
> +GLIBC_2.34 __ppoll64 F
> +GLIBC_2.34 __pselect64 F
>  GLIBC_2.34 __pthread_cleanup_routine F
> +GLIBC_2.34 __pthread_clockjoin_np64 F
> +GLIBC_2.34 __pthread_cond_clockwait64 F
> +GLIBC_2.34 __pthread_cond_timedwait64 F
>  GLIBC_2.34 __pthread_key_create F
> +GLIBC_2.34 __pthread_mutex_clocklock64 F
>  GLIBC_2.34 __pthread_mutex_lock F
> +GLIBC_2.34 __pthread_mutex_timedlock64 F
>  GLIBC_2.34 __pthread_mutex_unlock F
>  GLIBC_2.34 __pthread_register_cancel F
>  GLIBC_2.34 __pthread_register_cancel_defer F
> +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F
> +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F
> +GLIBC_2.34 __pthread_timedjoin_np64 F
>  GLIBC_2.34 __pthread_unregister_cancel F
>  GLIBC_2.34 __pthread_unregister_cancel_restore F
>  GLIBC_2.34 __pthread_unwind_next F
> +GLIBC_2.34 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 F
> +GLIBC_2.34 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
> +GLIBC_2.34 __semctl64 F
> +GLIBC_2.34 __semtimedop64 F
> +GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __settimeofday64 F
> +GLIBC_2.34 __shmctl64 F
> +GLIBC_2.34 __sigtimedwait64 F
> +GLIBC_2.34 __stat64_time64 F
> +GLIBC_2.34 __thrd_sleep64 F
> +GLIBC_2.34 __time64 F
> +GLIBC_2.34 __timegm64 F
> +GLIBC_2.34 __timerfd_gettime64 F
> +GLIBC_2.34 __timerfd_settime64 F
> +GLIBC_2.34 __timespec_get64 F
> +GLIBC_2.34 __timespec_getres64 F
> +GLIBC_2.34 __utime64 F
> +GLIBC_2.34 __utimensat64 F
> +GLIBC_2.34 __utimes64 F
> +GLIBC_2.34 __wait3_time64 F
> +GLIBC_2.34 __wait4_time64 F
>  GLIBC_2.34 call_once F
>  GLIBC_2.34 cnd_broadcast F
>  GLIBC_2.34 cnd_destroy F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
> index 38f0aad791..fb2769e87b 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
> @@ -34,6 +34,11 @@ GLIBC_2.3.4 mq_setattr F
>  GLIBC_2.3.4 mq_timedreceive F
>  GLIBC_2.3.4 mq_timedsend F
>  GLIBC_2.3.4 mq_unlink F
> +GLIBC_2.34 __aio_suspend_time64 F
> +GLIBC_2.34 __mq_timedreceive_time64 F
> +GLIBC_2.34 __mq_timedsend_time64 F
> +GLIBC_2.34 __timer_gettime64 F
> +GLIBC_2.34 __timer_settime64 F
>  GLIBC_2.4 lio_listio F
>  GLIBC_2.4 lio_listio64 F
>  GLIBC_2.7 __mq_open_2 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
> new file mode 100644
> index 0000000000..700f854597
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h
> @@ -0,0 +1,2 @@
> +/* ABI support 64-bit in non-default mode.  */
> +#define TIME64_NON_DEFAULT
> diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h
> index 4ad64c2259..790b9d5be6 100644
> --- a/sysdeps/unix/sysv/linux/sys/timerfd.h
> +++ b/sysdeps/unix/sysv/linux/sys/timerfd.h
> @@ -47,9 +47,31 @@ extern int timerfd_settime (int __ufd, int __flags,
>  			    const struct itimerspec *__utmr,
>  			    struct itimerspec *__otmr) __THROW;
>  
> +#ifdef __USE_TIME_BITS64
> +# if defined(__REDIRECT_NTH)
> +extern int __REDIRECT_NTH (timerfd_settime,
> +                           (int __ufd, int __flags,
> +                            const struct itimerspec *__restrict __value,
> +                            struct itimerspec *__restrict __ovalue),
> +                           __timerfd_settime64);
> +# else
> +# define timerfd_settime __timerfd_settime64
> +# endif
> +#endif
> +
>  /* Return the next expiration time of UFD.  */
>  extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
>  
> +#ifdef __USE_TIME_BITS64
> +# if defined(__REDIRECT_NTH)
> +extern int __REDIRECT_NTH (timerfd_gettime, (int __ufd,
> +                                             struct itimerspec *__otmr),
> +                           __timerfd_gettime64);
> +# else
> +# define timerfd_gettime __timerfd_gettime64
> +# endif
> +#endif
> +
>  __END_DECLS
>  
>  #endif /* sys/timerfd.h */
> diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h
> index eb8d15a806..e17265c607 100644
> --- a/sysdeps/unix/sysv/linux/sys/timex.h
> +++ b/sysdeps/unix/sysv/linux/sys/timex.h
> @@ -54,17 +54,34 @@ struct ntptimeval
>  
>  __BEGIN_DECLS
>  
> -extern int __adjtimex (struct timex *__ntx) __THROW;
> +#ifndef __USE_TIME_BITS64
>  extern int adjtimex (struct timex *__ntx) __THROW;
>  extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
>  
> -#ifdef __REDIRECT_NTH
> +# ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
> -			   ntp_gettimex);
> +                           ntp_gettimex);
> +# else
> +#  define ntp_gettime ntp_gettimex
> +# endif
> +extern int ntp_adjtime (struct timex *__tntx) __THROW;
>  #else
> -# define ntp_gettime ntp_gettimex
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx),
> +                           ___adjtimex64);
> +extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
> +                           __ntp_gettime64);
> +extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),
> +                           __ntp_gettimex64);
> +extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx),
> +                           ___adjtimex64);
> +# else
> +#  define adjtimex ___adjtimex64
> +#  define ntp_adjtime ___adjtimex64
> +#  define ntp_gettime __ntp_gettime64
> +#  define ntp_gettimex __ntp_gettimex64
> +# endif
>  #endif
> -extern int ntp_adjtime (struct timex *__tntx) __THROW;
>  
>  __END_DECLS
>  
> diff --git a/sysvipc/sys/msg.h b/sysvipc/sys/msg.h
> index 9ddedf5e15..f31a43757d 100644
> --- a/sysvipc/sys/msg.h
> +++ b/sysvipc/sys/msg.h
> @@ -58,7 +58,17 @@ struct msgbuf
>  __BEGIN_DECLS
>  
>  /* Message queue control operation.  */
> +#ifndef __USE_TIME_BITS64
>  extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (msgctl,
> +                           (int __msqid, int __cmd, struct msqid_ds *__buf),
> +                           __msgctl64);
> +# else
> +#  define msgctl __msgctl64
> +# endif
> +#endif
>  
>  /* Get messages queue.  */
>  extern int msgget (key_t __key, int __msgflg) __THROW;
> diff --git a/sysvipc/sys/sem.h b/sysvipc/sys/sem.h
> index 03b65dff21..4eb4c51bbe 100644
> --- a/sysvipc/sys/sem.h
> +++ b/sysvipc/sys/sem.h
> @@ -48,7 +48,17 @@ struct sembuf
>  __BEGIN_DECLS
>  
>  /* Semaphore control operation.  */
> +#ifndef __USE_TIME_BITS64
>  extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (semctl,
> +                           (int __semid, int __semnum, int __cmd, ...),
> +                           __semctl64);
> +# else
> +#  define semctl __semctl64
> +# endif
> +#endif
>  
>  /* Get semaphore.  */
>  extern int semget (key_t __key, int __nsems, int __semflg) __THROW;
> @@ -58,8 +68,19 @@ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW;
>  
>  #ifdef __USE_GNU
>  /* Operate on semaphore with timeout.  */
> +# ifndef __USE_TIME_BITS64
>  extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops,
>  		       const struct timespec *__timeout) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (semtimedop, (int __semid, struct sembuf *__sops,
> +                                        size_t __nsops,
> +                                        const struct timespec *__timeout),
> +                           __semtimedop64);
> +#  else
> +#   define semtimedop __semtimedop64
> +#  endif
> +# endif
>  #endif
>  
>  __END_DECLS
> diff --git a/sysvipc/sys/shm.h b/sysvipc/sys/shm.h
> index 7506ba67bf..b09e0497e6 100644
> --- a/sysvipc/sys/shm.h
> +++ b/sysvipc/sys/shm.h
> @@ -46,7 +46,17 @@ __BEGIN_DECLS
>     facility.  The definition is found in XPG4.2.  */
>  
>  /* Shared memory control operation.  */
> +#ifndef __USE_TIME_BITS64
>  extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (shmctl,
> +                           (int __shmid, int __cmd, struct shmid_ds *__buf),
> +                           __shmctl64);
> +# else
> +#  define shmctl __shmctl64
> +# endif
> +#endif
>  
>  /* Get shared memory segment.  */
>  extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
> diff --git a/time/sys/time.h b/time/sys/time.h
> index 42f91f186b..d21411c0b4 100644
> --- a/time/sys/time.h
> +++ b/time/sys/time.h
> @@ -63,10 +63,21 @@ struct timezone
>     use localtime etc. instead.
>     This function itself is semi-obsolete;
>     most callers should use time or clock_gettime instead. */
> +#ifndef __USE_TIME_BITS64
>  extern int gettimeofday (struct timeval *__restrict __tv,
>  			 void *__restrict __tz) __THROW __nonnull ((1));
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (gettimeofday, (struct timeval *__restrict __tv,
> +                                          void *__restrict __tz),
> +                           __gettimeofday64) __nonnull ((1));
> +# else
> +#  define gettimeofday __gettimeofday64
> +# endif
> +#endif
>  
>  #ifdef __USE_MISC
> +# ifndef __USE_TIME_BITS64
>  /* Set the current time of day and timezone information.
>     This call is restricted to the super-user.
>     Setting the timezone in this way is obsolete, but we don't yet
> @@ -82,6 +93,20 @@ extern int settimeofday (const struct timeval *__tv,
>     This call is restricted to the super-user.  */
>  extern int adjtime (const struct timeval *__delta,
>  		    struct timeval *__olddelta) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (settimeofday, (const struct timeval *__tv,
> +                                          const struct timezone *__tz),
> +                           __settimeofday64);
> +
> +extern int __REDIRECT_NTH (adjtime, (const struct timeval *__delta,
> +                                     struct timeval *__olddelta),
> +                           __adjtime64);
> +#  else
> +#   define settimeofday __settimeofday64
> +#   define adjtime __adjtime64
> +#  endif
> +# endif
>  #endif
>  
>  
> @@ -118,6 +143,7 @@ typedef enum __itimer_which __itimer_which_t;
>  typedef int __itimer_which_t;
>  #endif
>  
> +#ifndef __USE_TIME_BITS64
>  /* Set *VALUE to the current setting of timer WHICH.
>     Return 0 on success, -1 on errors.  */
>  extern int getitimer (__itimer_which_t __which,
> @@ -136,21 +162,66 @@ extern int setitimer (__itimer_which_t __which,
>  extern int utimes (const char *__file, const struct timeval __tvp[2])
>       __THROW __nonnull ((1));
>  
> +#else
> +# ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (getitimer, (__itimer_which_t __which,
> +                                       struct itimerval *__value),
> +                           __getitimer64);
> +
> +extern int __REDIRECT_NTH (setitimer, (__itimer_which_t __which,
> +                                       const struct itimerval *__restrict __new,
> +                                       struct itimerval *__restrict __old),
> +                           __setitimer64);
> +
> +extern int __REDIRECT_NTH (utimes, (const char *__file,
> +                                    const struct timeval __tvp[2]),
> +                           __utimes64) __nonnull ((1));
> +# else
> +#  define getitimer __getitimer64
> +#  define setitimer __setitimer64
> +#  define utimes __utimes64
> +# endif
> +#endif
> +
>  #ifdef __USE_MISC
> +# ifndef __USE_TIME_BITS64
>  /* Same as `utimes', but does not follow symbolic links.  */
>  extern int lutimes (const char *__file, const struct timeval __tvp[2])
>       __THROW __nonnull ((1));
>  
>  /* Same as `utimes', but takes an open file descriptor instead of a name.  */
>  extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (lutimes, (const char *__file,
> +                                     const struct timeval __tvp[2]),
> +                           __lutimes64) __nonnull ((1));
> +
> +extern int __REDIRECT_NTH (futimes, (int __fd, const struct timeval __tvp[2]),
> +                           __futimes64);
> +#  else
> +#   define lutimes __lutimes64
> +#   define futimes __futimes64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_GNU
> +# ifndef __USE_TIME_BITS64
>  /* Change the access time of FILE relative to FD to TVP[0] and the
>     modification time of FILE to TVP[1].  If TVP is a null pointer, use
>     the current time instead.  Returns 0 on success, -1 on errors.  */
>  extern int futimesat (int __fd, const char *__file,
>  		      const struct timeval __tvp[2]) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (futimesat, (int __fd, const char *__file,
> +                                       const struct timeval __tvp[2]),
> +                           __futimesat64);
> +#  else
> +#   define futimesat __futimesat64
> +#  endif
> +# endif
>  #endif
>  
>  
> diff --git a/time/time.h b/time/time.h
> index e255db9772..bde870c934 100644
> --- a/time/time.h
> +++ b/time/time.h
> @@ -71,6 +71,7 @@ __BEGIN_DECLS
>     The result / CLOCKS_PER_SEC is program time in seconds.  */
>  extern clock_t clock (void) __THROW;
>  
> +#ifndef __USE_TIME_BITS64
>  /* Return the current time and put it in *TIMER if TIMER is not NULL.  */
>  extern time_t time (time_t *__timer) __THROW;
>  
> @@ -80,7 +81,18 @@ extern double difftime (time_t __time1, time_t __time0)
>  
>  /* Return the `time_t' representation of TP and normalize TP.  */
>  extern time_t mktime (struct tm *__tp) __THROW;
> -
> +#else
> +# ifdef __REDIRECT_NTH
> +extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64);
> +extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t __time0),
> +                              __difftime64) __attribute__ ((__const__));
> +extern time_t __REDIRECT_NTH (mktime, (struct tm *__tp), __mktime64);
> +# else
> +#  define time __time64
> +#  define difftime __difftime64
> +#  define mktime __mktime64
> +# endif
> +#endif
>  
>  /* Format TP into S according to FORMAT.
>     Write no more than MAXSIZE characters and return the number
> @@ -114,6 +126,7 @@ extern char *strptime_l (const char *__restrict __s,
>  #endif
>  
>  
> +#ifndef __USE_TIME_BITS64
>  /* Return the `struct tm' representation of *TIMER
>     in Universal Coordinated Time (aka Greenwich Mean Time).  */
>  extern struct tm *gmtime (const time_t *__timer) __THROW;
> @@ -122,7 +135,20 @@ extern struct tm *gmtime (const time_t *__timer) __THROW;
>     of *TIMER in the local timezone.  */
>  extern struct tm *localtime (const time_t *__timer) __THROW;
>  
> +#else
> +# ifdef __REDIRECT_NTH
> +extern struct tm*__REDIRECT_NTH (gmtime, (const time_t *__timer), __gmtime64);
> +extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer),
> +				  __localtime64);
> +# else
> +#  define gmtime __gmtime64
> +#  define localtime __localtime64
> +# endif
> +#endif
> +
> +
>  #if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
> +# ifndef __USE_TIME_BITS64
>  /* Return the `struct tm' representation of *TIMER in UTC,
>     using *TP to store the result.  */
>  extern struct tm *gmtime_r (const time_t *__restrict __timer,
> @@ -132,6 +158,20 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer,
>     using *TP to store the result.  */
>  extern struct tm *localtime_r (const time_t *__restrict __timer,
>  			       struct tm *__restrict __tp) __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern struct tm*__REDIRECT_NTH (gmtime_r, (const time_t *__restrict __timer,
> +                                            struct tm *__restrict __tp),
> +                                 __gmtime64_r);
> +
> +extern struct tm*__REDIRECT_NTH (localtime_r, (const time_t *__restrict __t,
> +                                               struct tm *__restrict __tp),
> +                                 __localtime64_r);
> +#  else
> +#   define gmtime_r __gmtime64_r
> +#   define localtime_r __localtime_r
> +#  endif
> +# endif
>  #endif	/* POSIX || C2X */
>  
>  /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n"
> @@ -139,7 +179,15 @@ extern struct tm *localtime_r (const time_t *__restrict __timer,
>  extern char *asctime (const struct tm *__tp) __THROW;
>  
>  /* Equivalent to `asctime (localtime (timer))'.  */
> +#ifndef __USE_TIME_BITS64
>  extern char *ctime (const time_t *__timer) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern char *__REDIRECT_NTH (ctime, (const time_t *__timer), __ctime64);
> +# else
> +#  define ctime __ctime64
> +# endif
> +#endif
>  
>  #ifdef __USE_POSIX
>  /* Reentrant versions of the above functions.  */
> @@ -150,8 +198,18 @@ extern char *asctime_r (const struct tm *__restrict __tp,
>  			char *__restrict __buf) __THROW;
>  
>  /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'.  */
> +#ifndef __USE_TIME_BITS64
>  extern char *ctime_r (const time_t *__restrict __timer,
>  		      char *__restrict __buf) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern char *__REDIRECT_NTH (ctime_r, (const time_t *__restrict __timer,
> +                                       char *__restrict __buf), __ctime64_r);
> +# else
> +#  define ctime_r __ctime64_r
> +# endif
> +#endif
> +
>  #endif	/* POSIX */
>  
>  
> @@ -186,11 +244,19 @@ extern long int timezone;
>  /* Miscellaneous functions many Unices inherited from the public domain
>     localtime package.  These are included only for compatibility.  */
>  
> +#ifndef __USE_TIME_BITS64
>  /* Like `mktime', but for TP represents Universal Time, not local time.  */
>  extern time_t timegm (struct tm *__tp) __THROW;
> -
>  /* Another name for `mktime'.  */
>  extern time_t timelocal (struct tm *__tp) __THROW;
> +#else
> +# ifdef __REDIRECT_NTH
> +extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64);
> +extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64);
> +# else
> +#  define timegm __timegm64
> +# endif
> +#endif
>  
>  /* Return the number of days in YEAR.  */
>  extern int dysize (int __year) __THROW  __attribute__ ((__const__));
> @@ -198,6 +264,7 @@ extern int dysize (int __year) __THROW  __attribute__ ((__const__));
>  
>  
>  #ifdef __USE_POSIX199309
> +# ifndef __USE_TIME_BITS64
>  /* Pause execution for a number of nanoseconds.
>  
>     This function is a cancellation point and therefore not marked with
> @@ -205,7 +272,6 @@ extern int dysize (int __year) __THROW  __attribute__ ((__const__));
>  extern int nanosleep (const struct timespec *__requested_time,
>  		      struct timespec *__remaining);
>  
> -
>  /* Get resolution of clock CLOCK_ID.  */
>  extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW;
>  
> @@ -215,15 +281,46 @@ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW;
>  /* Set clock CLOCK_ID to value TP.  */
>  extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
>       __THROW;
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (nanosleep, (const struct timespec *__requested_time,
> +                                   struct timespec *__remaining),
> +                       __nanosleep64);
> +extern int __REDIRECT_NTH (clock_getres, (clockid_t __clock_id,
> +                                          struct timespec *__res),
> +                           __clock_getres64);
> +extern int __REDIRECT_NTH (clock_gettime, (clockid_t __clock_id, struct
> +                                           timespec *__tp), __clock_gettime64);
> +extern int __REDIRECT_NTH (clock_settime, (clockid_t __clock_id, const struct
> +                                           timespec *__tp), __clock_settime64);
> +#  else
> +#   define nanosleep __nanosleep64
> +#   define clock_getres __clock_getres64
> +#   define clock_gettime __clock_gettime64
> +#   define clock_settime __clock_settime64
> +#  endif
> +# endif
> +
>  
>  # ifdef __USE_XOPEN2K
>  /* High-resolution sleep with the specified clock.
>  
>     This function is a cancellation point and therefore not marked with
>     __THROW.  */
> +#  ifndef __USE_TIME_BITS64
>  extern int clock_nanosleep (clockid_t __clock_id, int __flags,
>  			    const struct timespec *__req,
>  			    struct timespec *__rem);
> +#  else
> +#   ifdef __REDIRECT
> +extern int __REDIRECT (clock_nanosleep, (clockid_t __clock_id, int __flags,
> +                                         const struct timespec *__req,
> +                                         struct timespec *__rem),
> +                       __clock_nanosleep_time64);
> +#   else
> +#    define clock_nanosleep __clock_nanosleep_time64
> +#   endif
> +#  endif
>  
>  /* Return clock ID for CPU-time clock.  */
>  extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
> @@ -239,6 +336,7 @@ extern int timer_create (clockid_t __clock_id,
>  extern int timer_delete (timer_t __timerid) __THROW;
>  
>  /* Set timer TIMERID to VALUE, returning old value in OVALUE.  */
> +# ifndef __USE_TIME_BITS64
>  extern int timer_settime (timer_t __timerid, int __flags,
>  			  const struct itimerspec *__restrict __value,
>  			  struct itimerspec *__restrict __ovalue) __THROW;
> @@ -246,6 +344,21 @@ extern int timer_settime (timer_t __timerid, int __flags,
>  /* Get current value of timer TIMERID and store it in VALUE.  */
>  extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
>       __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (timer_settime, (timer_t __timerid, int __flags,
> +     const struct itimerspec *__restrict __value,
> +     struct itimerspec *__restrict __ovalue),
> +                          __timer_settime64);
> +
> +extern int __REDIRECT_NTH (timer_gettime, (timer_t __timerid,
> +                                           struct itimerspec *__value),
> +                           __timer_gettime64);
> +#  else
> +#   define timer_settime __timer_settime64
> +#   define timer_gettime __timer_gettime64
> +#  endif
> +# endif
>  
>  /* Get expiration overrun for timer TIMERID.  */
>  extern int timer_getoverrun (timer_t __timerid) __THROW;
> @@ -253,16 +366,35 @@ extern int timer_getoverrun (timer_t __timerid) __THROW;
>  
>  
>  #ifdef __USE_ISOC11
> +# ifndef __USE_TIME_BITS64
>  /* Set TS to calendar time based in time base BASE.  */
>  extern int timespec_get (struct timespec *__ts, int __base)
>       __THROW __nonnull ((1));
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (timespec_get, (struct timespec *__ts, int __base),
> +                           __timespec_get64) __nonnull ((1));
> +#  else
> +#   define timespec_get __timespec_get64
> +#  endif
> +# endif
>  #endif
>  
>  
>  #if __GLIBC_USE (ISOC2X)
> +# ifndef __USE_TIME_BITS64
>  /* Set TS to resolution of time base BASE.  */
>  extern int timespec_getres (struct timespec *__ts, int __base)
>       __THROW;
> +# else
> +#  ifdef __REDIRECT_NTH
> +extern int __REDIRECT_NTH (timespec_getres, (struct timespec *__ts,
> +                                             int __base),
> +                           __timespec_getres64);
> +#  else
> +#   define timespec_getres __timespec_getres64
> +#  endif
> +# endif
>  #endif
>  
>  
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support
  2021-05-18 20:56 ` [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support Adhemerval Zanella
  2021-05-19 10:44   ` Lukasz Majewski
@ 2021-06-04 19:39   ` Carlos O'Donell
  2021-06-07 18:52     ` Adhemerval Zanella
  1 sibling, 1 reply; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:39 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> The glob might pass a different stat struct for gl_stat and gl_lstat
> when GLOB_ALTDIRFUNC is used.  This requires add a new 64 time
> version that also uses 64 time stat functions.

Needs a v3 please. See below. Minor mistake in the test list?

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Tested-by: Carlos O'Donell <carlos@redhat.com>
 
> Checked on i686-linux-gnu and x86_64-linux-gnu.
> ---
>  include/glob.h                                | 28 +++++++++++
>  posix/Makefile                                |  5 +-
>  posix/glob.c                                  | 46 +++++++++--------
>  posix/glob.h                                  | 22 +++++++++
>  posix/glob64-lstat-compat.c                   |  3 +-
>  posix/glob64-time64.c                         | 49 +++++++++++++++++++
>  posix/globfree64-time64.c                     | 30 ++++++++++++
>  sysdeps/gnu/glob64-lstat-compat.c             |  3 +-
>  sysdeps/unix/sysv/linux/Versions              |  2 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 +
>  sysdeps/unix/sysv/linux/glob-lstat-compat.c   |  6 ++-
>  sysdeps/unix/sysv/linux/glob.c                |  6 +++
>  sysdeps/unix/sysv/linux/glob64-lstat-compat.c | 12 ++---
>  sysdeps/unix/sysv/linux/glob64-time64.c       | 44 +++++++++++++++++
>  sysdeps/unix/sysv/linux/glob64.c              |  8 +--
>  sysdeps/unix/sysv/linux/globfree64-time64.c   | 35 +++++++++++++
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  2 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  2 +
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  2 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  2 +
>  .../sysv/linux/microblaze/be/libc.abilist     |  2 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  2 +
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  2 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  2 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 +
>  sysdeps/unix/sysv/linux/oldglob.c             | 11 ++---
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  2 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  2 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  2 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  2 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  2 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  2 +
>  35 files changed, 308 insertions(+), 40 deletions(-)
>  create mode 100644 posix/glob64-time64.c
>  create mode 100644 posix/globfree64-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/glob64-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/globfree64-time64.c
> 
> diff --git a/include/glob.h b/include/glob.h
> index 1d2f78793e..f48c71960d 100644
> --- a/include/glob.h
> +++ b/include/glob.h
> @@ -2,11 +2,39 @@
>  #include <posix/glob.h>
>  
>  #ifndef _ISOMAC
> +# include <sys/types.h>

OK.

> +
>  libc_hidden_proto (glob)
>  libc_hidden_proto (glob64)
>  libc_hidden_proto (globfree)
>  libc_hidden_proto (globfree64)
>  
> +# if __TIMESIZE == 64
> +#  define glob64_time64_t glob64_t

OK.

> +# else
> +# include <sys/stat.h>
> +
> +typedef struct
> +  {
> +    size_t gl_pathc;

OK. vs. __size_t

> +    char **gl_pathv;

OK. vs. char**

> +    size_t gl_offs;

OK. vs. __size_t

> +    int gl_flags;

OK. vs. int.

> +
> +    void (*gl_closedir) (void *);

OK. func ptr.

> +    struct dirent64 *(*gl_readdir) (void *);

OK. func ptr, but this one returns struct direent64 vs. struct direent.

> +    void *(*gl_opendir) (const char *);
> +    int (*gl_lstat) (const char *__restrict, struct __stat64_t64 *__restrict);
> +    int (*gl_stat) (const char *__restrict, struct __stat64_t64 *__restrict);

OK. struct __stat64_t64 vs. struct stat for 64-bit time_t.

> +  } glob64_time64_t;

OK. New ABI looks good to me. Should be the same size as the previous ABI.

> +
> +extern int __glob64_time64 (const char *pattern, int flags,
> +			    int (*errfunc) (const char *, int),
> +			    glob64_time64_t *pglob);

OK, use new glob64_time64_t type for pglob.

> +void __globfree64_time64 (glob64_time64_t *pglob);
> +libc_hidden_proto (__globfree64_time64)
> +# endif
> +
>  /* Now define the internal interfaces.  */
>  extern int __glob_pattern_p (const char *__pattern, int __quote);
>  extern int __glob64 (const char *__pattern, int __flags,
> diff --git a/posix/Makefile b/posix/Makefile
> index fa0dc0ea20..84204b1270 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -67,7 +67,10 @@ routines :=								      \
>  	get_child_max sched_cpucount sched_cpualloc sched_cpufree \
>  	streams-compat \
>  	shm-directory                                                         \
> -	execveat
> +	execveat \
> +	shm-directory \

This is not correct since it duplicates shm-directory. I expect you intended
to fix the silly "\" way on the end.

We should make all of those routines clearly into one entry per line to make
merging easier.

> +	glob64-time64 \
> +	globfree64-time64
>  
>  aux		:= init-posix environ
>  tests		:= test-errno tstgetopt testfnm runtests runptests \
> diff --git a/posix/glob.c b/posix/glob.c
> index 32c88e5d15..593a4c358f 100644
> --- a/posix/glob.c
> +++ b/posix/glob.c
> @@ -59,25 +59,37 @@
>  # define readdir(str) __readdir64 (str)
>  # define getpwnam_r(name, bufp, buf, len, res) \
>      __getpwnam_r (name, bufp, buf, len, res)
> -# define struct_stat64          struct stat64
>  # define FLEXIBLE_ARRAY_MEMBER
> +# ifndef struct_stat
> +#  define struct_stat           struct stat
> +# endif
> +# ifndef struct_stat64
> +#  define struct_stat64         struct stat64
> +# endif
> +# ifndef GLOB_LSTAT
> +#  define GLOB_LSTAT            gl_lstat
> +# endif
> +# ifndef GLOB_STAT64
> +#  define GLOB_STAT64           __stat64
> +# endif
> +# ifndef GLOB_LSTAT64
> +#  define GLOB_LSTAT64          __lstat64
> +# endif
>  # include <shlib-compat.h>
>  #else /* !_LIBC */
>  # define __glob                 glob
>  # define __getlogin_r(buf, len) getlogin_r (buf, len)
> -# define __lstat64(fname, buf)  lstat (fname, buf)
> -# if defined _WIN32 && !defined __CYGWIN__
> -   /* Avoid GCC or clang warning.  The original __stat64 macro is unused.  */
> -#  undef __stat64
> -# endif
> -# define __stat64(fname, buf)   stat (fname, buf)
>  # define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag)
> -# define struct_stat64          struct stat
>  # ifndef __MVS__
>  #  define __alloca              alloca
>  # endif
>  # define __readdir              readdir
>  # define COMPILE_GLOB64
> +# define struct_stat            struct stat
> +# define struct_stat64          struct stat
> +# define GLOB_LSTAT             gl_lstat
> +# define GLOB_STAT64            stat
> +# define GLOB_LSTAT64           lstat
>  #endif /* _LIBC */
>  
>  #include <fnmatch.h>
> @@ -196,22 +208,14 @@ glob_lstat (glob_t *pglob, int flags, const char *fullname)
>  {
>  /* Use on glob-lstat-compat.c to provide a compat symbol which does not
>     use lstat / gl_lstat.  */
> -#ifdef GLOB_NO_LSTAT
> -# define GL_LSTAT gl_stat
> -# define LSTAT64 __stat64
> -#else
> -# define GL_LSTAT gl_lstat
> -# define LSTAT64 __lstat64
> -#endif
> -
>    union
>    {
> -    struct stat st;
> +    struct_stat st;

OK.

>      struct_stat64 st64;
>    } ust;
>    return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC)
> -          ? pglob->GL_LSTAT (fullname, &ust.st)
> -          : LSTAT64 (fullname, &ust.st64));
> +          ? pglob->GLOB_LSTAT (fullname, &ust.st)
> +          : GLOB_LSTAT64 (fullname, &ust.st64));

OK.

>  }
>  
>  /* Set *R = A + B.  Return true if the answer is mathematically
> @@ -249,11 +253,11 @@ static int collated_compare (const void *, const void *) __THROWNL;
>  static bool
>  is_dir (char const *filename, int flags, glob_t const *pglob)
>  {
> -  struct stat st;
> +  struct_stat st;
>    struct_stat64 st64;
>    return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC)
>            ? pglob->gl_stat (filename, &st) == 0 && S_ISDIR (st.st_mode)
> -          : __stat64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode));
> +          : GLOB_STAT64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode));

OK.

>  }
>  
>  /* Find the end of the sub-pattern in a brace expression.  */
> diff --git a/posix/glob.h b/posix/glob.h
> index b5686600c7..700aeb2392 100644
> --- a/posix/glob.h
> +++ b/posix/glob.h
> @@ -150,20 +150,42 @@ extern int glob (const char *__restrict __pattern, int __flags,
>  /* Free storage allocated in PGLOB by a previous `glob' call.  */
>  extern void globfree (glob_t *__pglob) __THROW;
>  #else
> +# ifdef __USE_TIME_BITS64
> +extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
> +				    int __flags,
> +				    int (*__errfunc) (const char *, int),
> +				    glob_t *__restrict __pglob),
> +			     __glob64_time64);
> +
> +extern void __REDIRECT_NTH (globfree, (glob_t *__pglob),
> +			    __globfree64_time64);

OK. New ABI redirect.

> +# else
>  extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
>  				    int __flags,
>  				    int (*__errfunc) (const char *, int),
>  				    glob_t *__restrict __pglob), glob64);
>  
>  extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
> +# endif
>  #endif
>  
>  #ifdef __USE_LARGEFILE64
> +# ifdef __USE_TIME_BITS64
> +extern int __REDIRECT_NTHNL (glob64, (const char *__restrict __pattern,
> +				      int __flags,
> +				      int (*__errfunc) (const char *, int),
> +				      glob64_t *__restrict __pglob),
> +			     __glob64_time64);
> +
> +extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob),
> +			    __globfree64_time64);

OK.

> +# else
>  extern int glob64 (const char *__restrict __pattern, int __flags,
>  		   int (*__errfunc) (const char *, int),
>  		   glob64_t *__restrict __pglob) __THROWNL;
>  
>  extern void globfree64 (glob64_t *__pglob) __THROW;
> +# endif
>  #endif
>  
>  
> diff --git a/posix/glob64-lstat-compat.c b/posix/glob64-lstat-compat.c
> index bd81a1e390..e90d4ae93e 100644
> --- a/posix/glob64-lstat-compat.c
> +++ b/posix/glob64-lstat-compat.c
> @@ -28,7 +28,8 @@
>  # define GLOB_ATTRIBUTE attribute_compat_text_section
>  
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -# define GLOB_NO_LSTAT
> +# define GLOB_LSTAT   gl_stat
> +# define GLOB_LSTAT64 __stat64

OK.

>  
>  # include <posix/glob64.c>
>  
> diff --git a/posix/glob64-time64.c b/posix/glob64-time64.c
> new file mode 100644
> index 0000000000..04db45f93a
> --- /dev/null
> +++ b/posix/glob64-time64.c
> @@ -0,0 +1,49 @@
> +/* Long File Support glob with 64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <errno.h>
> +#include <glob.h>
> +#include <stddef.h>
> +
> +#if __TIMESIZE != 64
> +
> +/* Do glob searching for PATTERN, placing results in PGLOB.
> +   The bits defined above may be set in FLAGS.
> +   If a directory cannot be opened or read and ERRFUNC is not nil,
> +   it is called with the pathname that caused the error, and the
> +   `errno' value from the failing call; if it returns non-zero
> +   `glob' returns GLOB_ABORTED; if it returns zero, the error is ignored.
> +   If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
> +   Otherwise, `glob' returns zero.  */
> +int
> +__glob64_time64 (const char *pattern, int flags,
> +		 int (*errfunc) (const char *, int), glob64_time64_t *pglob)
> +{
> +  if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
> +    {
> +      __set_errno (EINVAL);
> +      return -1;
> +    }
> +
> +  __set_errno (ENOSYS);
> +  return GLOB_NOSYS;
> +}
> +
> +stub_warning (glob64)
> +
> +#endif

OK. Stub.

> diff --git a/posix/globfree64-time64.c b/posix/globfree64-time64.c
> new file mode 100644
> index 0000000000..d815bc6df1
> --- /dev/null
> +++ b/posix/globfree64-time64.c
> @@ -0,0 +1,30 @@
> +/* Long File Support globfree with 64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <glob.h>
> +
> +#if __TIMESIZE != 64
> +
> +/* Free storage allocated in PGLOB by a previous `glob' call.  */
> +void
> +__globfree64_time64 (glob64_time64_t *pglob)
> +{
> +}
> +libc_hidden_def (__globfree64_time64)
> +
> +#endif

OK. Stub.

> diff --git a/sysdeps/gnu/glob64-lstat-compat.c b/sysdeps/gnu/glob64-lstat-compat.c
> index 6764f1d062..ade4ccac8a 100644
> --- a/sysdeps/gnu/glob64-lstat-compat.c
> +++ b/sysdeps/gnu/glob64-lstat-compat.c
> @@ -39,7 +39,8 @@
>  #define GLOB_ATTRIBUTE attribute_compat_text_section
>  
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -#define GLOB_NO_LSTAT
> +#define GLOB_LSTAT   gl_stat
> +#define GLOB_LSTAT64 __stat64

OK.

>  
>  #include <posix/glob.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
> index 52fedc61f0..27a464483b 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -192,6 +192,8 @@ libc {
>      __getitimer64;
>      __getrusage64;
>      __gettimeofday64;
> +    __glob64_time64;
> +    __globfree64_time64;

OK. New ABI.

>      __gmtime64;
>      __gmtime64_r;
>      __localtime64;
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index 694033a42b..397c97cc16 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -208,6 +208,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 1ead45904f..9bc948703c 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -205,6 +205,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index e8fce124fd..0f84021d9f 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2285,6 +2285,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/glob-lstat-compat.c b/sysdeps/unix/sysv/linux/glob-lstat-compat.c
> index 1f502e3299..7729e0dc12 100644
> --- a/sysdeps/unix/sysv/linux/glob-lstat-compat.c
> +++ b/sysdeps/unix/sysv/linux/glob-lstat-compat.c
> @@ -30,7 +30,11 @@
>  #define GLOB_ATTRIBUTE attribute_compat_text_section
>  
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -#define GLOB_NO_LSTAT
> +#define struct_stat    struct stat
> +#define struct_stat64  struct stat64
> +#define GLOB_LSTAT     gl_stat
> +#define GLOB_STAT64    __stat64
> +#define GLOB_LSTAT64   __stat64
>  
>  #include <posix/glob.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/glob.c b/sysdeps/unix/sysv/linux/glob.c
> index 1be4885b96..89c287d01d 100644
> --- a/sysdeps/unix/sysv/linux/glob.c
> +++ b/sysdeps/unix/sysv/linux/glob.c
> @@ -19,6 +19,12 @@
>  #include <sys/stat.h>
>  #include <kernel_stat.h>
>  
> +#define struct_stat    struct stat
> +#define struct_stat64  struct stat64
> +#define GLOB_LSTAT     gl_lstat
> +#define GLOB_STAT64    __stat64
> +#define GLOB_LSTAT64   __lstat64

OK.

> +
>  #define glob64 __no_glob64_decl
>  #define __glob64 __no___glob64_decl
>  #include <posix/glob.c>
> diff --git a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
> index 40ad625f58..302a44d3a4 100644
> --- a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
> +++ b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
> @@ -33,15 +33,15 @@
>  # define __glob __glob64_lstat_compat
>  # define globfree globfree64
>  
> -# undef stat
> -# define stat stat64
> -
> -# define COMPILE_GLOB64	1
> -
>  # define GLOB_ATTRIBUTE attribute_compat_text_section
>  
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -# define GLOB_NO_LSTAT
> +# define COMPILE_GLOB64	1
> +# define struct_stat    struct stat64
> +# define struct_stat64  struct stat64
> +# define GLOB_LSTAT     gl_stat
> +# define GLOB_STAT64    __stat64
> +# define GLOB_LSTAT64   __stat64
>  
>  # include <posix/glob.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/glob64-time64.c b/sysdeps/unix/sysv/linux/glob64-time64.c
> new file mode 100644
> index 0000000000..260f067fa4
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/glob64-time64.c
> @@ -0,0 +1,44 @@
> +/* Find pathnames matching a pattern.  Linux version.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +# include <glob.h>
> +# include <dirent.h>
> +# include <sys/stat.h>
> +
> +# define dirent dirent64
> +# define __readdir(dirp) __readdir64 (dirp)
> +
> +# define glob_t glob64_time64_t
> +# define __glob __glob64_time64
> +
> +# define globfree(pglob) __globfree64_time64 (pglob)
> +
> +# define COMPILE_GLOB64  1
> +# define struct_stat     struct __stat64_t64
> +# define struct_stat64   struct __stat64_t64
> +# define GLOB_LSTAT      gl_lstat
> +# define GLOB_STAT64     __stat64_time64
> +# define GLOB_LSTAT64    __lstat64_time64
> +
> +# define COMPILE_GLOB64	1
> +
> +# include <posix/glob.c>

OK. Include posix/glob.c with different types.

> +#endif
> diff --git a/sysdeps/unix/sysv/linux/glob64.c b/sysdeps/unix/sysv/linux/glob64.c
> index 3cbadf34fb..572ca215df 100644
> --- a/sysdeps/unix/sysv/linux/glob64.c
> +++ b/sysdeps/unix/sysv/linux/glob64.c
> @@ -31,10 +31,12 @@
>  # define __glob __glob64
>  # define globfree(pglob) globfree64 (pglob)
>  
> -# undef stat
> -# define stat stat64
> -
>  # define COMPILE_GLOB64	1
> +# define struct_stat    struct stat64
> +# define struct_stat64  struct stat64
> +# define GLOB_LSTAT     gl_lstat
> +# define GLOB_STAT64    __stat64
> +# define GLOB_LSTAT64   __lstat64
>  
>  # include <posix/glob.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/globfree64-time64.c b/sysdeps/unix/sysv/linux/globfree64-time64.c
> new file mode 100644
> index 0000000000..d6b1e6ac49
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/globfree64-time64.c
> @@ -0,0 +1,35 @@
> +/* Frees the dynamically allocated storage from an earlier call to glob.
> +   Linux version.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +# include <glob.h>
> +# include <dirent.h>
> +# include <sys/stat.h>
> +
> +# define glob_t glob64_time64_t
> +# define globfree(pglob) __globfree64_time64 (pglob)
> +
> +# undef stat
> +# define stat __stat64_t64
> +
> +# include <posix/globfree.c>
> +libc_hidden_def (__globfree64_time64)

OK.

> +#endif
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index f196d94139..31caf8ebc3 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2238,6 +2238,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 0687af280c..75b71b8a5b 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2420,6 +2420,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __isnanf128 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index bfd2b7c135..2f93afc071 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -209,6 +209,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 2bd9f7ab64..dc074cf576 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2364,6 +2364,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 2436c57b2e..a8b8366c48 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2336,6 +2336,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index 1262d01845..63e3b096e3 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2333,6 +2333,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 2812b458c8..3d17b78b42 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2329,6 +2329,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index 782c5470a6..ba96f15040 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2327,6 +2327,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 3487d0f4c3..04cc170344 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2335,6 +2335,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index 056254475b..ce21e19622 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2375,6 +2375,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/oldglob.c b/sysdeps/unix/sysv/linux/oldglob.c
> index 59bf89dc1d..a9a4439ddb 100644
> --- a/sysdeps/unix/sysv/linux/oldglob.c
> +++ b/sysdeps/unix/sysv/linux/oldglob.c
> @@ -28,13 +28,12 @@ libc_hidden_proto (__old_glob64);
>  #define convert_dirent __old_convert_dirent
>  #define glob_in_dir __old_glob_in_dir
>  
> -#undef stat
> -#define stat stat64
> -#undef __stat
> -#define __stat(file, buf) __stat64 (file, buf)
> -
>  /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
> -#define GLOB_NO_LSTAT
> +#define struct_stat    struct stat64
> +#define struct_stat64  struct stat64
> +#define GLOB_LSTAT     gl_stat
> +#define GLOB_STAT64    __stat64
> +#define GLOB_LSTAT64   __stat64
>  
>  #define GLOB_ATTRIBUTE attribute_compat_text_section
>  
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 98e1da179b..4cfae3b735 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2391,6 +2391,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 6dc0ecf108..3e03f313b1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2424,6 +2424,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 230031f2be..4dfdc61761 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2389,6 +2389,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index 72073ecc27..2c00100dd6 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2245,6 +2245,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index e07c4657f9..2bcf38af9b 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2242,6 +2242,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index 7467677c1b..dad08de21f 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2382,6 +2382,8 @@ GLIBC_2.34 __futimesat64 F
>  GLIBC_2.34 __getitimer64 F
>  GLIBC_2.34 __getrusage64 F
>  GLIBC_2.34 __gettimeofday64 F
> +GLIBC_2.34 __glob64_time64 F
> +GLIBC_2.34 __globfree64_time64 F
>  GLIBC_2.34 __gmtime64 F
>  GLIBC_2.34 __gmtime64_r F
>  GLIBC_2.34 __libc_start_main F
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 21/25] io: Add fts64 with 64 bit time_t support
  2021-05-18 20:56 ` [PATCH v2 21/25] io: Add fts64 " Adhemerval Zanella
  2021-05-19 10:50   ` Lukasz Majewski
@ 2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:39 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> Similar to glob, fts routines passes a stat pointer that might
> differ of size and layout when 64 bit time API is used.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
 
> Checked on i686-linux-gnu and x86_64-linux-gnu.
> ---
>  include/fts.h                                 | 51 +++++++++++++++++++
>  io/Makefile                                   |  4 +-
>  io/fts.h                                      | 43 ++++++++++++++--
>  io/fts64-time64.c                             | 35 +++++++++++++
>  sysdeps/unix/sysv/linux/Versions              |  5 ++
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  5 ++
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  5 ++
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  5 ++
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  5 ++
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  5 ++
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  5 ++
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  5 ++
>  .../sysv/linux/microblaze/be/libc.abilist     |  5 ++
>  .../sysv/linux/microblaze/le/libc.abilist     |  5 ++
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  5 ++
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  5 ++
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  5 ++
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  5 ++
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  5 ++
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  5 ++
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  5 ++
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  5 ++
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  5 ++
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  5 ++
>  24 files changed, 227 insertions(+), 6 deletions(-)
>  create mode 100644 io/fts64-time64.c
> 
> diff --git a/include/fts.h b/include/fts.h
> index 145dce6779..ea36a9b9be 100644
> --- a/include/fts.h
> +++ b/include/fts.h
> @@ -1 +1,52 @@
> +#ifndef _FTS_H
>  #include <io/fts.h>
> +
> +#ifndef _ISOMAC
> +# if __TIMESIZE != 64
> +#  include <sys/stat.h>
> +
> +typedef struct
> +{
> +  struct _ftsent64_time64 *fts_cur;
> +  struct _ftsent64_time64 *fts_child;
> +  struct _ftsent64_time64 **fts_array;

OK, cur, child, array. All using ftsent64 and time64 as expected.

> +  dev_t fts_dev;
> +  char *fts_path;
> +  int fts_rfd;
> +  int fts_pathlen;
> +  int fts_nitems;

OK, dev_t, char, int int int.

> +  int (*fts_compar) (const void *, const void *);

OK, function pointer.

> +  int fts_options;

OK. Int.

> +} FTS64_TIME64;
> +
> +typedef struct _ftsent64_time64
> +{
> +  struct _ftsent64_time64 *fts_cycle;
> +  struct _ftsent64_time64 *fts_parent;
> +  struct _ftsent64_time64 *fts_link;

OK. cycle, parent, linke. Use ftsent64 and time64.

> +  long fts_number;
> +  void *fts_pointer;
> +  char *fts_accpath;
> +  char *fts_path;
> +  int fts_errno;
> +  int fts_symfd;
> +  unsigned short fts_pathlen;
> +  unsigned short fts_namelen;

OK. Long, void, char char, int int, ushort, ushort.

> +
> +  ino64_t fts_ino;
> +  dev_t fts_dev;
> +  nlink_t fts_nlink;

OK. ino64_t, dev_t, nlink_t.

> +
> +  short fts_level;
> +  unsigned short fts_info;
> +  unsigned short fts_flags;
> +  unsigned short fts_instr;

OK. Short, ushort, ushort, ushort.

> +
> +  struct __stat64_t64 *fts_statp;

OK. A stat64 with time64.

> +  char fts_name[1];

OK. char.

> +} FSTENT64_TIME64;
> +
> +# endif
> +#endif
> +
> +#endif /* _FTS_H  */
> diff --git a/io/Makefile b/io/Makefile
> index a22492f3f3..12c832cfcb 100644
> --- a/io/Makefile
> +++ b/io/Makefile
> @@ -54,7 +54,8 @@ routines :=								\
>  	posix_fadvise posix_fadvise64					\
>  	posix_fallocate posix_fallocate64				\
>  	sendfile sendfile64 copy_file_range 				\
> -	utimensat futimens file_change_detection
> +	utimensat futimens file_change_detection			\
> +	fts64-time64

OK. New test.

>  
>  others		:= pwd
>  test-srcs	:= ftwtest
> @@ -102,6 +103,7 @@ CFLAGS-statvfs.c += -fexceptions
>  CFLAGS-fstatvfs.c += -fexceptions
>  CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
>  CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
> +CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions

OK.

>  CFLAGS-ftw.c += $(uses-callbacks) -fexceptions
>  CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions
>  CFLAGS-posix_fallocate.c += -fexceptions
> diff --git a/io/fts.h b/io/fts.h
> index 867677a27e..8d3395fa31 100644
> --- a/io/fts.h
> +++ b/io/fts.h
> @@ -187,6 +187,7 @@ FTSENT	*fts_read (FTS *);
>  int	 fts_set (FTS *, FTSENT *, int) __THROW;
>  #else
>  # ifdef __REDIRECT
> +#  ifndef __USE_TIME_BITS64
>  FTSENT	*__REDIRECT (fts_children, (FTS *, int), fts64_children);
>  int	 __REDIRECT (fts_close, (FTS *), fts64_close);
>  FTS	*__REDIRECT (fts_open, (char * const *, int,
> @@ -194,21 +195,53 @@ FTS	*__REDIRECT (fts_open, (char * const *, int,
>  		     fts64_open);
>  FTSENT	*__REDIRECT (fts_read, (FTS *), fts64_read);
>  int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), fts64_set);
> +#  else
> +FTSENT	*__REDIRECT (fts_children, (FTS *, int), __fts64_children_time64);
> +int	 __REDIRECT (fts_close, (FTS *), __fts64_close_time64);
> +FTS	*__REDIRECT (fts_open, (char * const *, int,
> +				int (*)(const FTSENT **, const FTSENT **)),
> +		     __fts64_open_time64);
> +FTSENT	*__REDIRECT (fts_read, (FTS *), __fts64_read_time64);
> +int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),
> +			 __fts64_set_time64);

OK. Redirects with new type.

> +#  endif
>  # else
> -#  define fts_children fts64_children
> -#  define fts_close fts64_close
> -#  define fts_open fts64_open
> -#  define fts_read fts64_read
> -#  define fts_set fts64_set
> +#  ifndef __USE_TIME_BITS64
> +#   define fts_children fts64_children
> +#   define fts_close fts64_close
> +#   define fts_open fts64_open
> +#   define fts_read fts64_read
> +#   define fts_set fts64_set

OK. Macros for new functions.

> +#  else
> +#  endif
>  # endif
>  #endif
>  #ifdef __USE_LARGEFILE64
> +# ifndef __USE_TIME_BITS64
>  FTSENT64 *fts64_children (FTS64 *, int);
>  int	  fts64_close (FTS64 *);
>  FTS64	 *fts64_open (char * const *, int,
>  		      int (*)(const FTSENT64 **, const FTSENT64 **));
>  FTSENT64 *fts64_read (FTS64 *);
>  int	 fts64_set (FTS64 *, FTSENT64 *, int) __THROW;
> +# else
> +#  ifdef __REDIRECT
> +FTSENT	*__REDIRECT (fts64_children, (FTS64 *, int), __fts64_children_time64);
> +int	 __REDIRECT (fts64_close, (FTS64 *), __fts64_close_time64);
> +FTS	*__REDIRECT (fts64_open, (char * const *, int,
> +				int (*)(const FTSENT64 **, const FTSENT64 **)),
> +		     __fts64_open_time64);
> +FTSENT	*__REDIRECT (fts64_read, (FTS64 *), __fts64_read_time64);
> +int	 __REDIRECT_NTH (fts64_set, (FTS64 *, FTSENT64 *, int),
> +			 __fts64_set_time64);
> +#  else
> +#   define fts_children __fts64_children_time64
> +#   define fts_close __fts64_close_time64
> +#   define fts_open __fts64_open_time64
> +#   define fts_read __fts64_read_time64
> +#   define fts_set __fts64_set_time64
> +#  endif
> +# endif
>  #endif
>  __END_DECLS
>  
> diff --git a/io/fts64-time64.c b/io/fts64-time64.c
> new file mode 100644
> index 0000000000..c8885ca79b
> --- /dev/null
> +++ b/io/fts64-time64.c
> @@ -0,0 +1,35 @@
> +/* File tree traversal functions LFS version.
> +   Copyright (C) 2015-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <time.h>
> +
> +#if __TIMESIZE != 64
> +# define FTS_OPEN __fts64_open_time64
> +# define FTS_CLOSE __fts64_close_time64
> +# define FTS_READ __fts64_read_time64
> +# define FTS_SET __fts64_set_time64
> +# define FTS_CHILDREN __fts64_children_time64
> +# define FTSOBJ FTS64_TIME64
> +# define FTSENTRY FSTENT64_TIME64
> +# define INO_T ino64_t
> +# define STRUCT_STAT __stat64_t64
> +# define STAT __stat64_time64
> +# define LSTAT __lstat64_time64
> +
> +# include "fts.c"

OK. Wow! I'm surprised you could implement it with a wrapper that didn't require
any changes to fts.c, but here it is. I thought mips64 would need a change but
it doesn't.

> +#endif
> diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
> index 27a464483b..eb258a7333 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -189,6 +189,11 @@ libc {
>      __futimens64;
>      __futimes64;
>      __futimesat64;
> +    __fts64_open_time64;
> +    __fts64_close_time64;
> +    __fts64_read_time64;
> +    __fts64_set_time64;
> +    __fts64_children_time64;

OK.

>      __getitimer64;
>      __getrusage64;
>      __gettimeofday64;
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index 397c97cc16..4bdf41cae0 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -202,6 +202,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 9bc948703c..e7bd82b036 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -199,6 +199,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index 0f84021d9f..857bc753e3 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2279,6 +2279,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index 31caf8ebc3..3c94e046c5 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2232,6 +2232,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 75b71b8a5b..6b2f6e3ba9 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2414,6 +2414,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index 2f93afc071..9379012dd9 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -203,6 +203,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index dc074cf576..15142aae53 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2358,6 +2358,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index a8b8366c48..fb73ff10d0 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2330,6 +2330,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index 63e3b096e3..fafcf2f255 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2327,6 +2327,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 3d17b78b42..af82e41244 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2323,6 +2323,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index ba96f15040..9d7afa11f3 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2321,6 +2321,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 04cc170344..3bbd2468d7 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2329,6 +2329,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index ce21e19622..e3b4f8bd9d 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2369,6 +2369,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 4cfae3b735..f0756a3997 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2385,6 +2385,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 3e03f313b1..9e4bf76ba1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2418,6 +2418,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 4dfdc61761..56db45a52d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2383,6 +2383,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index 2c00100dd6..dbfdc3571f 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2239,6 +2239,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index 2bcf38af9b..4b959c0f79 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2236,6 +2236,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index dad08de21f..95fea73af5 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2376,6 +2376,11 @@ GLIBC_2.34 __ctime64_r F
>  GLIBC_2.34 __difftime64 F
>  GLIBC_2.34 __fstat64_time64 F
>  GLIBC_2.34 __fstatat64_time64 F
> +GLIBC_2.34 __fts64_children_time64 F
> +GLIBC_2.34 __fts64_close_time64 F
> +GLIBC_2.34 __fts64_open_time64 F
> +GLIBC_2.34 __fts64_read_time64 F
> +GLIBC_2.34 __fts64_set_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 22/25] io: Add ftw64 with 64 bit time_t support
  2021-05-18 20:56 ` [PATCH v2 22/25] io: Add ftw64 " Adhemerval Zanella
  2021-05-19 10:57   ` Lukasz Majewski
@ 2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:39 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> Similar to fts, ftw routines passes a stat pointer that might
> differ of size and layout when 64 bit time API is used.
> 

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> Checked on i686-linux-gnu and x86_64-linux-gnu.
> ---
>  include/ftw.h                                 | 18 ++++++++
>  io/Makefile                                   |  4 +-
>  io/ftw.c                                      |  5 +-
>  io/ftw.h                                      | 46 ++++++++++++++++++-
>  io/ftw64-time64.c                             | 34 ++++++++++++++
>  sysdeps/unix/sysv/linux/Versions              |  2 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  2 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  2 +
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  2 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  2 +
>  .../sysv/linux/microblaze/be/libc.abilist     |  2 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  2 +
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  2 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  2 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  2 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  2 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  2 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  2 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  2 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  2 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  2 +
>  25 files changed, 141 insertions(+), 6 deletions(-)
>  create mode 100644 io/ftw64-time64.c
> 
> diff --git a/include/ftw.h b/include/ftw.h
> index 4fb654cf22..8fb89c4046 100644
> --- a/include/ftw.h
> +++ b/include/ftw.h
> @@ -1 +1,19 @@
> +#ifndef _FTW_H
>  #include <io/ftw.h>
> +
> +#ifndef _ISOMAC
> +# if __TIMESIZE != 64
> +#  include <sys/stat.h>
> +
> +typedef int (*__ftw64_time64_func_t) (const char *,
> +				      const struct __stat64_t64 *, int);
> +typedef int (*__nftw64_time64_func_t) (const char *,
> +				       const struct __stat64_t64 *, int,
> +				       struct FTW *);
> +
> +extern int __ftw64_time64 (const char *, __ftw64_time64_func_t, int);
> +extern int __nftw64_time64 (const char *, __nftw64_time64_func_t, int, int);

OK. Variants.

> +# endif
> +#endif
> +
> +#endif /* _FTW_H  */
> diff --git a/io/Makefile b/io/Makefile
> index 12c832cfcb..d35e966258 100644
> --- a/io/Makefile
> +++ b/io/Makefile
> @@ -55,7 +55,8 @@ routines :=								\
>  	posix_fallocate posix_fallocate64				\
>  	sendfile sendfile64 copy_file_range 				\
>  	utimensat futimens file_change_detection			\
> -	fts64-time64
> +	fts64-time64							\
> +	ftw64-time64

OK. New.

>  
>  others		:= pwd
>  test-srcs	:= ftwtest
> @@ -106,6 +107,7 @@ CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
>  CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions
>  CFLAGS-ftw.c += $(uses-callbacks) -fexceptions
>  CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions
> +CFLAGS-ftw64-time64.c += $(uses-callbacks) -fexceptions
>  CFLAGS-posix_fallocate.c += -fexceptions
>  CFLAGS-posix_fallocate64.c += -fexceptions
>  CFLAGS-fallocate.c += -fexceptions
> diff --git a/io/ftw.c b/io/ftw.c
> index baca3deeee..ce1c6a14a3 100644
> --- a/io/ftw.c
> +++ b/io/ftw.c
> @@ -821,7 +821,7 @@ FTW_NAME (const char *path, FTW_FUNC_T func, int descriptors)
>    return ftw_startup (path, 0, func, descriptors, 0);
>  }
>  
> -#ifndef _LIBC
> +#ifndef NFTW_OLD_NAME
>  int
>  NFTW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags)
>  {
> @@ -844,7 +844,6 @@ NFTW_NEW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags)
>      }
>    return ftw_startup (path, 1, func, descriptors, flags);
>  }
> -
>  versioned_symbol (libc, NFTW_NEW_NAME, NFTW_NAME, GLIBC_2_3_3);
>  
>  # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_3_3)
> @@ -863,4 +862,4 @@ NFTW_OLD_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags)
>  
>  compat_symbol (libc, NFTW_OLD_NAME, NFTW_NAME, GLIBC_2_1);
>  # endif
> -#endif
> +#endif /* NFTW_OLD_NAME  */
> diff --git a/io/ftw.h b/io/ftw.h
> index 751d689cdb..446498856d 100644
> --- a/io/ftw.h
> +++ b/io/ftw.h
> @@ -137,15 +137,36 @@ extern int ftw (const char *__dir, __ftw_func_t __func, int __descriptors)
>       __nonnull ((1, 2));
>  #else
>  # ifdef __REDIRECT
> +#  ifndef __USE_TIME_BITS64
>  extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func,
>  			     int __descriptors), ftw64) __nonnull ((1, 2));
> +#  else
> +extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func,
> +			     int __descriptors), __ftw64_time64)

OK. Redirect.

> +     __nonnull ((1, 2));
> +#  endif
>  # else
> -#  define ftw ftw64
> +#  ifndef __USE_TIME_BITS64
> +#   define ftw ftw64
> +#  else
> +#   define ftw __ftw64_time64
> +#  endif
>  # endif
>  #endif
>  #ifdef __USE_LARGEFILE64
> +# ifndef __USE_TIME_BITS64
>  extern int ftw64 (const char *__dir, __ftw64_func_t __func,
>  		  int __descriptors) __nonnull ((1, 2));
> +# else
> +#  ifdef __REDIRECT
> +extern int __REDIRECT (ftw64, (const char *__dir, __ftw64_func_t __func,
> +			       int __descriptors),
> +		       __ftw64_time64)
> +     __nonnull ((1, 2));
> +#  else
> +#   define nftw64 __nftw64_time64
> +#  endif
> +# endif
>  #endif
>  
>  #ifdef __USE_XOPEN_EXTENDED
> @@ -159,16 +180,37 @@ extern int nftw (const char *__dir, __nftw_func_t __func, int __descriptors,
>  		 int __flag) __nonnull ((1, 2));
>  # else
>  #  ifdef __REDIRECT
> +#   ifndef __USE_TIME_BITS64
>  extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func,
>  			      int __descriptors, int __flag), nftw64)
>       __nonnull ((1, 2));
> +#   else
> +extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func,
> +			      int __descriptors, int __flag), __nftw64_time64)
> +     __nonnull ((1, 2));
> +#   endif
>  #  else
> -#   define nftw nftw64
> +#   ifndef __USE_TIME_BITS64
> +#    define nftw nftw64
> +#   else
> +#    define nftw __nftw64_time64
> +#   endif
>  #  endif
>  # endif
>  # ifdef __USE_LARGEFILE64
> +#  ifndef __USE_TIME_BITS64
>  extern int nftw64 (const char *__dir, __nftw64_func_t __func,
>  		   int __descriptors, int __flag) __nonnull ((1, 2));
> +#  else
> +#   ifdef __REDIRECT
> +extern int __REDIRECT (nftw64, (const char *__dir, __nftw64_func_t __func,
> +				int __descriptors, int __flag),
> +		       __nftw64_time64)
> +     __nonnull ((1, 2));
> +#   else
> +#    define nftw64 __nftw64_time64
> +#   endif
> +#  endif
>  # endif
>  #endif
>  
> diff --git a/io/ftw64-time64.c b/io/ftw64-time64.c
> new file mode 100644
> index 0000000000..7c9db5448a
> --- /dev/null
> +++ b/io/ftw64-time64.c
> @@ -0,0 +1,34 @@
> +/* File tree walker functions.  LFS version.
> +   Copyright (C) 1996-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/types.h>
> +
> +#if __TIMESIZE != 64
> +# define FTW_NAME       __ftw64_time64
> +# define NFTW_NAME      __nftw64_time64
> +# define INO_T          ino64_t
> +# define STRUCT_STAT    __stat64_t64
> +# define LSTAT          __lstat64_time64
> +# define STAT           __stat64_time64
> +# define FSTATAT        __fstatat64_time64
> +# define FTW_FUNC_T     __ftw64_time64_func_t
> +# define NFTW_FUNC_T    __nftw64_time64_func_t
> +
> +# include "ftw.c"

OK.

> +#endif
> diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
> index eb258a7333..84063d808c 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -194,6 +194,8 @@ libc {
>      __fts64_read_time64;
>      __fts64_set_time64;
>      __fts64_children_time64;
> +    __ftw64_time64;
> +    __nftw64_time64;
>      __getitimer64;
>      __getrusage64;
>      __gettimeofday64;
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index 4bdf41cae0..829ecfec18 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -207,6 +207,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -226,6 +227,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index e7bd82b036..5653b99cf0 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -204,6 +204,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -223,6 +224,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index 857bc753e3..e158505191 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2284,6 +2284,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2303,6 +2304,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index 3c94e046c5..788b0fbb29 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2237,6 +2237,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2256,6 +2257,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 6b2f6e3ba9..2ca1bc3408 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2419,6 +2419,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2439,6 +2440,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index 9379012dd9..5711de528e 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -208,6 +208,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -227,6 +228,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 15142aae53..514a8f321e 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2363,6 +2363,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2382,6 +2383,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index fb73ff10d0..a68e3e8422 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2335,6 +2335,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2354,6 +2355,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index fafcf2f255..e5412abb67 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2332,6 +2332,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2351,6 +2352,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index af82e41244..836e33db28 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2328,6 +2328,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2347,6 +2348,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index 9d7afa11f3..30fe740a12 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2326,6 +2326,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2345,6 +2346,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 3bbd2468d7..345a35807e 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2334,6 +2334,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2353,6 +2354,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e3b4f8bd9d..aba934d286 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2374,6 +2374,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2393,6 +2394,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index f0756a3997..bd0f351037 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2390,6 +2390,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2409,6 +2410,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 9e4bf76ba1..4b613fe9ba 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2423,6 +2423,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2442,6 +2443,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 56db45a52d..8e7ca663e8 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2388,6 +2388,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2407,6 +2408,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index dbfdc3571f..74fb49fc37 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2244,6 +2244,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2263,6 +2264,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index 4b959c0f79..8b9df6cd1e 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2241,6 +2241,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2260,6 +2261,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index 95fea73af5..023232a00b 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2381,6 +2381,7 @@ GLIBC_2.34 __fts64_close_time64 F
>  GLIBC_2.34 __fts64_open_time64 F
>  GLIBC_2.34 __fts64_read_time64 F
>  GLIBC_2.34 __fts64_set_time64 F
> +GLIBC_2.34 __ftw64_time64 F
>  GLIBC_2.34 __futimens64 F
>  GLIBC_2.34 __futimes64 F
>  GLIBC_2.34 __futimesat64 F
> @@ -2400,6 +2401,7 @@ GLIBC_2.34 __mktime64 F
>  GLIBC_2.34 __msgctl64 F
>  GLIBC_2.34 __mtx_timedlock64 F
>  GLIBC_2.34 __nanosleep64 F
> +GLIBC_2.34 __nftw64_time64 F
>  GLIBC_2.34 __ntp_gettime64 F
>  GLIBC_2.34 __ntp_gettimex64 F
>  GLIBC_2.34 __ppoll64 F
> 

OK.

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 23/25] libsupport: Add 64 bit time_t support for time functions
  2021-05-18 20:56 ` [PATCH v2 23/25] libsupport: Add 64 bit time_t support for time functions Adhemerval Zanella
  2021-05-19 11:00   ` Lukasz Majewski
@ 2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:39 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> The patch adds redirections for xclock_gettime, xclock_settime,
> timespec_add, timespec_sub, test_timespec_before_impl,
> test_timespec_equal_or_after_impl, support_timespec_ns,
> support_timespec_normalize, and support_timespec_check_in_range when
> _TIME_BITS=64 is defined.

Requesting v3 please.

Please replace all "64 bit" wit "64-bit". I might have missed
this in earlier posts. They are all adjectives to "time support"
and so should use hyphenation.

Overall nothing else noted.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Tested-by: Carlos O'Donell <carlos@redhat.com>
 
> Co-authored-by: Lukasz Majewski <lukma@denx.de>
> ---
>  support/Makefile                |  6 ++++
>  support/timespec-add-time64.c   | 27 +++++++++++++++++
>  support/timespec-add.c          |  2 +-
>  support/timespec-sub-time64.c   | 27 +++++++++++++++++
>  support/timespec-sub.c          |  2 +-
>  support/timespec-time64.c       | 40 +++++++++++++++++++++++++
>  support/timespec.c              |  9 +++---
>  support/timespec.h              | 52 +++++++++++++++++++++++++--------
>  support/xclock_gettime_time64.c | 26 +++++++++++++++++
>  support/xclock_settime_time64.c | 23 +++++++++++++++
>  support/xtime.h                 |  7 +++++
>  11 files changed, 202 insertions(+), 19 deletions(-)
>  create mode 100644 support/timespec-add-time64.c
>  create mode 100644 support/timespec-sub-time64.c
>  create mode 100644 support/timespec-time64.c
>  create mode 100644 support/xclock_gettime_time64.c
>  create mode 100644 support/xclock_settime_time64.c
> 
> diff --git a/support/Makefile b/support/Makefile
> index da6dc58d37..1ee73f81bc 100644
> --- a/support/Makefile
> +++ b/support/Makefile
> @@ -83,8 +83,11 @@ libsupport-routines = \
>    support_test_verify_impl \
>    temp_file \
>    timespec \
> +  timespec-time64 \
>    timespec-add \
> +  timespec-add-time64 \
>    timespec-sub \
> +  timespec-sub-time64 \
>    write_message \
>    xaccept \
>    xaccept4 \
> @@ -94,7 +97,9 @@ libsupport-routines = \
>    xchdir \
>    xchroot \
>    xclock_gettime \
> +  xclock_gettime_time64 \
>    xclock_settime \
> +  xclock_settime_time64 \
>    xclose \
>    xchmod \
>    xconnect \
> @@ -215,6 +220,7 @@ CFLAGS-support_paths.c = \
>  # in support_timespec_check_in_range and for that computation we use
>  # -fexcess-precision=standard.
>  CFLAGS-timespec.c += -fexcess-precision=standard
> +CFLAGS-timespec-time64.c += -fexcess-precision=standard
>  
>  ifeq (,$(CXX))
>  LINKS_DSO_PROGRAM = links-dso-program-c
> diff --git a/support/timespec-add-time64.c b/support/timespec-add-time64.c
> new file mode 100644
> index 0000000000..8574e1602c
> --- /dev/null
> +++ b/support/timespec-add-time64.c
> @@ -0,0 +1,27 @@
> +/* Add two struct __timespec64 values.  64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library and is also part of gnulib.
> +   Patches to this file should be submitted to both projects.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <time.h>
> +
> +#if __TIMESIZE != 64
> +# define timespec      __timespec64
> +# define time_t        __time64_t
> +# define timespec_add  timespec_add_time64
> +# include "timespec-add.c"
> +#endif
> diff --git a/support/timespec-add.c b/support/timespec-add.c
> index cf8bd91291..8ed3acef6d 100644
> --- a/support/timespec-add.c
> +++ b/support/timespec-add.c
> @@ -61,5 +61,5 @@ timespec_add (struct timespec a, struct timespec b)
>          }
>      }
>  
> -  return make_timespec (rs, rns);
> +  return (struct timespec) { .tv_sec = rs, .tv_nsec = rns };
>  }
> diff --git a/support/timespec-sub-time64.c b/support/timespec-sub-time64.c
> new file mode 100644
> index 0000000000..f88307016d
> --- /dev/null
> +++ b/support/timespec-sub-time64.c
> @@ -0,0 +1,27 @@
> +/* Subtract two struct __timespec64 values.  64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library and is also part of gnulib.
> +   Patches to this file should be submitted to both projects.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <time.h>
> +
> +#if __TIMESIZE != 64
> +# define timespec      __timespec64
> +# define time_t        __time64_t
> +# define timespec_sub  timespec_sub_time64
> +# include "timespec-sub.c"
> +#endif
> diff --git a/support/timespec-sub.c b/support/timespec-sub.c
> index 08cc233086..0b8fea042d 100644
> --- a/support/timespec-sub.c
> +++ b/support/timespec-sub.c
> @@ -61,5 +61,5 @@ timespec_sub (struct timespec a, struct timespec b)
>          }
>      }
>  
> -  return make_timespec (rs, rns);
> +  return (struct timespec) { .tv_sec = rs, .tv_nsec = rns };
>  }
> diff --git a/support/timespec-time64.c b/support/timespec-time64.c
> new file mode 100644
> index 0000000000..5bbf8be7e0
> --- /dev/null
> +++ b/support/timespec-time64.c
> @@ -0,0 +1,40 @@
> +/* Support code for timespec checks.  64 bit time support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <support/timespec.h>
> +#include <stdio.h>
> +#include <stdint.h>
> +#include <assert.h>
> +#include <intprops.h>
> +
> +#if __TIMESIZE != 64
> +struct __timespec64 timespec_sub_time64 (struct __timespec64,
> +					 struct __timespec64);
> +
> +#define test_timespec_before_impl          test_timespec_before_impl_time64
> +#define test_timespec_equal_or_after_impl  \
> +  test_timespec_equal_or_after_impl_time64
> +#define support_timespec_ns                support_timespec_ns_time64
> +#define support_timespec_normalize         support_timespec_normalize_time64
> +#define support_timespec_check_in_range    \
> +  support_timespec_check_in_range_time64
> +#define timespec                           __timespec64
> +#define timespec_sub                       timespec_sub_time64
> +
> +#include "timespec.c"
> +#endif
> diff --git a/support/timespec.c b/support/timespec.c
> index b02afad9d3..fcc54861b1 100644
> --- a/support/timespec.c
> +++ b/support/timespec.c
> @@ -23,9 +23,8 @@
>  #include <intprops.h>
>  
>  void
> -test_timespec_before_impl (const char *file, int line,
> -			   const struct timespec left,
> -			   const struct timespec right)
> +test_timespec_before_impl (const char *file, int line, struct timespec left,
> +			   struct timespec right)
>  {
>    if (left.tv_sec > right.tv_sec
>        || (left.tv_sec == right.tv_sec
> @@ -43,8 +42,8 @@ test_timespec_before_impl (const char *file, int line,
>  
>  void
>  test_timespec_equal_or_after_impl (const char *file, int line,
> -				   const struct timespec left,
> -				   const struct timespec right)
> +				   struct timespec left,
> +				   struct timespec right)
>  {
>    if (left.tv_sec < right.tv_sec
>        || (left.tv_sec == right.tv_sec
> diff --git a/support/timespec.h b/support/timespec.h
> index a3eb72aa01..0478aef51f 100644
> --- a/support/timespec.h
> +++ b/support/timespec.h
> @@ -24,11 +24,6 @@
>  #include <support/check.h>
>  #include <support/xtime.h>
>  
> -struct timespec timespec_add (struct timespec, struct timespec)
> -  __attribute__((const));
> -struct timespec timespec_sub (struct timespec, struct timespec)
> -  __attribute__((const));
> -
>  static inline struct timespec
>  make_timespec (time_t s, long int ns)
>  {
> @@ -40,21 +35,54 @@ make_timespec (time_t s, long int ns)
>  
>  enum { TIMESPEC_HZ = 1000000000 };
>  
> +#ifndef __USE_TIME_BITS64
> +struct timespec timespec_add (struct timespec, struct timespec)
> +  __attribute__((const));
> +struct timespec timespec_sub (struct timespec, struct timespec)
> +  __attribute__((const));
> +
>  void test_timespec_before_impl (const char *file, int line,
> -                                const struct timespec left,
> -                                const struct timespec right);
> +                                struct timespec left,
> +                                struct timespec right);
>  
>  void test_timespec_equal_or_after_impl (const char *file, int line,
> -                                        const struct timespec left,
> -                                        const struct timespec right);
> +                                        struct timespec left,
> +                                        struct timespec right);
>  
>  time_t support_timespec_ns (struct timespec time);
>  
>  struct timespec support_timespec_normalize (struct timespec time);
>  
> -int support_timespec_check_in_range (struct timespec expected, struct timespec observed,
> -				  double lower_bound, double upper_bound);
> -
> +int support_timespec_check_in_range (struct timespec expected,
> +				     struct timespec observed,
> +				     double lower_bound, double upper_bound);
> +
> +#else
> +struct timespec __REDIRECT (timespec_add, (struct timespec, struct timespec),
> +			    timespec_add_time64);
> +struct timespec __REDIRECT (timespec_sub, (struct timespec, struct timespec),
> +			    timespec_sub_time64);
> +void __REDIRECT (test_timespec_before_impl, (const char *file, int line,
> +					     struct timespec left,
> +					     struct timespec right),
> +		 test_timespec_before_impl_time64);
> +void __REDIRECT (test_timespec_equal_or_after_impl, (const char *f, int line,
> +						     struct timespec left,
> +						     struct timespec right),
> +		 test_timespec_equal_or_after_impl_time64);
> +
> +time_t __REDIRECT (support_timespec_ns, (struct timespec time),
> +		   support_timespec_ns_time64);
> +
> +struct timespec __REDIRECT (support_timespec_normalize, (struct timespec time),
> +			    support_timespec_normalize_time64);
> +
> +int __REDIRECT (support_timespec_check_in_range, (struct timespec expected,
> +						  struct timespec observed,
> +						  double lower_bound,
> +						  double upper_bound),
> +		support_timespec_check_in_range_time64);
> +#endif
>  
>  /* Check that the timespec on the left represents a time before the
>     time on the right. */
> diff --git a/support/xclock_gettime_time64.c b/support/xclock_gettime_time64.c
> new file mode 100644
> index 0000000000..bf9fe9bf9c
> --- /dev/null
> +++ b/support/xclock_gettime_time64.c
> @@ -0,0 +1,26 @@
> +/* clock_settime with error checking.  64 bit time_t support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <support/xtime.h>
> +
> +#if __TIMESIZE != 64
> +# define xclock_gettime  xclock_gettime_time64
> +# define timespec        __timespec64
> +# define clock_gettime   __clock_gettime64
> +# include "xclock_gettime.c"
> +#endif
> diff --git a/support/xclock_settime_time64.c b/support/xclock_settime_time64.c
> new file mode 100644
> index 0000000000..62a8be1815
> --- /dev/null
> +++ b/support/xclock_settime_time64.c
> @@ -0,0 +1,23 @@
> +/* clock_settime helper with error checking - 64 bit time_t support.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <support/xtime.h>
> +
> +#if __TIMESIZE != 64
> +# define xclock_settime  xclock_settime_time64
> +# define timespec        __timespec64
> +# define clock_settime   __clock_settime64
> +# include "xclock_settime.c"
> +#endif
> diff --git a/support/xtime.h b/support/xtime.h
> index b4ac3b59e2..25a069d447 100644
> --- a/support/xtime.h
> +++ b/support/xtime.h
> @@ -30,8 +30,15 @@ __BEGIN_DECLS
>  /* The following functions call the corresponding libc functions and
>     terminate the process on error.  */
>  
> +#ifndef __USE_TIME_BITS64
>  void xclock_gettime (clockid_t clock, struct timespec *ts);
>  void xclock_settime (clockid_t clock, const struct timespec *ts);
> +#else
> +void __REDIRECT (xclock_gettime, (clockid_t clock, struct timespec *ts),
> +		 xclock_gettime_time64);
> +void __REDIRECT (xclock_settime, (clockid_t clock, const struct timespec *ts),
> +		 xclock_settime_time64);
> +#endif
>  
>  /* This helper can often simplify tests by avoiding an explicit
>     variable declaration or allowing that declaration to be const. */
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 24/25] libsupport: Add 64 bit time_t support for stat functions
  2021-05-18 20:56 ` [PATCH v2 24/25] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella
  2021-05-19 11:04   ` Lukasz Majewski
@ 2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:39 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> The patch adds redirections for xstat, xlstat, and xfstat when
> _TIME_BITS=64 is defined.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  support/Makefile                |  3 +++
>  support/support-xfstat-time64.c | 32 ++++++++++++++++++++++++++++++++
>  support/support-xstat-time64.c  | 32 ++++++++++++++++++++++++++++++++
>  support/xlstat-time64.c         | 32 ++++++++++++++++++++++++++++++++
>  support/xunistd.h               | 13 +++++++++++++
>  5 files changed, 112 insertions(+)
>  create mode 100644 support/support-xfstat-time64.c
>  create mode 100644 support/support-xstat-time64.c
>  create mode 100644 support/xlstat-time64.c
> 
> diff --git a/support/Makefile b/support/Makefile
> index 1ee73f81bc..8b8534a3c6 100644
> --- a/support/Makefile
> +++ b/support/Makefile
> @@ -40,7 +40,9 @@ libsupport-routines = \
>    resolv_test \
>    set_fortify_handler \
>    support-xfstat \
> +  support-xfstat-time64 \
>    support-xstat \
> +  support-xstat-time64 \
>    support_become_root \
>    support_can_chroot \
>    support_capture_subprocess \
> @@ -117,6 +119,7 @@ libsupport-routines = \
>    xlisten \
>    xlseek \
>    xlstat \
> +  xlstat-time64 \
>    xmalloc \
>    xmemstream \
>    xmkdir \
> diff --git a/support/support-xfstat-time64.c b/support/support-xfstat-time64.c
> new file mode 100644
> index 0000000000..324c5d20d2
> --- /dev/null
> +++ b/support/support-xfstat-time64.c
> @@ -0,0 +1,32 @@
> +/* 64-bit time_t stat with error checking.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* NB: Non-standard file name to avoid sysdeps override for xstat.  */
> +
> +#include <support/check.h>
> +#include <support/xunistd.h>
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +void
> +xfstat_time64 (int fd, struct __stat64_t64 *result)
> +{
> +  if (__fstat64_time64 (fd, result) != 0)
> +    FAIL_EXIT1 ("__fstat64_time64 (%d): %m", fd);
> +}
> +#endif
> diff --git a/support/support-xstat-time64.c b/support/support-xstat-time64.c
> new file mode 100644
> index 0000000000..7d0194b98a
> --- /dev/null
> +++ b/support/support-xstat-time64.c
> @@ -0,0 +1,32 @@
> +/* 64-bit time_t stat with error checking.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* NB: Non-standard file name to avoid sysdeps override for xstat.  */
> +
> +#include <support/check.h>
> +#include <support/xunistd.h>
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +void
> +xstat_time64 (const char *path, struct __stat64_t64 *result)
> +{
> +  if (__stat64_time64 (path, result) != 0)
> +    FAIL_EXIT1 ("__stat64_time64 (\"%s\"): %m", path);
> +}
> +#endif
> diff --git a/support/xlstat-time64.c b/support/xlstat-time64.c
> new file mode 100644
> index 0000000000..ef4d922635
> --- /dev/null
> +++ b/support/xlstat-time64.c
> @@ -0,0 +1,32 @@
> +/* 64-bit time_t stat with error checking.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* NB: Non-standard file name to avoid sysdeps override for xstat.  */
> +
> +#include <support/check.h>
> +#include <support/xunistd.h>
> +#include <sys/stat.h>
> +
> +#if __TIMESIZE != 64
> +void
> +xlstat_time64 (const char *path, struct __stat64_t64 *result)
> +{
> +  if (__lstat64_time64 (path, result) != 0)
> +    FAIL_EXIT1 ("__lstat64_time64 (\"%s\"): %m", path);
> +}
> +#endif
> diff --git a/support/xunistd.h b/support/xunistd.h
> index c642588c29..e4ade65c85 100644
> --- a/support/xunistd.h
> +++ b/support/xunistd.h
> @@ -24,6 +24,7 @@
>  
>  #include <sys/cdefs.h>
>  #include <sys/types.h>
> +#include <sys/stat.h>
>  #include <unistd.h>
>  
>  __BEGIN_DECLS
> @@ -35,9 +36,21 @@ pid_t xwaitpid (pid_t, int *status, int flags);
>  void xpipe (int[2]);
>  void xdup2 (int, int);
>  int xopen (const char *path, int flags, mode_t);
> +#ifndef __USE_TIME_BITS64
> +# ifdef __USE_FILE_OFFSET64
> +void xstat (const char *path, struct stat *);
> +void xlstat (const char *path, struct stat *);
> +void xfstat (int fd, struct stat *);
> +# else
>  void xstat (const char *path, struct stat64 *);
>  void xlstat (const char *path, struct stat64 *);
>  void xfstat (int fd, struct stat64 *);
> +# endif
> +#else
> +void __REDIRECT (xstat, (const char *path, struct stat *), xstat_time64);
> +void __REDIRECT (xlstat, (const char *path, struct stat *), xlstat_time64);
> +void __REDIRECT (xfstat, (int fd, struct stat *), xfstat_time64);
> +#endif
>  void xmkdir (const char *path, mode_t);
>  void xchroot (const char *path);
>  void xunlink (const char *path);
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 25/25] y2038: Add test coverage
  2021-05-18 20:56 ` [PATCH v2 25/25] y2038: Add test coverage Adhemerval Zanella
  2021-05-19 11:08   ` Lukasz Majewski
@ 2021-06-04 19:39   ` Carlos O'Donell
  1 sibling, 0 replies; 92+ messages in thread
From: Carlos O'Donell @ 2021-06-04 19:39 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> It is enabled through a new rule, tests-y2038, which is built only
> when the ABI supports the comapt 64-bit time_t (defined by the
> header time64-compat.h, which also enables the creation of the
> symbol Version for Linux).  It means the tests are not built
> for ABI which already provide default 64-bit time_t.

Overall I like the new rule flag to split out the 64-bit LFS + time_t
tests to support testing them separately. Eventually we may want to
merge things in the future a bit, but this is a perfect initial
implementation. I really liked how easy it was to tweak a test and
then do `make test t=sysvipc/test-sysvmsg-time64` and then
`make test t=sysvipc/test-sysvmsg` and compare the results.

LGTM.

No regressions on x86_64, i686, ppc64le, aarch64, s390x.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
 
> The new rule already adds the required LFS and 64-bit time_t
> compiler flags.
> 
> The current coverage is:
> 
>   * libc:
>     - adjtime                       tst-adjtime-time64
>     - adjtimex                      tst-adjtimex-time64
>     - clock_adjtime                 tst-clock_adjtime-time64
>     - clock_getres                  tst-clock-time64, tst-cpuclock1-time64
>     - clock_gettime                 tst-clock-time64, tst-clock2-time64,
> 				    tst-cpuclock1-time64
>     - clock_nanosleep               tst-clock_nanosleep-time64,
> 				    tst-cpuclock1-time64
>     - clock_settime                 tst-clock2-time64
>     - cnd_timedwait                 tst-cnd-timedwait-time64
>     - ctime                         tst-ctime-time64
>     - ctime_r                       tst-ctime-time64
>     - difftime                      tst-difftime-time64
>     - fstat                         tst-stat-time64
>     - fstatat                       tst-stat-time64
>     - futimens                      tst-futimens-time64
>     - futimes                       tst-futimes-time64
>     - futimesat                     tst-futimesat-time64
>     - fts_*                         tst-fts-time64
>     - getitimer                     tst-itimer-timer64
>     - getrusage
>     - gettimeofday                  tst-clock_nanosleep-time64
>     - glob / globfree               tst-gnuglob64-time64
>     - gmtime                        tst-gmtime-time64
>     - gmtime_r                      tst-gmtime-time64
>     - lstat                         tst-stat-time64
>     - localtime                     tst-y2039-time64
>     - localtime_t                   tst-y2039-time64
>     - lutimes                       tst-lutimes-time64
>     - mktime                        tst-mktime4-time64
>     - mq_timedreceive               tst-mqueue{1248}-time64
>     - mq_timedsend                  tst-mqueue{1248}-time64
>     - msgctl                        test-sysvmsg-time64
>     - mtx_timedlock                 tst-mtx-timedlock-time64
>     - nanosleep                     tst-cpuclock{12}-time64,
> 				    tst-mqueue8-time64, tst-clock-time64
>     - nftw / ftw                    ftwtest-time64
>     - ntp_adjtime                   tst-ntp_adjtime-time64
>     - ntp_gettime                   tst-ntp_gettime-time64
>     - ntp_gettimex                  tst-ntp_gettimex-time64
>     - ppoll                         tst-ppoll-time64
>     - pselect                       tst-pselect-time64
>     - pthread_clockjoin_np          tst-join14-time64
>     - pthread_cond_clockwait        tst-cond11-time64
>     - pthread_cond_timedwait        tst-abstime-time64
>     - pthread_mutex_clocklock       tst-abstime-time64
>     - pthread_mutex_timedlock       tst-abstime-time64
>     - pthread_rwlock_clockrdlock    tst-abstime-time64, tst-rwlock14-time64
>     - pthread_rwlock_clockwrlock    tst-abstime-time64, tst-rwlock14-time64
>     - pthread_rwlock_timedrdlock    tst-abstime-time64, tst-rwlock14-time64
>     - pthread_rwlock_timedwrlock    tst-abstime-time64, tst-rwlock14-time64
>     - pthread_timedjoin_np          tst-join14-time64
>     - recvmmsg                      tst-cancel4_2-time64
>     - sched_rr_get_interval         tst-sched_rr_get_interval-time64
>     - select                        tst-select-time64
>     - sem_clockwait                 tst-sem5-time64
>     - sem_timedwait                 tst-sem5-time64
>     - semctl                        test-sysvsem-time64
>     - semtimedop                    test-sysvsem-time64
>     - setitimer                     tst-mqueue2-time64, tst-itimer-timer64
>     - settimeofday                  tst-settimeofday-time64
>     - shmctl                        test-sysvshm-time64
>     - sigtimedwait                  tst-sigtimedwait-time64
>     - stat                          tst-stat-time64
>     - thrd_sleep                    tst-thrd-sleep-time64
>     - time                          tst-mqueue{1248}-time64
>     - timegm                        tst-timegm-time64
>     - timer_gettime                 tst-timer4-time64
>     - timer_settime                 tst-timer4-time64
>     - timerfd_gettime               tst-timerfd-time64
>     - timerfd_settime               tst-timerfd-time64
>     - timespec_get                  tst-timespec_get-time64
>     - timespec_getres               tst-timespec_getres-time64
>     - utime                         tst-utime-time64
>     - utimensat                     tst-utimensat-time64
>     - utimes                        tst-utimes-time64
>     - wait3                         tst-wait3-time64
>     - wait4                         tst-wait4-time64
> 
>   * librt:
>     - aio_suspend                   tst-aio6-time64
>     - mq_timedreceive               tst-mqueue{1248}-time64
>     - mq_timedsend                  tst-mqueue{1248}-time64
>     - timer_gettime                 tst-timer4-time64
>     - timer_settime                 tst-timer4-time64
> 
>   * libanl:
>     - gai_suspend
> ---
>  Makeconfig                                    |  14 +++
>  Makerules                                     |  18 +++-
>  io/Makefile                                   |  22 +++-
>  io/ftwtest-time64.c                           |   1 +
>  io/tst-fts-time64.c                           |   1 +
>  io/tst-futimens-time64.c                      |   2 +
>  io/tst-futimens.c                             |   6 +-
>  io/tst-futimes-time64.c                       |   2 +
>  io/tst-futimes.c                              |   6 +-
>  io/tst-futimesat-time64.c                     |   4 +
>  io/tst-futimesat.c                            |  47 +++++---
>  io/tst-lutimes-time64.c                       |   2 +
>  io/tst-lutimes.c                              |  10 +-
>  io/tst-stat-time64.c                          | 102 ++++++++++++++++++
>  io/tst-utime-time64.c                         |   2 +
>  io/tst-utime.c                                |   6 +-
>  io/tst-utimensat-time64.c                     |   2 +
>  io/tst-utimensat.c                            |  12 ++-
>  io/tst-utimes-time64.c                        |   2 +
>  io/tst-utimes.c                               |   6 +-
>  misc/Makefile                                 |   4 +
>  misc/tst-pselect-time64.c                     |   1 +
>  misc/tst-select-time64.c                      |   1 +
>  nptl/Makefile                                 |   3 +
>  nptl/tst-cancel4_2-time64.c                   |   1 +
>  posix/Makefile                                |   2 +
>  posix/tst-gnuglob64-time64.c                  |   7 ++
>  posix/tst-sched_rr_get_interval-time64.c      |   1 +
>  posix/tst-wait3-time64.c                      |   1 +
>  posix/tst-wait4-time64.c                      |   1 +
>  rt/Makefile                                   |   9 ++
>  rt/tst-aio6-time64.c                          |   1 +
>  rt/tst-cpuclock2-time64.c                     |   1 +
>  rt/tst-cpuclock2.c                            |   9 +-
>  rt/tst-mqueue1-time64.c                       |   1 +
>  rt/tst-mqueue2-time64.c                       |   1 +
>  rt/tst-mqueue4-time64.c                       |   1 +
>  rt/tst-mqueue8-time64.c                       |   1 +
>  rt/tst-timer4-time64.c                        |   1 +
>  sysdeps/pthread/Makefile                      |  10 ++
>  sysdeps/pthread/tst-abstime-time64.c          |   1 +
>  sysdeps/pthread/tst-cnd-timedwait-time64.c    |   1 +
>  sysdeps/pthread/tst-cond11-time64.c           |   1 +
>  sysdeps/pthread/tst-join14-time64.c           |   1 +
>  sysdeps/pthread/tst-mtx-timedlock-time64.c    |   1 +
>  sysdeps/pthread/tst-rwlock14-time64.c         |   1 +
>  sysdeps/pthread/tst-sem5-time64.c             |   1 +
>  sysdeps/pthread/tst-thrd-sleep-time64.c       |   1 +
>  sysdeps/unix/sysv/linux/Makefile              |  10 ++
>  sysdeps/unix/sysv/linux/tst-adjtimex-time64.c |   1 +
>  .../sysv/linux/tst-clock_adjtime-time64.c     |   1 +
>  .../unix/sysv/linux/tst-ntp_adjtime-time64.c  |   1 +
>  .../unix/sysv/linux/tst-ntp_gettime-time64.c  |   1 +
>  .../unix/sysv/linux/tst-ntp_gettimex-time64.c |   1 +
>  sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
>  .../unix/sysv/linux/tst-sigtimedwait-time64.c |   1 +
>  sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
>  sysvipc/Makefile                              |   2 +
>  sysvipc/test-sysvmsg-time64.c                 |   1 +
>  sysvipc/test-sysvsem-time64.c                 |   1 +
>  sysvipc/test-sysvshm-time64.c                 |   1 +
>  time/Makefile                                 |  18 ++++
>  time/tst-adjtime-time64.c                     |   1 +
>  time/tst-clock-time64.c                       |   1 +
>  time/tst-clock2-time64.c                      |   1 +
>  time/tst-clock_nanosleep-time64.c             |   1 +
>  time/tst-clock_settime-time64.c               |   1 +
>  time/tst-cpuclock1-time64.c                   |   1 +
>  time/tst-ctime-time64.c                       |   1 +
>  time/tst-ctime.c                              |  16 +++
>  time/tst-difftime-time64.c                    |   1 +
>  time/tst-gmtime-time64.c                      |   1 +
>  time/tst-itimer-time64.c                      |   1 +
>  time/tst-mktime4-time64.c                     |   1 +
>  time/tst-settimeofday-time64.c                |   1 +
>  time/tst-timegm-time64.c                      |   1 +
>  time/tst-timespec_get-time64.c                |   1 +
>  time/tst-timespec_getres-time64.c             |   1 +
>  time/tst-y2039-time64.c                       |   1 +
>  time/tst-y2039.c                              |  10 ++
>  80 files changed, 385 insertions(+), 30 deletions(-)
>  create mode 100644 io/ftwtest-time64.c
>  create mode 100644 io/tst-fts-time64.c
>  create mode 100644 io/tst-futimens-time64.c
>  create mode 100644 io/tst-futimes-time64.c
>  create mode 100644 io/tst-futimesat-time64.c
>  create mode 100644 io/tst-lutimes-time64.c
>  create mode 100644 io/tst-stat-time64.c
>  create mode 100644 io/tst-utime-time64.c
>  create mode 100644 io/tst-utimensat-time64.c
>  create mode 100644 io/tst-utimes-time64.c
>  create mode 100644 misc/tst-pselect-time64.c
>  create mode 100644 misc/tst-select-time64.c
>  create mode 100644 nptl/tst-cancel4_2-time64.c
>  create mode 100644 posix/tst-gnuglob64-time64.c
>  create mode 100644 posix/tst-sched_rr_get_interval-time64.c
>  create mode 100644 posix/tst-wait3-time64.c
>  create mode 100644 posix/tst-wait4-time64.c
>  create mode 100644 rt/tst-aio6-time64.c
>  create mode 100644 rt/tst-cpuclock2-time64.c
>  create mode 100644 rt/tst-mqueue1-time64.c
>  create mode 100644 rt/tst-mqueue2-time64.c
>  create mode 100644 rt/tst-mqueue4-time64.c
>  create mode 100644 rt/tst-mqueue8-time64.c
>  create mode 100644 rt/tst-timer4-time64.c
>  create mode 100644 sysdeps/pthread/tst-abstime-time64.c
>  create mode 100644 sysdeps/pthread/tst-cnd-timedwait-time64.c
>  create mode 100644 sysdeps/pthread/tst-cond11-time64.c
>  create mode 100644 sysdeps/pthread/tst-join14-time64.c
>  create mode 100644 sysdeps/pthread/tst-mtx-timedlock-time64.c
>  create mode 100644 sysdeps/pthread/tst-rwlock14-time64.c
>  create mode 100644 sysdeps/pthread/tst-sem5-time64.c
>  create mode 100644 sysdeps/pthread/tst-thrd-sleep-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c
>  create mode 100644 sysvipc/test-sysvmsg-time64.c
>  create mode 100644 sysvipc/test-sysvsem-time64.c
>  create mode 100644 sysvipc/test-sysvshm-time64.c
>  create mode 100644 time/tst-adjtime-time64.c
>  create mode 100644 time/tst-clock-time64.c
>  create mode 100644 time/tst-clock2-time64.c
>  create mode 100644 time/tst-clock_nanosleep-time64.c
>  create mode 100644 time/tst-clock_settime-time64.c
>  create mode 100644 time/tst-cpuclock1-time64.c
>  create mode 100644 time/tst-ctime-time64.c
>  create mode 100644 time/tst-difftime-time64.c
>  create mode 100644 time/tst-gmtime-time64.c
>  create mode 100644 time/tst-itimer-time64.c
>  create mode 100644 time/tst-mktime4-time64.c
>  create mode 100644 time/tst-settimeofday-time64.c
>  create mode 100644 time/tst-timegm-time64.c
>  create mode 100644 time/tst-timespec_get-time64.c
>  create mode 100644 time/tst-timespec_getres-time64.c
>  create mode 100644 time/tst-y2039-time64.c
> 
> diff --git a/Makeconfig b/Makeconfig
> index 1d5e45926c..e50d1351a9 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -1235,6 +1235,20 @@ $(common-objpfx)versions.stmp: $(common-objpfx)Versions.all \
>  	touch $@
>  endif # avoid-generated
>  endif # $(build-shared) = yes
> +
> +-include $(common-objpfx)time64-compat.mk
> +postclean-generated += time64-compat.mk
> +
> +$(common-objpfx)time64-compat.mk: $(sysd-versions-force) \
> +				  $(common-objpfx)time64-compat.i
> +	sed '/^[        ]*#/d;/^[       ]*$$/d' $< > $@T
> +	mv -f $@T $@
> +$(common-objpfx)time64-compat.i: $(..)Makeconfig
> +	printf "#include <time64-compat.h>\n#ifdef TIME64_NON_DEFAULT\nhave-time64-compat = yes\n#endif" \
> +	| $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - > $@T
> +	mv -f $@T $@
> +

OK.

> +
>  endif # sysd-sorted-done
>  
>  # The name under which the run-time dynamic linker is installed.
> diff --git a/Makerules b/Makerules
> index ca9885436e..12f1a5cb50 100644
> --- a/Makerules
> +++ b/Makerules
> @@ -771,7 +771,8 @@ endif
>  	     $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
>  	     $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \
>  	     $(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \
> -	     $(addsuffix .d,$(tests) $(tests-internal) $(xtests) $(test-srcs))
> +	     $(addsuffix .d,$(tests) $(tests-internal) $(xtests) \
> +		$(test-srcs) $(tests-time64) $(xtests-time64))

OK.

>  ifeq ($(build-programs),yes)
>  +depfiles += $(addsuffix .d,$(others) $(sysdep-others))
>  endif
> @@ -1286,6 +1287,21 @@ check: tests
>  .PHONY: xcheck
>  xcheck: xtests
>  
> +# Handle tests-time64 and xtests-time64 that should built with LFS
> +# and 64-bit time support.
> +include $(o-iterator)
> +define o-iterator-doit
> +$(foreach f,$(tests-time64) $(xtests-time64),\
> +	    $(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
> +endef
> +object-suffixes-left := $(all-object-suffixes)
> +include $(o-iterator)
> +
> +ifeq ($(have-time64-compat),yes)
> +tests += $(foreach t,$(tests-time64),$(t))
> +xtests += $(foreach t,$(xtests-time64),$(t))
> +endif
> +
>  # The only difference between MODULE_NAME=testsuite and MODULE_NAME=nonlib is
>  # that almost all internal declarations from config.h, libc-symbols.h, and
>  # include/*.h are not available to 'testsuite' code, but are to 'nonlib' code.
> diff --git a/io/Makefile b/io/Makefile
> index d35e966258..ba8bd37355 100644
> --- a/io/Makefile
> +++ b/io/Makefile
> @@ -59,7 +59,7 @@ routines :=								\
>  	ftw64-time64
>  
>  others		:= pwd
> -test-srcs	:= ftwtest
> +test-srcs	:= ftwtest ftwtest-time64
>  tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
>  		   tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \
>  		   tst-openat tst-unlinkat tst-fstatat tst-futimesat \
> @@ -78,12 +78,24 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
>  		   tst-futimens \
>  		   tst-utimensat \
>  
> +tests-time64 := \
> +  tst-futimens-time64 \
> +  tst-futimes-time64\
> +  tst-fts-time64 \
> +  tst-lutimes-time64 \
> +  tst-stat-time64 \
> +  tst-futimesat-time64 \
> +  tst-utime-time64 \
> +  tst-utimensat-time64 \
> +  tst-utimes-time64 \
> +
>  # Likewise for statx, but we do not need static linking here.
>  tests-internal += tst-statx
>  tests-static += tst-statx
>  
>  ifeq ($(run-built-tests),yes)
> -tests-special += $(objpfx)ftwtest.out
> +tests-special += $(objpfx)ftwtest.out \
> +		 $(objpfx)ftwtest-time64.out
>  endif
>  
>  include ../Rules
> @@ -125,8 +137,14 @@ tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp
>  
>  tst-open-tmpfile-ARGS = --test-dir=$(objpfx)
>  
> +CFLAGS-ftwtest-time64.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
> +
>  ifeq ($(run-built-tests),yes)
>  $(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest
>  	$(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
>  	$(evaluate-test)
> +
> +$(objpfx)ftwtest-time64.out: ftwtest-sh $(objpfx)ftwtest-time64
> +	$(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
> +	$(evaluate-test)
>  endif
> diff --git a/io/ftwtest-time64.c b/io/ftwtest-time64.c
> new file mode 100644
> index 0000000000..67f1c46826
> --- /dev/null
> +++ b/io/ftwtest-time64.c
> @@ -0,0 +1 @@
> +#include "ftwtest.c"
> diff --git a/io/tst-fts-time64.c b/io/tst-fts-time64.c
> new file mode 100644
> index 0000000000..a4a41fe1cf
> --- /dev/null
> +++ b/io/tst-fts-time64.c
> @@ -0,0 +1 @@
> +#include "tst-fts.c"
> diff --git a/io/tst-futimens-time64.c b/io/tst-futimens-time64.c
> new file mode 100644
> index 0000000000..88fcb38489
> --- /dev/null
> +++ b/io/tst-futimens-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-futimens.c"
> diff --git a/io/tst-futimens.c b/io/tst-futimens.c
> index b3e3f3137f..4c18ede573 100644
> --- a/io/tst-futimens.c
> +++ b/io/tst-futimens.c
> @@ -20,13 +20,17 @@
>  #include <support/xunistd.h>
>  #include <sys/stat.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_futimens_helper (const char *file, int fd, const struct timespec *ts)
>  {
>    int result = futimens (fd, ts);
>    TEST_VERIFY_EXIT (result == 0);
>  
> -  struct stat64 st;
> +  struct_stat st;
>    xfstat (fd, &st);
>  
>    /* Check if seconds for atime match */
> diff --git a/io/tst-futimes-time64.c b/io/tst-futimes-time64.c
> new file mode 100644
> index 0000000000..d489c265d1
> --- /dev/null
> +++ b/io/tst-futimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-futimes.c"
> diff --git a/io/tst-futimes.c b/io/tst-futimes.c
> index bdef38d7cb..9575a4b08e 100644
> --- a/io/tst-futimes.c
> +++ b/io/tst-futimes.c
> @@ -21,13 +21,17 @@
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_futimens_helper (const char *file, int fd, const struct timeval *tv)
>  {
>    int r = futimes (fd, tv);
>    TEST_VERIFY_EXIT (r == 0);
>  
> -  struct stat64 st;
> +  struct_stat st;
>    xfstat (fd, &st);
>  
>    /* Check if seconds for atime match */
> diff --git a/io/tst-futimesat-time64.c b/io/tst-futimesat-time64.c
> new file mode 100644
> index 0000000000..f6c0500eef
> --- /dev/null
> +++ b/io/tst-futimesat-time64.c
> @@ -0,0 +1,4 @@
> +#define struct_stat  struct stat
> +#define fstat        fstat
> +#define fstatat      fstatat
> +#include "io/tst-futimesat.c"
> diff --git a/io/tst-futimesat.c b/io/tst-futimesat.c
> index af58ad06dd..c32ab2b668 100644
> --- a/io/tst-futimesat.c
> +++ b/io/tst-futimesat.c
> @@ -1,4 +1,23 @@
> +/* futimesat basic tests.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
>  #include <dirent.h>
> +#include <errno.h>
>  #include <fcntl.h>
>  #include <stdio.h>
>  #include <stdlib.h>
> @@ -7,19 +26,19 @@
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  
> +#include <support/test-driver.h>
> +#include <support/temp_file.h>
>  
> -static void prepare (void);
> -#define PREPARE(argc, argv) prepare ()
> -
> -static int do_test (void);
> -#define TEST_FUNCTION do_test ()
> -
> -#include "../test-skeleton.c"
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +# define fstat       fstat64
> +# define fstatat     fstatat64
> +#endif
>  
>  static int dir_fd;
>  
>  static void
> -prepare (void)
> +prepare (int argc, char *argv[])
>  {
>    size_t test_dir_len = strlen (test_dir);
>    static const char dir_name[] = "/tst-futimesat.XXXXXX";
> @@ -48,7 +67,7 @@ prepare (void)
>        exit (1);
>      }
>  }
> -
> +#define PREPARE prepare
>  
>  static int
>  do_test (void)
> @@ -98,8 +117,8 @@ do_test (void)
>    write (fd, "hello", 5);
>    puts ("file created");
>  
> -  struct stat64 st1;
> -  if (fstat64 (fd, &st1) != 0)
> +  struct_stat st1;
> +  if (fstat (fd, &st1) != 0)
>      {
>        puts ("fstat64 failed");
>        return 1;
> @@ -118,8 +137,8 @@ do_test (void)
>        return 1;
>      }
>  
> -  struct stat64 st2;
> -  if (fstatat64 (dir_fd, "some-file", &st2, 0) != 0)
> +  struct_stat st2;
> +  if (fstatat (dir_fd, "some-file", &st2, 0) != 0)
>      {
>        puts ("fstatat64 failed");
>        return 1;
> @@ -146,3 +165,5 @@ do_test (void)
>  
>    return 0;
>  }
> +
> +#include <support/test-driver.c>
> diff --git a/io/tst-lutimes-time64.c b/io/tst-lutimes-time64.c
> new file mode 100644
> index 0000000000..06caec0a91
> --- /dev/null
> +++ b/io/tst-lutimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-lutimes.c"
> diff --git a/io/tst-lutimes.c b/io/tst-lutimes.c
> index b2da3c5796..237a870415 100644
> --- a/io/tst-lutimes.c
> +++ b/io/tst-lutimes.c
> @@ -21,23 +21,27 @@
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_lutimes_helper (const char *testfile, int fd, const char *testlink,
>                       const struct timeval *tv)
>  {
> -  struct stat64 stfile_orig;
> +  struct_stat stfile_orig;
>    xlstat (testfile, &stfile_orig);
>  
>    TEST_VERIFY_EXIT (lutimes (testlink, tv) == 0);
>  
> -  struct stat64 stlink;
> +  struct_stat stlink;
>    xlstat (testlink, &stlink);
>  
>    TEST_COMPARE (stlink.st_atime, tv[0].tv_sec);
>    TEST_COMPARE (stlink.st_mtime, tv[1].tv_sec);
>  
>    /* Check if the timestamp from original file is not changed.  */
> -  struct stat64 stfile;
> +  struct_stat stfile;
>    xlstat (testfile, &stfile);
>  
>    TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
> diff --git a/io/tst-stat-time64.c b/io/tst-stat-time64.c
> new file mode 100644
> index 0000000000..c10fe1284a
> --- /dev/null
> +++ b/io/tst-stat-time64.c
> @@ -0,0 +1,102 @@
> +/* Basic test of stat with 64 bit time_t interfaces.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <errno.h>
> +#include <fcntl.h>
> +#include <stdbool.h>
> +#include <support/check.h>
> +#include <support/support.h>
> +#include <support/temp_file.h>
> +#include <support/xunistd.h>
> +#include <stdlib.h>
> +#include <sys/stat.h>
> +#include <sys/sysmacros.h>
> +
> +/* The idea of the test is check whether the 64 bit time_t stat implementation
> +   returns the expected value for comparable fields, so it does not really
> +   matter whether statx uses a fallback implementation or not.  */
> +
> +static void
> +stat_check (int fd, const char *path, struct stat *st)
> +{
> +  TEST_COMPARE (stat (path, st), 0);
> +}
> +
> +static void
> +lstat_check (int fd, const char *path, struct stat *st)
> +{
> +  TEST_COMPARE (lstat (path, st), 0);
> +}
> +
> +static void
> +fstat_check (int fd, const char *path, struct stat *st)
> +{
> +  TEST_COMPARE (fstat (fd, st), 0);
> +}
> +
> +static void
> +fstatat_check (int fd, const char *path, struct stat *st)
> +{
> +  TEST_COMPARE (fstatat (fd, path, st, 0), 0);
> +}
> +
> +typedef void (*test_t)(int, const char *path, struct stat *);
> +
> +static int
> +do_test (void)
> +{
> +  char *path;
> +  int fd = create_temp_file ("tst-statx-", &path);
> +  TEST_VERIFY_EXIT (fd >= 0);
> +  support_write_file_string (path, "abc");
> +
> +  struct statx stx;
> +  TEST_COMPARE (statx (fd, path, 0, STATX_BASIC_STATS, &stx), 0);
> +
> +  for (test_t *test = (test_t[]) { stat_check, lstat_check, fstat_check,
> +				   fstatat_check, NULL };
> +       *test != NULL; test++)
> +  {
> +    struct stat st;
> +    (*test) (fd, path, &st);
> +
> +    TEST_COMPARE (stx.stx_dev_major, major (st.st_dev));
> +    TEST_COMPARE (stx.stx_dev_minor, minor (st.st_dev));
> +    TEST_COMPARE (stx.stx_ino, st.st_ino);
> +    TEST_COMPARE (stx.stx_mode, st.st_mode);
> +    TEST_COMPARE (stx.stx_nlink, st.st_nlink);
> +    TEST_COMPARE (stx.stx_uid, st.st_uid);
> +    TEST_COMPARE (stx.stx_gid, st.st_gid);
> +    TEST_COMPARE (stx.stx_rdev_major, major (st.st_rdev));
> +    TEST_COMPARE (stx.stx_rdev_minor, minor (st.st_rdev));
> +    TEST_COMPARE (stx.stx_blksize, st.st_blksize);
> +    TEST_COMPARE (stx.stx_blocks, st.st_blocks);
> +
> +    TEST_COMPARE (stx.stx_ctime.tv_sec, st.st_ctim.tv_sec);
> +    TEST_COMPARE (stx.stx_ctime.tv_nsec, st.st_ctim.tv_nsec);
> +    TEST_COMPARE (stx.stx_mtime.tv_sec, st.st_mtim.tv_sec);
> +    TEST_COMPARE (stx.stx_mtime.tv_nsec, st.st_mtim.tv_nsec);
> +  }
> +
> +  xclose (fd);
> +  free (path);
> +
> +  return 0;
> +}
> +
> +#include <support/test-driver.c>
> diff --git a/io/tst-utime-time64.c b/io/tst-utime-time64.c
> new file mode 100644
> index 0000000000..eb62f59126
> --- /dev/null
> +++ b/io/tst-utime-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-utime.c"
> diff --git a/io/tst-utime.c b/io/tst-utime.c
> index 6269ef7929..0144e2a22a 100644
> --- a/io/tst-utime.c
> +++ b/io/tst-utime.c
> @@ -21,13 +21,17 @@
>  #include <support/xunistd.h>
>  #include <sys/stat.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_utime_helper (const char *file, int fd, const struct utimbuf *ut)
>  {
>    int result = utime (file, ut);
>    TEST_VERIFY_EXIT (result == 0);
>  
> -  struct stat64 st;
> +  struct_stat st;
>    xfstat (fd, &st);
>  
>    /* Check if seconds for actime match */
> diff --git a/io/tst-utimensat-time64.c b/io/tst-utimensat-time64.c
> new file mode 100644
> index 0000000000..7ac7d8df1d
> --- /dev/null
> +++ b/io/tst-utimensat-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-utimensat.c"
> diff --git a/io/tst-utimensat.c b/io/tst-utimensat.c
> index 0c7c8470bc..062abdd8d3 100644
> --- a/io/tst-utimensat.c
> +++ b/io/tst-utimensat.c
> @@ -22,6 +22,10 @@
>  #include <sys/stat.h>
>  #include <sys/time.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_utimesat_helper (const char *testfile, int fd, const char *testlink,
>                        const struct timespec *ts)
> @@ -29,7 +33,7 @@ test_utimesat_helper (const char *testfile, int fd, const char *testlink,
>    {
>      TEST_VERIFY_EXIT (utimensat (fd, testfile, ts, 0) == 0);
>  
> -    struct stat64 st;
> +    struct_stat st;
>      xfstat (fd, &st);
>  
>      /* Check if seconds for atime match */
> @@ -40,20 +44,20 @@ test_utimesat_helper (const char *testfile, int fd, const char *testlink,
>    }
>  
>    {
> -    struct stat64 stfile_orig;
> +    struct_stat stfile_orig;
>      xlstat (testfile, &stfile_orig);
>  
>      TEST_VERIFY_EXIT (utimensat (0 /* ignored  */, testlink, ts,
>  				 AT_SYMLINK_NOFOLLOW)
>  		       == 0);
> -    struct stat64 stlink;
> +    struct_stat stlink;
>      xlstat (testlink, &stlink);
>  
>      TEST_COMPARE (stlink.st_atime, ts[0].tv_sec);
>      TEST_COMPARE (stlink.st_mtime, ts[1].tv_sec);
>  
>      /* Check if the timestamp from original file is not changed.  */
> -    struct stat64 stfile;
> +    struct_stat stfile;
>      xlstat (testfile, &stfile);
>  
>      TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
> diff --git a/io/tst-utimes-time64.c b/io/tst-utimes-time64.c
> new file mode 100644
> index 0000000000..234ec02541
> --- /dev/null
> +++ b/io/tst-utimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-utimes.c"
> diff --git a/io/tst-utimes.c b/io/tst-utimes.c
> index 991ab0c7d3..e88efff45b 100644
> --- a/io/tst-utimes.c
> +++ b/io/tst-utimes.c
> @@ -22,13 +22,17 @@
>  #include <sys/time.h>
>  #include <time.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int
>  test_utimes_helper (const char *file, int fd, const struct timeval *tv)
>  {
>    int result = utimes (file, tv);
>    TEST_VERIFY_EXIT (result == 0);
>  
> -  struct stat64 st;
> +  struct_stat st;
>    xfstat (fd, &st);
>  
>    /* Check if seconds for atime match */
> diff --git a/misc/Makefile b/misc/Makefile
> index 38dad737f2..7f51f7163d 100644
> --- a/misc/Makefile
> +++ b/misc/Makefile
> @@ -90,6 +90,10 @@ tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \
>  	 tst-ldbl-warn tst-ldbl-error tst-dbl-efgcvt tst-ldbl-efgcvt \
>  	 tst-mntent-autofs tst-syscalls tst-mntent-escape tst-select
>  
> +tests-time64 := \
> +  tst-select-time64 \
> +  tst-pselect-time64
> +
>  # Tests which need libdl.
>  ifeq (yes,$(build-shared))
>  tests += tst-gethostid
> diff --git a/misc/tst-pselect-time64.c b/misc/tst-pselect-time64.c
> new file mode 100644
> index 0000000000..15a1e49292
> --- /dev/null
> +++ b/misc/tst-pselect-time64.c
> @@ -0,0 +1 @@
> +#include "tst-pselect.c"
> diff --git a/misc/tst-select-time64.c b/misc/tst-select-time64.c
> new file mode 100644
> index 0000000000..13120bfe31
> --- /dev/null
> +++ b/misc/tst-select-time64.c
> @@ -0,0 +1 @@
> +#include "tst-select.c"
> diff --git a/nptl/Makefile b/nptl/Makefile
> index bd5a9ce51f..50dde03ba8 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -329,6 +329,9 @@ xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
>  	tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 tst-setgroups \
>  	tst-mutexpp5 tst-mutexpp9
>  
> +tests-time64 := \
> +  tst-cancel4_2-time64
> +
>  # This test can run into task limits because of a linux kernel bug
>  # and then cause the make process to fail too, see bug 24537.
>  xtests += tst-eintr1
> diff --git a/nptl/tst-cancel4_2-time64.c b/nptl/tst-cancel4_2-time64.c
> new file mode 100644
> index 0000000000..4ac086a312
> --- /dev/null
> +++ b/nptl/tst-cancel4_2-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cancel4_2.c"
> diff --git a/posix/Makefile b/posix/Makefile
> index 84204b1270..31e745fadc 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -123,7 +123,9 @@ endif
>  tests-internal	:= bug-regex5 bug-regex20 bug-regex33 \
>  		   tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3
>  tests-container := bug-ga2
> +tests-time64	:= tst-wait4-time64 tst-wait3-time64 tst-gnuglob64-time64
>  xtests		:= tst-getaddrinfo4 tst-getaddrinfo5 tst-sched_rr_get_interval
> +xtests-time64	:= tst-sched_rr_get_interval-time64
>  ifeq (yes,$(build-shared))
>  test-srcs	:= globtest
>  tests           += wordexp-test tst-exec tst-spawn tst-spawn2 tst-spawn3
> diff --git a/posix/tst-gnuglob64-time64.c b/posix/tst-gnuglob64-time64.c
> new file mode 100644
> index 0000000000..00922bcdc6
> --- /dev/null
> +++ b/posix/tst-gnuglob64-time64.c
> @@ -0,0 +1,7 @@
> +#define GLOB_FUNC glob
> +#define GLOB_TYPE glob_t
> +#define GLOBFREE_FUNC globfree
> +#define DIRENT_STRUCT dirent
> +#define STAT_STRUCT stat
> +
> +#include "tst-gnuglob-skeleton.c"
> diff --git a/posix/tst-sched_rr_get_interval-time64.c b/posix/tst-sched_rr_get_interval-time64.c
> new file mode 100644
> index 0000000000..f4e66d2939
> --- /dev/null
> +++ b/posix/tst-sched_rr_get_interval-time64.c
> @@ -0,0 +1 @@
> +#include "tst-sched_rr_get_interval.c"
> diff --git a/posix/tst-wait3-time64.c b/posix/tst-wait3-time64.c
> new file mode 100644
> index 0000000000..2837bc7a9e
> --- /dev/null
> +++ b/posix/tst-wait3-time64.c
> @@ -0,0 +1 @@
> +#include "tst-wait3.c"
> diff --git a/posix/tst-wait4-time64.c b/posix/tst-wait4-time64.c
> new file mode 100644
> index 0000000000..12543b270f
> --- /dev/null
> +++ b/posix/tst-wait4-time64.c
> @@ -0,0 +1 @@
> +#include "tst-wait4.c"
> diff --git a/rt/Makefile b/rt/Makefile
> index 97c9bbd9de..797f2da51e 100644
> --- a/rt/Makefile
> +++ b/rt/Makefile
> @@ -51,6 +51,15 @@ tests := tst-shm tst-timer tst-timer2 \
>  	 tst-shm-cancel
>  tests-internal := tst-timer-sigmask
>  
> +tests-time64 := \
> +  tst-aio6-time64 \
> +  tst-cpuclock2-time64 \
> +  tst-mqueue1-time64 \
> +  tst-mqueue2-time64 \
> +  tst-mqueue4-time64 \
> +  tst-mqueue8-time64 \
> +  tst-timer4-time64
> +
>  extra-libs := librt
>  extra-libs-others := $(extra-libs)
>  
> diff --git a/rt/tst-aio6-time64.c b/rt/tst-aio6-time64.c
> new file mode 100644
> index 0000000000..a386a577ec
> --- /dev/null
> +++ b/rt/tst-aio6-time64.c
> @@ -0,0 +1 @@
> +#include "tst-aio6.c"
> diff --git a/rt/tst-cpuclock2-time64.c b/rt/tst-cpuclock2-time64.c
> new file mode 100644
> index 0000000000..05775522bb
> --- /dev/null
> +++ b/rt/tst-cpuclock2-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cpuclock2.c"
> diff --git a/rt/tst-cpuclock2.c b/rt/tst-cpuclock2.c
> index c1c7ed2ad8..eebc3609d0 100644
> --- a/rt/tst-cpuclock2.c
> +++ b/rt/tst-cpuclock2.c
> @@ -21,7 +21,11 @@
>  
>  #if (_POSIX_THREADS - 0) <= 0
>  
> -# define TEST_FUNCTION 0
> +static int
> +do_test ()
> +{
> +  return 0;
> +}
>  
>  #else
>  
> @@ -330,7 +334,6 @@ do_test (void)
>  
>    return result;
>  }
> -# define TEST_FUNCTION do_test ()
>  #endif
>  
> -#include "../test-skeleton.c"
> +#include <support/test-driver.c>
> diff --git a/rt/tst-mqueue1-time64.c b/rt/tst-mqueue1-time64.c
> new file mode 100644
> index 0000000000..9c600a9a97
> --- /dev/null
> +++ b/rt/tst-mqueue1-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mqueue1.c"
> diff --git a/rt/tst-mqueue2-time64.c b/rt/tst-mqueue2-time64.c
> new file mode 100644
> index 0000000000..9d49f0b196
> --- /dev/null
> +++ b/rt/tst-mqueue2-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mqueue2.c"
> diff --git a/rt/tst-mqueue4-time64.c b/rt/tst-mqueue4-time64.c
> new file mode 100644
> index 0000000000..c23a228dc4
> --- /dev/null
> +++ b/rt/tst-mqueue4-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mqueue4.c"
> diff --git a/rt/tst-mqueue8-time64.c b/rt/tst-mqueue8-time64.c
> new file mode 100644
> index 0000000000..972637f7f5
> --- /dev/null
> +++ b/rt/tst-mqueue8-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mqueue8.c"
> diff --git a/rt/tst-timer4-time64.c b/rt/tst-timer4-time64.c
> new file mode 100644
> index 0000000000..e47a593f10
> --- /dev/null
> +++ b/rt/tst-timer4-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timer4.c"
> diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
> index b15d085f51..0ae241209d 100644
> --- a/sysdeps/pthread/Makefile
> +++ b/sysdeps/pthread/Makefile
> @@ -125,6 +125,16 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \
>  	 tst-unwind-thread \
>  	 tst-pt-vfork1 tst-pt-vfork2 tst-vfork1x tst-vfork2x \
>  
> +tests-time64 := \
> +  tst-abstime-time64 \
> +  tst-cnd-timedwait-time64 \
> +  tst-cond11-time64 \
> +  tst-join14-time64 \
> +  tst-mtx-timedlock-time64 \
> +  tst-rwlock14-time64 \
> +  tst-sem5-time64 \
> +  tst-thrd-sleep-time64 \
> +
>  
>  # Files which must not be linked with libpthread.
>  tests-nolibpthread += tst-unload
> diff --git a/sysdeps/pthread/tst-abstime-time64.c b/sysdeps/pthread/tst-abstime-time64.c
> new file mode 100644
> index 0000000000..2fc77cb365
> --- /dev/null
> +++ b/sysdeps/pthread/tst-abstime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-abstime.c"
> diff --git a/sysdeps/pthread/tst-cnd-timedwait-time64.c b/sysdeps/pthread/tst-cnd-timedwait-time64.c
> new file mode 100644
> index 0000000000..9b2abfd277
> --- /dev/null
> +++ b/sysdeps/pthread/tst-cnd-timedwait-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cnd-timedwait.c"
> diff --git a/sysdeps/pthread/tst-cond11-time64.c b/sysdeps/pthread/tst-cond11-time64.c
> new file mode 100644
> index 0000000000..9bccb8ec8b
> --- /dev/null
> +++ b/sysdeps/pthread/tst-cond11-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cond11.c"
> diff --git a/sysdeps/pthread/tst-join14-time64.c b/sysdeps/pthread/tst-join14-time64.c
> new file mode 100644
> index 0000000000..bed784ee24
> --- /dev/null
> +++ b/sysdeps/pthread/tst-join14-time64.c
> @@ -0,0 +1 @@
> +#include "tst-join14.c"
> diff --git a/sysdeps/pthread/tst-mtx-timedlock-time64.c b/sysdeps/pthread/tst-mtx-timedlock-time64.c
> new file mode 100644
> index 0000000000..b3393c99ef
> --- /dev/null
> +++ b/sysdeps/pthread/tst-mtx-timedlock-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mtx-timedlock.c"
> diff --git a/sysdeps/pthread/tst-rwlock14-time64.c b/sysdeps/pthread/tst-rwlock14-time64.c
> new file mode 100644
> index 0000000000..ae9b1912cf
> --- /dev/null
> +++ b/sysdeps/pthread/tst-rwlock14-time64.c
> @@ -0,0 +1 @@
> +#include "tst-rwlock14.c"
> diff --git a/sysdeps/pthread/tst-sem5-time64.c b/sysdeps/pthread/tst-sem5-time64.c
> new file mode 100644
> index 0000000000..89c2a14f94
> --- /dev/null
> +++ b/sysdeps/pthread/tst-sem5-time64.c
> @@ -0,0 +1 @@
> +#include "tst-sem5.c"
> diff --git a/sysdeps/pthread/tst-thrd-sleep-time64.c b/sysdeps/pthread/tst-thrd-sleep-time64.c
> new file mode 100644
> index 0000000000..02837bd19f
> --- /dev/null
> +++ b/sysdeps/pthread/tst-thrd-sleep-time64.c
> @@ -0,0 +1 @@
> +#include "tst-thrd-sleep.c"
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 747d1083e0..27716e53b7 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -122,6 +122,16 @@ endif
>  
>  tests-internal += tst-sigcontext-get_pc
>  
> +tests-time64 += \
> +  tst-adjtimex-time64 \
> +  tst-clock_adjtime-time64 \
> +  tst-ntp_adjtime-time64 \
> +  tst-ntp_gettime-time64 \
> +  tst-ntp_gettimex-time64 \
> +  tst-ppoll-time64 \
> +  tst-sigtimedwait-time64 \
> +  tst-timerfd-time64 \
> +
>  CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
>  
>  # Generate the list of SYS_* macros for the system calls (__NR_*
> diff --git a/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c b/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
> new file mode 100644
> index 0000000000..2b6988b7c4
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c
> @@ -0,0 +1 @@
> +#include "tst-adjtimex.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c b/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
> new file mode 100644
> index 0000000000..9691e81229
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-clock_adjtime.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
> new file mode 100644
> index 0000000000..30e7380b02
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ntp_adjtime.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
> new file mode 100644
> index 0000000000..42caa66301
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ntp_gettime.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
> new file mode 100644
> index 0000000000..3f017b3c22
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ntp_gettimex.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-ppoll-time64.c b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c
> new file mode 100644
> index 0000000000..96ee2faee3
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ppoll.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c b/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
> new file mode 100644
> index 0000000000..1513e81749
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c
> @@ -0,0 +1 @@
> +#include "tst-sigtimedwait.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-timerfd-time64.c b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c
> new file mode 100644
> index 0000000000..bb17f48139
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timerfd.c"
> diff --git a/sysvipc/Makefile b/sysvipc/Makefile
> index a534791928..86911803b5 100644
> --- a/sysvipc/Makefile
> +++ b/sysvipc/Makefile
> @@ -32,6 +32,8 @@ routines := ftok \
>  
>  tests    := test-sysvmsg test-sysvsem test-sysvshm
>  
> +tests-time64 := test-sysvmsg-time64 test-sysvsem-time64 test-sysvshm-time64
> +
>  include ../Rules
>  
>  CFLAGS-msgrcv.c += -fexceptions -fasynchronous-unwind-tables
> diff --git a/sysvipc/test-sysvmsg-time64.c b/sysvipc/test-sysvmsg-time64.c
> new file mode 100644
> index 0000000000..c23e0c337e
> --- /dev/null
> +++ b/sysvipc/test-sysvmsg-time64.c
> @@ -0,0 +1 @@
> +#include "test-sysvmsg.c"
> diff --git a/sysvipc/test-sysvsem-time64.c b/sysvipc/test-sysvsem-time64.c
> new file mode 100644
> index 0000000000..05c95068cd
> --- /dev/null
> +++ b/sysvipc/test-sysvsem-time64.c
> @@ -0,0 +1 @@
> +#include "test-sysvsem.c"
> diff --git a/sysvipc/test-sysvshm-time64.c b/sysvipc/test-sysvshm-time64.c
> new file mode 100644
> index 0000000000..8e2963f563
> --- /dev/null
> +++ b/sysvipc/test-sysvshm-time64.c
> @@ -0,0 +1 @@
> +#include "test-sysvshm.c"
> diff --git a/time/Makefile b/time/Makefile
> index 805c79c4d0..c84bd5d3ec 100644
> --- a/time/Makefile
> +++ b/time/Makefile
> @@ -52,6 +52,24 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
>  	   tst-settimeofday tst-itimer tst-gmtime tst-timegm \
>  	   tst-timespec_get tst-timespec_getres
>  
> +tests-time64 := \
> +  tst-adjtime-time64 \
> +  tst-clock-time64 \
> +  tst-clock2-time64 \
> +  tst-clock_nanosleep-time64 \
> +  tst-clock_settime-time64 \
> +  tst-cpuclock1-time64 \
> +  tst-ctime-time64 \
> +  tst-difftime-time64 \
> +  tst-gmtime-time64 \
> +  tst-itimer-time64 \
> +  tst-mktime4-time64 \
> +  tst-settimeofday-time64 \
> +  tst-timegm-time64 \
> +  tst-timespec_get-time64 \
> +  tst-timespec_getres-time64 \
> +  tst-y2039-time64
> +
>  include ../Rules
>  
>  ifeq ($(run-built-tests),yes)
> diff --git a/time/tst-adjtime-time64.c b/time/tst-adjtime-time64.c
> new file mode 100644
> index 0000000000..097d6efc4b
> --- /dev/null
> +++ b/time/tst-adjtime-time64.c
> @@ -0,0 +1 @@
> +#include <tst-adjtime.c>
> diff --git a/time/tst-clock-time64.c b/time/tst-clock-time64.c
> new file mode 100644
> index 0000000000..a1349678c8
> --- /dev/null
> +++ b/time/tst-clock-time64.c
> @@ -0,0 +1 @@
> +#include "tst-clock.c"
> diff --git a/time/tst-clock2-time64.c b/time/tst-clock2-time64.c
> new file mode 100644
> index 0000000000..897f47b287
> --- /dev/null
> +++ b/time/tst-clock2-time64.c
> @@ -0,0 +1 @@
> +#include "tst-clock2.c"
> diff --git a/time/tst-clock_nanosleep-time64.c b/time/tst-clock_nanosleep-time64.c
> new file mode 100644
> index 0000000000..c8638aa3d2
> --- /dev/null
> +++ b/time/tst-clock_nanosleep-time64.c
> @@ -0,0 +1 @@
> +#include "tst-clock_nanosleep.c"
> diff --git a/time/tst-clock_settime-time64.c b/time/tst-clock_settime-time64.c
> new file mode 100644
> index 0000000000..328b04a030
> --- /dev/null
> +++ b/time/tst-clock_settime-time64.c
> @@ -0,0 +1 @@
> +#include <tst-clock_settime.c>
> diff --git a/time/tst-cpuclock1-time64.c b/time/tst-cpuclock1-time64.c
> new file mode 100644
> index 0000000000..5a7ffa27ac
> --- /dev/null
> +++ b/time/tst-cpuclock1-time64.c
> @@ -0,0 +1 @@
> +#include "tst-cpuclock1.c"
> diff --git a/time/tst-ctime-time64.c b/time/tst-ctime-time64.c
> new file mode 100644
> index 0000000000..24a5ae98ed
> --- /dev/null
> +++ b/time/tst-ctime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-ctime.c"
> diff --git a/time/tst-ctime.c b/time/tst-ctime.c
> index e89a906bf8..884d69bfa0 100644
> --- a/time/tst-ctime.c
> +++ b/time/tst-ctime.c
> @@ -24,6 +24,7 @@ static int
>  do_test (void)
>  {
>    char *str;
> +  char strb[32];
>    time_t t;
>  
>    /* Use glibc time zone extension "TZ=:" to to guarantee that UTC
> @@ -36,11 +37,21 @@ do_test (void)
>    str = ctime (&t);
>    TEST_COMPARE_STRING (str, "Thu Jan  1 00:00:00 1970\n");
>  
> +  /* Same as before but with ctime_r.  */
> +  str = ctime_r (&t, strb);
> +  TEST_VERIFY (str == strb);
> +  TEST_COMPARE_STRING (str, "Thu Jan  1 00:00:00 1970\n");
> +
>    /* Check if the max time value for 32 bit time_t can be converted.  */
>    t = 0x7fffffff;
>    str = ctime (&t);
>    TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n");
>  
> +  /* Same as before but with ctime_r.  */
> +  str = ctime_r (&t, strb);
> +  TEST_VERIFY (str == strb);
> +  TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n");
> +
>    /* Check if we run on port with 32 bit time_t size */
>    time_t tov;
>    if (__builtin_add_overflow (t, 1, &tov))
> @@ -50,6 +61,11 @@ do_test (void)
>    str = ctime (&tov);
>    TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n");
>  
> +  /* Same as before but with ctime_r.  */
> +  str = ctime_r (&tov, strb);
> +  TEST_VERIFY (str == strb);
> +  TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n");
> +
>    return 0;
>  }
>  
> diff --git a/time/tst-difftime-time64.c b/time/tst-difftime-time64.c
> new file mode 100644
> index 0000000000..751ce6c483
> --- /dev/null
> +++ b/time/tst-difftime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-difftime.c"
> diff --git a/time/tst-gmtime-time64.c b/time/tst-gmtime-time64.c
> new file mode 100644
> index 0000000000..0df11c1913
> --- /dev/null
> +++ b/time/tst-gmtime-time64.c
> @@ -0,0 +1 @@
> +#include "tst-gmtime.c"
> diff --git a/time/tst-itimer-time64.c b/time/tst-itimer-time64.c
> new file mode 100644
> index 0000000000..ddd2efa175
> --- /dev/null
> +++ b/time/tst-itimer-time64.c
> @@ -0,0 +1 @@
> +#include <time/tst-itimer.c>
> diff --git a/time/tst-mktime4-time64.c b/time/tst-mktime4-time64.c
> new file mode 100644
> index 0000000000..bf5197c6f3
> --- /dev/null
> +++ b/time/tst-mktime4-time64.c
> @@ -0,0 +1 @@
> +#include "tst-mktime4.c"
> diff --git a/time/tst-settimeofday-time64.c b/time/tst-settimeofday-time64.c
> new file mode 100644
> index 0000000000..185d167a22
> --- /dev/null
> +++ b/time/tst-settimeofday-time64.c
> @@ -0,0 +1 @@
> +#include <tst-settimeofday.c>
> diff --git a/time/tst-timegm-time64.c b/time/tst-timegm-time64.c
> new file mode 100644
> index 0000000000..8e3084f74e
> --- /dev/null
> +++ b/time/tst-timegm-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timegm.c"
> diff --git a/time/tst-timespec_get-time64.c b/time/tst-timespec_get-time64.c
> new file mode 100644
> index 0000000000..48f336385d
> --- /dev/null
> +++ b/time/tst-timespec_get-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timespec_get.c"
> diff --git a/time/tst-timespec_getres-time64.c b/time/tst-timespec_getres-time64.c
> new file mode 100644
> index 0000000000..59a0f36103
> --- /dev/null
> +++ b/time/tst-timespec_getres-time64.c
> @@ -0,0 +1 @@
> +#include "tst-timespec_getres.c"
> diff --git a/time/tst-y2039-time64.c b/time/tst-y2039-time64.c
> new file mode 100644
> index 0000000000..3c8a504186
> --- /dev/null
> +++ b/time/tst-y2039-time64.c
> @@ -0,0 +1 @@
> +#include "tst-y2039.c"
> diff --git a/time/tst-y2039.c b/time/tst-y2039.c
> index ef024c0a77..66a22d4c2c 100644
> --- a/time/tst-y2039.c
> +++ b/time/tst-y2039.c
> @@ -37,6 +37,16 @@ do_test (void)
>  			> 0);
>        puts (buf);
>        TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
> +
> +      /* Same as before but for localtime_r.  */
> +      struct tm tmd;
> +      tm = localtime_r (&ouch, &tmd);
> +      TEST_VERIFY_EXIT (tm == &tmd);
> +
> +      TEST_VERIFY_EXIT (strftime (buf, sizeof buf, "%Y-%m-%d %H:%M:%S %Z", tm)
> +			> 0);
> +      puts (buf);
> +      TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
>      }
>    else
>      FAIL_UNSUPPORTED ("32-bit time_t");
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO
  2021-06-04 19:30   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO Carlos O'Donell
@ 2021-06-07 17:52     ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-06-07 17:52 UTC (permalink / raw)
  To: Carlos O'Donell, libc-alpha



On 04/06/2021 16:30, Carlos O'Donell wrote:
>> +#ifndef __ASSUME_TIME64_SYSCALLS
>> +static int
>> +setsockopt32 (int fd, int level, int optname, const void *optval,
>> +	      socklen_t len)
>> +{
>> +  int r = -1;
>> +
>> +  if (level != SOL_SOCKET)
>> +    return r;
>> +
>> +  switch (optname)
>> +    {
>> +    case COMPAT_SO_RCVTIMEO_NEW:
>> +    case COMPAT_SO_SNDTIMEO_NEW:
>> +      {
>> +        if (len < sizeof (struct __timeval64))
>> +	  {
>> +	    __set_errno (EINVAL);
>> +	    break;
> 
> Same issue as above with size. Silent truncation required.

For setsockopt I think returning EINVAL is the correct approach here.  POSIX
does not specify that the returned value should silently truncated in the 
case of the options is larger than the input value (as for getsockopt) and
it is what kernel really does:

net/core/sock.c:

 364 static int sock_set_timeout(long *timeo_p, sockptr_t optval, int optlen,
 365                             bool old_timeval)
 366 {
 367         struct __kernel_sock_timeval tv;
 368 
 369         if (old_timeval && in_compat_syscall() && !COMPAT_USE_64BIT_TIME) {
 370                 struct old_timeval32 tv32;
 371 
 372                 if (optlen < sizeof(tv32))
 373                         return -EINVAL;
 374 
 375                 if (copy_from_sockptr(&tv32, optval, sizeof(tv32)))
 376                         return -EFAULT;
 377                 tv.tv_sec = tv32.tv_sec;
 378                 tv.tv_usec = tv32.tv_usec;
 379         } else if (old_timeval) {
 380                 struct __kernel_old_timeval old_tv;
 381 
 382                 if (optlen < sizeof(old_tv))
 383                         return -EINVAL;
 384                 if (copy_from_sockptr(&old_tv, optval, sizeof(old_tv)))
 385                         return -EFAULT;
 386                 tv.tv_sec = old_tv.tv_sec;
 387                 tv.tv_usec = old_tv.tv_usec;
 388         } else {
 389                 if (optlen < sizeof(tv))
 390                         return -EINVAL;
 391                 if (copy_from_sockptr(&tv, optval, sizeof(tv)))
 392                         return -EFAULT;
 393         }


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 13/25] y2038: Use a common definition for stat
  2021-06-04 19:37   ` Carlos O'Donell
@ 2021-06-07 18:07     ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-06-07 18:07 UTC (permalink / raw)
  To: Carlos O'Donell, libc-alpha



On 04/06/2021 16:37, Carlos O'Donell wrote:
> On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
>> From: Lukasz Majewski <lukma@denx.de>
>>
>> Instead of replicate the same definitions from struct_stat_time64.h
>> on the multiple struct_stat.h, use a common header which is included
>> when required (struct_stat_time64_helper.h).  The 64-bit time support
>> is added only for LFS support.
>>
>> The __USE_TIME_BITS64 is not defined internally yet, although the
>> internal header is used when building the 64-bit stat implementations.
> 
> Requesting a v3 please.
> 
> Please add the __glibc_reserved* members to the structures to preserve
> maximum compatibility with the kernel structure.
> 
> See review of patch 14/25 for more general details.
> 
> I am almost OK with this change as-is because in general everyone
> should be using statx at this point with the ability to extend and
> provide more information.
> 
> However because the kernel contains:
> 
>  24 struct stat {

This struct more specifically is the one used on compat non-LFS syscalls,
which glibc only issues for compat symbols. But even the 'struct stat64'
does add the two extra unused members.

>  25         unsigned long   st_dev;         /* Device.  */
>  26         unsigned long   st_ino;         /* File serial number.  */
>  27         unsigned int    st_mode;        /* File mode.  */
>  28         unsigned int    st_nlink;       /* Link count.  */
>  29         unsigned int    st_uid;         /* User ID of the file's owner.  */
>  30         unsigned int    st_gid;         /* Group ID of the file's group. */
>  31         unsigned long   st_rdev;        /* Device number, if device.  */
>  32         unsigned long   __pad1;
>  33         long            st_size;        /* Size of file, in bytes.  */
>  34         int             st_blksize;     /* Optimal block size for I/O.  */
>  35         int             __pad2;
>  36         long            st_blocks;      /* Number 512-byte blocks allocated. */
>  37         long            st_atime;       /* Time of last access.  */
>  38         unsigned long   st_atime_nsec;
>  39         long            st_mtime;       /* Time of last modification.  */
>  40         unsigned long   st_mtime_nsec;
>  41         long            st_ctime;       /* Time of last status change.  */
>  42         unsigned long   st_ctime_nsec;
>  43         unsigned int    __unused4;
>  44         unsigned int    __unused5;
>  45 };
> 
> With __unused4 and __unused5. I think we should match this ABI as closely as we can
> to avoid future compatibility issues with legacy APIs.
> 

These kernel interfaces are really a mess and not really in sync across
architectures. Some ABI adds the reserved fields only for non LFS,
which the generic interface adds regardless.  And from kernel comment
the reversed fields were added to allow glibc compatibility, not
really to provide further extension.

In any case , I think it should not hurt to add two extra unsigned int 
reserved fields for 64 bit time support.


> OK. Reindent.
> 
>>    };
>>  #endif
>>  
>> @@ -127,5 +135,4 @@ struct stat64
>>  /* Nanosecond resolution time values are supported.  */
>>  #define _STATBUF_ST_NSEC
>>  
>> -
> 
> Please avoid spurious empty line removal when not related to the patch at hand.

Ack.

> 
>> +  __blksize_t st_blksize;	/* Optimal block size for I/O.  */
>> +  __blkcnt64_t st_blocks;	/* Number 512-byte blocks allocated. */
> 
> OK.
> 
> Plase add __glibc_reserved4 and __glibc_reserved5 here.

Ack.

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 14/25] y2038: Use a common definition for msqid_ds
  2021-06-04 19:38   ` Carlos O'Donell
@ 2021-06-07 18:29     ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-06-07 18:29 UTC (permalink / raw)
  To: Carlos O'Donell, libc-alpha



On 04/06/2021 16:38, Carlos O'Donell wrote:
> On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
>> From: Lukasz Majewski <lukma@denx.de>
>>
>> Instead of replicate the same definitions from struct_msqid64_ds.h
>> on the multiple struct_msqid_ds.h, use a common header which is included
>> when required (struct_msqid64_ds_helper.h).
>>
>> The __USE_TIME_BITS64 is not defined internally yet, although the
>> internal header is used when building the 64-bit stat implementations.
> 
> Requesting a v3 please.
> 
> Please add the __glibc_reserved* members to the structures to preserve
> maximum compatibility with the kernel structure.
> 
> What I would like to see is that __glibc_reserved4 and __glibc_reserved5
> are *preserved* for both ABIs in the dual-time case. The kernel for msqid
> still has the following:
> 
>  26 struct msqid64_ds {
>  27         struct ipc64_perm msg_perm;
>  28 #if __BITS_PER_LONG == 64
>  29         long             msg_stime;     /* last msgsnd time */
>  30         long             msg_rtime;     /* last msgrcv time */
>  31         long             msg_ctime;     /* last change time */
>  32 #else
>  33         unsigned long   msg_stime;      /* last msgsnd time */
>  34         unsigned long   msg_stime_high;
>  35         unsigned long   msg_rtime;      /* last msgrcv time */
>  36         unsigned long   msg_rtime_high;
>  37         unsigned long   msg_ctime;      /* last change time */
>  38         unsigned long   msg_ctime_high;
>  39 #endif
>  40         unsigned long   msg_cbytes;     /* current number of bytes on queue */
>  41         unsigned long   msg_qnum;       /* number of messages in queue */
>  42         unsigned long    msg_qbytes;    /* max number of bytes on queue */
>  43         __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
>  44         __kernel_pid_t msg_lrpid;       /* last receive pid */
>  45         unsigned long    __unused4;
>  46         unsigned long    __unused5;
>  47 };
> 
> For maximum compatibility with future kernel changes we should keep
> the unused fields in the glibc equivalent structure. If the values are
> ever used then they would already be allocated as part of the size of
> the structure without the need for an ABI change. Given that these are
> somewhat legacy APIs we should be aiming for preserving existing behaviour
> rather than aiming for the smallest possible size structure.
> 
> On i686 the new 64-bit time_t struct is only 80 bytes, while the original
> struct size is 88 bytes. Adding the reserved entries brings this back to
> 88 bytes in the new ABI. We can add static asserts if we think we need to
> check exactly for alignment of 64-bit time_t, but since we copy from a
> kernel structure I'm largely worried about the ABI being too small to cary
> the information that we might need to copy from the matching kernel struct.
> 

Alright, I already sent my findings that it would increase the msqid_ds
size for _TIME_BITS=64 on some legacy ABIs (arm, mips, s390) but as
we discussed on weekly call it should be fine.

I don't think we need a static assert to check for alignment here (since
glibc export struct for _TIME_BITS might not be potentially equal to
kernel expected one and we already do the heavy lifting in msgctl to
copy and adjust the fields). 

> 
> This is a spurious cleanup from the last patch IMO. If possible please move it
> into the previous commit.
> 
> s/defitions/definitions/g
> 
>>     Copyright (C) 2021 Free Software Foundation, Inc.
>>     This file is part of the GNU C Library.
>>  

Ack, I just removed this change.

>> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
>> index 43e8cd7cfc..992734914a 100644
>> --- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
>> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h
>> @@ -25,14 +25,6 @@
>>  #else
>>  struct __msqid64_ds
>>  {
>> -  struct ipc_perm msg_perm;	/* structure describing operation permission */
>> -  __time64_t msg_stime;		/* time of last msgsnd command */
>> -  __time64_t msg_rtime;		/* time of last msgsnd command */
>> -  __time64_t msg_ctime;		/* time of last change */
>> -  __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
>> -  msgqnum_t msg_qnum;		/* number of messages currently on queue */
>> -  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
>> -  __pid_t msg_lspid;		/* pid of last msgsnd() */
>> -  __pid_t msg_lrpid;		/* pid of last msgrcv() */
>> +# include <bits/types/struct_msqid64_ds_helper.h>
> 
> OK. Used unconditionally since this is 64-bit time_t.
> 
>>  };
>>  #endif
>> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
>> new file mode 100644
>> index 0000000000..02dfddaa2b
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
>> @@ -0,0 +1,28 @@
>> +/* Common defintions for struct msqid_ds with 64 bit time.
> 
> s/defintions/definitions/g

Ack.

> 
>> +   Copyright (C) 2021 Free Software Foundation, Inc.
>> +   This file is part of the GNU C Library.
>> +
>> +   The GNU C Library is free software; you can redistribute it and/or
>> +   modify it under the terms of the GNU Lesser General Public
>> +   License as published by the Free Software Foundation; either
>> +   version 2.1 of the License, or (at your option) any later version.
>> +
>> +   The GNU C Library is distributed in the hope that it will be useful,
>> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> +   Lesser General Public License for more details.
>> +
>> +   You should have received a copy of the GNU Lesser General Public
>> +   License along with the GNU C Library.  If not, see
>> +   <https://www.gnu.org/licenses/>.  */
>> +
> 
> Reviewing...
> 
>> +  /* Content of internal __msqid64_ds.  */
>> +  struct ipc_perm msg_perm;	/* structure describing operation permission */
> 
> OK.
> 
>> +  __time64_t msg_stime;		/* time of last msgsnd command */
>> +  __time64_t msg_rtime;		/* time of last msgsnd command */
>> +  __time64_t msg_ctime;		/* time of last change */
> 
> OK. Usually a tuple of * and *_high (endian swapping for order applied).
> 
>> +  __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
> 
> OK.
> 
>> +  msgqnum_t msg_qnum;		/* number of messages currently on queue */
> 
> OK.
> 
>> +  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
> 
> OK.
> 
>> +  __pid_t msg_lspid;		/* pid of last msgsnd() */
>> +  __pid_t msg_lrpid;		/* pid of last msgrcv() */
> 
> OK.
> 
> Add __glibc_reserved4/5 entries here.
> 

Ack.

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 15/25] y2038: Use a common definition for semid_ds
  2021-06-04 19:38   ` Carlos O'Donell
@ 2021-06-07 18:46     ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-06-07 18:46 UTC (permalink / raw)
  To: Carlos O'Donell, libc-alpha



On 04/06/2021 16:38, Carlos O'Donell wrote:
> On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
>> Instead of replicate the same definitions from struct_semid64_ds.h
>> on the multiple struct_semid_ds.h, use a common header which is included
>> when required (struct_semid64_ds_helper.h).
>>
>> The __USE_TIME_BITS64 is not defined internally yet, although the
>> internal header is used when building the 64-bit semctl implementation.
> 
> Requesting a v3 please.
> 
> Similar to 14/25, we should add the __glibc_reserved* members to the
> structure to preserve maximum compatibility with the kernel structure.
> 
> The original struct semid_ds is 64 bytes on i686 with high-low time pairs
> and only 56 bytes in the 64-bit time_t version. With the two reserved
> members added back it's 64 bytes in both ABIs.

Ack.

> 
> We could add some static asserts if we really want to be thorough about
> the alignment of __time64_t.

I think there is no need, this would bsaically verify the expected ABI
already set by the compiler (since we do not need to actually follow
kernel expected internal layout).

> 
>> ---
>>  sysdeps/unix/sysv/linux/Makefile              |  3 ++-
>>  .../sysv/linux/bits/types/struct_semid64_ds.h |  5 +---
>>  .../bits/types/struct_semid64_ds_helper.h     | 23 +++++++++++++++++++
>>  .../sysv/linux/bits/types/struct_semid_ds.h   | 10 +++++---
>>  .../linux/hppa/bits/types/struct_semid_ds.h   |  4 ++++
>>  .../linux/mips/bits/types/struct_semid_ds.h   |  4 ++++
>>  .../powerpc/bits/types/struct_semid_ds.h      | 10 +++++---
>>  .../linux/sparc/bits/types/struct_semid_ds.h  | 10 +++++---
>>  .../linux/x86/bits/types/struct_semid_ds.h    |  4 ++++
>>  9 files changed, 59 insertions(+), 14 deletions(-)
>>  create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
>>
>> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
>> index 193b7c46b9..b599c423ed 100644
>> --- a/sysdeps/unix/sysv/linux/Makefile
>> +++ b/sysdeps/unix/sysv/linux/Makefile
>> @@ -102,7 +102,8 @@ sysdep_headers += sys/mount.h sys/acct.h \
>>  		  bits/ipc-perm.h \
>>  		  bits/struct_stat.h \
>>  		  bits/struct_stat_time64_helper.h \
>> -		  bits/types/struct_msqid64_ds_helper.h
>> +		  bits/types/struct_msqid64_ds_helper.h \
>> +		  bits/types/struct_semid64_ds_helper.h
> 
> OK. Add helper.
> 
>>  
>>  tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
>>  	 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
>> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
>> index 7263e50bbf..adaee3eb9e 100644
>> --- a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
>> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h
>> @@ -25,9 +25,6 @@
>>  #else
>>  struct __semid64_ds
>>  {
>> -  struct ipc_perm sem_perm;		/* operation permission struct */
>> -  __time64_t sem_otime;			/* last semop() time */
>> -  __time64_t sem_ctime;			/* last time changed by semctl() */
>> -  __syscall_ulong_t sem_nsems;		/* number of semaphores in set */
>> +# include <bits/types/struct_semid64_ds_helper.h>
> 
> OK. Use helper.
> 
>>  };
>>  #endif
>> diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
>> new file mode 100644
>> index 0000000000..ea60b671f1
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
>> @@ -0,0 +1,23 @@
>> +/* Common definitions for struct semid_ds with 64 bit time.
>> +   Copyright (C) 2020-2021 Free Software Foundation, Inc.
>> +   This file is part of the GNU C Library.
>> +
>> +   The GNU C Library is free software; you can redistribute it and/or
>> +   modify it under the terms of the GNU Lesser General Public
>> +   License as published by the Free Software Foundation; either
>> +   version 2.1 of the License, or (at your option) any later version.
>> +
>> +   The GNU C Library is distributed in the hope that it will be useful,
>> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> +   Lesser General Public License for more details.
>> +
>> +   You should have received a copy of the GNU Lesser General Public
>> +   License along with the GNU C Library; if not, see
>> +   <https://www.gnu.org/licenses/>.  */
>> +
>> +  /* Content of internal __semid64_ds.  */
>> +  struct ipc_perm sem_perm;		/* operation permission struct */
>> +  __time64_t sem_otime;			/* last semop() time */
>> +  __time64_t sem_ctime;			/* last time changed by semctl() */
>> +  __syscall_ulong_t sem_nsems;		/* number of semaphores in set */
> 
> Definitions look good.
> 
> Needs __glibc_reserved3 and __glibc_reserved4.

Ack.

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support
  2021-06-04 19:39   ` Carlos O'Donell
@ 2021-06-07 18:52     ` Adhemerval Zanella
  0 siblings, 0 replies; 92+ messages in thread
From: Adhemerval Zanella @ 2021-06-07 18:52 UTC (permalink / raw)
  To: Carlos O'Donell, libc-alpha



On 04/06/2021 16:39, Carlos O'Donell wrote:
> On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
>> The glob might pass a different stat struct for gl_stat and gl_lstat
>> when GLOB_ALTDIRFUNC is used.  This requires add a new 64 time
>> version that also uses 64 time stat functions.
> 
> Needs a v3 please. See below. Minor mistake in the test list?

Ok, although the mistake is pretty obvious (the extra shm-directory
entry in routines).  Do you think it would be worth to resend
the v3 upstream?

> 
> No regressions on x86_64, i686, ppc64le, aarch64, s390x.
> 
> Tested-by: Carlos O'Donell <carlos@redhat.com>
>  

>> diff --git a/posix/Makefile b/posix/Makefile
>> index fa0dc0ea20..84204b1270 100644
>> --- a/posix/Makefile
>> +++ b/posix/Makefile
>> @@ -67,7 +67,10 @@ routines :=								      \
>>  	get_child_max sched_cpucount sched_cpualloc sched_cpufree \
>>  	streams-compat \
>>  	shm-directory                                                         \
>> -	execveat
>> +	execveat \
>> +	shm-directory \
> 
> This is not correct since it duplicates shm-directory. I expect you intended
> to fix the silly "\" way on the end.
> 
> We should make all of those routines clearly into one entry per line to make
> merging easier.
> 
>> +	glob64-time64 \
>> +	globfree64-time64
>>  
>>  aux		:= init-posix environ
>>  tests		:= test-errno tstgetopt testfnm runtests runptests \

Indeed the duplicated 'shm-directory' is wrong, I removed it.

^ permalink raw reply	[flat|nested] 92+ messages in thread

end of thread, other threads:[~2021-06-07 18:53 UTC | newest]

Thread overview: 92+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 20:55 [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Adhemerval Zanella
2021-05-18 20:55 ` [PATCH v2 01/25] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
2021-05-19  8:24   ` Lukasz Majewski
2021-05-20  6:38   ` Florian Weimer
2021-05-20 10:43     ` Adhemerval Zanella
2021-06-04 19:29   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 02/25] linux: mips: Split librt.abilist " Adhemerval Zanella
2021-05-19  8:25   ` Lukasz Majewski
2021-06-04 19:29   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 03/25] linux: mips: Split libanl.abilist " Adhemerval Zanella
2021-05-19  8:25   ` Lukasz Majewski
2021-06-04 19:30   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 04/25] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella
2021-05-19  8:26   ` Lukasz Majewski
2021-06-04 19:30   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella
2021-05-19  8:36   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO Lukasz Majewski
2021-05-20  6:44   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Florian Weimer
2021-05-20 18:01     ` Adhemerval Zanella
2021-05-21 18:37       ` Florian Weimer
2021-05-21 19:17         ` Adhemerval Zanella
2021-06-04 19:30   ` [PATCH v2 05/25] linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO Carlos O'Donell
2021-06-07 17:52     ` Adhemerval Zanella
2021-05-18 20:55 ` [PATCH v2 06/25] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella
2021-05-19  8:50   ` Lukasz Majewski
2021-05-20  6:50   ` Florian Weimer
2021-05-20 18:46     ` Adhemerval Zanella
2021-05-21 18:38       ` Florian Weimer
2021-05-21 19:02         ` Adhemerval Zanella
2021-06-04 19:30   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 07/25] linux: Add recvvmsg " Adhemerval Zanella
2021-05-19  9:02   ` Lukasz Majewski
2021-06-04 19:30   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 08/25] y2038: Add __USE_TIME_BITS64 support for time_t Adhemerval Zanella
2021-05-19  9:02   ` Lukasz Majewski
2021-06-04 19:30   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 09/25] y2038: Add __USE_TIME_BITS64 support for struct timeval Adhemerval Zanella
2021-05-19  9:03   ` Lukasz Majewski
2021-06-04 19:31   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 10/25] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella
2021-05-19  9:03   ` Lukasz Majewski
2021-06-04 19:31   ` Carlos O'Donell
2021-05-18 20:55 ` [PATCH v2 11/25] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Adhemerval Zanella
2021-05-19  9:04   ` Lukasz Majewski
2021-06-04 19:31   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Adhemerval Zanella
2021-05-19  9:04   ` Lukasz Majewski
2021-06-04 19:31   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 13/25] y2038: Use a common definition for stat Adhemerval Zanella
2021-06-04 19:37   ` Carlos O'Donell
2021-06-07 18:07     ` Adhemerval Zanella
2021-05-18 20:56 ` [PATCH v2 14/25] y2038: Use a common definition for msqid_ds Adhemerval Zanella
2021-06-04 19:38   ` Carlos O'Donell
2021-06-07 18:29     ` Adhemerval Zanella
2021-05-18 20:56 ` [PATCH v2 15/25] y2038: Use a common definition for semid_ds Adhemerval Zanella
2021-05-19  9:09   ` Lukasz Majewski
2021-06-04 19:38   ` Carlos O'Donell
2021-06-07 18:46     ` Adhemerval Zanella
2021-05-18 20:56 ` [PATCH v2 16/25] y2038: Use a common definition for shmid_ds Adhemerval Zanella
2021-05-19  9:09   ` Lukasz Majewski
2021-06-04 19:38   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 17/25] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Adhemerval Zanella
2021-05-19  9:13   ` Lukasz Majewski
2021-06-04 19:38   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 18/25] time: Add 64 bit time support for getdate Adhemerval Zanella
2021-05-19  9:15   ` Lukasz Majewski
2021-06-04 19:38   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 19/25] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella
2021-05-19  9:18   ` Lukasz Majewski
2021-05-20  6:58   ` Florian Weimer
2021-05-20 10:37     ` Adhemerval Zanella
2021-06-04 19:38   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 20/25] posix: Add glob64 with 64 bit time_t support Adhemerval Zanella
2021-05-19 10:44   ` Lukasz Majewski
2021-06-04 19:39   ` Carlos O'Donell
2021-06-07 18:52     ` Adhemerval Zanella
2021-05-18 20:56 ` [PATCH v2 21/25] io: Add fts64 " Adhemerval Zanella
2021-05-19 10:50   ` Lukasz Majewski
2021-06-04 19:39   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 22/25] io: Add ftw64 " Adhemerval Zanella
2021-05-19 10:57   ` Lukasz Majewski
2021-06-04 19:39   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 23/25] libsupport: Add 64 bit time_t support for time functions Adhemerval Zanella
2021-05-19 11:00   ` Lukasz Majewski
2021-06-04 19:39   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 24/25] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella
2021-05-19 11:04   ` Lukasz Majewski
2021-06-04 19:39   ` Carlos O'Donell
2021-05-18 20:56 ` [PATCH v2 25/25] y2038: Add test coverage Adhemerval Zanella
2021-05-19 11:08   ` Lukasz Majewski
2021-06-04 19:39   ` Carlos O'Donell
2021-06-04 19:29 ` [PATCH v2 00/25] Add 64 bit time support on legacy ABIs Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).