unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/52] Add 64 bit time support on legacy ABIs
@ 2021-03-05 20:14 Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella via Libc-alpha
                   ` (53 more replies)
  0 siblings, 54 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

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 as 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 5 subparts:

  1. Patches from 01/52 to 14/52 are newer tests and infrastructure
     changes that are independent of 64 bit time support.

  2. Patches from 15/52 to 23/52 add the 64 bit time support on
     utmp/utmpx/lastlog and it affects *all* the ABIs with the
     exception of s390.

  3. Patches from 24/52 to 41/52 are the one that adjust the exported
     API, add some specific newer symbols (glob, ftw, and fts) and
     enable the _TIME_BITS on the installed headers.

  4. Patches from 42/52 to 44/52 enables basic test coverage.  Although
     it does not cover all the newer symbol redirection, the idea is to
     use Lukasz patches and newer tests to cover all the symbols for
     2.34 release.

  5. Patches from 45/52 to 52/52 make glibc itself to use the newer
     64 bit symbol internally and on installed programs.

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 4.12.13 kernel.  As expected,
the arm shows some tests failures due the missing kernel support:

FAIL: io/tst-utimensat-time64
FAIL: misc/tst-futimens-time64
FAIL: misc/tst-futimes-time64
FAIL: misc/tst-lutimes-time64
FAIL: misc/tst-utime-time64
FAIL: misc/tst-utimes-time64

Adhemerval Zanella (50):
  io: Use temporary directory and file for ftwtest-sh
  linux: Add futimes test
  linux: Add lutimes test
  time: Add getitimer and setitimer basic tests
  time: Add gmtime/gmtime_r tests
  time: Add timegm/timelocal basic tests
  time: Add basic timespec_get tests
  time: Add 64 bit tests for getdate / getdate_r
  io: Add basic tests for utimensat
  posix: Add wait3 tests
  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
  login: Consolidate utmp and utmpx headers
  login: Move gnu utmpx to default implementation
  Consolidate and simplify internal utmp definitions
  support: Add 'touch' command
  Add tests-container-internal rules
  login: Add 64-bit time support to utmp/utmpx
  linux: Add pwrite64_nocancel
  login: Use 64-bit time on struct lastlog [BZ #25844]
  Remove __WORDSIZE_TIME64_COMPAT32
  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
  Use 64 bit time_t stat internally
  debug: build pcprofiledump with LFS and 64 bit time support
  elf: Use LFS and 64 bit time_t for installed programs
  iconv: Use LFS and 64 bit time_t for installed programs
  locale: Use LFS and 64 bit time_t for installed programs
  nss: Use LFS and 64 bit time_t for installed programs
  posix: Use LFS and 64 bit time_t for installed programs
  timezone: Use LFS and 64 bit time_t for installed programs

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

 Makeconfig                                    |  14 +
 Makefile                                      |   4 +-
 Makerules                                     |  21 +-
 NEWS                                          |   5 +
 Rules                                         |  12 +-
 .../updwtmp.c => bits/types/struct_lastlog.h  |  26 +-
 bits/types/struct_utmp.h                      |  53 ++
 bits/types/struct_utmpx.h                     |  54 +++
 bits/utmp.h                                   |  48 +-
 .../sysv/linux/s390/bits => bits}/utmpx.h     |  34 +-
 bits/wordsize.h                               |   6 -
 csu/check_fds.c                               |   8 +-
 debug/Makefile                                |   1 +
 elf/Makefile                                  |  13 +-
 elf/dl-load.c                                 |   8 +-
 elf/dl-misc.c                                 |   4 +-
 elf/dl-profile.c                              |   4 +-
 iconv/Makefile                                |   8 +
 iconv/gconv_cache.c                           |   4 +-
 include/dirent.h                              |   2 +-
 include/features-time64.h                     |   1 +
 include/features.h                            |   2 +
 include/file_change_detection.h               |   6 +-
 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 +-
 include/utmp.h                                |   5 +-
 include/utmpx.h                               |   1 +
 inet/rcmd.c                                   |   6 +-
 intl/loadmsgcat.c                             |   4 +-
 io/Makefile                                   |  28 +-
 io/file_change_detection.c                    |  16 +-
 io/fts.h                                      |  43 +-
 io/fts64-time64.c                             |  35 ++
 io/ftw.c                                      |   5 +-
 io/ftw.h                                      |  46 +-
 .../s390-32/getutent_r.c => io/ftw64-time64.c |  34 +-
 io/ftwtest-sh                                 | 246 +++++-----
 io/ftwtest-time64.c                           |   1 +
 io/getdirname.c                               |   6 +-
 io/sys/poll.h                                 |  11 +
 io/sys/stat.h                                 | 113 ++++-
 io/tst-fts-time64.c                           |   1 +
 io/tst-futimesat-time64.c                     |   4 +
 io/tst-futimesat.c                            |  47 +-
 io/tst-stat-time64.c                          | 102 ++++
 io/tst-utimensat-time64.c                     |   2 +
 io/tst-utimensat.c                            | 115 +++++
 io/utime.h                                    |  16 +
 libio/filedoalloc.c                           |   2 +-
 libio/fileops.c                               |   8 +-
 libio/oldfileops.c                            |   2 +-
 libio/wfileops.c                              |   2 +-
 locale/Makefile                               |   9 +
 locale/loadarchive.c                          |   8 +-
 locale/loadlocale.c                           |   6 +-
 login/Makefile                                |  16 +-
 login/Versions                                |  26 +
 login/getutent.c                              |   7 +-
 login/getutent_r.c                            |  48 +-
 login/getutid.c                               |   7 +-
 login/getutid_r.c                             |  33 +-
 login/getutline.c                             |   7 +-
 login/getutline_r.c                           |  33 +-
 login/getutmp.c                               |  42 +-
 login/getutmpx.c                              |  35 +-
 login/getutxent.c                             |   9 +-
 login/getutxid.c                              |   9 +-
 login/getutxline.c                            |   9 +-
 .../getutent.c => login/lastlog-compat.h      |  29 +-
 login/lastlog_read.c                          |  78 +++
 login/lastlog_write.c                         |  64 +++
 login/login.c                                 |  10 +-
 .../linux/s390/s390-32 => login}/login32.c    |  16 +-
 login/pututxline.c                            |   9 +-
 login/tst-lastlog.c                           |  80 ++++
 login/tst-lastlog.root/tst-lastlog.script     |   6 +
 login/tst-utmp-default.c                      | 292 ++++++++++++
 .../tst-utmp-default.script                   |  10 +
 login/tst-utmp32.c                            | 318 ++++++++++++
 login/tst-utmp32.root/tst-utmp32.script       |   7 +
 login/updwtmp.c                               |  32 +-
 login/updwtmpx.c                              |   9 +-
 .../utmp-convert.h => login/utmp-convert.c    |  59 +--
 .../s390-32/getutmp.c => login/utmp-convert.h |  39 +-
 .../sysv/linux/updwtmp.c => login/utmp-path.h |  42 +-
 login/utmp-private.h                          |  24 +-
 login/utmp.h                                  |  11 +
 login/utmp32.c                                | 247 ++++++++++
 .../linux/s390/s390-32 => login}/utmp32.h     |   9 +
 login/utmp_file.c                             | 451 +++++++++++-------
 login/utmpname.c                              |   8 +
 {sysdeps/gnu => login}/utmpx.h                |   0
 login/utmpx32.c                               | 112 +++++
 .../linux/s390/s390-32 => login}/utmpx32.h    |   6 +-
 manual/creature.texi                          |  44 ++
 manual/users.texi                             |   4 +-
 misc/Makefile                                 |   2 +
 misc/sys/select.h                             |  27 ++
 misc/tst-pselect-time64.c                     |   1 +
 nptl/Makefile                                 |   3 +
 nptl/tst-cancel4_2-time64.c                   |   1 +
 nscd/nscd_helper.c                            |   4 +-
 nss/Makefile                                  |  11 +-
 nss/nss_database.c                            |   4 +-
 posix/Makefile                                |  10 +-
 posix/glob.c                                  |  46 +-
 posix/glob.h                                  |  22 +
 posix/glob64-lstat-compat.c                   |   3 +-
 posix/glob64-time64.c                         |  49 ++
 .../getutid.c => posix/globfree64-time64.c    |  22 +-
 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-wait-skeleton.c                     | 209 ++++++++
 posix/tst-wait3-time64.c                      |   1 +
 .../s390-32/updwtmpx.c => posix/tst-wait3.c   |  18 +-
 posix/tst-wait4-time64.c                      |   1 +
 posix/tst-wait4.c                             | 193 +-------
 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                              |   8 +
 support/support-xfstat-time64.c               |  32 ++
 .../support-xstat-time64.c                    |  28 +-
 support/test-container.c                      |  11 +
 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 +-
 .../xclock_gettime_time64.c                   |  22 +-
 support/xlstat-time64.c                       |  32 ++
 support/xtime.h                               |   5 +
 support/xunistd.h                             |  13 +
 sysdeps/aarch64/bits/wordsize.h               |   2 -
 .../getutxent.c => generic/features-time64.h} |  17 +-
 sysdeps/generic/paths.h                       |  12 +-
 sysdeps/generic/time64-compat.h               |   3 +
 sysdeps/generic/utmp-compat.h                 |   3 +
 sysdeps/generic/utmp-equal.h                  |  42 --
 sysdeps/gnu/getutmpx.c                        |   1 -
 sysdeps/gnu/glob64-lstat-compat.c             |   3 +-
 sysdeps/gnu/utmp_file.c                       |  31 --
 sysdeps/mach/hurd/i386/libc.abilist           |  17 +
 sysdeps/mach/hurd/i386/libutil.abilist        |   1 +
 sysdeps/mips/bits/wordsize.h                  |   6 -
 sysdeps/nptl/pthread.h                        | 119 +++++
 sysdeps/posix/dl-fileid.h                     |   4 +-
 sysdeps/posix/euidaccess.c                    |   4 +-
 sysdeps/posix/getaddrinfo.c                   |  21 +-
 sysdeps/posix/getcwd.c                        |  15 +-
 sysdeps/posix/pathconf.c                      |   4 +-
 sysdeps/posix/sysconf.c                       |   4 +-
 sysdeps/posix/tempname.c                      |   8 +-
 sysdeps/powerpc/powerpc32/bits/wordsize.h     |   2 -
 sysdeps/powerpc/powerpc64/bits/wordsize.h     |   2 -
 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/riscv/bits/wordsize.h                 |   2 -
 sysdeps/s390/s390-32/bits/wordsize.h          |   2 -
 sysdeps/s390/s390-64/bits/wordsize.h          |   2 -
 sysdeps/sparc/sparc32/bits/wordsize.h         |   2 -
 sysdeps/sparc/sparc64/bits/wordsize.h         |   2 -
 sysdeps/unix/sysv/linux/Makefile              |  22 +-
 sysdeps/unix/sysv/linux/Versions              | 125 +++++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  17 +
 .../unix/sysv/linux/aarch64/libutil.abilist   |   1 +
 sysdeps/unix/sysv/linux/alpha/bits/wordsize.h |   1 -
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  17 +
 sysdeps/unix/sysv/linux/alpha/libutil.abilist |   1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      |  17 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist   |   1 +
 sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  78 +++
 .../unix/sysv/linux/arm/be/libpthread.abilist |  14 +
 sysdeps/unix/sysv/linux/arm/be/librt.abilist  |   5 +
 .../unix/sysv/linux/arm/be/libutil.abilist    |   1 +
 sysdeps/unix/sysv/linux/arm/le/libanl.abilist |   1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  78 +++
 .../unix/sysv/linux/arm/le/libpthread.abilist |  14 +
 sysdeps/unix/sysv/linux/arm/le/librt.abilist  |   5 +
 .../unix/sysv/linux/arm/le/libutil.abilist    |   1 +
 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 +-
 .../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}    |  25 +-
 .../sysv/linux/bits/types/struct_shmid_ds.h   |  10 +-
 .../unix/sysv/linux/convert_scm_timestamps.c  |  96 ++++
 sysdeps/unix/sysv/linux/csky/libanl.abilist   |   1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  78 +++
 .../unix/sysv/linux/csky/libpthread.abilist   |  14 +
 sysdeps/unix/sysv/linux/csky/librt.abilist    |   5 +
 sysdeps/unix/sysv/linux/csky/libutil.abilist  |   1 +
 sysdeps/unix/sysv/linux/csky/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/fdopendir.c           |   4 +-
 sysdeps/unix/sysv/linux/features-time64.h     |  37 ++
 sysdeps/unix/sysv/linux/fexecve.c             |   4 +-
 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 +-
 .../getutid_r.c => globfree64-time64.c}       |  30 +-
 .../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     |  78 +++
 .../unix/sysv/linux/hppa/libpthread.abilist   |  14 +
 sysdeps/unix/sysv/linux/hppa/librt.abilist    |   5 +
 sysdeps/unix/sysv/linux/hppa/libutil.abilist  |   1 +
 .../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     |  78 +++
 .../unix/sysv/linux/i386/libpthread.abilist   |  14 +
 sysdeps/unix/sysv/linux/i386/librt.abilist    |   5 +
 sysdeps/unix/sysv/linux/i386/libutil.abilist  |   1 +
 sysdeps/unix/sysv/linux/i386/time64-compat.h  |   2 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |  17 +
 sysdeps/unix/sysv/linux/ia64/libutil.abilist  |   1 +
 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     |  78 +++
 .../linux/m68k/coldfire/libpthread.abilist    |  14 +
 .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
 .../sysv/linux/m68k/coldfire/libutil.abilist  |   1 +
 .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  78 +++
 .../sysv/linux/m68k/m680x0/libpthread.abilist |  14 +
 .../unix/sysv/linux/m68k/m680x0/librt.abilist |   5 +
 .../sysv/linux/m68k/m680x0/libutil.abilist    |   1 +
 sysdeps/unix/sysv/linux/m68k/time64-compat.h  |   2 +
 .../sysv/linux/microblaze/be/libanl.abilist   |   1 +
 .../sysv/linux/microblaze/be/libc.abilist     |  78 +++
 .../linux/microblaze/be/libpthread.abilist    |  14 +
 .../sysv/linux/microblaze/be/librt.abilist    |   5 +
 .../sysv/linux/microblaze/be/libutil.abilist  |   1 +
 .../sysv/linux/microblaze/bits/struct_stat.h  |  48 +-
 .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
 .../sysv/linux/microblaze/le/libc.abilist     |  78 +++
 .../linux/microblaze/le/libpthread.abilist    |  14 +
 .../sysv/linux/microblaze/le/librt.abilist    |   5 +
 .../sysv/linux/microblaze/le/libutil.abilist  |   1 +
 .../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   |  78 +++
 .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
 .../sysv/linux/mips/mips32/libpthread.abilist |  14 +
 .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
 .../sysv/linux/mips/mips32/libutil.abilist    |   1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  78 +++
 .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
 .../sysv/linux/mips/mips64/libutil.abilist    |   1 +
 .../sysv/linux/mips/mips64/n32/libanl.abilist |   5 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  78 +++
 .../linux/mips/mips64/n32/libpthread.abilist  | 252 ++++++++++
 .../sysv/linux/mips/mips64/n32/librt.abilist  |  42 ++
 .../linux/mips/mips64/n32/time64-compat.h     |   2 +
 .../mips/mips64/{ => n64}/libanl.abilist      |   0
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  17 +
 .../mips/mips64/{ => n64}/libpthread.abilist  |   0
 .../linux/mips/mips64/{ => n64}/librt.abilist |   0
 .../sysv/linux/mips/socket-constants-time64.h |  35 ++
 sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  78 +++
 .../unix/sysv/linux/nios2/libpthread.abilist  |  14 +
 sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/nios2/libutil.abilist |   1 +
 sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
 sysdeps/unix/sysv/linux/not-cancel.h          |   4 +
 sysdeps/unix/sysv/linux/oldglob.c             |  11 +-
 sysdeps/unix/sysv/linux/opendir.c             |   7 +-
 sysdeps/unix/sysv/linux/pathconf.c            |   5 +-
 sysdeps/unix/sysv/linux/paths.h               |  10 +-
 .../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 +-
 .../unix/sysv/linux/powerpc/bits/wordsize.h   |   2 -
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  78 +++
 .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
 .../powerpc/powerpc32/libpthread.abilist      |  14 +
 .../linux/powerpc/powerpc32/librt.abilist     |   5 +
 .../linux/powerpc/powerpc32/libutil.abilist   |   1 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  78 +++
 .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |  17 +
 .../powerpc/powerpc64/be/libutil.abilist      |   1 +
 .../linux/powerpc/powerpc64/le/libc.abilist   |  17 +
 .../powerpc/powerpc64/le/libutil.abilist      |   1 +
 .../linux/powerpc/socket-constants-time64.h   |  35 ++
 .../s390-32/login.c => pwrite64_nocancel.c}   |  30 +-
 sysdeps/unix/sysv/linux/recvmmsg.c            |  17 +-
 sysdeps/unix/sysv/linux/recvmsg.c             |  23 +-
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |  17 +
 .../sysv/linux/riscv/rv32/libutil.abilist     |   1 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  17 +
 .../sysv/linux/riscv/rv64/libutil.abilist     |   1 +
 .../unix/sysv/linux/s390/bits/struct_utmp.h   |  51 ++
 .../sysv/linux/s390/bits/struct_utmpx.h}      |  65 +--
 sysdeps/unix/sysv/linux/s390/bits/utmp.h      | 127 -----
 .../sysv/linux/s390/lastlog-compat.h}         |  34 +-
 .../unix/sysv/linux/s390/s390-32/getutxline.c |  30 --
 .../sysv/linux/s390/s390-32/libanl.abilist    |   5 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  63 +++
 .../linux/s390/s390-32/libpthread.abilist     |  14 +
 .../sysv/linux/s390/s390-32/librt.abilist     |   5 +
 .../unix/sysv/linux/s390/s390-32/pututxline.c |  30 --
 .../sysv/linux/s390/s390-32/time64-compat.h   |   2 +
 .../sysv/linux/s390/s390-32/utmp-compat.h     |   2 +-
 sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c | 184 -------
 .../sysv/linux/s390/s390-32/utmpx-convert.h   |  85 ----
 .../unix/sysv/linux/s390/s390-32/utmpx32.c    | 139 ------
 .../linux/s390/{ => s390-64}/libanl.abilist   |   0
 .../unix/sysv/linux/s390/s390-64/libc.abilist |   2 +
 .../sysv/linux/s390/s390-64/utmp-compat.h     |   3 +
 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    |  78 +++
 .../unix/sysv/linux/sh/be/libpthread.abilist  |  14 +
 sysdeps/unix/sysv/linux/sh/be/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/sh/be/libutil.abilist |   1 +
 sysdeps/unix/sysv/linux/sh/le/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  78 +++
 .../unix/sysv/linux/sh/le/libpthread.abilist  |  14 +
 sysdeps/unix/sysv/linux/sh/le/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/sh/le/libutil.abilist |   1 +
 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 +-
 sysdeps/unix/sysv/linux/sparc/bits/wordsize.h |   2 -
 .../linux/sparc/socket-constants-time64.h     |  35 ++
 .../sysv/linux/sparc/sparc32/libanl.abilist   |   1 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  78 +++
 .../linux/sparc/sparc32/libpthread.abilist    |  14 +
 .../sysv/linux/sparc/sparc32/librt.abilist    |   5 +
 .../sysv/linux/sparc/sparc32/libutil.abilist  |   1 +
 .../sysv/linux/sparc/sparc32/time64-compat.h  |   2 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |  17 +
 .../sysv/linux/sparc/sparc64/libutil.abilist  |   1 +
 sysdeps/unix/sysv/linux/struct_stat_time64.h  |  59 +--
 sysdeps/unix/sysv/linux/sys/timerfd.h         |  22 +
 sysdeps/unix/sysv/linux/sys/timex.h           |  28 +-
 sysdeps/unix/sysv/linux/tst-futimens-time64.c |   2 +
 sysdeps/unix/sysv/linux/tst-futimens.c        |   8 +-
 sysdeps/unix/sysv/linux/tst-futimes-time64.c  |   2 +
 sysdeps/unix/sysv/linux/tst-futimes.c         |  85 ++++
 sysdeps/unix/sysv/linux/tst-lutimes-time64.c  |   2 +
 sysdeps/unix/sysv/linux/tst-lutimes.c         |  95 ++++
 sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
 sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
 sysdeps/unix/sysv/linux/tst-utime-time64.c    |   2 +
 sysdeps/unix/sysv/linux/tst-utime.c           |   6 +-
 sysdeps/unix/sysv/linux/tst-utimes-time64.c   |   2 +
 sysdeps/unix/sysv/linux/tst-utimes.c          |   6 +-
 sysdeps/unix/sysv/linux/ttyname.c             |  17 +-
 sysdeps/unix/sysv/linux/ttyname.h             |  10 +-
 sysdeps/unix/sysv/linux/ttyname_r.c           |  16 +-
 sysdeps/unix/sysv/linux/utmp-path.h           |  54 +++
 sysdeps/unix/sysv/linux/utmp_file.c           |  37 --
 .../unix/sysv/linux/x86/bits/struct_stat.h    |  90 ++--
 .../linux/x86/bits/types/struct_semid_ds.h    |   4 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  17 +
 .../unix/sysv/linux/x86_64/64/libutil.abilist |   1 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  17 +
 .../sysv/linux/x86_64/x32/libutil.abilist     |   1 +
 sysdeps/wordsize-32/bits/wordsize.h           |   1 -
 sysdeps/wordsize-64/bits/wordsize.h           |   1 -
 sysdeps/x86/bits/wordsize.h                   |   3 -
 sysvipc/Makefile                              |   2 +
 sysvipc/ftok.c                                |   4 +-
 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                                   | 128 ++++-
 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-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                            | 147 +++---
 time/tst-gmtime-time64.c                      |   1 +
 time/tst-gmtime.c                             | 125 +++++
 time/tst-itimer-time64.c                      |   1 +
 time/tst-itimer.c                             | 175 +++++++
 time/tst-mktime4-time64.c                     |   1 +
 time/tst-timegm-time64.c                      |   1 +
 time/tst-timegm.c                             |  95 ++++
 time/tst-timespec_get-time64.c                |   1 +
 time/tst-timespec_get.c                       |  40 ++
 time/tst-y2039-time64.c                       |   1 +
 time/tst-y2039.c                              |  10 +
 time/tzfile.c                                 |   6 +-
 timezone/Makefile                             |   1 +
 463 files changed, 9068 insertions(+), 2386 deletions(-)
 rename sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c => bits/types/struct_lastlog.h (64%)
 create mode 100644 bits/types/struct_utmp.h
 create mode 100644 bits/types/struct_utmpx.h
 rename {sysdeps/unix/sysv/linux/s390/bits => bits}/utmpx.h (64%)
 create mode 100644 include/features-time64.h
 create mode 100644 include/utmpx.h
 create mode 100644 io/fts64-time64.c
 rename sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c => io/ftw64-time64.c (55%)
 create mode 100644 io/ftwtest-time64.c
 create mode 100644 io/tst-fts-time64.c
 create mode 100644 io/tst-futimesat-time64.c
 create mode 100644 io/tst-stat-time64.c
 create mode 100644 io/tst-utimensat-time64.c
 create mode 100644 io/tst-utimensat.c
 rename sysdeps/unix/sysv/linux/s390/s390-32/getutent.c => login/lastlog-compat.h (66%)
 create mode 100644 login/lastlog_read.c
 create mode 100644 login/lastlog_write.c
 rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/login32.c (72%)
 create mode 100644 login/tst-lastlog.c
 create mode 100644 login/tst-lastlog.root/tst-lastlog.script
 create mode 100644 login/tst-utmp-default.c
 create mode 100644 login/tst-utmp-default.root/tst-utmp-default.script
 create mode 100644 login/tst-utmp32.c
 create mode 100644 login/tst-utmp32.root/tst-utmp32.script
 rename sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h => login/utmp-convert.c (58%)
 rename sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c => login/utmp-convert.h (59%)
 rename sysdeps/unix/sysv/linux/updwtmp.c => login/utmp-path.h (50%)
 create mode 100644 login/utmp32.c
 rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/utmp32.h (78%)
 rename {sysdeps/gnu => login}/utmpx.h (100%)
 create mode 100644 login/utmpx32.c
 rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/utmpx32.h (93%)
 create mode 100644 misc/tst-pselect-time64.c
 create mode 100644 nptl/tst-cancel4_2-time64.c
 create mode 100644 posix/glob64-time64.c
 rename sysdeps/unix/sysv/linux/s390/s390-32/getutid.c => posix/globfree64-time64.c (67%)
 create mode 100644 posix/tst-gnuglob64-time64.c
 create mode 100644 posix/tst-sched_rr_get_interval-time64.c
 create mode 100644 posix/tst-wait-skeleton.c
 create mode 100644 posix/tst-wait3-time64.c
 rename sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c => posix/tst-wait3.c (66%)
 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
 rename sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c => support/support-xstat-time64.c (63%)
 create mode 100644 support/timespec-add-time64.c
 create mode 100644 support/timespec-sub-time64.c
 create mode 100644 support/timespec-time64.c
 rename sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c => support/xclock_gettime_time64.c (66%)
 create mode 100644 support/xlstat-time64.c
 rename sysdeps/{unix/sysv/linux/s390/s390-32/getutxent.c => generic/features-time64.h} (66%)
 create mode 100644 sysdeps/generic/time64-compat.h
 create mode 100644 sysdeps/generic/utmp-compat.h
 delete mode 100644 sysdeps/generic/utmp-equal.h
 delete mode 100644 sysdeps/gnu/getutmpx.c
 delete mode 100644 sysdeps/gnu/utmp_file.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/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
 rename sysdeps/unix/sysv/linux/{s390/s390-32/getutline.c => bits/types/struct_semid64_ds_helper.h} (64%)
 rename sysdeps/{gnu/updwtmp.c => unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h} (57%)
 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
 rename sysdeps/unix/sysv/linux/{s390/s390-32/getutid_r.c => globfree64-time64.c} (62%)
 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
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
 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%)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n64}/libpthread.abilist (100%)
 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
 rename sysdeps/unix/sysv/linux/{s390/s390-32/login.c => pwrite64_nocancel.c} (62%)
 create mode 100644 sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h
 rename sysdeps/{gnu/bits/utmpx.h => unix/sysv/linux/s390/bits/struct_utmpx.h} (51%)
 delete mode 100644 sysdeps/unix/sysv/linux/s390/bits/utmp.h
 rename sysdeps/{gnu/getutmp.c => unix/sysv/linux/s390/lastlog-compat.h} (61%)
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
 rename sysdeps/unix/sysv/linux/s390/{ => s390-64}/libanl.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h
 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-futimens-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-futimes-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-futimes.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-lutimes-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-lutimes.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-utime-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-utimes-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/utmp-path.h
 delete mode 100644 sysdeps/unix/sysv/linux/utmp_file.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-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-gmtime.c
 create mode 100644 time/tst-itimer-time64.c
 create mode 100644 time/tst-itimer.c
 create mode 100644 time/tst-mktime4-time64.c
 create mode 100644 time/tst-timegm-time64.c
 create mode 100644 time/tst-timegm.c
 create mode 100644 time/tst-timespec_get-time64.c
 create mode 100644 time/tst-timespec_get.c
 create mode 100644 time/tst-y2039-time64.c

-- 
2.25.1


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

* [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:56   ` Andreas Schwab
  2021-03-05 23:53   ` Joseph Myers
  2021-03-05 20:14 ` [PATCH 02/52] linux: Add futimes test Adhemerval Zanella via Libc-alpha
                   ` (52 subsequent siblings)
  53 siblings, 2 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

Instead of creating files on glibc source dir.  It also allows run
in parallel.

Checked on x86_64-linux-gnu.
---
 io/ftwtest-sh | 246 +++++++++++++++++++++++++-------------------------
 1 file changed, 121 insertions(+), 125 deletions(-)

diff --git a/io/ftwtest-sh b/io/ftwtest-sh
index a9ae33ff30..6d553dad5d 100644
--- a/io/ftwtest-sh
+++ b/io/ftwtest-sh
@@ -42,16 +42,12 @@ LC_ALL=C
 export LC_ALL
 
 # First create our scenario:
-tmp=${objpfx}io
-tmpdir=$tmp/ftwtest.d
+tmp=/tmp
+tmpdir=$(mktemp -d $tmp/ftwtest.d.XXXXXX)
+ftwtest=$(basename $tmpdir)
 
-trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 0 1 2 3 15
+#trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 0 1 2 3 15
 
-if test -d $tmpdir; then
-  chmod -fR a+x $tmpdir
-  rm -fr $tmpdir
-fi
-mkdir $tmpdir
 mkdir $tmpdir/foo
 mkdir $tmpdir/bar
 echo > $tmpdir/baz
@@ -67,24 +63,24 @@ ln -s $tmpdir/foo/lvl1/lvl2/lvl3/lvl4 $tmpdir/foo/lvl1/link@1
 echo > $tmpdir/bar/xo
 chmod a-x,a+r $tmpdir/bar
 
-testout=$tmp/ftwtest-tmp.out
+testout=$(mktemp $tmp/ftwtest-tmp-XXXXXX.out)
 
 $testprogram $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_NS, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
 EOF
 rm $testout
 
@@ -92,18 +88,18 @@ $testprogram --depth $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_DP, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_DP, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_DP, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_DP, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_DP, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_DP, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/", file = "$ftwtest", flag = FTW_DP, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_DP, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_DP, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_NS, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_DP, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_DP, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_DP, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
 EOF
 rm $testout
 
@@ -111,20 +107,20 @@ $testprogram --phys $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SL, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "link@2", flag = FTW_SL, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "link@3", flag = FTW_SL, level = 5
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_NS, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SL, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "link@2", flag = FTW_SL, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "link@3", flag = FTW_SL, level = 5
 EOF
 rm $testout
 
@@ -138,73 +134,73 @@ $testprogram --chdir $tmpdir |
 tmpreal=`cd $tmp; pwd -P 2>/dev/null`
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, cwd = $tmpreal/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/ftwtest.d/bar, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2/lvl3, level = 5
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, cwd = $tmpreal, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, cwd = $tmpreal/$ftwtest, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/$ftwtest/bar, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2/lvl3, level = 5
 EOF
 rm $testout
 
 curwd=`pwd -P 2>/dev/null`
 cd "$tmp"
-$testprogram --chdir ftwtest.d |
+$testprogram --chdir $ftwtest |
     sort > $testout
 cd "$curwd"
 
 cat <<EOF | diff -u $testout - || exit 1
-base = "", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
-base = "ftwtest.d/", file = "bar", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/", file = "baz", flag = FTW_F, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/", file = "foo", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/ftwtest.d/bar, level = 2
-base = "ftwtest.d/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo, level = 2
-base = "ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2/lvl3, level = 5
+base = "", file = "$ftwtest", flag = FTW_D, cwd = $tmpreal, level = 0
+base = "$ftwtest/", file = "bar", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/", file = "baz", flag = FTW_F, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/", file = "foo", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/$ftwtest/bar, level = 2
+base = "$ftwtest/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo, level = 2
+base = "$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2/lvl3, level = 5
 EOF
 rm $testout
 
 curwd=`pwd -P`
 cd "$tmp"
-$testprogram --chdir ftwtest.d/. |
+$testprogram --chdir $ftwtest/. |
     sort > $testout
 cd "$curwd"
 
 cat <<EOF | diff -u $testout - || exit 1
-base = "ftwtest.d/", file = ".", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 0
-base = "ftwtest.d/./", file = "bar", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/./", file = "baz", flag = FTW_F, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/./", file = "foo", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/./bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/ftwtest.d/bar, level = 2
-base = "ftwtest.d/./foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo, level = 2
-base = "ftwtest.d/./foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/./foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/./foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/./foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "ftwtest.d/./foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "ftwtest.d/./foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2/lvl3, level = 5
+base = "$ftwtest/", file = ".", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 0
+base = "$ftwtest/./", file = "bar", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/./", file = "baz", flag = FTW_F, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/./", file = "foo", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/./bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/$ftwtest/bar, level = 2
+base = "$ftwtest/./foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo, level = 2
+base = "$ftwtest/./foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/./foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/./foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/./foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$ftwtest/./foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$ftwtest/./foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2/lvl3, level = 5
 EOF
 rm $testout
 
 curwd=`pwd -P 2>/dev/null`
 cd "$tmp"
-$testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
+$testprogram --chdir $ftwtest/foo/lvl1/link@1 |
     sort > $testout
 cd "$curwd"
 
 cat <<EOF | diff -u $testout - || exit 1
-base = "ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 0
+base = "$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 0
 EOF
 rm $testout
 
@@ -212,7 +208,7 @@ $testprogram --early-exit $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
 succeeded
 EOF
 rm $testout
@@ -226,16 +222,16 @@ $testprogram --skip-subtree=lvl1 $tmpdir |
     sort > $testout
 
 cat <<EOF | diff -u $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
 EOF
 rm $testout
 
@@ -250,16 +246,16 @@ catcmd=cat
   && catcmd="grep -v lvl1b"
 
 $catcmd <<EOF | diff -u $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
 EOF
 rm $testout
 
@@ -269,28 +265,28 @@ $testprogram --skip-siblings=file@1b $tmpdir |
 # The filesystem is not required to put file2@1b and file3@1b after file@1b.
 # If file[23]@1b come after file@1b, it shouldn't be printed, while if they
 # come before, they should.
-regexp=`echo $(ls -U $tmp/ftwtest.d/foo/lvl1b \
+regexp=`echo $(ls -U $tmp/$ftwtest/foo/lvl1b \
 	       | sed -n '/file@1b$/,${/file[23]@1b$/p;}') | sed 's, ,|,'`
 catcmd=cat
 [ -n "$regexp" ] && catcmd="egrep -v $regexp"
 
 $catcmd <<EOF | diff -u $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
 EOF
 rm $testout
 
-- 
2.25.1


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

* [PATCH 02/52] linux: Add futimes test
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:30   ` Florian Weimer via Libc-alpha
                     ` (2 more replies)
  2021-03-05 20:14 ` [PATCH 03/52] linux: Add lutimes test Adhemerval Zanella via Libc-alpha
                   ` (51 subsequent siblings)
  53 siblings, 3 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

It uses stat to compare against the values set by futimes.

Checked on i686-linux-gnu.
---
 sysdeps/unix/sysv/linux/Makefile      |  4 +-
 sysdeps/unix/sysv/linux/tst-futimes.c | 85 +++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 1 deletion(-)
 create mode 100644 sysdeps/unix/sysv/linux/tst-futimes.c

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 51e28b97ac..94b933310b 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -107,7 +107,9 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
 	 tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
 	 tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux \
-	 tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes
+	 tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes \
+	 tst-futimes
+
 tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
 
 CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
diff --git a/sysdeps/unix/sysv/linux/tst-futimes.c b/sysdeps/unix/sysv/linux/tst-futimes.c
new file mode 100644
index 0000000000..026b0af023
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-futimes.c
@@ -0,0 +1,85 @@
+/* Basix test for utimes.
+   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 <time.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <support/check.h>
+#include <support/xunistd.h>
+#include <support/temp_file.h>
+
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
+static int temp_fd = -1;
+static char *testfile;
+
+/* struct timeval array with Y2038 threshold minus 2 and 1 seconds.  */
+const static struct timeval t1[2] = { { 0x7FFFFFFE, 0 },  { 0x7FFFFFFF, 0 } };
+
+/* struct timeval array with Y2038 threshold plus 1 and 2 seconds.  */
+const static struct timeval t2[2] = { { 0x80000001ULL, 0 },
+				      { 0x80000002ULL, 0 } };
+
+/* struct timeval array around Y2038 threshold.  */
+const static struct timeval t3[2] = { { 0x7FFFFFFE, 0 },
+				      { 0x80000002ULL, 0 } };
+
+#define PREPARE do_prepare
+static void
+do_prepare (int argc, char *argv[])
+{
+  temp_fd = create_temp_file ("utimes", &testfile);
+  TEST_VERIFY_EXIT (temp_fd > 0);
+}
+
+static int
+test_utime_helper (const struct timeval *tv)
+{
+  /* Check if we run on port with 32 bit time_t size */
+  time_t t;
+  if (__builtin_add_overflow (tv->tv_sec, 0, &t))
+    return 0;
+
+  TEST_VERIFY_EXIT (futimes (temp_fd, tv) == 0);
+
+  struct_stat st;
+  xfstat (temp_fd, &st);
+
+  /* Check if seconds for atime match */
+  TEST_COMPARE (st.st_atime, tv[0].tv_sec);
+
+  /* Check if seconds for mtime match */
+  TEST_COMPARE (st.st_mtime, tv[1].tv_sec);
+
+  return 0;
+}
+
+static int
+do_test (void)
+{
+  test_utime_helper (&t1[0]);
+  test_utime_helper (&t2[0]);
+  test_utime_helper (&t3[0]);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.25.1


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

* [PATCH 03/52] linux: Add lutimes test
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 02/52] linux: Add futimes test Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:31   ` Florian Weimer via Libc-alpha
  2021-03-06  0:02   ` Joseph Myers
  2021-03-05 20:14 ` [PATCH 04/52] time: Add getitimer and setitimer basic tests Adhemerval Zanella via Libc-alpha
                   ` (50 subsequent siblings)
  53 siblings, 2 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

It uses stat to compare against the values set by lutimes.

Checked on i686-linux-gnu.
---
 sysdeps/unix/sysv/linux/Makefile      |  2 +-
 sysdeps/unix/sysv/linux/tst-lutimes.c | 95 +++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 1 deletion(-)
 create mode 100644 sysdeps/unix/sysv/linux/tst-lutimes.c

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 94b933310b..b206f77594 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -108,7 +108,7 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
 	 tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux \
 	 tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes \
-	 tst-futimes
+	 tst-futimes tst-lutimes
 
 tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
 
diff --git a/sysdeps/unix/sysv/linux/tst-lutimes.c b/sysdeps/unix/sysv/linux/tst-lutimes.c
new file mode 100644
index 0000000000..9e30691bbe
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-lutimes.c
@@ -0,0 +1,95 @@
+/* Basix test for utimes.
+   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/time.h>
+#include <support/check.h>
+#include <support/temp_file.h>
+#include <support/support.h>
+#include <support/xunistd.h>
+
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
+static int temp_fd = -1;
+static char *testfile;
+static char *testlink;
+
+/* struct timeval array with Y2038 threshold minus 2 and 1 seconds.  */
+const static struct timeval t1[2] = { { 0x7FFFFFFE, 0 },  { 0x7FFFFFFF, 0 } };
+
+/* struct timeval array with Y2038 threshold plus 1 and 2 seconds.  */
+const static struct timeval t2[2] = { { 0x80000001ULL, 0 },
+				      { 0x80000002ULL, 0 } };
+
+/* struct timeval array around Y2038 threshold.  */
+const static struct timeval t3[2] = { { 0x7FFFFFFE, 0 },
+				      { 0x80000002ULL, 0 } };
+
+#define PREPARE do_prepare
+static void
+do_prepare (int argc, char *argv[])
+{
+  temp_fd = create_temp_file ("utimes", &testfile);
+  TEST_VERIFY_EXIT (temp_fd > 0);
+
+  testlink = xasprintf ("%s-symlink", testfile);
+  xsymlink (testfile, testlink);
+  add_temp_file (testlink);
+}
+
+static int
+test_utime_helper (const struct timeval *tv)
+{
+  /* Check if we run on port with 32 bit time_t size */
+  time_t t;
+  if (__builtin_add_overflow (tv->tv_sec, 0, &t))
+    return 0;
+
+  struct_stat stfile_orig;
+  xlstat (testfile, &stfile_orig);
+
+  TEST_VERIFY_EXIT (lutimes (testlink, tv) == 0);
+
+  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_stat stfile;
+  xlstat (testfile, &stfile);
+
+  TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
+  TEST_COMPARE (stfile_orig.st_mtime, stfile.st_mtime);
+
+  return 0;
+}
+
+static int
+do_test (void)
+{
+  test_utime_helper (&t1[0]);
+  test_utime_helper (&t2[0]);
+  test_utime_helper (&t3[0]);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.25.1


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

* [PATCH 04/52] time: Add getitimer and setitimer basic tests
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (2 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 03/52] linux: Add lutimes test Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 05/52] time: Add gmtime/gmtime_r tests Adhemerval Zanella via Libc-alpha
                   ` (49 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 time/Makefile     |   2 +-
 time/tst-itimer.c | 175 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 time/tst-itimer.c

diff --git a/time/Makefile b/time/Makefile
index a52b6b94bc..ccc9eefd61 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -48,7 +48,7 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \
 	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
 	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
-	   tst-adjtime tst-ctime tst-difftime tst-mktime4
+	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer
 
 include ../Rules
 
diff --git a/time/tst-itimer.c b/time/tst-itimer.c
new file mode 100644
index 0000000000..e464d6b092
--- /dev/null
+++ b/time/tst-itimer.c
@@ -0,0 +1,175 @@
+/* Basic tests for getitimer and setitimer.
+   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 <array_length.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <support/check.h>
+#include <support/xsignal.h>
+#include <unistd.h>
+#include <time.h>
+
+static sig_atomic_t cnt;
+
+static void
+alrm_handler (int sig)
+{
+  if (++cnt > 3)
+    cnt = 3;
+}
+
+static void
+intr_sleep (int sec)
+{
+  struct timespec ts = { .tv_sec = sec, .tv_nsec = 0 };
+  while (nanosleep (&ts, &ts) == -1 && errno == EINTR)
+    ;
+}
+
+static int
+do_test (void)
+{
+  struct itimerval it, it_old;
+  const int timers[] = { ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF };
+  for (int i = 0; i < array_length (timers); i++)
+    {
+      TEST_COMPARE (getitimer (timers[i], &it), 0);
+
+      /* No timer set, all value should be 0.  */
+      TEST_COMPARE (it.it_interval.tv_sec, 0);
+      TEST_COMPARE (it.it_interval.tv_usec, 0);
+      TEST_COMPARE (it.it_value.tv_sec, 0);
+      TEST_COMPARE (it.it_value.tv_usec, 0);
+
+      it.it_interval.tv_sec = 10;
+      it.it_interval.tv_usec = 20;
+      TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
+
+      TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old),
+		    0);
+      /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while
+	 other timers returns setitimer value.  */
+      if (timers[i] == ITIMER_REAL)
+	{
+	  TEST_COMPARE (it_old.it_interval.tv_sec, 0);
+	  TEST_COMPARE (it_old.it_interval.tv_usec, 0);
+	}
+      else
+	{
+	  TEST_COMPARE (it_old.it_interval.tv_sec, 10);
+	  TEST_COMPARE (it_old.it_interval.tv_usec, 20);
+	}
+
+      /* Create a periodic timer and check if the return value is the one
+	 previously set.  */
+      it.it_interval.tv_sec = 10;
+      it.it_interval.tv_usec = 20;
+      it.it_value.tv_sec = 30;
+      it.it_value.tv_usec = 40;
+      TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
+
+      TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old),
+		    0);
+      TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec);
+      TEST_COMPARE (it.it_interval.tv_usec, it_old.it_interval.tv_usec);
+
+      if (sizeof (time_t) == 4)
+	continue;
+
+      /* Same as before, but with a 64 bit time_t value.  */
+      it.it_interval.tv_sec = (time_t) 0x1ffffffffull;
+      it.it_interval.tv_usec = 20;
+      it.it_value.tv_sec = 0;
+      it.it_value.tv_usec = 0;
+
+      /* Linux does not provide 64 bit time_t support for getitimer and
+	 setitimer on architectures with 32 bit time_t support.  */
+      if (sizeof (__time_t) == 8)
+	{
+	  TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
+	  TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 },
+				   &it_old),
+			0);
+	  /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while other
+	     timers returns setitimer value.  */
+	  if (timers[i] == ITIMER_REAL)
+	    {
+	      TEST_COMPARE (it_old.it_interval.tv_sec, 0ull);
+	      TEST_COMPARE (it_old.it_interval.tv_usec, 0);
+	    }
+	  else
+	    {
+	      TEST_COMPARE (it_old.it_interval.tv_sec, 0x1ffffffffull);
+	      TEST_COMPARE (it_old.it_interval.tv_usec, 20);
+	    }
+	}
+      else
+	{
+	  TEST_COMPARE (setitimer (timers[i], &it, NULL), -1);
+	  TEST_COMPARE (errno, EOVERFLOW);
+	}
+
+      /* Create a periodic timer and check if the return value is the one
+	 previously set.  */
+      it.it_interval.tv_sec = (time_t) 0x1ffffffffull;
+      it.it_interval.tv_usec = 20;
+      it.it_value.tv_sec = 30;
+      it.it_value.tv_usec = 40;
+      if (sizeof (__time_t) == 8)
+	{
+	  TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
+
+	  TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 },
+				   &it_old),
+			0);
+	  TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec);
+	  TEST_COMPARE (it.it_interval.tv_usec, it_old.it_interval.tv_usec);
+	}
+      else
+	{
+	  TEST_COMPARE (setitimer (timers[i], &it, NULL), -1);
+	  TEST_COMPARE (errno, EOVERFLOW);
+	}
+  }
+
+  {
+    struct sigaction sa = { .sa_handler = alrm_handler, .sa_flags = 0 };
+    sigemptyset (&sa.sa_mask);
+    xsigaction (SIGALRM, &sa, NULL);
+  }
+
+  /* Setup a timer to 0.1s and sleep for 1s and check to 3 signal handler
+     execution.  */
+  it.it_interval.tv_sec = 0;
+  it.it_interval.tv_usec = 100000;
+  it.it_value.tv_sec = 0;
+  it.it_value.tv_usec = 100000;
+
+  /* Check ITIMER_VIRTUAL and ITIMER_PROF would require to generate load
+     and be subject to system load.  */
+  cnt = 0;
+  TEST_COMPARE (setitimer (ITIMER_REAL, &it, NULL), 0);
+  intr_sleep (1);
+  TEST_COMPARE (cnt, 3);
+  TEST_COMPARE (setitimer (ITIMER_REAL, &(struct itimerval) { 0 }, NULL), 0);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.25.1


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

* [PATCH 05/52] time: Add gmtime/gmtime_r tests
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (3 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 04/52] time: Add getitimer and setitimer basic tests Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 06/52] time: Add timegm/timelocal basic tests Adhemerval Zanella via Libc-alpha
                   ` (48 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 time/Makefile     |   3 +-
 time/tst-gmtime.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 127 insertions(+), 1 deletion(-)
 create mode 100644 time/tst-gmtime.c

diff --git a/time/Makefile b/time/Makefile
index ccc9eefd61..d52454bddc 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -48,7 +48,8 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \
 	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
 	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
-	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer
+	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \
+	   tst-gmtime
 
 include ../Rules
 
diff --git a/time/tst-gmtime.c b/time/tst-gmtime.c
new file mode 100644
index 0000000000..4d09cade79
--- /dev/null
+++ b/time/tst-gmtime.c
@@ -0,0 +1,125 @@
+/* Basic tests for gmtime.
+   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 <time.h>
+#include <stdlib.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+  /* Check if the epoch time can be converted.  */
+  {
+    time_t t = 0;
+    struct tm *tmg = gmtime (&t);
+    TEST_COMPARE (tmg->tm_sec,   0);
+    TEST_COMPARE (tmg->tm_min,   0);
+    TEST_COMPARE (tmg->tm_hour,  0);
+    TEST_COMPARE (tmg->tm_mday,  1);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  70);
+    TEST_COMPARE (tmg->tm_wday,  4);
+    TEST_COMPARE (tmg->tm_yday,  0);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+  {
+    /* Same as before but with gmtime_r.  */
+    time_t t = 0;
+    struct tm tms;
+    struct tm *tmg = gmtime_r (&t, &tms);
+    TEST_VERIFY (tmg == &tms);
+    TEST_COMPARE (tmg->tm_year, 70);
+    TEST_COMPARE (tmg->tm_sec,   0);
+    TEST_COMPARE (tmg->tm_min,   0);
+    TEST_COMPARE (tmg->tm_hour,  0);
+    TEST_COMPARE (tmg->tm_mday,  1);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  70);
+    TEST_COMPARE (tmg->tm_wday,  4);
+    TEST_COMPARE (tmg->tm_yday,  0);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+
+  /* Check if the max time value for 32 bit time_t can be converted.  */
+  {
+    time_t t = 0x7fffffff;
+    struct tm *tmg = gmtime (&t);
+    TEST_COMPARE (tmg->tm_sec,   7);
+    TEST_COMPARE (tmg->tm_min,   14);
+    TEST_COMPARE (tmg->tm_hour,  3);
+    TEST_COMPARE (tmg->tm_mday,  19);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  138);
+    TEST_COMPARE (tmg->tm_wday,  2);
+    TEST_COMPARE (tmg->tm_yday,  18);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+  {
+    /* Same as before but with ctime_r.  */
+    time_t t = 0x7fffffff;
+    struct tm tms;
+    struct tm *tmg = gmtime_r (&t, &tms);
+    TEST_VERIFY (tmg == &tms);
+    TEST_COMPARE (tmg->tm_sec,   7);
+    TEST_COMPARE (tmg->tm_min,   14);
+    TEST_COMPARE (tmg->tm_hour,  3);
+    TEST_COMPARE (tmg->tm_mday,  19);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  138);
+    TEST_COMPARE (tmg->tm_wday,  2);
+    TEST_COMPARE (tmg->tm_yday,  18);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+
+  if (sizeof (time_t) < 8)
+    return 0;
+
+  {
+    time_t t = (time_t) 0x80000000ull;
+    struct tm *tmg = gmtime (&t);
+    TEST_COMPARE (tmg->tm_sec,   8);
+    TEST_COMPARE (tmg->tm_min,   14);
+    TEST_COMPARE (tmg->tm_hour,  3);
+    TEST_COMPARE (tmg->tm_mday,  19);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  138);
+    TEST_COMPARE (tmg->tm_wday,  2);
+    TEST_COMPARE (tmg->tm_yday,  18);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+
+  {
+    time_t t = (time_t) 0x80000000ull;
+    struct tm tms;
+    struct tm *tmg = gmtime_r (&t, &tms);
+    TEST_VERIFY (tmg == &tms);
+    TEST_COMPARE (tmg->tm_sec,   8);
+    TEST_COMPARE (tmg->tm_min,   14);
+    TEST_COMPARE (tmg->tm_hour,  3);
+    TEST_COMPARE (tmg->tm_mday,  19);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  138);
+    TEST_COMPARE (tmg->tm_wday,  2);
+    TEST_COMPARE (tmg->tm_yday,  18);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.25.1


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

* [PATCH 06/52] time: Add timegm/timelocal basic tests
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (4 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 05/52] time: Add gmtime/gmtime_r tests Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 07/52] time: Add basic timespec_get tests Adhemerval Zanella via Libc-alpha
                   ` (47 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

Checked i686-linux-gnu and x86_64-linux-gnu.
---
 time/Makefile     |  2 +-
 time/tst-timegm.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 1 deletion(-)
 create mode 100644 time/tst-timegm.c

diff --git a/time/Makefile b/time/Makefile
index d52454bddc..786dc45b51 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
 	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
 	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \
-	   tst-gmtime
+	   tst-gmtime tst-timegm
 
 include ../Rules
 
diff --git a/time/tst-timegm.c b/time/tst-timegm.c
new file mode 100644
index 0000000000..3f4d21951a
--- /dev/null
+++ b/time/tst-timegm.c
@@ -0,0 +1,95 @@
+/* Basic tests for timegm.
+   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 <time.h>
+#include <stdlib.h>
+#include <support/check.h>
+
+static void
+do_test_func (time_t (*func)(struct tm *))
+{
+  {
+    struct tm tmg =
+      {
+	.tm_sec = 0,
+	.tm_min = 0,
+	.tm_hour = 0,
+	.tm_mday = 1,
+	.tm_mon = 0,
+	.tm_year = 70,
+	.tm_wday = 4,
+	.tm_yday = 0,
+	.tm_isdst = 0
+     };
+     time_t t = func (&tmg);
+     TEST_COMPARE (t, 0);
+  }
+
+  {
+    struct tm tmg =
+      {
+	.tm_sec = 7,
+	.tm_min = 14,
+	.tm_hour = 3,
+	.tm_mday = 19,
+	.tm_mon = 0,
+	.tm_year = 138,
+	.tm_wday = 2,
+	.tm_yday = 18,
+	.tm_isdst = 0
+     };
+     time_t t = func (&tmg);
+     TEST_COMPARE (t, 0x7fffffff);
+  }
+
+  if (sizeof (time_t) < 8)
+    return;
+
+  {
+    struct tm tmg =
+      {
+	.tm_sec = 8,
+	.tm_min = 14,
+	.tm_hour = 3,
+	.tm_mday = 19,
+	.tm_mon = 0,
+	.tm_year = 138,
+	.tm_wday = 2,
+	.tm_yday = 18,
+	.tm_isdst = 0
+     };
+     time_t t = func (&tmg);
+     TEST_COMPARE (t, (time_t) 0x80000000ull);
+  }
+}
+
+static int
+do_test (void)
+{
+  do_test_func (timegm);
+
+  /* timelocal is a alias to timegm with the only difference it takes local
+     timezone into account, while timegm takes the input value to be UTC.  */
+  TEST_VERIFY_EXIT (setenv ("TZ", ":", 1) == 0);
+  tzset ();
+  do_test_func (timelocal);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.25.1


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

* [PATCH 07/52] time: Add basic timespec_get tests
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (5 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 06/52] time: Add timegm/timelocal basic tests Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 08/52] time: Add 64 bit tests for getdate / getdate_r Adhemerval Zanella via Libc-alpha
                   ` (46 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

Checkec on x86_64-linux-gnu and i686-linux-gnu.
---
 time/Makefile           |  2 +-
 time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 time/tst-timespec_get.c

diff --git a/time/Makefile b/time/Makefile
index 786dc45b51..f14022b334 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
 	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
 	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \
-	   tst-gmtime tst-timegm
+	   tst-gmtime tst-timegm tst-timespec_get
 
 include ../Rules
 
diff --git a/time/tst-timespec_get.c b/time/tst-timespec_get.c
new file mode 100644
index 0000000000..7389927db4
--- /dev/null
+++ b/time/tst-timespec_get.c
@@ -0,0 +1,40 @@
+/* Basic tests for timespec_get.
+   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 <time.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+  {
+    struct timespec ts;
+    TEST_COMPARE (timespec_get (&ts, 0), 0);
+  }
+
+  {
+    struct timespec ts;
+    TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC);
+    TEST_VERIFY (ts.tv_nsec >= 0);
+    TEST_VERIFY (ts.tv_nsec < 1000000000);
+  }
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.25.1


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

* [PATCH 08/52] time: Add 64 bit tests for getdate / getdate_r
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (6 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 07/52] time: Add basic timespec_get tests Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 09/52] io: Add basic tests for utimensat Adhemerval Zanella via Libc-alpha
                   ` (45 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

The test is also converted to use libsupport.

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 time/tst-getdate.c | 153 +++++++++++++++++++++++++++------------------
 1 file changed, 92 insertions(+), 61 deletions(-)

diff --git a/time/tst-getdate.c b/time/tst-getdate.c
index 37ecc4823e..c37ba3083a 100644
--- a/time/tst-getdate.c
+++ b/time/tst-getdate.c
@@ -17,110 +17,141 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <array_length.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <support/check.h>
+#include <support/temp_file.h>
+#include <support/xunistd.h>
 #include <time.h>
 
 static const struct
 {
   const char *str;
   const char *tz;
-  int err;
   struct tm tm;
+  bool time64;
 } tests [] =
 {
-  {"21:01:10 1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"21:01:10    1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"   21:01:10 1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"21:01:10 1999-1-31   ", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"    21:01:10 1999-1-31   ", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"21:01:10 1999-2-28", "Universal", 0, {10, 1, 21, 28, 1, 99, 0, 0, 0}},
-  {"16:30:46 2000-2-29", "Universal", 0, {46, 30,16, 29, 1, 100, 0, 0, 0}},
-  {"01-08-2000 05:06:07", "Europe/Berlin", 0, {7, 6, 5, 1, 7, 100, 0, 0, 0}}
+  {"21:01:10 1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"21:01:10    1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"   21:01:10 1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"21:01:10 1999-1-31   ", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"    21:01:10 1999-1-31   ", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"21:01:10 1999-2-28", "Universal", {10, 1, 21, 28, 1, 99, 0, 0, 0},
+   false },
+  {"16:30:46 2000-2-29", "Universal", {46, 30,16, 29, 1, 100, 0, 0, 0},
+   false },
+  {"01-08-2000 05:06:07", "Europe/Berlin", {7, 6, 5, 1, 7, 100, 0, 0, 0},
+   false },
+
+  /* 64 bit time_t tests.  */
+  {"21:01:10 2038-1-31", "Universal", {10, 1, 21, 31, 0, 138, 0, 0, 0},
+   true },
+  {"22:01:10 2048-5-20", "Universal", {10, 1, 22, 20, 4, 148, 0, 0, 0},
+   true },
+  {"01-08-2038 05:06:07", "Europe/Berlin", {7, 6, 5, 1, 7, 138, 0, 0, 0},
+   true },
+  {"20-03-2050 21:30:08", "Europe/Berlin", {8, 30, 21, 20, 2, 150, 0, 0, 0},
+   true }
 };
 
-static void
-report_date_error (int err)
+static const char *
+report_date_error (void)
 {
-  switch(err)
+  switch (getdate_err)
     {
     case 1:
-      printf ("The environment variable DATEMSK is not defined or null.\n");
-      break;
+      return "The environment variable DATEMSK is not defined or null.";
     case 2:
-      printf ("The template file denoted by the DATEMSK environment variable cannot be opened.\n");
-      break;
+      return "The template file denoted by the DATEMSK environment variable "
+	     "cannot be opened.";
     case 3:
-      printf ("Information about the template file cannot retrieved.\n");
-      break;
+      return "Information about the template file cannot retrieved.";
     case 4:
-      printf ("The template file is not a regular file.\n");
-      break;
+      return "The template file is not a regular file.\n";
     case 5:
-      printf ("An I/O error occurred while reading the template file.\n");
-      break;
+      return "An I/O error occurred while reading the template file.";
     case 6:
-      printf ("Not enough memory available to execute the function.\n");
-      break;
+      return "Not enough memory available to execute the function.";
     case 7:
-      printf ("The template file contains no matching template.\n");
-      break;
+      return "The template file contains no matching template.";
     case 8:
-      printf ("The input date is invalid, but would match a template otherwise.\n");
-      break;
+      return "The input date is invalid, but would match a template "
+	      "otherwise.";
     default:
-      printf("Unknown error code.\n");
-      break;
+      return "Unknown error code.";
     }
 }
 
+static char *datemsk;
+static const char datemskstr[] =
+  "%H:%M:%S %F\n"
+  "%d-%m-%Y %T\n";
+
+static void
+do_prepare (int argc, char **argv)
+{
+  int fd = create_temp_file ("tst-chk1.", &datemsk);
+  xwrite (fd, datemskstr, sizeof (datemskstr) - 1);
+
+  setenv ("DATEMSK", datemsk, 1);
+}
+#define PREPARE do_prepare
 
 static int
 do_test (void)
 {
-  int errors = 0;
-  size_t i;
   struct tm *tm;
 
-
-  for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
+  for (int i = 0; i < array_length (tests); ++i)
     {
       setenv ("TZ", tests[i].tz, 1);
 
-      tm = getdate (tests[i].str);
+      int expected_err;
+      if (sizeof (time_t) == 4 && tests[i].time64)
+	expected_err = 8;
+      else
+	expected_err = 0;
 
-      if (getdate_err != tests[i].err)
+      tm = getdate (tests[i].str);
+      TEST_COMPARE (getdate_err, expected_err);
+      if (getdate_err != expected_err)
 	{
-	  printf ("Failure for getdate (\"%s\"):\n", tests[i].str);
-	  printf ("getdate_err should be %d but returned: %d which means:\n",
-		  tests[i].err, getdate_err);
-	  report_date_error (getdate_err);
-	  ++errors;
+	  support_record_failure ();
+	  printf ("%s\n", report_date_error ());
 	}
-      else if (tests[i].tm.tm_mon != tm->tm_mon
-	       || tests[i].tm.tm_year != tm->tm_year
-	       || tests[i].tm.tm_mday != tm->tm_mday
-	       || tests[i].tm.tm_hour != tm->tm_hour
-	       || tests[i].tm.tm_min != tm->tm_min
-	       || tests[i].tm.tm_sec != tm->tm_sec)
+      else if (getdate_err == 0)
+	{
+	  TEST_COMPARE (tests[i].tm.tm_mon, tm->tm_mon);
+	  TEST_COMPARE (tests[i].tm.tm_year, tm->tm_year);
+	  TEST_COMPARE (tests[i].tm.tm_mday, tm->tm_mday);
+	  TEST_COMPARE (tests[i].tm.tm_hour, tm->tm_hour);
+	  TEST_COMPARE (tests[i].tm.tm_min, tm->tm_min);
+	  TEST_COMPARE (tests[i].tm.tm_sec, tm->tm_sec);
+	}
+
+      struct tm tms;
+      TEST_COMPARE (getdate_r (tests[i].str, &tms), expected_err);
+      if (getdate_err == 0)
 	{
-	  printf ("Failure for getdate (\"%s\"):\n", tests[i].str);
-	  printf ("struct tm is:  %d-%d-%d %d:%d:%d\n",
-		  tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
-		  tm->tm_hour, tm->tm_min, tm->tm_sec);
-	  printf ("but should be: %d-%d-%d %d:%d:%d\n",
-		  tests[i].tm.tm_year + 1900, tests[i].tm.tm_mon + 1,
-		  tests[i].tm.tm_mday,
-		  tests[i].tm.tm_hour, tests[i].tm.tm_min, tests[i].tm.tm_sec);
-	  ++errors;
+	  TEST_COMPARE (tests[i].tm.tm_mon, tms.tm_mon);
+	  TEST_COMPARE (tests[i].tm.tm_year, tms.tm_year);
+	  TEST_COMPARE (tests[i].tm.tm_mday, tms.tm_mday);
+	  TEST_COMPARE (tests[i].tm.tm_hour, tms.tm_hour);
+	  TEST_COMPARE (tests[i].tm.tm_min, tms.tm_min);
+	  TEST_COMPARE (tests[i].tm.tm_sec, tms.tm_sec);
 	}
     }
 
-  if (!errors)
-    printf ("No errors found.\n");
-  return errors != 0;
+  return 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
-- 
2.25.1


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

* [PATCH 09/52] io: Add basic tests for utimensat
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (7 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 08/52] time: Add 64 bit tests for getdate / getdate_r Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 10/52] posix: Add wait3 tests Adhemerval Zanella via Libc-alpha
                   ` (44 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

Checked on x86_64-linux-gnu and i686-linux-gnu
---
 io/Makefile        |   2 +-
 io/tst-utimensat.c | 115 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 116 insertions(+), 1 deletion(-)
 create mode 100644 io/tst-utimensat.c

diff --git a/io/Makefile b/io/Makefile
index b7bebe923f..59d36e8782 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -68,7 +68,7 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-fts tst-fts-lfs tst-open-tmpfile \
 		   tst-copy_file_range tst-getcwd-abspath tst-lockf \
 		   tst-ftw-lnk tst-file_change_detection tst-lchmod \
-		   tst-ftw-bz26353
+		   tst-ftw-bz26353 tst-utimensat
 
 # Likewise for statx, but we do not need static linking here.
 tests-internal += tst-statx
diff --git a/io/tst-utimensat.c b/io/tst-utimensat.c
new file mode 100644
index 0000000000..b62e409e07
--- /dev/null
+++ b/io/tst-utimensat.c
@@ -0,0 +1,115 @@
+/* utimensat 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 <time.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <support/check.h>
+#include <support/support.h>
+#include <support/temp_file.h>
+#include <support/xunistd.h>
+
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
+static int temp_fd = -1;
+static char *testfile;
+static char *testlink;
+
+/* struct timeval array with Y2038 threshold minus 2 and 1 seconds.  */
+const static struct timespec t1[2] = { { 0x7FFFFFFE, 0 },
+				       { 0x7FFFFFFF, 0 } };
+
+/* struct timeval array with Y2038 threshold plus 1 and 2 seconds.  */
+const static struct timespec t2[2] = { { 0x80000001ULL, 0 },
+				       { 0x80000002ULL, 0 } };
+
+/* struct timeval array around Y2038 threshold.  */
+const static struct timespec t3[2] = { { 0x7FFFFFFE, 0 },
+				       { 0x80000002ULL, 0 } };
+
+static void
+do_prepare (int argc, char *argv[])
+{
+  temp_fd = create_temp_file ("tst-utimensat", &testfile);
+  TEST_VERIFY_EXIT (temp_fd > 0);
+
+  testlink = xasprintf ("%s-symlink", testfile);
+  xsymlink (testfile, testlink);
+  add_temp_file (testlink);
+}
+#define PREPARE do_prepare
+
+static void
+test_utimensat_helper (const struct timespec ts[2])
+{
+  /* Check if we run on port with 32 bit time_t size */
+  {
+    time_t t;
+    if (__builtin_add_overflow (ts->tv_sec, 0, &t))
+      return;
+  }
+
+  {
+    TEST_VERIFY_EXIT (utimensat (temp_fd, testfile, ts, 0) == 0);
+
+    struct_stat st;
+    xfstat (temp_fd, &st);
+
+    /* Check if seconds for atime match */
+    TEST_COMPARE (st.st_atime, ts[0].tv_sec);
+
+    /* Check if seconds for mtime match */
+    TEST_COMPARE (st.st_mtime, ts[1].tv_sec);
+  }
+
+  {
+    struct_stat stfile_orig;
+    xlstat (testfile, &stfile_orig);
+
+    TEST_VERIFY_EXIT (utimensat (0 /* ignored  */, testlink, ts,
+				 AT_SYMLINK_NOFOLLOW)
+		       == 0);
+    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_stat stfile;
+    xlstat (testfile, &stfile);
+
+    TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
+    TEST_COMPARE (stfile_orig.st_mtime, stfile.st_mtime);
+  }
+}
+
+static int
+do_test (void)
+{
+  test_utimensat_helper (t1);
+  test_utimensat_helper (t2);
+  test_utimensat_helper (t3);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.25.1


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

* [PATCH 10/52] posix: Add wait3 tests
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (8 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 09/52] io: Add basic tests for utimensat Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 11/52] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella via Libc-alpha
                   ` (43 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

The tst-wait4 is moved to common file and used for wait3
tests.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 posix/Makefile            |   2 +-
 posix/tst-wait-skeleton.c | 209 ++++++++++++++++++++++++++++++++++++++
 posix/tst-wait3.c         |  22 ++++
 posix/tst-wait4.c         | 193 +----------------------------------
 4 files changed, 235 insertions(+), 191 deletions(-)
 create mode 100644 posix/tst-wait-skeleton.c
 create mode 100644 posix/tst-wait3.c

diff --git a/posix/Makefile b/posix/Makefile
index 239fbb340a..8e31c721e1 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -84,7 +84,7 @@ tests		:= test-errno tstgetopt testfnm runtests runptests \
 		   tst-nice tst-nanosleep tst-regex2 \
 		   transbug tst-rxspencer tst-pcre tst-boost \
 		   bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 \
-		   tst-waitid tst-wait4 \
+		   tst-waitid tst-wait4 tst-wait3 \
 		   tst-getaddrinfo2 bug-glob2 bug-glob3 tst-sysconf \
 		   tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
 		   tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
diff --git a/posix/tst-wait-skeleton.c b/posix/tst-wait-skeleton.c
new file mode 100644
index 0000000000..57022cb61c
--- /dev/null
+++ b/posix/tst-wait-skeleton.c
@@ -0,0 +1,209 @@
+/* Test framework for wait3 and wait4.
+   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/>.  */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+#include <signal.h>
+#include <time.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+
+#include <support/xsignal.h>
+#include <support/xunistd.h>
+#include <support/check.h>
+#include <support/process_state.h>
+
+static void
+test_child (void)
+{
+  /* First thing, we stop ourselves.  */
+  raise (SIGSTOP);
+
+  /* Hey, we got continued!  */
+  while (1)
+    pause ();
+}
+
+#ifndef WEXITED
+# define WEXITED        0
+# define WCONTINUED     0
+# define WSTOPPED       WUNTRACED
+#endif
+
+/* Set with only SIGCHLD on do_test_waitid.  */
+static sigset_t chldset;
+
+#ifdef SA_SIGINFO
+static void
+sigchld (int signo, siginfo_t *info, void *ctx)
+{
+}
+#endif
+
+static void
+check_sigchld (int code, int status, pid_t pid)
+{
+#ifdef SA_SIGINFO
+  siginfo_t siginfo;
+  TEST_COMPARE (sigwaitinfo (&chldset, &siginfo), SIGCHLD);
+
+  TEST_COMPARE (siginfo.si_signo, SIGCHLD);
+  TEST_COMPARE (siginfo.si_code, code);
+  TEST_COMPARE (siginfo.si_status, status);
+  TEST_COMPARE (siginfo.si_pid, pid);
+#endif
+}
+
+static int
+do_test_wait (pid_t pid)
+{
+  /* Adding process_state_tracing_stop ('t') allows the test to work under
+     trace programs such as ptrace.  */
+  enum support_process_state stop_state = support_process_state_stopped
+                                          | support_process_state_tracing_stop;
+
+  support_process_state_wait (pid, stop_state);
+
+  check_sigchld (CLD_STOPPED, SIGSTOP, pid);
+
+  pid_t ret;
+  int wstatus;
+  struct rusage rusage;
+
+  ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, NULL);
+  if (ret == -1 && errno == ENOTSUP)
+    FAIL_RET ("waitid WNOHANG on stopped: %m");
+  TEST_COMPARE (ret, pid);
+  TEST_VERIFY (WIFSTOPPED (wstatus));
+
+  /* Issue again but with struct rusage input.  */
+  ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
+  /* With WNOHANG and WUNTRACED, if the children has not changes its state
+     since previous call the expected result it 0.  */
+  TEST_COMPARE (ret, 0);
+
+  /* Some sanity tests to check if 'wtatus' and 'rusage' possible
+     input values.  */
+  ret = WAIT_CALL (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
+  TEST_COMPARE (ret, 0);
+  ret = WAIT_CALL (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, NULL);
+  TEST_COMPARE (ret, 0);
+
+  if (kill (pid, SIGCONT) != 0)
+    FAIL_RET ("kill (%d, SIGCONT): %m\n", pid);
+
+  /* Wait for the child to have continued.  */
+  support_process_state_wait (pid, support_process_state_sleeping);
+
+#if WCONTINUED != 0
+  check_sigchld (CLD_CONTINUED, SIGCONT, pid);
+
+  ret = WAIT_CALL (pid, &wstatus, WCONTINUED|WNOHANG, NULL);
+  TEST_COMPARE (ret, pid);
+  TEST_VERIFY (WIFCONTINUED (wstatus));
+
+  /* Issue again but with struct rusage input.  */
+  ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
+  /* With WNOHANG and WUNTRACED, if the children has not changes its state
+     since previous call the expected result it 0.  */
+  TEST_COMPARE (ret, 0);
+
+  /* Now stop him again and test waitpid with WCONTINUED.  */
+  if (kill (pid, SIGSTOP) != 0)
+    FAIL_RET ("kill (%d, SIGSTOP): %m\n", pid);
+
+  /* Wait the child stop.  The waitid call below will block until it has
+     stopped, but if we are real quick and enter the waitid system call
+     before the SIGCHLD has been generated, then it will be discarded and
+     never delivered.  */
+  support_process_state_wait (pid, stop_state);
+
+  ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WNOHANG, &rusage);
+  TEST_COMPARE (ret, pid);
+
+  check_sigchld (CLD_STOPPED, SIGSTOP, pid);
+
+  if (kill (pid, SIGCONT) != 0)
+    FAIL_RET ("kill (%d, SIGCONT): %m\n", pid);
+
+  /* Wait for the child to have continued.  */
+  support_process_state_wait (pid, support_process_state_sleeping);
+
+  check_sigchld (CLD_CONTINUED, SIGCONT, pid);
+
+  ret = WAIT_CALL (pid, &wstatus, WCONTINUED|WNOHANG, NULL);
+  TEST_COMPARE (ret, pid);
+  TEST_VERIFY (WIFCONTINUED (wstatus));
+#endif
+
+  /* Die, child, die!  */
+  if (kill (pid, SIGKILL) != 0)
+    FAIL_RET ("kill (%d, SIGKILL): %m\n", pid);
+
+  support_process_state_wait (pid, support_process_state_zombie);
+
+  ret = WAIT_CALL (pid, &wstatus, 0, &rusage);
+  TEST_COMPARE (ret, pid);
+  TEST_VERIFY (WIFSIGNALED (wstatus));
+  TEST_VERIFY (WTERMSIG (wstatus) == SIGKILL);
+
+  check_sigchld (CLD_KILLED, SIGKILL, pid);
+
+  return 0;
+}
+
+static int
+do_test (void)
+{
+#ifdef SA_SIGINFO
+  {
+    struct sigaction sa;
+    sa.sa_flags = SA_SIGINFO | SA_RESTART;
+    sa.sa_sigaction = sigchld;
+    sigemptyset (&sa.sa_mask);
+    xsigaction (SIGCHLD, &sa, NULL);
+  }
+#endif
+
+  sigemptyset (&chldset);
+  sigaddset (&chldset, SIGCHLD);
+
+  /* The SIGCHLD shall has blocked at the time of the call to sigwait;
+     otherwise, the behavior is undefined.  */
+  sigprocmask (SIG_BLOCK, &chldset, NULL);
+
+  pid_t pid = xfork ();
+  if (pid == 0)
+    {
+      test_child ();
+      _exit (127);
+    }
+
+  do_test_wait (pid);
+
+  xsignal (SIGCHLD, SIG_IGN);
+  kill (pid, SIGKILL);          /* Make sure it's dead if we bailed early.  */
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/posix/tst-wait3.c b/posix/tst-wait3.c
new file mode 100644
index 0000000000..27411c04e4
--- /dev/null
+++ b/posix/tst-wait3.c
@@ -0,0 +1,22 @@
+/* Tests for wait3.
+   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/>.  */
+
+#define WAIT_CALL(__pid, __wstatus, __options, __rusage) \
+   wait3 (__wstatus, __options, __rusage)
+
+#include "tst-wait-skeleton.c"
diff --git a/posix/tst-wait4.c b/posix/tst-wait4.c
index e4ce79d2cd..b7532d3891 100644
--- a/posix/tst-wait4.c
+++ b/posix/tst-wait4.c
@@ -16,194 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/resource.h>
-#include <signal.h>
-#include <time.h>
-#include <stdatomic.h>
-#include <stdbool.h>
+#define WAIT_CALL(__pid, __wstatus, __options, __rusage) \
+   wait4 (__pid, __wstatus, __options, __rusage)
 
-#include <support/xsignal.h>
-#include <support/xunistd.h>
-#include <support/check.h>
-#include <support/process_state.h>
-
-static void
-test_child (void)
-{
-  /* First thing, we stop ourselves.  */
-  raise (SIGSTOP);
-
-  /* Hey, we got continued!  */
-  while (1)
-    pause ();
-}
-
-#ifndef WEXITED
-# define WEXITED        0
-# define WCONTINUED     0
-# define WSTOPPED       WUNTRACED
-#endif
-
-/* Set with only SIGCHLD on do_test_waitid.  */
-static sigset_t chldset;
-
-#ifdef SA_SIGINFO
-static void
-sigchld (int signo, siginfo_t *info, void *ctx)
-{
-}
-#endif
-
-static void
-check_sigchld (int code, int status, pid_t pid)
-{
-#ifdef SA_SIGINFO
-  siginfo_t siginfo;
-  TEST_COMPARE (sigwaitinfo (&chldset, &siginfo), SIGCHLD);
-
-  TEST_COMPARE (siginfo.si_signo, SIGCHLD);
-  TEST_COMPARE (siginfo.si_code, code);
-  TEST_COMPARE (siginfo.si_status, status);
-  TEST_COMPARE (siginfo.si_pid, pid);
-#endif
-}
-
-static int
-do_test_wait4 (pid_t pid)
-{
-  /* Adding process_state_tracing_stop ('t') allows the test to work under
-     trace programs such as ptrace.  */
-  enum support_process_state stop_state = support_process_state_stopped
-                                          | support_process_state_tracing_stop;
-
-  support_process_state_wait (pid, stop_state);
-
-  check_sigchld (CLD_STOPPED, SIGSTOP, pid);
-
-  pid_t ret;
-  int wstatus;
-  struct rusage rusage;
-
-  ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, NULL);
-  if (ret == -1 && errno == ENOTSUP)
-    FAIL_RET ("waitid WNOHANG on stopped: %m");
-  TEST_COMPARE (ret, pid);
-  TEST_VERIFY (WIFSTOPPED (wstatus));
-
-  /* Issue again but with struct rusage input.  */
-  ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
-  /* With WNOHANG and WUNTRACED, if the children has not changes its state
-     since previous call the expected result it 0.  */
-  TEST_COMPARE (ret, 0);
-
-  /* Some sanity tests to check if 'wtatus' and 'rusage' possible
-     input values.  */
-  ret = wait4 (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
-  TEST_COMPARE (ret, 0);
-  ret = wait4 (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, NULL);
-  TEST_COMPARE (ret, 0);
-
-  if (kill (pid, SIGCONT) != 0)
-    FAIL_RET ("kill (%d, SIGCONT): %m\n", pid);
-
-  /* Wait for the child to have continued.  */
-  support_process_state_wait (pid, support_process_state_sleeping);
-
-#if WCONTINUED != 0
-  check_sigchld (CLD_CONTINUED, SIGCONT, pid);
-
-  ret = wait4 (pid, &wstatus, WCONTINUED|WNOHANG, NULL);
-  TEST_COMPARE (ret, pid);
-  TEST_VERIFY (WIFCONTINUED (wstatus));
-
-  /* Issue again but with struct rusage input.  */
-  ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
-  /* With WNOHANG and WUNTRACED, if the children has not changes its state
-     since previous call the expected result it 0.  */
-  TEST_COMPARE (ret, 0);
-
-  /* Now stop him again and test waitpid with WCONTINUED.  */
-  if (kill (pid, SIGSTOP) != 0)
-    FAIL_RET ("kill (%d, SIGSTOP): %m\n", pid);
-
-  /* Wait the child stop.  The waitid call below will block until it has
-     stopped, but if we are real quick and enter the waitid system call
-     before the SIGCHLD has been generated, then it will be discarded and
-     never delivered.  */
-  support_process_state_wait (pid, stop_state);
-
-  ret = wait4 (pid, &wstatus, WUNTRACED|WNOHANG, &rusage);
-  TEST_COMPARE (ret, pid);
-
-  check_sigchld (CLD_STOPPED, SIGSTOP, pid);
-
-  if (kill (pid, SIGCONT) != 0)
-    FAIL_RET ("kill (%d, SIGCONT): %m\n", pid);
-
-  /* Wait for the child to have continued.  */
-  support_process_state_wait (pid, support_process_state_sleeping);
-
-  check_sigchld (CLD_CONTINUED, SIGCONT, pid);
-
-  ret = wait4 (pid, &wstatus, WCONTINUED|WNOHANG, NULL);
-  TEST_COMPARE (ret, pid);
-  TEST_VERIFY (WIFCONTINUED (wstatus));
-#endif
-
-  /* Die, child, die!  */
-  if (kill (pid, SIGKILL) != 0)
-    FAIL_RET ("kill (%d, SIGKILL): %m\n", pid);
-
-  support_process_state_wait (pid, support_process_state_zombie);
-
-  ret = wait4 (pid, &wstatus, 0, &rusage);
-  TEST_COMPARE (ret, pid);
-  TEST_VERIFY (WIFSIGNALED (wstatus));
-  TEST_VERIFY (WTERMSIG (wstatus) == SIGKILL);
-
-  check_sigchld (CLD_KILLED, SIGKILL, pid);
-
-  return 0;
-}
-
-static int
-do_test (void)
-{
-#ifdef SA_SIGINFO
-  {
-    struct sigaction sa;
-    sa.sa_flags = SA_SIGINFO | SA_RESTART;
-    sa.sa_sigaction = sigchld;
-    sigemptyset (&sa.sa_mask);
-    xsigaction (SIGCHLD, &sa, NULL);
-  }
-#endif
-
-  sigemptyset (&chldset);
-  sigaddset (&chldset, SIGCHLD);
-
-  /* The SIGCHLD shall has blocked at the time of the call to sigwait;
-     otherwise, the behavior is undefined.  */
-  sigprocmask (SIG_BLOCK, &chldset, NULL);
-
-  pid_t pid = xfork ();
-  if (pid == 0)
-    {
-      test_child ();
-      _exit (127);
-    }
-
-  do_test_wait4 (pid);
-
-  xsignal (SIGCHLD, SIG_IGN);
-  kill (pid, SIGKILL);          /* Make sure it's dead if we bailed early.  */
-
-  return 0;
-}
-
-#include <support/test-driver.c>
+#include "tst-wait-skeleton.c"
-- 
2.25.1


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

* [PATCH 11/52] linux: mips: Split libpthread.abilist in n32 and n64
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (9 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 10/52] posix: Add wait3 tests Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:39   ` Florian Weimer via Libc-alpha
  2021-03-05 20:14 ` [PATCH 12/52] linux: mips: Split librt.abilist " Adhemerval Zanella via Libc-alpha
                   ` (42 subsequent siblings)
  53 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

The n32 will require the 64 bit time symbols for y2038 support.
---
 .../mips/mips64/{ => n32}/libpthread.abilist  |   0
 .../linux/mips/mips64/n64/libpthread.abilist  | 238 ++++++++++++++++++
 2 files changed, 238 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..b35d7f19ca
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
@@ -0,0 +1,238 @@
+GLIBC_2.0 _IO_flockfile F
+GLIBC_2.0 _IO_ftrylockfile F
+GLIBC_2.0 _IO_funlockfile F
+GLIBC_2.0 __close F
+GLIBC_2.0 __connect F
+GLIBC_2.0 __errno_location F
+GLIBC_2.0 __fcntl F
+GLIBC_2.0 __fork F
+GLIBC_2.0 __h_errno_location F
+GLIBC_2.0 __lseek F
+GLIBC_2.0 __open F
+GLIBC_2.0 __pthread_getspecific F
+GLIBC_2.0 __pthread_key_create F
+GLIBC_2.0 __pthread_mutex_destroy F
+GLIBC_2.0 __pthread_mutex_init F
+GLIBC_2.0 __pthread_mutex_lock F
+GLIBC_2.0 __pthread_mutex_trylock F
+GLIBC_2.0 __pthread_mutex_unlock F
+GLIBC_2.0 __pthread_mutexattr_destroy F
+GLIBC_2.0 __pthread_mutexattr_init F
+GLIBC_2.0 __pthread_mutexattr_settype F
+GLIBC_2.0 __pthread_once F
+GLIBC_2.0 __pthread_setspecific F
+GLIBC_2.0 __read F
+GLIBC_2.0 __send F
+GLIBC_2.0 __sigaction F
+GLIBC_2.0 __write F
+GLIBC_2.0 _pthread_cleanup_pop F
+GLIBC_2.0 _pthread_cleanup_pop_restore F
+GLIBC_2.0 _pthread_cleanup_push F
+GLIBC_2.0 _pthread_cleanup_push_defer F
+GLIBC_2.0 accept F
+GLIBC_2.0 close F
+GLIBC_2.0 connect F
+GLIBC_2.0 fcntl F
+GLIBC_2.0 flockfile F
+GLIBC_2.0 fork F
+GLIBC_2.0 fsync F
+GLIBC_2.0 ftrylockfile F
+GLIBC_2.0 funlockfile F
+GLIBC_2.0 longjmp F
+GLIBC_2.0 lseek F
+GLIBC_2.0 msync F
+GLIBC_2.0 open F
+GLIBC_2.0 pause F
+GLIBC_2.0 pthread_atfork F
+GLIBC_2.0 pthread_cancel F
+GLIBC_2.0 pthread_cond_broadcast F
+GLIBC_2.0 pthread_cond_signal F
+GLIBC_2.0 pthread_cond_timedwait F
+GLIBC_2.0 pthread_cond_wait F
+GLIBC_2.0 pthread_create F
+GLIBC_2.0 pthread_detach F
+GLIBC_2.0 pthread_exit F
+GLIBC_2.0 pthread_getspecific F
+GLIBC_2.0 pthread_join F
+GLIBC_2.0 pthread_key_create F
+GLIBC_2.0 pthread_key_delete F
+GLIBC_2.0 pthread_kill F
+GLIBC_2.0 pthread_kill_other_threads_np F
+GLIBC_2.0 pthread_mutex_destroy F
+GLIBC_2.0 pthread_mutex_init F
+GLIBC_2.0 pthread_mutex_lock F
+GLIBC_2.0 pthread_mutex_trylock F
+GLIBC_2.0 pthread_mutex_unlock F
+GLIBC_2.0 pthread_mutexattr_destroy F
+GLIBC_2.0 pthread_mutexattr_getkind_np F
+GLIBC_2.0 pthread_mutexattr_init F
+GLIBC_2.0 pthread_mutexattr_setkind_np F
+GLIBC_2.0 pthread_once F
+GLIBC_2.0 pthread_setcancelstate F
+GLIBC_2.0 pthread_setcanceltype F
+GLIBC_2.0 pthread_setspecific F
+GLIBC_2.0 pthread_testcancel F
+GLIBC_2.0 raise F
+GLIBC_2.0 read F
+GLIBC_2.0 recv F
+GLIBC_2.0 recvfrom F
+GLIBC_2.0 recvmsg F
+GLIBC_2.0 sem_destroy F
+GLIBC_2.0 sem_getvalue F
+GLIBC_2.0 sem_init F
+GLIBC_2.0 sem_post F
+GLIBC_2.0 sem_trywait F
+GLIBC_2.0 sem_wait F
+GLIBC_2.0 send F
+GLIBC_2.0 sendmsg F
+GLIBC_2.0 sendto F
+GLIBC_2.0 sigaction F
+GLIBC_2.0 siglongjmp F
+GLIBC_2.0 sigwait F
+GLIBC_2.0 system F
+GLIBC_2.0 tcdrain F
+GLIBC_2.0 write F
+GLIBC_2.11 pthread_sigqueue F
+GLIBC_2.12 pthread_getname_np F
+GLIBC_2.12 pthread_mutex_consistent F
+GLIBC_2.12 pthread_mutexattr_getrobust F
+GLIBC_2.12 pthread_mutexattr_setrobust F
+GLIBC_2.12 pthread_setname_np F
+GLIBC_2.18 pthread_getattr_default_np F
+GLIBC_2.18 pthread_setattr_default_np F
+GLIBC_2.2 __libc_allocate_rtsig F
+GLIBC_2.2 __libc_current_sigrtmax F
+GLIBC_2.2 __libc_current_sigrtmin F
+GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
+GLIBC_2.2 __pthread_rwlock_destroy F
+GLIBC_2.2 __pthread_rwlock_init F
+GLIBC_2.2 __pthread_rwlock_rdlock F
+GLIBC_2.2 __pthread_rwlock_tryrdlock F
+GLIBC_2.2 __pthread_rwlock_trywrlock F
+GLIBC_2.2 __pthread_rwlock_unlock F
+GLIBC_2.2 __pthread_rwlock_wrlock F
+GLIBC_2.2 __pwrite64 F
+GLIBC_2.2 __res_state F
+GLIBC_2.2 lseek64 F
+GLIBC_2.2 open64 F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
+GLIBC_2.2 pthread_attr_getguardsize F
+GLIBC_2.2 pthread_attr_getstack F
+GLIBC_2.2 pthread_attr_getstackaddr F
+GLIBC_2.2 pthread_attr_getstacksize F
+GLIBC_2.2 pthread_attr_setguardsize F
+GLIBC_2.2 pthread_attr_setstack F
+GLIBC_2.2 pthread_attr_setstackaddr F
+GLIBC_2.2 pthread_attr_setstacksize F
+GLIBC_2.2 pthread_barrier_destroy F
+GLIBC_2.2 pthread_barrier_init F
+GLIBC_2.2 pthread_barrier_wait F
+GLIBC_2.2 pthread_barrierattr_destroy F
+GLIBC_2.2 pthread_barrierattr_init F
+GLIBC_2.2 pthread_barrierattr_setpshared F
+GLIBC_2.2 pthread_condattr_getpshared F
+GLIBC_2.2 pthread_condattr_setpshared F
+GLIBC_2.2 pthread_create F
+GLIBC_2.2 pthread_getconcurrency F
+GLIBC_2.2 pthread_getcpuclockid F
+GLIBC_2.2 pthread_mutex_timedlock F
+GLIBC_2.2 pthread_mutexattr_getpshared F
+GLIBC_2.2 pthread_mutexattr_gettype F
+GLIBC_2.2 pthread_mutexattr_setpshared F
+GLIBC_2.2 pthread_mutexattr_settype F
+GLIBC_2.2 pthread_rwlock_destroy F
+GLIBC_2.2 pthread_rwlock_init F
+GLIBC_2.2 pthread_rwlock_rdlock F
+GLIBC_2.2 pthread_rwlock_timedrdlock F
+GLIBC_2.2 pthread_rwlock_timedwrlock F
+GLIBC_2.2 pthread_rwlock_tryrdlock F
+GLIBC_2.2 pthread_rwlock_trywrlock F
+GLIBC_2.2 pthread_rwlock_unlock F
+GLIBC_2.2 pthread_rwlock_wrlock F
+GLIBC_2.2 pthread_rwlockattr_destroy F
+GLIBC_2.2 pthread_rwlockattr_getkind_np F
+GLIBC_2.2 pthread_rwlockattr_getpshared F
+GLIBC_2.2 pthread_rwlockattr_init F
+GLIBC_2.2 pthread_rwlockattr_setkind_np F
+GLIBC_2.2 pthread_rwlockattr_setpshared F
+GLIBC_2.2 pthread_setconcurrency F
+GLIBC_2.2 pthread_spin_destroy F
+GLIBC_2.2 pthread_spin_init F
+GLIBC_2.2 pthread_spin_lock F
+GLIBC_2.2 pthread_spin_trylock F
+GLIBC_2.2 pthread_spin_unlock F
+GLIBC_2.2 pthread_yield F
+GLIBC_2.2 pwrite F
+GLIBC_2.2 pwrite64 F
+GLIBC_2.2 sem_close F
+GLIBC_2.2 sem_destroy F
+GLIBC_2.2 sem_getvalue F
+GLIBC_2.2 sem_init F
+GLIBC_2.2 sem_open F
+GLIBC_2.2 sem_post F
+GLIBC_2.2 sem_timedwait F
+GLIBC_2.2 sem_trywait F
+GLIBC_2.2 sem_unlink F
+GLIBC_2.2 sem_wait F
+GLIBC_2.2.3 __libpthread_version_placeholder F
+GLIBC_2.2.6 __libpthread_version_placeholder F
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
+GLIBC_2.3.2 pthread_cond_broadcast F
+GLIBC_2.3.2 pthread_cond_signal F
+GLIBC_2.3.2 pthread_cond_timedwait F
+GLIBC_2.3.2 pthread_cond_wait F
+GLIBC_2.3.3 __pthread_cleanup_routine F
+GLIBC_2.3.3 __pthread_register_cancel F
+GLIBC_2.3.3 __pthread_register_cancel_defer F
+GLIBC_2.3.3 __pthread_unregister_cancel F
+GLIBC_2.3.3 __pthread_unregister_cancel_restore F
+GLIBC_2.3.3 __pthread_unwind_next F
+GLIBC_2.3.3 pthread_attr_getaffinity_np F
+GLIBC_2.3.3 pthread_attr_setstack F
+GLIBC_2.3.3 pthread_attr_setstacksize F
+GLIBC_2.3.3 pthread_barrierattr_getpshared F
+GLIBC_2.3.3 pthread_condattr_getclock F
+GLIBC_2.3.3 pthread_condattr_setclock F
+GLIBC_2.3.3 pthread_setaffinity_np F
+GLIBC_2.3.3 pthread_timedjoin_np F
+GLIBC_2.3.3 pthread_tryjoin_np F
+GLIBC_2.3.4 pthread_attr_getaffinity_np F
+GLIBC_2.3.4 pthread_setaffinity_np F
+GLIBC_2.3.4 pthread_setschedprio F
+GLIBC_2.30 pthread_cond_clockwait F
+GLIBC_2.30 pthread_mutex_clocklock F
+GLIBC_2.30 pthread_rwlock_clockrdlock F
+GLIBC_2.30 pthread_rwlock_clockwrlock F
+GLIBC_2.30 sem_clockwait F
+GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.4 pthread_mutex_consistent_np F
+GLIBC_2.4 pthread_mutex_getprioceiling F
+GLIBC_2.4 pthread_mutex_setprioceiling F
+GLIBC_2.4 pthread_mutexattr_getprioceiling F
+GLIBC_2.4 pthread_mutexattr_getprotocol F
+GLIBC_2.4 pthread_mutexattr_getrobust_np F
+GLIBC_2.4 pthread_mutexattr_setprioceiling F
+GLIBC_2.4 pthread_mutexattr_setprotocol F
+GLIBC_2.4 pthread_mutexattr_setrobust_np F
-- 
2.25.1


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

* [PATCH 12/52] linux: mips: Split librt.abilist in n32 and n64
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (10 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 11/52] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 13/52] linux: mips: Split libanl.abilist " Adhemerval Zanella via Libc-alpha
                   ` (41 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 13/52] linux: mips: Split libanl.abilist in n32 and n64
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (11 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 12/52] linux: mips: Split librt.abilist " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 14/52] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella via Libc-alpha
                   ` (40 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 14/52] linux: s390: Add libanl.abilist in s390 and s390x
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (12 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 13/52] linux: mips: Split libanl.abilist " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 15/52] login: Consolidate utmp and utmpx headers Adhemerval Zanella via Libc-alpha
                   ` (39 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 15/52] login: Consolidate utmp and utmpx headers
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (13 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 14/52] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 16/52] login: Move gnu utmpx to default implementation Adhemerval Zanella via Libc-alpha
                   ` (38 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

It moves the 'struct lastlog', 'struct utmp', and 'struct utmpx' to
specific files and consolidates the s390-32 utmp.h and utmpx.h headers.

Checked on x86_64-linux-gnu and i686-linux-gnu.  I also checked with
a build for s390-linux-gnu.
---
 bits/types/struct_lastlog.h                   |  34 +++++
 bits/types/struct_utmp.h                      |  55 ++++++++
 bits/utmp.h                                   |  48 +------
 login/Makefile                                |   5 +-
 sysdeps/gnu/bits/struct_utmpx.h               |  55 ++++++++
 sysdeps/gnu/bits/utmpx.h                      |  34 +----
 .../sysv/linux/s390/bits/struct_lastlog.h     |  34 +++++
 .../unix/sysv/linux/s390/bits/struct_utmp.h   |  51 +++++++
 .../s390/bits/{utmpx.h => struct_utmpx.h}     |  57 +-------
 sysdeps/unix/sysv/linux/s390/bits/utmp.h      | 127 ------------------
 10 files changed, 239 insertions(+), 261 deletions(-)
 create mode 100644 bits/types/struct_lastlog.h
 create mode 100644 bits/types/struct_utmp.h
 create mode 100644 sysdeps/gnu/bits/struct_utmpx.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h
 rename sysdeps/unix/sysv/linux/s390/bits/{utmpx.h => struct_utmpx.h} (56%)
 delete mode 100644 sysdeps/unix/sysv/linux/s390/bits/utmp.h

diff --git a/bits/types/struct_lastlog.h b/bits/types/struct_lastlog.h
new file mode 100644
index 0000000000..bde4dd2ad0
--- /dev/null
+++ b/bits/types/struct_lastlog.h
@@ -0,0 +1,34 @@
+/* The 'struct lastlog' type.
+   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 _UTMP_H
+# error "Never include <bits/struct_lastlog.h> directly; use <utmp.h> instead."
+#endif
+
+/* The structure describing an entry in the database of
+   previous logins.  */
+struct lastlog
+{
+#if __WORDSIZE_TIME64_COMPAT32
+  int32_t ll_time;
+#else
+  __time_t ll_time;
+#endif
+  char ll_line[UT_LINESIZE];
+  char ll_host[UT_HOSTSIZE];
+};
diff --git a/bits/types/struct_utmp.h b/bits/types/struct_utmp.h
new file mode 100644
index 0000000000..76529ea62f
--- /dev/null
+++ b/bits/types/struct_utmp.h
@@ -0,0 +1,55 @@
+/* The 'struct utmp' type, describing entries in the utmp file.
+   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 _UTMP_H
+# error "Never include <bits/struct_utmp.h> directly; use <utmp.h> instead."
+#endif
+
+/* The structure describing an entry in the user accounting database.  */
+struct utmp
+{
+  short int ut_type;		/* Type of login.  */
+  pid_t ut_pid;			/* Process ID of login process.  */
+  char ut_line[UT_LINESIZE]
+    __attribute_nonstring__;	/* Devicename.  */
+  char ut_id[4]
+    __attribute_nonstring__;	/* Inittab ID.  */
+  char ut_user[UT_NAMESIZE]
+    __attribute_nonstring__;	/* Username.  */
+  char ut_host[UT_HOSTSIZE]
+    __attribute_nonstring__;	/* Hostname for remote login.  */
+  struct exit_status ut_exit;	/* Exit status of a process marked
+				   as DEAD_PROCESS.  */
+/* The ut_session and ut_tv fields must be the same size when compiled
+   32- and 64-bit.  This allows data files and shared memory to be
+   shared between 32- and 64-bit applications.  */
+#if __WORDSIZE_TIME64_COMPAT32
+  int32_t ut_session;		/* Session ID, used for windowing.  */
+  struct
+  {
+    int32_t tv_sec;		/* Seconds.  */
+    int32_t tv_usec;		/* Microseconds.  */
+  } ut_tv;			/* Time entry was made.  */
+#else
+  long int ut_session;		/* Session ID, used for windowing.  */
+  struct timeval ut_tv;		/* Time entry was made.  */
+#endif
+
+  int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
+  char __glibc_reserved[20];		/* Reserved for future use.  */
+};
diff --git a/bits/utmp.h b/bits/utmp.h
index 7e5512ef26..da2a6ac260 100644
--- a/bits/utmp.h
+++ b/bits/utmp.h
@@ -31,18 +31,7 @@
 #define UT_HOSTSIZE	256
 
 
-/* The structure describing an entry in the database of
-   previous logins.  */
-struct lastlog
-  {
-#if __WORDSIZE_TIME64_COMPAT32
-    int32_t ll_time;
-#else
-    __time_t ll_time;
-#endif
-    char ll_line[UT_LINESIZE];
-    char ll_host[UT_HOSTSIZE];
-  };
+#include <bits/types/struct_lastlog.h>
 
 
 /* The structure describing the status of a terminated process.  This
@@ -53,40 +42,7 @@ struct exit_status
     short int e_exit;		/* Process exit status.  */
   };
 
-
-/* The structure describing an entry in the user accounting database.  */
-struct utmp
-{
-  short int ut_type;		/* Type of login.  */
-  pid_t ut_pid;			/* Process ID of login process.  */
-  char ut_line[UT_LINESIZE]
-    __attribute_nonstring__;	/* Devicename.  */
-  char ut_id[4]
-    __attribute_nonstring__;	/* Inittab ID.  */
-  char ut_user[UT_NAMESIZE]
-    __attribute_nonstring__;	/* Username.  */
-  char ut_host[UT_HOSTSIZE]
-    __attribute_nonstring__;	/* Hostname for remote login.  */
-  struct exit_status ut_exit;	/* Exit status of a process marked
-				   as DEAD_PROCESS.  */
-/* The ut_session and ut_tv fields must be the same size when compiled
-   32- and 64-bit.  This allows data files and shared memory to be
-   shared between 32- and 64-bit applications.  */
-#if __WORDSIZE_TIME64_COMPAT32
-  int32_t ut_session;		/* Session ID, used for windowing.  */
-  struct
-  {
-    int32_t tv_sec;		/* Seconds.  */
-    int32_t tv_usec;		/* Microseconds.  */
-  } ut_tv;			/* Time entry was made.  */
-#else
-  long int ut_session;		/* Session ID, used for windowing.  */
-  struct timeval ut_tv;		/* Time entry was made.  */
-#endif
-
-  int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __glibc_reserved[20];		/* Reserved for future use.  */
-};
+#include <bits/types/struct_utmp.h>
 
 /* Backwards compatibility hacks.  */
 #define ut_name		ut_user
diff --git a/login/Makefile b/login/Makefile
index bc72e6e5b4..f7059ac660 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -23,7 +23,10 @@ subdir	:= login
 
 include ../Makeconfig
 
-headers	:= utmp.h bits/utmp.h lastlog.h pty.h
+headers	:= utmp.h bits/utmp.h lastlog.h pty.h \
+	   bits/types/struct_lastlog.h \
+	   bits/types/struct_utmp.h \
+	   bits/struct_utmpx.h
 
 routines := getlogin getlogin_r setlogin getlogin_r_chk \
 	    getutent getutent_r getutid getutline getutid_r getutline_r \
diff --git a/sysdeps/gnu/bits/struct_utmpx.h b/sysdeps/gnu/bits/struct_utmpx.h
new file mode 100644
index 0000000000..8d6db50c06
--- /dev/null
+++ b/sysdeps/gnu/bits/struct_utmpx.h
@@ -0,0 +1,55 @@
+/* The 'struct utmpx' type.
+   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 _UTMPX_H
+# error "Never include <bits/struct_utmpx.h> directly; use <utmpx.h> instead."
+#endif
+
+/* The structure describing an entry in the user accounting database.  */
+struct utmpx
+{
+  short int ut_type;		/* Type of login.  */
+  __pid_t ut_pid;		/* Process ID of login process.  */
+  char ut_line[__UT_LINESIZE]
+    __attribute_nonstring__;	/* Devicename.  */
+  char ut_id[4]
+    __attribute_nonstring__;	/* Inittab ID.  */
+  char ut_user[__UT_NAMESIZE]
+    __attribute_nonstring__;	/* Username.  */
+  char ut_host[__UT_HOSTSIZE]
+    __attribute_nonstring__;	/* Hostname for remote login.  */
+  struct __exit_status ut_exit;	/* Exit status of a process marked
+				   as DEAD_PROCESS.  */
+
+/* The fields ut_session and ut_tv must be the same size when compiled
+   32- and 64-bit.  This allows files and shared memory to be shared
+   between 32- and 64-bit applications.  */
+#if __WORDSIZE_TIME64_COMPAT32
+  __int32_t ut_session;		/* Session ID, used for windowing.  */
+  struct
+  {
+    __int32_t tv_sec;		/* Seconds.  */
+    __int32_t tv_usec;		/* Microseconds.  */
+  } ut_tv;			/* Time entry was made.  */
+#else
+  long int ut_session;		/* Session ID, used for windowing.  */
+  struct timeval ut_tv;		/* Time entry was made.  */
+#endif
+  __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
+  char __glibc_reserved[20];		/* Reserved for future use.  */
+};
diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h
index c859c5b900..26ec95603f 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/sysdeps/gnu/bits/utmpx.h
@@ -51,39 +51,7 @@ struct __exit_status
   };
 
 
-/* The structure describing an entry in the user accounting database.  */
-struct utmpx
-{
-  short int ut_type;		/* Type of login.  */
-  __pid_t ut_pid;		/* Process ID of login process.  */
-  char ut_line[__UT_LINESIZE]
-    __attribute_nonstring__;	/* Devicename.  */
-  char ut_id[4]
-    __attribute_nonstring__;	/* Inittab ID.  */
-  char ut_user[__UT_NAMESIZE]
-    __attribute_nonstring__;	/* Username.  */
-  char ut_host[__UT_HOSTSIZE]
-    __attribute_nonstring__;	/* Hostname for remote login.  */
-  struct __exit_status ut_exit;	/* Exit status of a process marked
-				   as DEAD_PROCESS.  */
-
-/* The fields ut_session and ut_tv must be the same size when compiled
-   32- and 64-bit.  This allows files and shared memory to be shared
-   between 32- and 64-bit applications.  */
-#if __WORDSIZE_TIME64_COMPAT32
-  __int32_t ut_session;		/* Session ID, used for windowing.  */
-  struct
-  {
-    __int32_t tv_sec;		/* Seconds.  */
-    __int32_t tv_usec;		/* Microseconds.  */
-  } ut_tv;			/* Time entry was made.  */
-#else
-  long int ut_session;		/* Session ID, used for windowing.  */
-  struct timeval ut_tv;		/* Time entry was made.  */
-#endif
-  __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __glibc_reserved[20];		/* Reserved for future use.  */
-};
+#include <bits/struct_utmpx.h>
 
 
 /* Values for the `ut_type' field of a `struct utmpx'.  */
diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h b/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h
new file mode 100644
index 0000000000..4faa9922f4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h
@@ -0,0 +1,34 @@
+/* The 'struct lastlog' type.
+   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 _UTMP_H
+# error "Never include <bits/struct_lastlog.h> directly; use <utmp.h> instead."
+#endif
+
+/* The structure describing an entry in the database of
+   previous logins.  */
+struct lastlog
+{
+#if __WORDSIZE == 32
+  int64_t ll_time;
+#else
+  __time_t ll_time;
+#endif
+  char ll_line[UT_LINESIZE];
+  char ll_host[UT_HOSTSIZE];
+};
diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h b/sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h
new file mode 100644
index 0000000000..c54b789553
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h
@@ -0,0 +1,51 @@
+/* The 'struct utmp' type, describing entries in the utmp file.
+   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 structure describing an entry in the user accounting database.  */
+struct utmp
+{
+  short int ut_type;		/* Type of login.  */
+  pid_t ut_pid;			/* Process ID of login process.  */
+  char ut_line[UT_LINESIZE]
+     __attribute_nonstring__;	/* Devicename.  */
+  char ut_id[4]
+    __attribute_nonstring__;	/* Inittab ID.  */
+  char ut_user[UT_NAMESIZE]
+     __attribute_nonstring__;	/* Username.  */
+  char ut_host[UT_HOSTSIZE]
+     __attribute_nonstring__;	/* Hostname for remote login.  */
+  struct exit_status ut_exit;	/* Exit status of a process marked
+				   as DEAD_PROCESS.  */
+/* The ut_session and ut_tv fields must be the same size when compiled
+   32- and 64-bit.  This allows data files and shared memory to be
+   shared between 32- and 64-bit applications.  */
+#if __WORDSIZE == 32
+  int64_t ut_session;		/* Session ID, used for windowing.  */
+  struct
+  {
+    int64_t tv_sec;		/* Seconds.  */
+    int64_t tv_usec;		/* Microseconds.  */
+  } ut_tv;			/* Time entry was made.  */
+#else
+  long int ut_session;		/* Session ID, used for windowing.  */
+  struct timeval ut_tv;		/* Time entry was made.  */
+#endif
+
+  int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
+  char __glibc_reserved[20];		/* Reserved for future use.  */
+};
diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h b/sysdeps/unix/sysv/linux/s390/bits/struct_utmpx.h
similarity index 56%
rename from sysdeps/unix/sysv/linux/s390/bits/utmpx.h
rename to sysdeps/unix/sysv/linux/s390/bits/struct_utmpx.h
index c51faf9ac6..f0708b9c6b 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/struct_utmpx.h
@@ -1,5 +1,5 @@
-/* Structures and definitions for the user accounting database.  GNU version.
-   Copyright (C) 1997-2021 Free Software Foundation, Inc.
+/* The 'struct utmpx' type.
+   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
@@ -17,40 +17,9 @@
    <https://www.gnu.org/licenses/>.  */
 
 #ifndef _UTMPX_H
-# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
+# error "Never include <bits/struct_utmpx.h> directly; use <utmpx.h> instead."
 #endif
 
-#include <bits/types.h>
-#include <sys/time.h>
-#include <bits/wordsize.h>
-
-
-#ifdef __USE_GNU
-# include <paths.h>
-# define _PATH_UTMPX	_PATH_UTMP
-# define _PATH_WTMPX	_PATH_WTMP
-#endif
-
-
-#define __UT_LINESIZE	32
-#define __UT_NAMESIZE	32
-#define __UT_HOSTSIZE	256
-
-
-/* The structure describing the status of a terminated process.  This
-   type is used in `struct utmpx' below.  */
-struct __exit_status
-  {
-#ifdef __USE_GNU
-    short int e_termination;	/* Process termination status.  */
-    short int e_exit;		/* Process exit status.  */
-#else
-    short int __e_termination;	/* Process termination status.  */
-    short int __e_exit;		/* Process exit status.  */
-#endif
-  };
-
-
 /* The structure describing an entry in the user accounting database.  */
 struct utmpx
 {
@@ -84,23 +53,3 @@ struct utmpx
   __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
   char __glibc_reserved[20];		/* Reserved for future use.  */
 };
-
-
-/* Values for the `ut_type' field of a `struct utmpx'.  */
-#define EMPTY		0	/* No valid user accounting information.  */
-
-#ifdef __USE_GNU
-# define RUN_LVL	1	/* The system's runlevel.  */
-#endif
-#define BOOT_TIME	2	/* Time of system boot.  */
-#define NEW_TIME	3	/* Time after system clock changed.  */
-#define OLD_TIME	4	/* Time when system clock changed.  */
-
-#define INIT_PROCESS	5	/* Process spawned by the init process.  */
-#define LOGIN_PROCESS	6	/* Session leader of a logged in user.  */
-#define USER_PROCESS	7	/* Normal process.  */
-#define DEAD_PROCESS	8	/* Terminated process.  */
-
-#ifdef __USE_GNU
-# define ACCOUNTING	9	/* System accounting.  */
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmp.h b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
deleted file mode 100644
index 4172fa04cc..0000000000
--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* The `struct utmp' type, describing entries in the utmp file.  GNU version.
-   Copyright (C) 1993-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 _UTMP_H
-# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
-#endif
-
-#include <paths.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <bits/wordsize.h>
-
-
-#define UT_LINESIZE	32
-#define UT_NAMESIZE	32
-#define UT_HOSTSIZE	256
-
-
-/* The structure describing an entry in the database of
-   previous logins.  */
-struct lastlog
-  {
-#if __WORDSIZE == 32
-    int64_t ll_time;
-#else
-    __time_t ll_time;
-#endif
-    char ll_line[UT_LINESIZE];
-    char ll_host[UT_HOSTSIZE];
-  };
-
-
-/* The structure describing the status of a terminated process.  This
-   type is used in `struct utmp' below.  */
-struct exit_status
-  {
-    short int e_termination;	/* Process termination status.  */
-    short int e_exit;		/* Process exit status.  */
-  };
-
-
-/* The structure describing an entry in the user accounting database.  */
-struct utmp
-{
-  short int ut_type;		/* Type of login.  */
-  pid_t ut_pid;			/* Process ID of login process.  */
-  char ut_line[UT_LINESIZE]
-     __attribute_nonstring__;	/* Devicename.  */
-  char ut_id[4]
-    __attribute_nonstring__;	/* Inittab ID.  */
-  char ut_user[UT_NAMESIZE]
-     __attribute_nonstring__;	/* Username.  */
-  char ut_host[UT_HOSTSIZE]
-     __attribute_nonstring__;	/* Hostname for remote login.  */
-  struct exit_status ut_exit;	/* Exit status of a process marked
-				   as DEAD_PROCESS.  */
-/* The ut_session and ut_tv fields must be the same size when compiled
-   32- and 64-bit.  This allows data files and shared memory to be
-   shared between 32- and 64-bit applications.  */
-#if __WORDSIZE == 32
-  int64_t ut_session;		/* Session ID, used for windowing.  */
-  struct
-  {
-    int64_t tv_sec;		/* Seconds.  */
-    int64_t tv_usec;		/* Microseconds.  */
-  } ut_tv;			/* Time entry was made.  */
-#else
-  long int ut_session;		/* Session ID, used for windowing.  */
-  struct timeval ut_tv;		/* Time entry was made.  */
-#endif
-
-  int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __glibc_reserved[20];		/* Reserved for future use.  */
-};
-
-/* Backwards compatibility hacks.  */
-#define ut_name		ut_user
-#ifndef _NO_UT_TIME
-/* We have a problem here: `ut_time' is also used otherwise.  Define
-   _NO_UT_TIME if the compiler complains.  */
-# define ut_time	ut_tv.tv_sec
-#endif
-#define ut_xtime	ut_tv.tv_sec
-#define ut_addr		ut_addr_v6[0]
-
-
-/* Values for the `ut_type' field of a `struct utmp'.  */
-#define EMPTY		0	/* No valid user accounting information.  */
-
-#define RUN_LVL		1	/* The system's runlevel.  */
-#define BOOT_TIME	2	/* Time of system boot.  */
-#define NEW_TIME	3	/* Time after system clock changed.  */
-#define OLD_TIME	4	/* Time when system clock changed.  */
-
-#define INIT_PROCESS	5	/* Process spawned by the init process.  */
-#define LOGIN_PROCESS	6	/* Session leader of a logged in user.  */
-#define USER_PROCESS	7	/* Normal process.  */
-#define DEAD_PROCESS	8	/* Terminated process.  */
-
-#define ACCOUNTING	9
-
-/* Old Linux name for the EMPTY type.  */
-#define UT_UNKNOWN	EMPTY
-
-
-/* Tell the user that we have a modern system with UT_HOST, UT_PID,
-   UT_TYPE, UT_ID and UT_TV fields.  */
-#define _HAVE_UT_TYPE	1
-#define _HAVE_UT_PID	1
-#define _HAVE_UT_ID	1
-#define _HAVE_UT_TV	1
-#define _HAVE_UT_HOST	1
-- 
2.25.1


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

* [PATCH 16/52] login: Move gnu utmpx to default implementation
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (14 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 15/52] login: Consolidate utmp and utmpx headers Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 17/52] Consolidate and simplify internal utmp definitions Adhemerval Zanella via Libc-alpha
                   ` (37 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

It removes one indirection where generic implementation assumes that
utmp and utmpx might differ and allows the optimize the symbol alias
where getutmp is the same as getumpx.

Checked with make check run-built-tests=no on all afftected ABIs.
---
 .../gnu/bits => bits/types}/struct_utmpx.h    |  0
 {sysdeps/gnu/bits => bits}/utmpx.h            |  2 +-
 include/utmpx.h                               |  1 +
 login/Makefile                                |  2 +-
 login/getutmp.c                               | 34 ++++++++++++++++--
 login/getutmpx.c                              | 35 +------------------
 login/updwtmp.c                               | 11 +++++-
 {sysdeps/gnu => login}/utmpx.h                |  0
 sysdeps/gnu/getutmp.c                         | 34 ------------------
 sysdeps/gnu/getutmpx.c                        |  1 -
 sysdeps/gnu/updwtmp.c                         | 31 ----------------
 .../unix/sysv/linux/s390/s390-32/getutmp.c    | 21 ++++-------
 .../unix/sysv/linux/s390/s390-32/updwtmp.c    |  2 +-
 13 files changed, 54 insertions(+), 120 deletions(-)
 rename {sysdeps/gnu/bits => bits/types}/struct_utmpx.h (100%)
 rename {sysdeps/gnu/bits => bits}/utmpx.h (98%)
 create mode 100644 include/utmpx.h
 rename {sysdeps/gnu => login}/utmpx.h (100%)
 delete mode 100644 sysdeps/gnu/getutmp.c
 delete mode 100644 sysdeps/gnu/getutmpx.c
 delete mode 100644 sysdeps/gnu/updwtmp.c

diff --git a/sysdeps/gnu/bits/struct_utmpx.h b/bits/types/struct_utmpx.h
similarity index 100%
rename from sysdeps/gnu/bits/struct_utmpx.h
rename to bits/types/struct_utmpx.h
diff --git a/sysdeps/gnu/bits/utmpx.h b/bits/utmpx.h
similarity index 98%
rename from sysdeps/gnu/bits/utmpx.h
rename to bits/utmpx.h
index 26ec95603f..b2947b1c13 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/bits/utmpx.h
@@ -51,7 +51,7 @@ struct __exit_status
   };
 
 
-#include <bits/struct_utmpx.h>
+#include <bits/types/struct_utmpx.h>
 
 
 /* Values for the `ut_type' field of a `struct utmpx'.  */
diff --git a/include/utmpx.h b/include/utmpx.h
new file mode 100644
index 0000000000..cfe9b7c054
--- /dev/null
+++ b/include/utmpx.h
@@ -0,0 +1 @@
+#include <login/utmpx.h>
diff --git a/login/Makefile b/login/Makefile
index f7059ac660..5e2cb1da06 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -26,7 +26,7 @@ include ../Makeconfig
 headers	:= utmp.h bits/utmp.h lastlog.h pty.h \
 	   bits/types/struct_lastlog.h \
 	   bits/types/struct_utmp.h \
-	   bits/struct_utmpx.h
+	   bits/types/struct_utmpx.h
 
 routines := getlogin getlogin_r setlogin getlogin_r_chk \
 	    getutent getutent_r getutid getutline getutid_r getutline_r \
diff --git a/login/getutmp.c b/login/getutmp.c
index 0401e041dd..60aafb5067 100644
--- a/login/getutmp.c
+++ b/login/getutmp.c
@@ -17,17 +17,47 @@
 
 #include <string.h>
 #include <utmp.h>
+#include <stddef.h>
+#define getutmpx __redirect_getutmpx
 #include <utmpx.h>
+#undef getutmpx
+
+#define CHECK_SIZE_AND_OFFSET(field) \
+  _Static_assert (sizeof ((struct utmp){0}.field)		\
+		  == sizeof ((struct utmpx){0}.field),		\
+		  "sizeof ((struct utmp){0}." #field " != "	\
+		  "sizeof ((struct utmpx){0}" #field);	\
+  _Static_assert (offsetof (struct utmp, field)			\
+		  == offsetof (struct utmpx, field),		\
+		  "offsetof (struct utmp, " #field ") != "	\
+		  "offsetof (struct utmpx, " #field ")");
+
+/* This ensure the getutmp to getutmpx alias is valid.  */
+_Static_assert (sizeof (struct utmp) == sizeof (struct utmpx),
+		"sizeof (struct utmp) != sizeof (struct utmpx)");
+CHECK_SIZE_AND_OFFSET (ut_type)
+CHECK_SIZE_AND_OFFSET (ut_pid)
+CHECK_SIZE_AND_OFFSET (ut_line)
+CHECK_SIZE_AND_OFFSET (ut_user)
+CHECK_SIZE_AND_OFFSET (ut_id)
+CHECK_SIZE_AND_OFFSET (ut_host)
+CHECK_SIZE_AND_OFFSET (ut_tv)
+
 
 /* Copy the information in UTMPX to UTMP. */
 void
-getutmp (const struct utmpx *utmpx, struct utmp *utmp)
+__getutmp (const struct utmpx *utmpx, struct utmp *utmp)
 {
+  memset (utmp, 0, sizeof (struct utmpx));
   utmp->ut_type = utmpx->ut_type;
   utmp->ut_pid = utmpx->ut_pid;
   memcpy (utmp->ut_line, utmpx->ut_line, sizeof (utmp->ut_line));
   memcpy (utmp->ut_user, utmpx->ut_user, sizeof (utmp->ut_user));
   memcpy (utmp->ut_id, utmpx->ut_id, sizeof (utmp->ut_id));
   memcpy (utmp->ut_host, utmpx->ut_host, sizeof (utmp->ut_host));
-  utmp->ut_tv = utmpx->ut_tv;
+  utmp->ut_tv.tv_sec = utmpx->ut_tv.tv_sec;
+  utmp->ut_tv.tv_usec = utmpx->ut_tv.tv_usec;
 }
+
+weak_alias (__getutmp, getutmp)
+strong_alias (__getutmp, getutmpx)
diff --git a/login/getutmpx.c b/login/getutmpx.c
index 228726a05a..839eb6826e 100644
--- a/login/getutmpx.c
+++ b/login/getutmpx.c
@@ -1,34 +1 @@
-/* Copyright (C) 1999-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 <string.h>
-#include <utmp.h>
-#include <utmpx.h>
-
-/* Copy the information in UTMP to UTMPX. */
-void
-getutmpx (const struct utmp *utmp, struct utmpx *utmpx)
-{
-  memset (utmpx, 0, sizeof (struct utmpx));
-  utmpx->ut_type = utmp->ut_type;
-  utmpx->ut_pid = utmp->ut_pid;
-  memcpy (utmpx->ut_line, utmp->ut_line, sizeof (utmp->ut_line));
-  memcpy (utmpx->ut_user, utmp->ut_user, sizeof (utmp->ut_user));
-  memcpy (utmpx->ut_id, utmp->ut_id, sizeof (utmp->ut_id));
-  memcpy (utmpx->ut_host, utmp->ut_host, sizeof (utmp->ut_host));
-  utmpx->ut_tv = utmp->ut_tv;
-}
+/* Implemented by getutmp.c. */
diff --git a/login/updwtmp.c b/login/updwtmp.c
index 0558198464..ae67cfc10a 100644
--- a/login/updwtmp.c
+++ b/login/updwtmp.c
@@ -17,11 +17,20 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <utmp.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "utmp-private.h"
 
 #ifndef TRANSFORM_UTMP_FILE_NAME
-# define TRANSFORM_UTMP_FILE_NAME(file_name) (file_name)
+# define TRANSFORM_UTMP_FILE_NAME(file_name)	\
+  ((strcmp (file_name, _PATH_UTMP "x") == 0	\
+    && __access (_PATH_UTMP "x", F_OK) != 0)	\
+   ? _PATH_UTMP					\
+   : ((strcmp (file_name, _PATH_WTMP "x") == 0	\
+       && __access (_PATH_WTMP "x", F_OK) != 0)	\
+      ? _PATH_WTMP				\
+      : file_name))
 #endif
 
 void
diff --git a/sysdeps/gnu/utmpx.h b/login/utmpx.h
similarity index 100%
rename from sysdeps/gnu/utmpx.h
rename to login/utmpx.h
diff --git a/sysdeps/gnu/getutmp.c b/sysdeps/gnu/getutmp.c
deleted file mode 100644
index 4ce9d65ce0..0000000000
--- a/sysdeps/gnu/getutmp.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1999-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 <assert.h>
-#include <string.h>
-#include <utmp.h>
-#ifndef _UTMPX_H
-/* This is an ugly hack but we must not see the getutmpx declaration.  */
-# define getutmpx XXXgetutmpx
-# include <utmpx.h>
-# undef getutmpx
-#endif
-
-void
-getutmp (const struct utmpx *utmpx, struct utmp *utmp)
-{
-  assert (sizeof (struct utmp) == sizeof (struct utmpx));
-  memcpy (utmp, utmpx, sizeof (struct utmp));
-}
-strong_alias (getutmp, getutmpx)
diff --git a/sysdeps/gnu/getutmpx.c b/sysdeps/gnu/getutmpx.c
deleted file mode 100644
index f393734a63..0000000000
--- a/sysdeps/gnu/getutmpx.c
+++ /dev/null
@@ -1 +0,0 @@
-/* We don't need a separate version.  it is the same as getutmp().  */
diff --git a/sysdeps/gnu/updwtmp.c b/sysdeps/gnu/updwtmp.c
deleted file mode 100644
index a1cb93d75d..0000000000
--- a/sysdeps/gnu/updwtmp.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 1998-2021 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
-
-   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 <string.h>
-#include <unistd.h>
-
-#define TRANSFORM_UTMP_FILE_NAME(file_name)	\
-  ((strcmp (file_name, _PATH_UTMP "x") == 0	\
-    && __access (_PATH_UTMP "x", F_OK) != 0)	\
-   ? _PATH_UTMP					\
-   : ((strcmp (file_name, _PATH_WTMP "x") == 0	\
-       && __access (_PATH_WTMP "x", F_OK) != 0)	\
-      ? _PATH_WTMP				\
-      : file_name))
-
-#include <login/updwtmp.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
index 5820701f21..6ffea2a553 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
@@ -16,22 +16,15 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <string.h>
-#include <utmp.h>
-/* This is an ugly hack but we must not see the getutmpx declaration.  */
-#define getutmpx XXXgetutmpx
-#include <utmpx.h>
-#undef getutmpx
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
 
-#include "utmp-compat.h"
+#include <login/getutmp.c>
 
-#undef weak_alias
-#define weak_alias(n,a)
-#define getutmp __getutmp
-#define getutmpx __getutmpx
-#include "sysdeps/gnu/getutmp.c"
-#undef getutmp
-#undef getutmpx
+#include "utmp-compat.h"
 
 default_symbol_version (__getutmp, getutmp, UTMP_COMPAT_BASE);
+_strong_alias (__getutmp, __getutmpx)
 default_symbol_version (__getutmpx, getutmpx, UTMP_COMPAT_BASE);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
index d4aa0ce2ac..7ef8e85c00 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
@@ -25,7 +25,7 @@
 # undef weak_alias
 # define weak_alias(n,a)
 #endif
-#include "sysdeps/gnu/updwtmp.c"
+#include <login/updwtmp.c>
 
 #if defined SHARED
 default_symbol_version (__updwtmp, updwtmp, UTMP_COMPAT_BASE);
-- 
2.25.1


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

* [PATCH 17/52] Consolidate and simplify internal utmp definitions
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (15 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 16/52] login: Move gnu utmpx to default implementation Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 18/52] support: Add 'touch' command Adhemerval Zanella via Libc-alpha
                   ` (36 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

The TRANSFORM_UTMP_FILE_NAME macro is refactored to the inline function
utmp_file_name_time32 and the __utmp_equal function is removed and inlined
on its only usage  (matches_last_entry at utmp_file.c).

Checked with make check run-built-tests=no on all afftected ABIs.
---
 login/updwtmp.c                              | 14 +----
 sysdeps/gnu/utmp_file.c => login/utmp-path.h | 32 ++++++++----
 login/utmp_file.c                            | 26 ++++++---
 manual/users.texi                            |  4 +-
 sysdeps/generic/paths.h                      |  8 +--
 sysdeps/generic/utmp-equal.h                 | 42 ---------------
 sysdeps/unix/sysv/linux/paths.h              |  6 ++-
 sysdeps/unix/sysv/linux/updwtmp.c            | 37 -------------
 sysdeps/unix/sysv/linux/utmp-path.h          | 55 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/utmp_file.c          | 37 -------------
 10 files changed, 107 insertions(+), 154 deletions(-)
 rename sysdeps/gnu/utmp_file.c => login/utmp-path.h (50%)
 delete mode 100644 sysdeps/generic/utmp-equal.h
 delete mode 100644 sysdeps/unix/sysv/linux/updwtmp.c
 create mode 100644 sysdeps/unix/sysv/linux/utmp-path.h
 delete mode 100644 sysdeps/unix/sysv/linux/utmp_file.c

diff --git a/login/updwtmp.c b/login/updwtmp.c
index ae67cfc10a..e67a9cf2d9 100644
--- a/login/updwtmp.c
+++ b/login/updwtmp.c
@@ -21,22 +21,12 @@
 #include <unistd.h>
 
 #include "utmp-private.h"
-
-#ifndef TRANSFORM_UTMP_FILE_NAME
-# define TRANSFORM_UTMP_FILE_NAME(file_name)	\
-  ((strcmp (file_name, _PATH_UTMP "x") == 0	\
-    && __access (_PATH_UTMP "x", F_OK) != 0)	\
-   ? _PATH_UTMP					\
-   : ((strcmp (file_name, _PATH_WTMP "x") == 0	\
-       && __access (_PATH_WTMP "x", F_OK) != 0)	\
-      ? _PATH_WTMP				\
-      : file_name))
-#endif
+#include <utmp-path.h>
 
 void
 __updwtmp (const char *wtmp_file, const struct utmp *utmp)
 {
-  const char *file_name = TRANSFORM_UTMP_FILE_NAME (wtmp_file);
+  const char *file_name = utmp_file_name_time32 (wtmp_file);
 
   __libc_updwtmp (file_name, utmp);
 }
diff --git a/sysdeps/gnu/utmp_file.c b/login/utmp-path.h
similarity index 50%
rename from sysdeps/gnu/utmp_file.c
rename to login/utmp-path.h
index 696fb38fa8..351a932862 100644
--- a/sysdeps/gnu/utmp_file.c
+++ b/login/utmp-path.h
@@ -1,6 +1,6 @@
-/* Copyright (C) 1998-2021 Free Software Foundation, Inc.
+/* Handle {u,w}tmp and {u,w}tmpx file name usage.
+   Copyright (C) 1998-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -16,16 +16,26 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#ifndef _UTMP_PATH_H
+#define _UTMP_PATH_H 1
+
 #include <string.h>
 #include <unistd.h>
 
-#define TRANSFORM_UTMP_FILE_NAME(file_name)	\
-  ((strcmp (file_name, _PATH_UTMP "x") == 0	\
-    && __access (_PATH_UTMP "x", F_OK) != 0)	\
-   ? _PATH_UTMP					\
-   : ((strcmp (file_name, _PATH_WTMP "x") == 0	\
-       && __access (_PATH_WTMP "x", F_OK) != 0)	\
-      ? _PATH_WTMP				\
-      : file_name))
+/* The function returns the utmp database for 32-bit utmp{x} entries based
+   on FILE_NAME.  If the argument ends with 'x' and the file does not
+   exits the default old utmp{x} name is returned instead.  */
+static inline const char *
+utmp_file_name_time32 (const char *file_name)
+{
+  if (strcmp (file_name, _PATH_UTMP_BASE "x") == 0
+      && __access (_PATH_UTMP_BASE "x", F_OK) != 0)
+    return _PATH_UTMP_BASE;
+  else if (strcmp (file_name, _PATH_WTMP_BASE "x") == 0
+	   && __access (_PATH_WTMP_BASE "x", F_OK) != 0)
+    return _PATH_UTMP_BASE;
+
+  return file_name;
+}
 
-#include <login/utmp_file.c>
+#endif /* _UTMP_PATH_H  */
diff --git a/login/utmp_file.c b/login/utmp_file.c
index 8c0b3a0bb4..377209b26d 100644
--- a/login/utmp_file.c
+++ b/login/utmp_file.c
@@ -32,7 +32,7 @@
 #include <not-cancel.h>
 
 #include "utmp-private.h"
-#include "utmp-equal.h"
+#include <utmp-path.h>
 
 
 /* Descriptor for the file and position.  */
@@ -60,7 +60,21 @@ matches_last_entry (const struct utmp *data)
     return data->ut_type == last_entry.ut_type;
   else
     /* For the process-related entries, a full match is needed.  */
-    return __utmp_equal (&last_entry, data);
+    return (data->ut_type == INIT_PROCESS
+	    || data->ut_type == LOGIN_PROCESS
+	    || data->ut_type == USER_PROCESS
+	    || data->ut_type == DEAD_PROCESS)
+      && (last_entry.ut_type == INIT_PROCESS
+	  || last_entry.ut_type == LOGIN_PROCESS
+	  || last_entry.ut_type == USER_PROCESS
+	  || last_entry.ut_type == DEAD_PROCESS)
+      && (data->ut_id[0] && last_entry.ut_id[0]
+	  ? strncmp (data->ut_id, last_entry.ut_id,
+		     sizeof last_entry.ut_id)
+	    == 0
+	  : (strncmp (data->ut_line, last_entry.ut_line,
+		      sizeof last_entry.ut_line)
+	     == 0));
 }
 
 /* Locking timeout.  */
@@ -129,10 +143,6 @@ file_unlock (int fd)
   __fcntl64_nocancel (fd, F_SETLKW, &fl);
 }
 
-#ifndef TRANSFORM_UTMP_FILE_NAME
-# define TRANSFORM_UTMP_FILE_NAME(file_name) (file_name)
-#endif
-
 int
 __libc_setutent (void)
 {
@@ -140,7 +150,7 @@ __libc_setutent (void)
     {
       const char *file_name;
 
-      file_name = TRANSFORM_UTMP_FILE_NAME (__libc_utmp_file_name);
+      file_name = utmp_file_name_time32 (__libc_utmp_file_name);
 
       file_writable = false;
       file_fd = __open_nocancel
@@ -353,7 +363,7 @@ __libc_pututline (const struct utmp *data)
   if (! file_writable)
     {
       /* We must make the file descriptor writable before going on.  */
-      const char *file_name = TRANSFORM_UTMP_FILE_NAME (__libc_utmp_file_name);
+      const char *file_name = utmp_file_name_time32 (__libc_utmp_file_name);
 
       int new_fd = __open_nocancel
 	(file_name, O_RDWR | O_LARGEFILE | O_CLOEXEC);
diff --git a/manual/users.texi b/manual/users.texi
index ec22ce6c1c..dcaca1dcf1 100644
--- a/manual/users.texi
+++ b/manual/users.texi
@@ -1234,7 +1234,7 @@ over again.
 @c   pututline_unknown @mtasurace:utent @acsfd
 @c    setutent_unknown dup @mtasurace:utent @acsfd
 @c   pututline_file @mtascusig:ALRM @mtascutimer @acsfd
-@c    TRANSFORM_UTMP_FILE_NAME ok
+@c    utmp_file_name_time32 ok
 @c     strcmp dup ok
 @c     acesss dup ok
 @c    open_not_cancel_2 dup @acsfd
@@ -1427,7 +1427,7 @@ the following function:
 @standards{SVID, utmp.h}
 @safety{@prelim{}@mtunsafe{@mtascusig{:ALRM} @mtascutimer{}}@asunsafe{}@acunsafe{@acsfd{}}}
 @c updwtmp @mtascusig:ALRM @mtascutimer @acsfd
-@c  TRANSFORM_UTMP_FILE_NAME dup ok
+@c  utmp_file_name_time32 dup ok
 @c  *libc_utmp_file_functions->updwtmp = updwtmp_file @mtascusig:ALRM @mtascutimer @acsfd
 @c   open_not_cancel_2 dup @acsfd
 @c   LOCK_FILE dup @mtascusig:ALRM @mtascutimer
diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h
index 893b4c2286..99a791ce31 100644
--- a/sysdeps/generic/paths.h
+++ b/sysdeps/generic/paths.h
@@ -60,10 +60,12 @@
 #define	_PATH_SHELLS	"/etc/shells"
 #define	_PATH_TTY	"/dev/tty"
 #define	_PATH_UNIX	"/vmunix"
-#define	_PATH_UTMP	"/var/run/utmp"
-#define	_PATH_UTMP_DB	"/var/run/utmp.db"
+#define	_PATH_UTMP_BASE	"/var/run/utmp"
+#define	_PATH_UTMP	_PATH_UTMP_BASE
+#define	_PATH_UTMP_DB	_PATH_UTMP_BASE ".db"
 #define	_PATH_VI	"/usr/bin/vi"
-#define	_PATH_WTMP	"/var/log/wtmp"
+#define	_PATH_WTMP_BASE	"/var/log/wtmp"
+#define	_PATH_WTMP	_PATH_WTMP_BASE
 
 /* Provide trailing slash, since mostly used for building pathnames. */
 #define	_PATH_DEV	"/dev/"
diff --git a/sysdeps/generic/utmp-equal.h b/sysdeps/generic/utmp-equal.h
deleted file mode 100644
index b1c4f008b9..0000000000
--- a/sysdeps/generic/utmp-equal.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Helper function for utmp functions to see if two entries are equal.
-   Copyright (C) 1996-2021 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>
-   and Paul Janzen <pcj@primenet.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 <string.h>
-#include <utmp.h>
-
-#include "utmp-private.h"
-
-/* Test whether two entries match.  */
-static int
-__utmp_equal (const struct utmp *entry, const struct utmp *match)
-{
-  return (entry->ut_type == INIT_PROCESS
-          || entry->ut_type == LOGIN_PROCESS
-          || entry->ut_type == USER_PROCESS
-          || entry->ut_type == DEAD_PROCESS)
-    && (match->ut_type == INIT_PROCESS
-        || match->ut_type == LOGIN_PROCESS
-        || match->ut_type == USER_PROCESS
-        || match->ut_type == DEAD_PROCESS)
-    && (entry->ut_id[0] && match->ut_id[0]
-        ? strncmp (entry->ut_id, match->ut_id, sizeof match->ut_id) == 0
-        : (strncmp (entry->ut_line, match->ut_line, sizeof match->ut_line)
-           == 0));
-}
diff --git a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h
index 1342ab3a96..3b8aeab788 100644
--- a/sysdeps/unix/sysv/linux/paths.h
+++ b/sysdeps/unix/sysv/linux/paths.h
@@ -61,9 +61,11 @@
 #define	_PATH_SHELLS	"/etc/shells"
 #define	_PATH_TTY	"/dev/tty"
 #define	_PATH_UNIX	"/boot/vmlinux"
-#define	_PATH_UTMP	"/var/run/utmp"
+#define	_PATH_UTMP_BASE	"/var/run/utmp"
+#define	_PATH_UTMP	_PATH_UTMP_BASE
 #define	_PATH_VI	"/usr/bin/vi"
-#define	_PATH_WTMP	"/var/log/wtmp"
+#define	_PATH_WTMP_BASE	"/var/log/wtmp"
+#define	_PATH_WTMP	_PATH_WTMP_BASE
 
 /* Provide trailing slash, since mostly used for building pathnames. */
 #define	_PATH_DEV	"/dev/"
diff --git a/sysdeps/unix/sysv/linux/updwtmp.c b/sysdeps/unix/sysv/linux/updwtmp.c
deleted file mode 100644
index 93d72e75a6..0000000000
--- a/sysdeps/unix/sysv/linux/updwtmp.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1998-2021 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
-
-   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 <string.h>
-#include <unistd.h>
-
-#define TRANSFORM_UTMP_FILE_NAME(file_name)		\
-  ((strcmp (file_name, _PATH_UTMP) == 0			\
-    && __access (_PATH_UTMP "x", F_OK) == 0)		\
-   ? (_PATH_UTMP "x")					\
-   : ((strcmp (file_name, _PATH_WTMP) == 0		\
-       && __access ( _PATH_WTMP "x", F_OK) == 0)	\
-      ? (_PATH_WTMP "x")				\
-      : ((strcmp (file_name, _PATH_UTMP "x") == 0	\
-	  && __access (_PATH_UTMP "x", F_OK) != 0)	\
-	 ? _PATH_UTMP					\
-	 : ((strcmp (file_name, _PATH_WTMP "x") == 0	\
-	     && __access (_PATH_WTMP "x", F_OK) != 0)	\
-	    ? _PATH_WTMP				\
-	    : file_name))))
-
-#include <login/updwtmp.c>
diff --git a/sysdeps/unix/sysv/linux/utmp-path.h b/sysdeps/unix/sysv/linux/utmp-path.h
new file mode 100644
index 0000000000..f39222d62f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/utmp-path.h
@@ -0,0 +1,55 @@
+/* Handle {u,w}tmp and {u,w}tmpx file name usage.
+   Copyright (C) 1998-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 _UTMP_PATH_H
+#define _UTMP_PATH_H 1
+
+#include <string.h>
+#include <unistd.h>
+
+
+/* The function returns the utmp database for 32-bit utmp{x} entries based
+   on FILE_NAME:
+
+   - if the default {x,w}utmp name is used but a file name ending with 'x'
+     exists it is returned instead
+
+   - if the argument ends with 'x' and the file is not accessible the default
+     {x,w}utmp is returned instead.
+
+   - if neither 1. nor 2. applies, the FILE_NAME is returned instead.  */
+static inline const char *
+utmp_file_name_time32 (const char *file_name)
+{
+  if (strcmp (file_name, _PATH_UTMP_BASE) == 0
+      && __access (_PATH_UTMP_BASE "x", F_OK) == 0)
+    return _PATH_UTMP_BASE "x";
+  else if (strcmp (file_name, _PATH_WTMP_BASE) == 0
+           && __access (_PATH_WTMP_BASE "x", F_OK) == 0)
+    return _PATH_WTMP_BASE "x";
+  else if (strcmp (file_name, _PATH_UTMP_BASE "x") == 0
+           && __access (_PATH_UTMP_BASE "x", F_OK) != 0)
+    return _PATH_UTMP_BASE;
+  else if (strcmp (file_name, _PATH_WTMP_BASE "x") == 0
+           && __access (_PATH_WTMP_BASE "x", F_OK) != 0)
+    return _PATH_WTMP_BASE;
+
+  return file_name;
+}
+
+#endif /* _UTMP_PATH_H  */
diff --git a/sysdeps/unix/sysv/linux/utmp_file.c b/sysdeps/unix/sysv/linux/utmp_file.c
deleted file mode 100644
index 78d10db8c8..0000000000
--- a/sysdeps/unix/sysv/linux/utmp_file.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1998-2021 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
-
-   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 <string.h>
-#include <unistd.h>
-
-#define TRANSFORM_UTMP_FILE_NAME(file_name)		\
-  ((strcmp (file_name, _PATH_UTMP) == 0			\
-    && __access (_PATH_UTMP "x", F_OK) == 0)		\
-   ? (_PATH_UTMP "x")					\
-   : ((strcmp (file_name, _PATH_WTMP) == 0		\
-       && __access ( _PATH_WTMP "x", F_OK) == 0)	\
-      ? (_PATH_WTMP "x")				\
-      : ((strcmp (file_name, _PATH_UTMP "x") == 0	\
-	  && __access (_PATH_UTMP "x", F_OK) != 0)	\
-	 ? _PATH_UTMP					\
-	 : ((strcmp (file_name, _PATH_WTMP "x") == 0	\
-	     && __access (_PATH_WTMP "x", F_OK) != 0)	\
-	    ? _PATH_WTMP				\
-	    : file_name))))
-
-#include <login/utmp_file.c>
-- 
2.25.1


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

* [PATCH 18/52] support: Add 'touch' command
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (16 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 17/52] Consolidate and simplify internal utmp definitions Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 19/52] Add tests-container-internal rules Adhemerval Zanella via Libc-alpha
                   ` (35 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

It allow creates empty files with an specific mode.
---
 support/test-container.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/support/test-container.c b/support/test-container.c
index 28cc44d9f1..0d85bfb357 100644
--- a/support/test-container.c
+++ b/support/test-container.c
@@ -104,6 +104,7 @@ int verbose = 0;
 	 cwd PATH
 	 exec FILE
 	 mkdirp MODE DIR
+	 touch MODE FILE
 
        variables:
 	 $B/ build dir, equivalent to $(common-objpfx)
@@ -129,6 +130,7 @@ int verbose = 0;
 	 - 'cwd': set test working directory
 	 - 'exec': change test binary location (may end in /)
 	 - 'mkdirp': A minimal "mkdir -p FILE" command.
+	 - 'touch': A minimal 'touch' command to create empty files.
 
    * mytest.root/postclean.req causes fresh rsync (with delete) after
      test if present
@@ -1018,6 +1020,15 @@ main (int argc, char **argv)
 		TEST_COMPARE (errno, 0);
 		xmkdirp (the_words[2], m);
 	      }
+	    else if (nt == 3 && strcmp (the_words[0], "touch") == 0)
+	      {
+		long int m;
+		errno = 0;
+		m = strtol (the_words[1], NULL, 0);
+		TEST_COMPARE (errno, 0);
+
+		xclose (xopen (the_words[2], O_WRONLY | O_TRUNC | O_CREAT, m));
+	      }
 	    else if (nt > 0 && the_words[0][0] != '#')
 	      {
 		fprintf (stderr, "\033[31minvalid [%s]\033[0m\n", the_words[0]);
-- 
2.25.1


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

* [PATCH 19/52] Add tests-container-internal rules
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (17 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 18/52] support: Add 'touch' command Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx Adhemerval Zanella via Libc-alpha
                   ` (34 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

It is similar to test-container, but build with -MODULE_NAME=nonlib
(similar to test-internal).
---
 Makefile  |  2 +-
 Makerules |  3 ++-
 Rules     | 12 +++++++-----
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 50f99ca611..71c7d8b5ec 100644
--- a/Makefile
+++ b/Makefile
@@ -589,7 +589,7 @@ else
 LINKS_DSO_PROGRAM = links-dso-program
 endif
 
-$(tests-container) $(addsuffix /tests,$(subdirs)) : \
+$(tests-container) $(tests-container-internal) $(addsuffix /tests,$(subdirs)) : \
 		$(objpfx)testroot.pristine/install.stamp
 $(objpfx)testroot.pristine/install.stamp :
 	test -d $(objpfx)testroot.pristine || \
diff --git a/Makerules b/Makerules
index ca9885436e..fc5251ffad 100644
--- a/Makerules
+++ b/Makerules
@@ -1290,7 +1290,7 @@ xcheck: xtests
 # 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.
 all-testsuite := $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) \
-		 $(tests-container))
+		 $(tests-container) $(tests-container-internal))
 ifneq (,$(all-testsuite))
 cpp-srcs-left = $(all-testsuite)
 lib := testsuite
@@ -1298,6 +1298,7 @@ include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
 endif
 
 all-nonlib := $(strip $(tests-internal) $(test-internal-extras) \
+		      $(tests-container-internal) \
 		      $(others) $(others-extras))
 ifneq (,$(all-nonlib))
 cpp-srcs-left = $(all-nonlib)
diff --git a/Rules b/Rules
index 082625bb71..67c6f009e4 100644
--- a/Rules
+++ b/Rules
@@ -148,13 +148,15 @@ others: $(py-const)
 ifeq ($(run-built-tests),no)
 tests: $(addprefix $(objpfx),$(filter-out $(tests-unsupported), \
                                           $(tests) $(tests-internal) \
-					  $(tests-container)) \
+					  $(tests-container) \
+					  $(tests-container-internal)) \
 			     $(test-srcs)) $(tests-special) \
 			     $(tests-printers-programs)
 xtests: tests $(xtests-special)
 else
 tests: $(tests:%=$(objpfx)%.out) $(tests-internal:%=$(objpfx)%.out) \
        $(tests-container:%=$(objpfx)%.out) \
+       $(tests-container-internal:%=$(objpfx)%.out) \
        $(tests-mcheck:%=$(objpfx)%-mcheck.out) \
        $(tests-special) $(tests-printers-out)
 xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-special)
@@ -166,7 +168,7 @@ ifeq ($(run-built-tests),no)
 tests-expected =
 else
 tests-expected = $(tests) $(tests-internal) $(tests-printers) \
-	$(tests-container) $(tests-mcheck:%=%-mcheck)
+	$(tests-container) $(tests-container-internal) $(tests-mcheck:%=%-mcheck)
 endif
 tests:
 	$(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
@@ -180,7 +182,7 @@ xtests:
 ifeq ($(build-programs),yes)
 binaries-all-notests = $(others) $(sysdep-others)
 binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs) \
-		     $(tests-container)
+		     $(tests-container) $(tests-container-internal)
 binaries-all = $(binaries-all-notests) $(binaries-all-tests)
 binaries-static-notests = $(others-static)
 binaries-static-tests = $(tests-static) $(xtests-static)
@@ -289,8 +291,8 @@ $(objpfx)%.out: /dev/null $(objpfx)%	# Make it 2nd arg for canned sequence.
 
 # Any tests that require an isolated container (filesystem, network
 # and pid namespaces) in which to run, should be added to
-# tests-container.
-$(tests-container:%=$(objpfx)%.out): $(objpfx)%.out : $(if $(wildcard $(objpfx)%.files),$(objpfx)%.files,/dev/null) $(objpfx)%
+# tests-container or tests-container-internal.
+$(tests-container:%=$(objpfx)%.out) $(tests-container-internal:%=$(objpfx)%.out): $(objpfx)%.out : $(if $(wildcard $(objpfx)%.files),$(objpfx)%.files,/dev/null) $(objpfx)%
 	$(test-wrapper-env) $(run-program-env) $(run-via-rtld-prefix) \
 	  $(common-objpfx)support/test-container env $(run-program-env) $($*-ENV) \
 	  $(host-test-program-cmd) $($*-ARGS) > $@; \
-- 
2.25.1


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

* [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (18 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 19/52] Add tests-container-internal rules Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-04-27 12:30   ` Florian Weimer via Libc-alpha
  2021-03-05 20:14 ` [PATCH 21/52] linux: Add pwrite64_nocancel Adhemerval Zanella via Libc-alpha
                   ` (33 subsequent siblings)
  53 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

The new struct has the same size for 32-bit and 64-bit architecture with
two main differences compared to the 32-bit time one:

  1. ut_session is now 64-bit and it is mainly to set the ut_tv member
     alignment to be similar on both 32-bit and 64-bit architecture
     (for architectures that support multiple ABIs with different
     wordsize, such as x86 and powerpc).

  2. The internal tv_sec and tv_usec for ut_tv are now 64-bit.  Although
     it does not fully fix BZ#17470 nor BZ#18235, it might allow define
     the type as 'struct timeval' for __TIMESIZE=64 (thus fixing the
     aforementioned bug in this build configuration).

Different than laid out on the Y2038 Proofness Design [1], the
'utmp.trans' strategy is not used.  Instead:

  - New file names are defined for _PATH_UTMP, _PATH_WTMP, and
    _PATH_UTMP_DB (if applicable) and used as default for the new 2.34
    utmp{x} symbols.

  - The new utmp{x} symbols read/write 64-bit time_t entries as default.
    However if the old _PATH_UTMP or _PATH_WTMP is passed on
    utm{x}pname or updwtmp, the implementation read 32-bit utmp{x}
    entries and convert it to 64-bit ones.

  - The compat symbols read/write 32-bit time_t entries as default.
    If the default _PATH_UTMP or _PATH_WTMP is passed on
    utm{x}pname or updwtmp, the implementation reads 64-bit entries
    and convert to 32-bit ones.

The idea is not to maintain multiple databases with different formats
(which has underlying issues due to complexity, how to handle entries
that might overflow, and increases the security surface of BZ#24492),
but rather to move new application to use y2038 entries (which currently
affects 64-bit architecture as well, modulo s390).

If required the system might provide a tool to convert the old format
to newer one by opening the old file with utmpname and copying the
entries to the new format with updwtmp.

Also, for new 64-bit databases the path is not redirected to use the
utmpx one depending of the file existance (utmp_file_name_time32).
This is undocumented behavior most likely added be compatible with
Solaris (which defines different utmp dabases for utmpx files).

The s390 is an outlier: the 31-bit ABI added 64-bit time support on
GLIBC 2.8 and 64-bit has support since its inclusion.  The s390 ABI
follows the above design, but with a different ABI base version
(2.8 vs 2.34). The s390x instead does not have support to read/write
32-bit registers and does not provide compat symbols.

Checked on x86_64-linux-gnu and i686-linux-gnu.

[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#utmp_types_and_APIs
---
 bits/types/struct_utmp.h                      |  12 +-
 bits/types/struct_utmpx.h                     |  11 +-
 include/utmp.h                                |   5 +-
 login/Makefile                                |   9 +-
 login/Versions                                |  24 +
 login/getutent.c                              |   7 +-
 login/getutent_r.c                            |  48 +-
 login/getutid.c                               |   7 +-
 login/getutid_r.c                             |  33 +-
 login/getutline.c                             |   7 +-
 login/getutline_r.c                           |  33 +-
 login/getutmp.c                               |  10 +-
 login/getutxent.c                             |   9 +-
 login/getutxid.c                              |   9 +-
 login/getutxline.c                            |   9 +-
 login/login.c                                 |  10 +-
 .../linux/s390/s390-32 => login}/login32.c    |  16 +-
 login/pututxline.c                            |   9 +-
 login/tst-utmp-default.c                      | 292 +++++++++++
 .../tst-utmp-default.script                   |  10 +
 login/tst-utmp32.c                            | 318 ++++++++++++
 login/tst-utmp32.root/tst-utmp32.script       |   7 +
 login/updwtmp.c                               |  25 +-
 login/updwtmpx.c                              |   9 +-
 .../utmp-convert.h => login/utmp-convert.c    |  59 +--
 .../getutent.c => login/utmp-convert.h        |  28 +-
 login/utmp-path.h                             |   2 +-
 login/utmp-private.h                          |  24 +-
 login/utmp32.c                                | 247 ++++++++++
 .../linux/s390/s390-32 => login}/utmp32.h     |   9 +
 login/utmp_file.c                             | 459 +++++++++++-------
 login/utmpname.c                              |   8 +
 login/utmpx32.c                               | 112 +++++
 .../linux/s390/s390-32 => login}/utmpx32.h    |   6 +-
 sysdeps/generic/paths.h                       |   7 +-
 sysdeps/generic/utmp-compat.h                 |   3 +
 sysdeps/mach/hurd/i386/libc.abilist           |  15 +
 sysdeps/mach/hurd/i386/libutil.abilist        |   1 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  15 +
 .../unix/sysv/linux/aarch64/libutil.abilist   |   1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  15 +
 sysdeps/unix/sysv/linux/alpha/libutil.abilist |   1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      |  15 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist   |   1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  15 +
 .../unix/sysv/linux/arm/be/libutil.abilist    |   1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  15 +
 .../unix/sysv/linux/arm/le/libutil.abilist    |   1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  15 +
 sysdeps/unix/sysv/linux/csky/libutil.abilist  |   1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  15 +
 sysdeps/unix/sysv/linux/hppa/libutil.abilist  |   1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  15 +
 sysdeps/unix/sysv/linux/i386/libutil.abilist  |   1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |  15 +
 sysdeps/unix/sysv/linux/ia64/libutil.abilist  |   1 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |  15 +
 .../sysv/linux/m68k/coldfire/libutil.abilist  |   1 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  15 +
 .../sysv/linux/m68k/m680x0/libutil.abilist    |   1 +
 .../sysv/linux/microblaze/be/libc.abilist     |  15 +
 .../sysv/linux/microblaze/be/libutil.abilist  |   1 +
 .../sysv/linux/microblaze/le/libc.abilist     |  15 +
 .../sysv/linux/microblaze/le/libutil.abilist  |   1 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  15 +
 .../sysv/linux/mips/mips32/libutil.abilist    |   1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  15 +
 .../sysv/linux/mips/mips64/libutil.abilist    |   1 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  15 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  15 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  15 +
 sysdeps/unix/sysv/linux/nios2/libutil.abilist |   1 +
 sysdeps/unix/sysv/linux/paths.h               |   5 +-
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  15 +
 .../linux/powerpc/powerpc32/libutil.abilist   |   1 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  15 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |  15 +
 .../powerpc/powerpc64/be/libutil.abilist      |   1 +
 .../linux/powerpc/powerpc64/le/libc.abilist   |  15 +
 .../powerpc/powerpc64/le/libutil.abilist      |   1 +
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |  15 +
 .../sysv/linux/riscv/rv32/libutil.abilist     |   1 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  15 +
 .../sysv/linux/riscv/rv64/libutil.abilist     |   1 +
 .../unix/sysv/linux/s390/s390-32/getutent_r.c |  38 --
 .../unix/sysv/linux/s390/s390-32/getutid.c    |  32 --
 .../unix/sysv/linux/s390/s390-32/getutid_r.c  |  35 --
 .../unix/sysv/linux/s390/s390-32/getutline.c  |  32 --
 .../sysv/linux/s390/s390-32/getutline_r.c     |  34 --
 .../unix/sysv/linux/s390/s390-32/getutmp.c    |  30 --
 .../unix/sysv/linux/s390/s390-32/getutxent.c  |  30 --
 .../unix/sysv/linux/s390/s390-32/getutxid.c   |  30 --
 .../unix/sysv/linux/s390/s390-32/getutxline.c |  30 --
 sysdeps/unix/sysv/linux/s390/s390-32/login.c  |  35 --
 .../unix/sysv/linux/s390/s390-32/pututxline.c |  30 --
 .../unix/sysv/linux/s390/s390-32/updwtmp.c    |  32 --
 .../unix/sysv/linux/s390/s390-32/updwtmpx.c   |  30 --
 .../sysv/linux/s390/s390-32/utmp-compat.h     |   2 +-
 sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c | 184 -------
 .../sysv/linux/s390/s390-32/utmpx-convert.h   |  85 ----
 .../unix/sysv/linux/s390/s390-32/utmpx32.c    | 139 ------
 .../sysv/linux/s390/s390-64/utmp-compat.h     |   3 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  15 +
 sysdeps/unix/sysv/linux/sh/be/libutil.abilist |   1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  15 +
 sysdeps/unix/sysv/linux/sh/le/libutil.abilist |   1 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  15 +
 .../sysv/linux/sparc/sparc32/libutil.abilist  |   1 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |  15 +
 .../sysv/linux/sparc/sparc64/libutil.abilist  |   1 +
 sysdeps/unix/sysv/linux/utmp-path.h           |   3 +-
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  15 +
 .../unix/sysv/linux/x86_64/64/libutil.abilist |   1 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  15 +
 .../sysv/linux/x86_64/x32/libutil.abilist     |   1 +
 115 files changed, 2108 insertions(+), 1117 deletions(-)
 rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/login32.c (72%)
 create mode 100644 login/tst-utmp-default.c
 create mode 100644 login/tst-utmp-default.root/tst-utmp-default.script
 create mode 100644 login/tst-utmp32.c
 create mode 100644 login/tst-utmp32.root/tst-utmp32.script
 rename sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h => login/utmp-convert.c (58%)
 rename sysdeps/unix/sysv/linux/s390/s390-32/getutent.c => login/utmp-convert.h (59%)
 create mode 100644 login/utmp32.c
 rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/utmp32.h (78%)
 create mode 100644 login/utmpx32.c
 rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/utmpx32.h (93%)
 create mode 100644 sysdeps/generic/utmp-compat.h
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutid.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutline.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/login.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h

diff --git a/bits/types/struct_utmp.h b/bits/types/struct_utmp.h
index 76529ea62f..5f0d1cf822 100644
--- a/bits/types/struct_utmp.h
+++ b/bits/types/struct_utmp.h
@@ -38,18 +38,16 @@ struct utmp
 /* The ut_session and ut_tv fields must be the same size when compiled
    32- and 64-bit.  This allows data files and shared memory to be
    shared between 32- and 64-bit applications.  */
-#if __WORDSIZE_TIME64_COMPAT32
-  int32_t ut_session;		/* Session ID, used for windowing.  */
+  int64_t ut_session;		/* Session ID, used for windowing.  */
+#if __TIMESIZE != 64
   struct
   {
-    int32_t tv_sec;		/* Seconds.  */
-    int32_t tv_usec;		/* Microseconds.  */
+    int64_t tv_sec;		/* Seconds.  */
+    int64_t tv_usec;		/* Microseconds.  */
   } ut_tv;			/* Time entry was made.  */
 #else
-  long int ut_session;		/* Session ID, used for windowing.  */
   struct timeval ut_tv;		/* Time entry was made.  */
 #endif
-
   int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __glibc_reserved[20];		/* Reserved for future use.  */
+  char __glibc_reserved[8];	/* Reserved for future use.  */
 };
diff --git a/bits/types/struct_utmpx.h b/bits/types/struct_utmpx.h
index 8d6db50c06..d3be1ee1ed 100644
--- a/bits/types/struct_utmpx.h
+++ b/bits/types/struct_utmpx.h
@@ -39,17 +39,16 @@ struct utmpx
 /* The fields ut_session and ut_tv must be the same size when compiled
    32- and 64-bit.  This allows files and shared memory to be shared
    between 32- and 64-bit applications.  */
-#if __WORDSIZE_TIME64_COMPAT32
-  __int32_t ut_session;		/* Session ID, used for windowing.  */
+  __int64_t ut_session;		/* Session ID, used for windowing.  */
+#if __TIMESIZE != 64
   struct
   {
-    __int32_t tv_sec;		/* Seconds.  */
-    __int32_t tv_usec;		/* Microseconds.  */
+    __int64_t tv_sec;		/* Seconds.  */
+    __int64_t tv_usec;		/* Microseconds.  */
   } ut_tv;			/* Time entry was made.  */
 #else
-  long int ut_session;		/* Session ID, used for windowing.  */
   struct timeval ut_tv;		/* Time entry was made.  */
 #endif
   __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char __glibc_reserved[20];		/* Reserved for future use.  */
+  char __glibc_reserved[8];	/* Reserved for future use.  */
 };
diff --git a/include/utmp.h b/include/utmp.h
index 374184e9b2..7a205c13e2 100644
--- a/include/utmp.h
+++ b/include/utmp.h
@@ -9,7 +9,7 @@ libc_hidden_proto (__updwtmp)
 extern int __utmpname (const char *__file) attribute_hidden;
 extern struct utmp *__getutent (void);
 libc_hidden_proto (__getutent)
-extern void __setutent (void) attribute_hidden;
+extern void __setutent (void);
 extern void __endutent (void) attribute_hidden;
 extern struct utmp *__getutid (const struct utmp *__id);
 libc_hidden_proto (__getutid)
@@ -26,6 +26,9 @@ extern int __getutline_r (const struct utmp *__line,
 			  struct utmp *__buffer, struct utmp **__result);
 libc_hidden_proto (__getutline_r)
 
+extern void __login (const struct utmp *ut);
+hidden_proto (__login)
+
 libutil_hidden_proto (login_tty)
 
 # endif /* !_ISOMAC */
diff --git a/login/Makefile b/login/Makefile
index 5e2cb1da06..794d061604 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -31,7 +31,7 @@ headers	:= utmp.h bits/utmp.h lastlog.h pty.h \
 routines := getlogin getlogin_r setlogin getlogin_r_chk \
 	    getutent getutent_r getutid getutline getutid_r getutline_r \
 	    utmp_file utmpname updwtmp getpt grantpt unlockpt ptsname \
-	    ptsname_r_chk
+	    ptsname_r_chk utmp32 utmpx32 utmp-convert
 
 CFLAGS-grantpt.c += -DLIBEXECDIR='"$(libexecdir)"'
 
@@ -49,11 +49,16 @@ vpath %.c programs
 tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
   tst-pututxline-lockfail tst-pututxline-cache
 
+ifeq ($(have-GLIBC_2.33),yes)
+tests-container-internal := tst-utmp32
+tests-container := tst-utmp-default
+endif
+
 # Build the -lutil library with these extra functions.
 extra-libs      := libutil
 extra-libs-others := $(extra-libs)
 
-libutil-routines:= login login_tty logout logwtmp openpty forkpty
+libutil-routines:= login login_tty logout logwtmp openpty forkpty login32
 
 include ../Rules
 
diff --git a/login/Versions b/login/Versions
index 475fcf063f..d28ecdca9f 100644
--- a/login/Versions
+++ b/login/Versions
@@ -45,10 +45,34 @@ libc {
     __getlogin_r_chk;
     __ptsname_r_chk;
   }
+  GLIBC_2.34 {
+    getutent;
+    getutent_r;
+    getutid;
+    getutid_r;
+    getutline;
+    getutline_r;
+    getutmp;
+    getutmpx;
+    getutxent;
+    getutxid;
+    getutxline;
+    pututline;
+    pututxline;
+    updwtmp;
+    updwtmpx;
+  }
+  GLIBC_PRIVATE {
+    # Used on compat login from libutil.
+    __utmp_convert32to64;
+  }
 }
 
 libutil {
   GLIBC_2.0 {
     forkpty; login; login_tty; logout; logwtmp; openpty;
   }
+  GLIBC_2.34 {
+    login;
+  }
 }
diff --git a/login/getutent.c b/login/getutent.c
index c2428bfb3e..57cbe76506 100644
--- a/login/getutent.c
+++ b/login/getutent.c
@@ -18,7 +18,8 @@
 
 #include <stdlib.h>
 #include <utmp.h>
-
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 /* Local buffer to store the result.  */
 libc_freeres_ptr (static struct utmp *buffer);
@@ -42,4 +43,8 @@ __getutent (void)
   return result;
 }
 libc_hidden_def (__getutent)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutent, getutent, UTMP_COMPAT_BASE);
+#else
 weak_alias (__getutent, getutent)
+#endif
diff --git a/login/getutent_r.c b/login/getutent_r.c
index 0af48acec8..72e9e0d070 100644
--- a/login/getutent_r.c
+++ b/login/getutent_r.c
@@ -20,8 +20,11 @@
 #include <libc-lock.h>
 #include <stdlib.h>
 #include <utmp.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
+#include <utmp-private.h>
+#include <utmp-convert.h>
 
-#include "utmp-private.h"
 
 /* We need to protect the opening of the file.  */
 __libc_lock_define_initialized (, __libc_utmp_lock attribute_hidden)
@@ -32,7 +35,12 @@ __setutent (void)
 {
   __libc_lock_lock (__libc_utmp_lock);
 
-  __libc_setutent ();
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+  if (__libc_utmpname_mode == UTMPNAME_TIME32)
+    __libc_setutent32 ();
+  else
+#endif
+    __libc_setutent ();
 
   __libc_lock_unlock (__libc_utmp_lock);
 }
@@ -46,14 +54,32 @@ __getutent_r (struct utmp *buffer, struct utmp **result)
 
   __libc_lock_lock (__libc_utmp_lock);
 
-  retval = __libc_getutent_r (buffer, result);
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+  if (__libc_utmpname_mode == UTMPNAME_TIME32)
+    {
+      struct utmp32 out32;
+      struct utmp32 *out32p;
+      retval = __libc_getutent32_r (&out32, &out32p);
+      if (retval == 0)
+	{
+	  __utmp_convert32to64 (out32p, buffer);
+	  *result = buffer;
+	}
+    }
+  else
+#endif
+    retval = __libc_getutent_r (buffer, result);
 
   __libc_lock_unlock (__libc_utmp_lock);
 
   return retval;
 }
 libc_hidden_def (__getutent_r)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutent_r, getutent_r, UTMP_COMPAT_BASE);
+#else
 weak_alias (__getutent_r, getutent_r)
+#endif
 
 
 struct utmp *
@@ -63,14 +89,28 @@ __pututline (const struct utmp *data)
 
   __libc_lock_lock (__libc_utmp_lock);
 
-  buffer = __libc_pututline (data);
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+  if (__libc_utmpname_mode == UTMPNAME_TIME32)
+    {
+      struct utmp32 in32;
+      __utmp_convert64to32 (data, &in32);
+      struct utmp32 *out32p = __libc_pututline32 (&in32);
+      buffer = out32p != NULL ? (struct utmp *) data : NULL;
+    }
+  else
+#endif
+    buffer = __libc_pututline (data);
 
   __libc_lock_unlock (__libc_utmp_lock);
 
   return buffer;
 }
 libc_hidden_def (__pututline)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __pututline, pututline, UTMP_COMPAT_BASE);
+#else
 weak_alias (__pututline, pututline)
+#endif
 
 
 void
diff --git a/login/getutid.c b/login/getutid.c
index d986b9d892..ace3e840b7 100644
--- a/login/getutid.c
+++ b/login/getutid.c
@@ -18,7 +18,8 @@
 
 #include <stdlib.h>
 #include <utmp.h>
-
+#include <shlib-compat.h>
+#include <utmp-compat.h>
 
 /* Local buffer to store the result.  */
 libc_freeres_ptr (static struct utmp *buffer);
@@ -40,4 +41,8 @@ __getutid (const struct utmp *id)
   return result;
 }
 libc_hidden_def (__getutid)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutid, getutid, UTMP_COMPAT_BASE);
+#else
 weak_alias (__getutid, getutid)
+#endif
diff --git a/login/getutid_r.c b/login/getutid_r.c
index 68f40a6e24..f763a0f748 100644
--- a/login/getutid_r.c
+++ b/login/getutid_r.c
@@ -21,9 +21,10 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <utmp.h>
-
-#include "utmp-private.h"
-
+#include <utmp-compat.h>
+#include <shlib-compat.h>
+#include <utmp-private.h>
+#include <utmp-convert.h>
 
 /* We have to use the lock in getutent_r.c.  */
 __libc_lock_define (extern, __libc_utmp_lock attribute_hidden)
@@ -48,11 +49,35 @@ __getutid_r (const struct utmp *id, struct utmp *buffer, struct utmp **result)
 
   __libc_lock_lock (__libc_utmp_lock);
 
-  retval = __libc_getutid_r (id, buffer, result);
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+  if (__libc_utmpname_mode == UTMPNAME_TIME32)
+    {
+      struct utmp32 in32;
+      struct utmp32 out32;
+      struct utmp32 *out32p;
+
+      __utmp_convert64to32 (id, &in32);
+
+      retval =  __libc_getutid32_r (&in32, &out32, &out32p);
+      if (retval == 0)
+	{
+	  __utmp_convert32to64 (out32p, buffer);
+	  *result = buffer;
+	}
+      else
+	*result = NULL;
+    }
+  else
+#endif
+    retval = __libc_getutid_r (id, buffer, result);
 
   __libc_lock_unlock (__libc_utmp_lock);
 
   return retval;
 }
 libc_hidden_def (__getutid_r)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutid_r, getutid_r, UTMP_COMPAT_BASE);
+#else
 weak_alias (__getutid_r, getutid_r)
+#endif
diff --git a/login/getutline.c b/login/getutline.c
index 2c8320c9a9..59a56d1ff8 100644
--- a/login/getutline.c
+++ b/login/getutline.c
@@ -18,7 +18,8 @@
 
 #include <stdlib.h>
 #include <utmp.h>
-
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 /* Local buffer to store the result.  */
 libc_freeres_ptr (static struct utmp *buffer);
@@ -41,4 +42,8 @@ __getutline (const struct utmp *line)
   return result;
 }
 libc_hidden_def (__getutline)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutline, getutline, UTMP_COMPAT_BASE);
+#else
 weak_alias (__getutline, getutline)
+#endif
diff --git a/login/getutline_r.c b/login/getutline_r.c
index 39b8a5830f..0f04f9eaa0 100644
--- a/login/getutline_r.c
+++ b/login/getutline_r.c
@@ -20,9 +20,10 @@
 #include <errno.h>
 #include <libc-lock.h>
 #include <utmp.h>
-
-#include "utmp-private.h"
-
+#include <utmp-compat.h>
+#include <shlib-compat.h>
+#include <utmp-private.h>
+#include <utmp-convert.h>
 
 /* We have to use the lock in getutent_r.c.  */
 __libc_lock_define (extern, __libc_utmp_lock attribute_hidden)
@@ -36,11 +37,35 @@ __getutline_r (const struct utmp *line, struct utmp *buffer,
 
   __libc_lock_lock (__libc_utmp_lock);
 
-  retval = __libc_getutline_r (line, buffer, result);
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+  if (__libc_utmpname_mode == UTMPNAME_TIME32)
+   {
+      struct utmp32 in32;
+      struct utmp32 out32;
+      struct utmp32 *out32p;
+
+      __utmp_convert64to32 (line, &in32);
+
+      retval =  __libc_getutline32_r (&in32, &out32, &out32p);
+      if (retval == 0)
+	{
+	  __utmp_convert32to64 (out32p, buffer);
+	  *result = buffer;
+	}
+      else
+	*result = NULL;
+    }
+  else
+#endif
+    retval = __libc_getutline_r (line, buffer, result);
 
   __libc_lock_unlock (__libc_utmp_lock);
 
   return retval;
 }
 libc_hidden_def (__getutline_r)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutline_r, getutline_r, UTMP_COMPAT_BASE);
+#else
 weak_alias (__getutline_r, getutline_r)
+#endif
diff --git a/login/getutmp.c b/login/getutmp.c
index 60aafb5067..f2873cc9cd 100644
--- a/login/getutmp.c
+++ b/login/getutmp.c
@@ -21,6 +21,8 @@
 #define getutmpx __redirect_getutmpx
 #include <utmpx.h>
 #undef getutmpx
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 #define CHECK_SIZE_AND_OFFSET(field) \
   _Static_assert (sizeof ((struct utmp){0}.field)		\
@@ -59,5 +61,11 @@ __getutmp (const struct utmpx *utmpx, struct utmp *utmp)
   utmp->ut_tv.tv_usec = utmpx->ut_tv.tv_usec;
 }
 
-weak_alias (__getutmp, getutmp)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutmp, getutmp, UTMP_COMPAT_BASE);
+strong_alias (__getutmp, __getutmpx)
+versioned_symbol (libc, __getutmpx, getutmpx, UTMP_COMPAT_BASE);
+#else
+strong_alias (__getutmp, getutmp)
 strong_alias (__getutmp, getutmpx)
+#endif
diff --git a/login/getutxent.c b/login/getutxent.c
index a6794bac70..bd5a62b5fe 100644
--- a/login/getutxent.c
+++ b/login/getutxent.c
@@ -18,9 +18,16 @@
 
 #include <utmp.h>
 #include <utmpx.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 struct utmpx *
-getutxent (void)
+__getutxent (void)
 {
   return (struct utmpx *) __getutent ();
 }
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutxent, getutxent, UTMP_COMPAT_BASE);
+#else
+weak_alias (__getutxent, getutxent)
+#endif
diff --git a/login/getutxid.c b/login/getutxid.c
index ae3b9fe7b0..ec33512eb4 100644
--- a/login/getutxid.c
+++ b/login/getutxid.c
@@ -18,9 +18,16 @@
 
 #include <utmp.h>
 #include <utmpx.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 struct utmpx *
-getutxid (const struct utmpx *id)
+__getutxid (const struct utmpx *id)
 {
   return (struct utmpx *) __getutid ((const struct utmp *) id);
 }
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutxid, getutxid, UTMP_COMPAT_BASE);
+#else
+weak_alias (__getutxid, getutxid)
+#endif
diff --git a/login/getutxline.c b/login/getutxline.c
index 274716bf7a..6baac67fc3 100644
--- a/login/getutxline.c
+++ b/login/getutxline.c
@@ -18,9 +18,16 @@
 
 #include <utmp.h>
 #include <utmpx.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 struct utmpx *
-getutxline (const struct utmpx *line)
+__getutxline (const struct utmpx *line)
 {
   return (struct utmpx *) __getutline ((const struct utmp *) line);
 }
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __getutxline, getutxline, UTMP_COMPAT_BASE);
+#else
+weak_alias (__getutxline, getutxline)
+#endif
diff --git a/login/login.c b/login/login.c
index d280c13f1f..56cbf37dfe 100644
--- a/login/login.c
+++ b/login/login.c
@@ -23,6 +23,8 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <utmp.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 
 /* Return the result of ttyname in the buffer pointed to by TTY, which should
@@ -78,7 +80,7 @@ tty_name (int fd, char **tty, size_t buf_len)
 }
 \f
 void
-login (const struct utmp *ut)
+__login (const struct utmp *ut)
 {
 #ifdef PATH_MAX
   char _tty[PATH_MAX + UT_LINESIZE];
@@ -137,3 +139,9 @@ login (const struct utmp *ut)
   /* Update the WTMP file.  Here we have to add a new entry.  */
   updwtmp (_PATH_WTMP, &copy);
 }
+hidden_def (__login)
+#if SHLIB_COMPAT(libutil, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libutil, __login, login, UTMP_COMPAT_BASE);
+#else
+weak_alias (__login, login)
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/login32.c b/login/login32.c
similarity index 72%
rename from sysdeps/unix/sysv/linux/s390/s390-32/login32.c
rename to login/login32.c
index 45419bc092..29fd77d566 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/login32.c
+++ b/login/login32.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
+/* Write utmp and wtmp entries, 32-bit time compat version.
+   Copyright (C) 2008-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
@@ -16,21 +16,23 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <sys/types.h>
 #include <utmp.h>
-#include <libc-symbols.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 #include "utmp32.h"
 #include "utmp-convert.h"
 
+#if SHLIB_COMPAT(libutil, GLIBC_2_0, UTMP_COMPAT_BASE)
 /* Write the given entry into utmp and wtmp.  */
 void
 login32 (const struct utmp32 *entry)
 {
   struct utmp in64;
 
-  utmp_convert32to64 (entry, &in64);
-  login (&in64);
+  __utmp_convert32to64 (entry, &in64);
+  __login (&in64);
 }
 
-symbol_version (login32, login, GLIBC_2.0);
+compat_symbol (libutil, login32, login, GLIBC_2_0);
+#endif
diff --git a/login/pututxline.c b/login/pututxline.c
index 8b38f1fd97..2b49dfe767 100644
--- a/login/pututxline.c
+++ b/login/pututxline.c
@@ -18,9 +18,16 @@
 
 #include <utmp.h>
 #include <utmpx.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 struct utmpx *
-pututxline (const struct utmpx *utmpx)
+__pututxline (const struct utmpx *utmpx)
 {
   return (struct utmpx *) __pututline ((const struct utmp *) utmpx);
 }
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __pututxline, pututxline, UTMP_COMPAT_BASE);
+#else
+weak_alias (__pututxline, pututxline)
+#endif
diff --git a/login/tst-utmp-default.c b/login/tst-utmp-default.c
new file mode 100644
index 0000000000..5cc997f97d
--- /dev/null
+++ b/login/tst-utmp-default.c
@@ -0,0 +1,292 @@
+/* Tests for UTMP functions using default and old UTMP_FILE.
+   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 <stdlib.h>
+#include <string.h>
+#include <utmp.h>
+
+#include <support/check.h>
+#include <support/temp_file.h>
+
+/* The default utmp{x} functions read and write the exported 64-bit time_t
+   utmp/utmpx struct as default with the only exception when the old
+   UTMP_FILE ('/var/run/utmp') or WUTMP_FILE ('/var/run/wtmp') is set
+   explicitly with utmpname or updwtmp.  In this case old 32-bit time_t
+   entries are read / write instead.  */
+
+static struct utmp entry[] =
+{
+#define UT(a)  .ut_tv = { .tv_sec = (a)}
+
+  { .ut_type = BOOT_TIME, .ut_pid = 1, UT(1000) },
+  { .ut_type = RUN_LVL, .ut_pid = 1, UT(2000) },
+  { .ut_type = INIT_PROCESS, .ut_pid = 5, .ut_id = "si", UT(3000) },
+  { .ut_type = LOGIN_PROCESS, .ut_pid = 23, .ut_line = "tty1", .ut_id = "1",
+    .ut_user = "LOGIN", UT(4000) },
+  { .ut_type = USER_PROCESS, .ut_pid = 24, .ut_line = "tty2", .ut_id = "2",
+    .ut_user = "albert", UT(8000) },
+  { .ut_type = USER_PROCESS, .ut_pid = 196, .ut_line = "ttyp0", .ut_id = "p0",
+    .ut_user = "niels", UT(10000) },
+  { .ut_type = DEAD_PROCESS, .ut_line = "ttyp1", .ut_id = "p1", UT(16000) },
+  { .ut_type = EMPTY },
+  { .ut_type = EMPTY }
+};
+const size_t entry_size = sizeof (entry) / sizeof (entry[0]);
+
+static time_t entry_time = 20000;
+static pid_t entry_pid = 234;
+
+static void
+compare_utmp (const struct utmp *left, const struct utmp *right)
+{
+  TEST_COMPARE (left->ut_type, right->ut_type);
+  TEST_COMPARE (left->ut_pid, right->ut_pid);
+  TEST_COMPARE_BLOB (left->ut_line, sizeof (left->ut_line),
+		     right->ut_line, sizeof (right->ut_line));
+  TEST_COMPARE_BLOB (left->ut_id, sizeof (left->ut_id),
+		     right->ut_id, sizeof (right->ut_id));
+  TEST_COMPARE_BLOB (left->ut_user, sizeof (left->ut_user),
+		     right->ut_user, sizeof (right->ut_user));
+  TEST_COMPARE_BLOB (left->ut_host, sizeof (left->ut_host),
+		     right->ut_host, sizeof (right->ut_host));
+  TEST_COMPARE (left->ut_exit.e_termination, right->ut_exit.e_termination);
+  TEST_COMPARE (left->ut_exit.e_exit, right->ut_exit.e_exit);
+  TEST_COMPARE (left->ut_tv.tv_sec, right->ut_tv.tv_sec);
+  TEST_COMPARE (left->ut_tv.tv_usec, right->ut_tv.tv_usec);
+  TEST_COMPARE_BLOB (left->ut_addr_v6, sizeof (left->ut_addr_v6),
+		     right->ut_addr_v6, sizeof (right->ut_addr_v6));
+}
+
+static void
+do_init (void)
+{
+  setutent ();
+
+  for (int n = 0; n < entry_size; n++)
+    TEST_VERIFY (pututline (&entry[n]) != NULL);
+
+  endutent ();
+}
+
+static void
+do_check (void)
+{
+  struct utmp *ut;
+  int n;
+
+  setutent ();
+
+  n = 0;
+  while ((ut = getutent ()))
+    {
+      TEST_VERIFY (n <= entry_size);
+      compare_utmp (ut, &entry[n]);
+      n++;
+    }
+  TEST_COMPARE (n, entry_size);
+
+  endutent ();
+}
+
+static void
+simulate_login (const char *line, const char *user)
+{
+  for (int n = 0; n < entry_size; n++)
+    {
+      if (strcmp (line, entry[n].ut_line) == 0
+	  || entry[n].ut_type == DEAD_PROCESS)
+	{
+	  if (entry[n].ut_pid == DEAD_PROCESS)
+	    entry[n].ut_pid = (entry_pid += 27);
+	  entry[n].ut_type = USER_PROCESS;
+	  strncpy (entry[n].ut_user, user, sizeof (entry[n].ut_user));
+	  entry[n].ut_tv.tv_sec = (entry_time += 1000);
+	  setutent ();
+
+	  TEST_VERIFY (pututline (&entry[n]) != NULL);
+
+	  endutent ();
+
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("no entries available");
+}
+
+static void
+simulate_logout (const char *line)
+{
+  int n;
+
+  for (n = 0; n < entry_size; n++)
+    {
+      if (strcmp (line, entry[n].ut_line) == 0)
+	{
+	  entry[n].ut_type = DEAD_PROCESS;
+	  strncpy (entry[n].ut_user, "", sizeof (entry[n].ut_user));
+          entry[n].ut_tv.tv_sec = (entry_time += 1000);
+	  setutent ();
+
+	  TEST_VERIFY (pututline (&entry[n]) != NULL);
+
+	  endutent ();
+
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("no entries available");
+}
+
+static void
+check_login (const char *line)
+{
+  struct utmp *up;
+  struct utmp ut;
+
+  setutent ();
+
+  strcpy (ut.ut_line, line);
+  up = getutline (&ut);
+  TEST_VERIFY (up != NULL);
+
+  endutent ();
+
+  for (int n = 0; n < entry_size; n++)
+    {
+      if (strcmp (line, entry[n].ut_line) == 0)
+	{
+	  compare_utmp (up, &entry[n]);
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("bogus entry for line `%s'", line);
+}
+
+static void
+check_logout (const char *line)
+{
+  struct utmp ut;
+
+  setutent ();
+
+  strcpy (ut.ut_line, line);
+  TEST_VERIFY (getutline (&ut) == NULL);
+
+  endutent ();
+}
+
+static void
+check_id (const char *id)
+{
+  struct utmp *up;
+  struct utmp ut;
+
+  setutent ();
+
+  ut.ut_type = USER_PROCESS;
+  strcpy (ut.ut_id, id);
+  up = getutid (&ut);
+  TEST_VERIFY (up != NULL);
+
+  endutent ();
+
+  for (int n = 0; n < entry_size; n++)
+    {
+      if (strcmp (id, entry[n].ut_id) == 0)
+	{
+	  compare_utmp (up, &entry[n]);
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("bogus entry for ID `%s'", id);
+}
+
+static void
+check_type (int type)
+{
+  struct utmp *up;
+  struct utmp ut;
+  int n;
+
+  setutent ();
+
+  ut.ut_type = type;
+  up = getutid (&ut);
+  TEST_VERIFY (up != NULL);
+
+  endutent ();
+
+  for (n = 0; n < entry_size; n++)
+    {
+      if (type == entry[n].ut_type)
+	{
+	  compare_utmp (up, &entry[n]);
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("bogus entry for type `%d'", type);
+}
+
+static void
+run_test (void)
+{
+  do_init ();
+  do_check ();
+
+  simulate_login ("tty1", "erwin");
+  do_check ();
+
+  simulate_login ("ttyp1", "paul");
+  do_check ();
+
+  simulate_logout ("tty2");
+  do_check ();
+
+  simulate_logout ("ttyp0");
+  do_check ();
+
+  simulate_login ("ttyp2", "richard");
+  do_check ();
+
+  check_login ("tty1");
+  check_logout ("ttyp0");
+  check_id ("p1");
+  check_id ("2");
+  check_id ("si");
+  check_type (BOOT_TIME);
+  check_type (RUN_LVL);
+}
+
+static int
+do_test (void)
+{
+  utmpname (UTMP_FILE);
+  run_test ();
+
+  utmpname ("/var/run/utmp");
+  run_test ();
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/login/tst-utmp-default.root/tst-utmp-default.script b/login/tst-utmp-default.root/tst-utmp-default.script
new file mode 100644
index 0000000000..26ef984f5f
--- /dev/null
+++ b/login/tst-utmp-default.root/tst-utmp-default.script
@@ -0,0 +1,10 @@
+# We create empty UTMP_FILE and WTMP_FILE
+mkdirp 0755 /var/run
+touch  0664 /var/run/utmp.v2
+touch  0664 /var/run/wtmp.v2
+# Same for the old files as well
+touch  0664 /var/run/utmp
+touch  0664 /var/run/wtmp
+
+# Must run localedef as root to write into default paths.
+su
diff --git a/login/tst-utmp32.c b/login/tst-utmp32.c
new file mode 100644
index 0000000000..d4a356102a
--- /dev/null
+++ b/login/tst-utmp32.c
@@ -0,0 +1,318 @@
+/* Tests for UTMP compat mode.
+   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 <shlib-compat.h>
+#include <support/test-driver.h>
+#include <stdio.h>
+
+/* The test check the compat utmp/utmpx routines for the two operation modes:
+
+   1. Use the default UTMP_FILE which uses the default code path which
+      read/write 64-bit entries and converts to 32-bit time_t utmp/utmpx
+      entries.
+
+   2. Set a non default path with utmpname, which uses the compat code
+      path to read/write 32-bit time_t utmp/utmpx entries.  */
+
+#include <stdlib.h>
+#include <string.h>
+#include <utmp.h>
+
+#include <support/check.h>
+#include <support/temp_file.h>
+#include <array_length.h>
+
+#include <utmp32.h>
+
+compat_symbol_reference (libc, setutent,  setutent,  GLIBC_2_0);
+compat_symbol_reference (libc, pututline, pututline, GLIBC_2_0);
+compat_symbol_reference (libc, getutline, getutline, GLIBC_2_0);
+compat_symbol_reference (libc, getutent,  getutent,  GLIBC_2_0);
+compat_symbol_reference (libc, getutid,   getutid,   GLIBC_2_0);
+
+static struct utmp32 entry[] =
+{
+#define UT(a)  .ut_tv = { .tv_sec = (a)}
+
+  { .ut_type = BOOT_TIME, .ut_pid = 1, UT(1000) },
+  { .ut_type = RUN_LVL, .ut_pid = 1, UT(2000) },
+  { .ut_type = INIT_PROCESS, .ut_pid = 5, .ut_id = "si", UT(3000) },
+  { .ut_type = LOGIN_PROCESS, .ut_pid = 23, .ut_line = "tty1", .ut_id = "1",
+    .ut_user = "LOGIN", UT(4000) },
+  { .ut_type = USER_PROCESS, .ut_pid = 24, .ut_line = "tty2", .ut_id = "2",
+    .ut_user = "albert", UT(8000) },
+  { .ut_type = USER_PROCESS, .ut_pid = 196, .ut_line = "ttyp0", .ut_id = "p0",
+    .ut_user = "niels", UT(10000) },
+  { .ut_type = DEAD_PROCESS, .ut_line = "ttyp1", .ut_id = "p1", UT(16000) },
+  { .ut_type = EMPTY },
+  { .ut_type = EMPTY }
+};
+
+static time_t entry_time = 20000;
+static pid_t entry_pid = 234;
+
+static void
+compare_utmp32 (const struct utmp32 *left, const struct utmp32 *right)
+{
+  TEST_COMPARE (left->ut_type, right->ut_type);
+  TEST_COMPARE (left->ut_pid, right->ut_pid);
+  TEST_COMPARE_BLOB (left->ut_line, sizeof (left->ut_line),
+		     right->ut_line, sizeof (right->ut_line));
+  TEST_COMPARE_BLOB (left->ut_id, sizeof (left->ut_id),
+		     right->ut_id, sizeof (right->ut_id));
+  TEST_COMPARE_BLOB (left->ut_user, sizeof (left->ut_user),
+		     right->ut_user, sizeof (right->ut_user));
+  TEST_COMPARE_BLOB (left->ut_host, sizeof (left->ut_host),
+		     right->ut_host, sizeof (right->ut_host));
+  TEST_COMPARE (left->ut_exit.e_termination, right->ut_exit.e_termination);
+  TEST_COMPARE (left->ut_exit.e_exit, right->ut_exit.e_exit);
+  TEST_COMPARE (left->ut_tv.tv_sec, right->ut_tv.tv_sec);
+  TEST_COMPARE (left->ut_tv.tv_usec, right->ut_tv.tv_usec);
+  TEST_COMPARE_BLOB (left->ut_addr_v6, sizeof (left->ut_addr_v6),
+		     right->ut_addr_v6, sizeof (right->ut_addr_v6));
+}
+
+static void
+do_init (void)
+{
+  setutent ();
+
+  for (int n = 0; n < array_length (entry); n++)
+    TEST_VERIFY (pututline ((const struct utmp *) &entry[n]) != NULL);
+
+  endutent ();
+}
+
+static void
+do_check (void)
+{
+  int n;
+
+  setutent ();
+
+  n = 0;
+  while (1)
+    {
+      struct utmp32 *ut = (struct utmp32 *) getutent ();
+      if (ut == NULL)
+	break;
+      TEST_VERIFY (n <= array_length (entry));
+      compare_utmp32 (ut, &entry[n]);
+      n++;
+    }
+  TEST_COMPARE (n, array_length (entry));
+
+  endutent ();
+}
+
+static void
+simulate_login (const char *line, const char *user)
+{
+  for (int n = 0; n <array_length (entry); n++)
+    {
+      if (strcmp (line, entry[n].ut_line) == 0
+	  || entry[n].ut_type == DEAD_PROCESS)
+	{
+	  if (entry[n].ut_pid == DEAD_PROCESS)
+	    entry[n].ut_pid = (entry_pid += 27);
+	  entry[n].ut_type = USER_PROCESS;
+	  strncpy (entry[n].ut_user, user, sizeof (entry[n].ut_user));
+	  entry[n].ut_tv.tv_sec = (entry_time += 1000);
+	  setutent ();
+
+	  TEST_VERIFY (pututline ((const struct utmp *) &entry[n]) != NULL);
+
+	  endutent ();
+
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("no entries available");
+}
+
+static void
+simulate_logout (const char *line)
+{
+  int n;
+
+  for (n = 0; n < array_length (entry); n++)
+    {
+      if (strcmp (line, entry[n].ut_line) == 0)
+	{
+	  entry[n].ut_type = DEAD_PROCESS;
+	  strncpy (entry[n].ut_user, "", sizeof (entry[n].ut_user));
+          entry[n].ut_tv.tv_sec = (entry_time += 1000);
+	  setutent ();
+
+	  TEST_VERIFY (pututline ((const struct utmp *) &entry[n]) != NULL);
+
+	  endutent ();
+
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("no entries available");
+}
+
+static void
+check_login (const char *line)
+{
+  struct utmp32 *up;
+  struct utmp32 ut;
+
+  setutent ();
+
+  strcpy (ut.ut_line, line);
+  up = (struct utmp32 *) getutline ((const struct utmp *) &ut);
+  TEST_VERIFY (up != NULL);
+
+  endutent ();
+
+  for (int n = 0; n < array_length (entry); n++)
+    {
+      if (strcmp (line, entry[n].ut_line) == 0)
+	{
+	  compare_utmp32 (up, &entry[n]);
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("bogus entry for line `%s'", line);
+}
+
+static void
+check_logout (const char *line)
+{
+  struct utmp32 ut;
+
+  setutent ();
+
+  strcpy (ut.ut_line, line);
+  TEST_VERIFY (getutline ((const struct utmp *) &ut) == NULL);
+
+  endutent ();
+}
+
+static void
+check_id (const char *id)
+{
+  struct utmp32 *up;
+  struct utmp32 ut;
+
+  setutent ();
+
+  ut.ut_type = USER_PROCESS;
+  strcpy (ut.ut_id, id);
+  up = (struct utmp32 *) getutid ((const struct utmp *) &ut);
+  TEST_VERIFY (up != NULL);
+
+  endutent ();
+
+  for (int n = 0; n < array_length (entry); n++)
+    {
+      if (strcmp (id, entry[n].ut_id) == 0)
+	{
+	  compare_utmp32 (up, &entry[n]);
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("bogus entry for ID `%s'", id);
+}
+
+static void
+check_type (int type)
+{
+  struct utmp32 *up;
+  struct utmp32 ut;
+  int n;
+
+  setutent ();
+
+  ut.ut_type = type;
+  up = (struct utmp32 *) getutid ((const struct utmp *) &ut);
+  TEST_VERIFY (up != NULL);
+
+  endutent ();
+
+  for (n = 0; n < array_length (entry); n++)
+    {
+      if (type == entry[n].ut_type)
+	{
+	  compare_utmp32 (up, &entry[n]);
+	  return;
+	}
+    }
+
+  FAIL_EXIT1 ("bogus entry for type `%d'", type);
+}
+
+static char *name;
+
+static void
+do_prepare (int argc, char **argv)
+{
+  int fd = create_temp_file ("tst-utmp32.", &name);
+  TEST_VERIFY_EXIT (fd != -1);
+}
+#define PREPARE do_prepare
+
+static void
+run_test (void)
+{
+  do_init ();
+  do_check ();
+
+  simulate_login ("tty1", "erwin");
+  do_check ();
+
+  simulate_login ("ttyp1", "paul");
+  do_check ();
+
+  simulate_logout ("tty2");
+  do_check ();
+
+  simulate_logout ("ttyp0");
+  do_check ();
+
+  simulate_login ("ttyp2", "richard");
+  do_check ();
+
+  check_login ("tty1");
+  check_logout ("ttyp0");
+  check_id ("p1");
+  check_id ("2");
+  check_id ("si");
+  check_type (BOOT_TIME);
+  check_type (RUN_LVL);
+}
+
+static int
+do_test (void)
+{
+  run_test ();
+
+  utmpname (name);
+  run_test ();
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/login/tst-utmp32.root/tst-utmp32.script b/login/tst-utmp32.root/tst-utmp32.script
new file mode 100644
index 0000000000..4aadc63335
--- /dev/null
+++ b/login/tst-utmp32.root/tst-utmp32.script
@@ -0,0 +1,7 @@
+# We create empty UTMP_FILE and WTMP_FILE
+mkdirp 0755 /var/run
+touch  0664 /var/run/utmp.v2
+touch  0664 /var/run/wtmp.v2
+
+# Must run localedef as root to write into default paths.
+su
diff --git a/login/updwtmp.c b/login/updwtmp.c
index e67a9cf2d9..e61d933aa3 100644
--- a/login/updwtmp.c
+++ b/login/updwtmp.c
@@ -19,16 +19,31 @@
 #include <utmp.h>
 #include <string.h>
 #include <unistd.h>
-
-#include "utmp-private.h"
+#include <utmp-private.h>
 #include <utmp-path.h>
+#include <utmp-compat.h>
+#include <utmp-convert.h>
+#include <shlib-compat.h>
 
 void
 __updwtmp (const char *wtmp_file, const struct utmp *utmp)
 {
-  const char *file_name = utmp_file_name_time32 (wtmp_file);
-
-  __libc_updwtmp (file_name, utmp);
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+  if (strcmp (wtmp_file, _PATH_WTMP_BASE) == 0
+      || strcmp (wtmp_file, _PATH_WTMP_BASE) == 0)
+    {
+      const char *file_name = utmp_file_name_time32 (wtmp_file);
+      struct utmp32 in32;
+      __utmp_convert64to32 (utmp, &in32);
+      __libc_updwtmp32 (file_name, &in32);
+    }
+  else
+#endif
+    __libc_updwtmp (wtmp_file, utmp);
 }
 libc_hidden_def (__updwtmp)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __updwtmp, updwtmp, UTMP_COMPAT_BASE);
+#else
 weak_alias (__updwtmp, updwtmp)
+#endif
diff --git a/login/updwtmpx.c b/login/updwtmpx.c
index ba06645dfd..93c3fd3f2d 100644
--- a/login/updwtmpx.c
+++ b/login/updwtmpx.c
@@ -18,9 +18,16 @@
 
 #include <utmp.h>
 #include <utmpx.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 void
-updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
+__updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
 {
   __updwtmp (wtmpx_file, (const struct utmp *) utmpx);
 }
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+versioned_symbol (libc, __updwtmpx, updwtmpx, UTMP_COMPAT_BASE);
+#else
+weak_alias (__updwtmpx, updwtmpx)
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h b/login/utmp-convert.c
similarity index 58%
rename from sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h
rename to login/utmp-convert.c
index 9418afb0f4..8d55ddfa4f 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h
+++ b/login/utmp-convert.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
+/* Converto to/from 64-bit to 32-bit time_t utmp/utmpx struct.
+   Copyright (C) 2008-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
@@ -16,71 +16,42 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-
-/* This file provides functions converting between the 32 and 64 bit
-   struct utmp variants.  */
-
-#ifndef _UTMP_CONVERT_H
-#define _UTMP_CONVERT_H 1
-
 #include <string.h>
-
-#include "utmp32.h"
+#include <utmp-convert.h>
 
 /* Convert the 64 bit struct utmp value in FROM to the 32 bit version
    returned in TO.  */
-static inline void
-utmp_convert64to32 (const struct utmp *from, struct utmp32 *to)
+void
+__utmp_convert64to32 (const struct utmp *from, struct utmp32 *to)
 {
-#if _HAVE_UT_TYPE - 0
   to->ut_type = from->ut_type;
-#endif
-#if _HAVE_UT_PID - 0
   to->ut_pid = from->ut_pid;
-#endif
   memcpy (to->ut_line, from->ut_line, UT_LINESIZE);
   memcpy (to->ut_user, from->ut_user, UT_NAMESIZE);
-#if _HAVE_UT_ID - 0
   memcpy (to->ut_id, from->ut_id, 4);
-#endif
-#if _HAVE_UT_HOST - 0
   memcpy (to->ut_host, from->ut_host, UT_HOSTSIZE);
-#endif
   to->ut_exit = from->ut_exit;
-  to->ut_session = (int32_t) from->ut_session;
-#if _HAVE_UT_TV - 0
-  to->ut_tv.tv_sec = (int32_t) from->ut_tv.tv_sec;
-  to->ut_tv.tv_usec = (int32_t) from->ut_tv.tv_usec;
-#endif
+  to->ut_session = from->ut_session;
+  to->ut_tv.tv_sec = from->ut_tv.tv_sec;
+  to->ut_tv.tv_usec = from->ut_tv.tv_usec;
   memcpy (to->ut_addr_v6, from->ut_addr_v6, 4 * 4);
 }
 
 /* Convert the 32 bit struct utmp value in FROM to the 64 bit version
    returned in TO.  */
-static inline void
-utmp_convert32to64 (const struct utmp32 *from, struct utmp *to)
+void
+__utmp_convert32to64 (const struct utmp32 *from, struct utmp *to)
 {
-#if _HAVE_UT_TYPE - 0
   to->ut_type = from->ut_type;
-#endif
-#if _HAVE_UT_PID - 0
   to->ut_pid = from->ut_pid;
-#endif
   memcpy (to->ut_line, from->ut_line, UT_LINESIZE);
   memcpy (to->ut_user, from->ut_user, UT_NAMESIZE);
-#if _HAVE_UT_ID - 0
   memcpy (to->ut_id, from->ut_id, 4);
-#endif
-#if _HAVE_UT_HOST - 0
   memcpy (to->ut_host, from->ut_host, UT_HOSTSIZE);
-#endif
   to->ut_exit = from->ut_exit;
-  to->ut_session = (int64_t) from->ut_session;
-#if _HAVE_UT_TV - 0
-  to->ut_tv.tv_sec = (int64_t) from->ut_tv.tv_sec;
-  to->ut_tv.tv_usec = (int64_t) from->ut_tv.tv_usec;
-#endif
-  memcpy (to->ut_addr_v6, from->ut_addr_v6, 4 * 4);
+  to->ut_session = from->ut_session;
+  to->ut_tv.tv_sec = from->ut_tv.tv_sec;
+  to->ut_tv.tv_usec = from->ut_tv.tv_usec;
+  memcpy (to->ut_addr_v6, from->ut_addr_v6, sizeof (to->ut_addr_v6));
 }
-
-#endif /* utmp-convert.h */
+libc_hidden_def (__utmp_convert32to64)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutent.c b/login/utmp-convert.h
similarity index 59%
rename from sysdeps/unix/sysv/linux/s390/s390-32/getutent.c
rename to login/utmp-convert.h
index 7774a59580..43125f249d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutent.c
+++ b/login/utmp-convert.h
@@ -16,17 +16,23 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <stdlib.h>
-#include <utmp.h>
 
-#include "utmp-compat.h"
+/* This file provides functions converting between the 32 and 64 bit
+   struct utmp variants.  */
 
-#if defined SHARED
-# undef weak_alias
-# define weak_alias(n,a)
-#endif
-#include "login/getutent.c"
+#ifndef _UTMP_CONVERT_H
+#define _UTMP_CONVERT_H 1
 
-#if defined SHARED
-default_symbol_version (__getutent, getutent, UTMP_COMPAT_BASE);
-#endif
+#include <utmp32.h>
+
+/* Convert the 64 bit struct utmp value in FROM to the 32 bit version
+   returned in TO.  */
+void __utmp_convert64to32 (const struct utmp *from, struct utmp32 *to)
+  attribute_hidden;
+
+/* Convert the 32 bit struct utmp value in FROM to the 64 bit version
+   returned in TO.  */
+void __utmp_convert32to64 (const struct utmp32 *from, struct utmp *to);
+libc_hidden_proto (__utmp_convert32to64);
+
+#endif /* utmp-convert.h */
diff --git a/login/utmp-path.h b/login/utmp-path.h
index 351a932862..27191b23a4 100644
--- a/login/utmp-path.h
+++ b/login/utmp-path.h
@@ -19,8 +19,8 @@
 #ifndef _UTMP_PATH_H
 #define _UTMP_PATH_H 1
 
-#include <string.h>
 #include <unistd.h>
+#include <string.h>
 
 /* The function returns the utmp database for 32-bit utmp{x} entries based
    on FILE_NAME.  If the argument ends with 'x' and the file does not
diff --git a/login/utmp-private.h b/login/utmp-private.h
index 00632ce51d..689ee82273 100644
--- a/login/utmp-private.h
+++ b/login/utmp-private.h
@@ -22,23 +22,43 @@
 #define _UTMP_PRIVATE_H	1
 
 #include <utmp.h>
+#include <utmp32.h>
+#include <sys/param.h>
 #include <libc-lock.h>
 
 /* These functions check for initialization, but not perform any
    locking.  */
-int __libc_setutent (void) attribute_hidden;
+void __libc_setutent (void) attribute_hidden;
+void __libc_endutent (void) attribute_hidden;
+
 int __libc_getutent_r (struct utmp *, struct utmp **) attribute_hidden;
 int __libc_getutid_r (const struct utmp *, struct utmp *, struct utmp **)
   attribute_hidden;
 int __libc_getutline_r (const struct utmp *, struct utmp *, struct utmp **)
   attribute_hidden;
 struct utmp *__libc_pututline (const struct utmp *) attribute_hidden;
-void __libc_endutent (void) attribute_hidden;
 int __libc_updwtmp (const char *, const struct utmp *) attribute_hidden;
 
+void __libc_setutent32 (void) attribute_hidden;
+int __libc_getutent32_r (struct utmp32 *, struct utmp32 **) attribute_hidden;
+int __libc_getutid32_r (const struct utmp32 *, struct utmp32 *,
+			struct utmp32 **) attribute_hidden;
+int __libc_getutline32_r (const struct utmp32 *, struct utmp32 *,
+			  struct utmp32 **) attribute_hidden;
+struct utmp32 *__libc_pututline32 (const struct utmp32 *) attribute_hidden;
+int __libc_updwtmp32 (const char *, const struct utmp32 *) attribute_hidden;
+
 /* Current file name.  */
 extern const char *__libc_utmp_file_name attribute_hidden;
 
+enum __libc_utmpname_mode_t
+{
+  UTMPNAME_TIME64,
+  UTMPNAME_TIME32,
+  UTMPNAME_UNDEF
+};
+extern enum __libc_utmpname_mode_t __libc_utmpname_mode attribute_hidden;
+
 /* Locks access to the global data.  */
 __libc_lock_define (extern, __libc_utmp_lock attribute_hidden)
 
diff --git a/login/utmp32.c b/login/utmp32.c
new file mode 100644
index 0000000000..427bd97449
--- /dev/null
+++ b/login/utmp32.c
@@ -0,0 +1,247 @@
+/* Compability symbols for utmp with 32-bit entry times.
+   Copyright (C) 2008-2020 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/types.h>
+#include <utmp.h>
+#include <errno.h>
+#include <libc-lock.h>
+
+#include <utmp32.h>
+#include <utmp-convert.h>
+#include <utmp-private.h>
+#include <utmp-path.h>
+
+#include <utmp-compat.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+
+/* The compat utmp{x} functions are used for 32-bit time_t utmp/utmpx struct
+   and they use two operation modes:
+
+   1. Read/write 64-bit utmp{x} entries and convert them to/from 32-bit utmp.
+      This is done for the exported UTMP_FILE / WUTMP_FILE
+      (__libc_utmpname_mode equal to UTMPNAME_TIME64).
+
+   2. Read/write 32-bit utmp if the target file is any other than the default
+      UTMP_FILE / WUTMP_FILE ones.
+
+   It allows maintaining the already set file format for old records, while
+   also allowing reading newer ones (which might be created with call to the
+   default utmp/utmpx symbol version).  */
+
+int
+__getutid32_r (const struct utmp32 *id, struct utmp32 *buffer,
+	       struct utmp32 **result)
+{
+  int r;
+
+  switch (id->ut_type)
+    {
+    case RUN_LVL:
+    case BOOT_TIME:
+    case OLD_TIME:
+    case NEW_TIME:
+    case INIT_PROCESS:
+    case LOGIN_PROCESS:
+    case USER_PROCESS:
+    case DEAD_PROCESS:
+      break;
+    default:
+      __set_errno (EINVAL);
+      *result = NULL;
+      return -1;
+    }
+
+  __libc_lock_lock (__libc_utmp_lock);
+
+  if (__libc_utmpname_mode == UTMPNAME_TIME64)
+   {
+      struct utmp in64;
+      struct utmp out64;
+      struct utmp *out64p;
+
+      __utmp_convert32to64 (id, &in64);
+
+      r =  __libc_getutid_r (&in64, &out64, &out64p);
+      if (r == 0)
+	{
+	  __utmp_convert64to32 (out64p, buffer);
+	  *result = buffer;
+	}
+      else
+	*result = NULL;
+    }
+  else
+    r = __libc_getutid32_r (id, buffer, result);
+
+  __libc_lock_unlock (__libc_utmp_lock);
+
+  return r;
+}
+compat_symbol (libc, __getutid32_r, getutid_r, GLIBC_2_0);
+
+struct utmp32 *
+__getutid32 (const struct utmp32 *id)
+{
+  static struct utmp32 *out32 = NULL;
+  if (out32 == NULL)
+    {
+      out32 = malloc (sizeof (struct utmp32));
+      if (out32 == NULL)
+	return NULL;
+    }
+
+  struct utmp32 *result;
+  return __getutid32_r (id, out32, &result) < 0 ? NULL : result;
+}
+compat_symbol (libc, __getutid32, getutid, GLIBC_2_0);
+
+int
+__getutline32_r (const struct utmp32 *line,
+		 struct utmp32 *buffer, struct utmp32 **result)
+{
+  int r;
+
+  __libc_lock_lock (__libc_utmp_lock);
+
+  if (__libc_utmpname_mode == UTMPNAME_TIME64)
+   {
+      struct utmp in64;
+      struct utmp out64;
+      struct utmp *out64p;
+
+      __utmp_convert32to64 (line, &in64);
+
+      r =  __libc_getutline_r (&in64, &out64, &out64p);
+      if (r == 0)
+	{
+	  __utmp_convert64to32 (out64p, buffer);
+	  *result = buffer;
+	}
+      else
+	*result = NULL;
+    }
+  else
+    r = __libc_getutline32_r (line, buffer, result);
+
+  __libc_lock_unlock (__libc_utmp_lock);
+
+  return r;
+}
+compat_symbol (libc, __getutline32_r, getutline_r, GLIBC_2_0);
+
+struct utmp32 *
+__getutline32 (const struct utmp32 *line)
+{
+  static struct utmp32 *out32 = NULL;
+  if (out32 == NULL)
+    {
+      out32 = malloc (sizeof (struct utmp32));
+      if (out32 == NULL)
+	return NULL;
+    }
+
+  struct utmp32 *result;
+  return __getutline32_r (line, out32, &result) < 0 ? NULL : result;
+}
+compat_symbol (libc, __getutline32, getutline, GLIBC_2_0);
+
+struct utmp32 *
+__pututline32 (const struct utmp32 *line)
+{
+  struct utmp32 *r;
+
+  __libc_lock_lock (__libc_utmp_lock);
+
+  if (__libc_utmpname_mode == UTMPNAME_TIME64)
+   {
+      struct utmp in64;
+      __utmp_convert32to64 (line, &in64);
+      struct utmp *out64p = __libc_pututline (&in64);
+      r = out64p != NULL ? (struct utmp32 *) line : NULL;
+    }
+  else
+    r = __libc_pututline32 (line);
+
+  __libc_lock_unlock (__libc_utmp_lock);
+
+  return r;
+}
+compat_symbol (libc, __pututline32, pututline, GLIBC_2_0);
+
+int
+__getutent32_r (struct utmp32 *buffer, struct utmp32 **result)
+{
+  int r;
+
+  __libc_lock_lock (__libc_utmp_lock);
+
+  if (__libc_utmpname_mode == UTMPNAME_TIME64)
+    {
+      struct utmp out64;
+      struct utmp *out64p;
+      r = __libc_getutent_r (&out64, &out64p);
+      if (r == 0)
+	{
+	  __utmp_convert64to32 (out64p, buffer);
+	  *result = buffer;
+	}
+    }
+  else
+    r = __libc_getutent32_r (buffer, result);
+
+  __libc_lock_unlock (__libc_utmp_lock);
+
+  return r;
+}
+compat_symbol (libc, __getutent32_r, getutent_r, GLIBC_2_0);
+
+struct utmp32 *
+__getutent32 (void)
+{
+  static struct utmp32 *out32 = NULL;
+  if (out32 == NULL)
+    {
+      out32 = malloc (sizeof (struct utmp32));
+      if (out32 == NULL)
+	return NULL;
+    }
+
+  struct utmp32 *result;
+  return __getutent32_r (out32, &result) < 0 ? NULL : result;
+}
+compat_symbol (libc, __getutent32, getutent, GLIBC_2_0);
+
+void
+__updwtmp32 (const char *wtmp_file, const struct utmp32 *utmp)
+{
+  const char *file_name = utmp_file_name_time32 (wtmp_file);
+
+  if (__libc_utmpname_mode == UTMPNAME_TIME64)
+    {
+      struct utmp in32;
+      __utmp_convert32to64 (utmp, &in32);
+      __libc_updwtmp (file_name, &in32);
+    }
+  else
+    __libc_updwtmp32 (file_name, utmp);
+}
+compat_symbol (libc, __updwtmp32, updwtmp, GLIBC_2_0);
+
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)   */
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h b/login/utmp32.h
similarity index 78%
rename from sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h
rename to login/utmp32.h
index 002b5377d6..a3440a4c73 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h
+++ b/login/utmp32.h
@@ -47,5 +47,14 @@ struct utmp32
   char __glibc_reserved[20];		/* Reserved for future use.  */
 };
 
+int __getutid32_r (const struct utmp32 *, struct utmp32 *, struct utmp32 **);
+struct utmp32 *__getutid32 (const struct utmp32 *);
+int __getutline32_r (const struct utmp32 *, struct utmp32 *,
+		     struct utmp32 **);
+struct utmp32 *__getutline32 (const struct utmp32 *line);
+struct utmp32 *__pututline32 (const struct utmp32 *line);
+int __getutent32_r (struct utmp32 *, struct utmp32 **);
+struct utmp32 *__getutent32 (void);
+void __updwtmp32 (const char *wtmp_file, const struct utmp32 *utmp);
 
 #endif  /* utmp32.h  */
diff --git a/login/utmp_file.c b/login/utmp_file.c
index 377209b26d..ee1fe51b43 100644
--- a/login/utmp_file.c
+++ b/login/utmp_file.c
@@ -17,22 +17,16 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <assert.h>
-#include <errno.h>
 #include <fcntl.h>
-#include <signal.h>
 #include <stdbool.h>
-#include <stdio.h>
 #include <string.h>
-#include <unistd.h>
-#include <utmp.h>
-#include <not-cancel.h>
-#include <kernel-features.h>
-#include <sigsetops.h>
+#include <sys/param.h>
 #include <not-cancel.h>
 
-#include "utmp-private.h"
+#include <utmp-private.h>
 #include <utmp-path.h>
+#include <utmp-compat.h>
+#include <shlib-compat.h>
 
 
 /* Descriptor for the file and position.  */
@@ -40,41 +34,91 @@ static int file_fd = -1;
 static bool file_writable;
 static off64_t file_offset;
 
+
+/* The utmp{x} internal functions work on two operations modes
+
+   1. Read/write 64-bit time utmp{x} entries using the exported
+      'struct utmp{x}'
+
+   2. Read/write 32-bit time utmp{x} entries using the old 'struct utmp32'
+
+   The operation mode mainly change the register size and how to interpret
+   the 'last_entry' buffered record.  */
+enum operation_mode_t
+{
+  UTMP_TIME64,
+  UTMP_TIME32
+};
+static enum operation_mode_t cur_mode = UTMP_TIME64;
+
+enum
+{
+  utmp_buffer_size = MAX (sizeof (struct utmp), sizeof (struct utmp32))
+};
+
 /* Cache for the last read entry.  */
-static struct utmp last_entry;
+static char last_entry[utmp_buffer_size];
+
+static inline size_t last_entry_size (enum operation_mode_t mode)
+{
+  return mode == UTMP_TIME64 ? sizeof (struct utmp) : sizeof (struct utmp32);
+}
+
+static inline short int last_entry_type (enum operation_mode_t mode)
+{
+  short int r;
+  if (mode == UTMP_TIME32)
+    memcpy (&r, last_entry + offsetof (struct utmp32, ut_type), sizeof (r));
+  else
+    memcpy (&r, last_entry + offsetof (struct utmp, ut_type), sizeof (r));
+  return r;
+}
+
+static inline const char *last_entry_id (enum operation_mode_t mode)
+{
+  if (mode == UTMP_TIME64)
+   return ((struct utmp *) (last_entry))->ut_id;
+  return ((struct utmp32 *) (last_entry))->ut_id;
+}
+
+static inline const char *last_entry_line (enum operation_mode_t mode)
+{
+  if (mode == UTMP_TIME64)
+   return ((struct utmp *) (last_entry))->ut_line;
+  return ((struct utmp32 *) (last_entry))->ut_line;
+}
 
-/* Returns true if *ENTRY matches last_entry, based on
-   data->ut_type.  */
+/* Returns true if *ENTRY matches last_entry, based on data->ut_type.  */
 static bool
-matches_last_entry (const struct utmp *data)
+matches_last_entry (enum operation_mode_t mode, short int type,
+		    const char *id, const char *line)
 {
   if (file_offset <= 0)
     /* Nothing has been read.  last_entry is stale and cannot match.  */
     return false;
 
-  if (data->ut_type == RUN_LVL
-      || data->ut_type == BOOT_TIME
-      || data->ut_type == OLD_TIME
-      || data->ut_type == NEW_TIME)
-    /* For some entry types, only a type match is required.  */
-    return data->ut_type == last_entry.ut_type;
-  else
-    /* For the process-related entries, a full match is needed.  */
-    return (data->ut_type == INIT_PROCESS
-	    || data->ut_type == LOGIN_PROCESS
-	    || data->ut_type == USER_PROCESS
-	    || data->ut_type == DEAD_PROCESS)
-      && (last_entry.ut_type == INIT_PROCESS
-	  || last_entry.ut_type == LOGIN_PROCESS
-	  || last_entry.ut_type == USER_PROCESS
-	  || last_entry.ut_type == DEAD_PROCESS)
-      && (data->ut_id[0] && last_entry.ut_id[0]
-	  ? strncmp (data->ut_id, last_entry.ut_id,
-		     sizeof last_entry.ut_id)
-	    == 0
-	  : (strncmp (data->ut_line, last_entry.ut_line,
-		      sizeof last_entry.ut_line)
-	     == 0));
+  switch (type)
+    {
+    case RUN_LVL:
+    case BOOT_TIME:
+    case OLD_TIME:
+    case NEW_TIME:
+      /* For some entry types, only a type match is required.  */
+      return type == last_entry_type (mode);
+    default:
+      /* For the process-related entries, a full match is needed.  */
+      return (type == INIT_PROCESS
+	      || type == LOGIN_PROCESS
+	      || type == USER_PROCESS
+	      || type == DEAD_PROCESS)
+	&& (last_entry_type (mode) == INIT_PROCESS
+	    || last_entry_type (mode) == LOGIN_PROCESS
+	    || last_entry_type (mode) == USER_PROCESS
+	    || last_entry_type (mode) == DEAD_PROCESS)
+	&& (id[0] != '\0' && last_entry_id (mode)[0] != '\0'
+	    ? strncmp (id, last_entry_id (mode), 4 * sizeof (char)) == 0
+	    : (strncmp (line, last_entry_id (mode), UT_LINESIZE) == 0));
+    }
 }
 
 /* Locking timeout.  */
@@ -143,33 +187,40 @@ file_unlock (int fd)
   __fcntl64_nocancel (fd, F_SETLKW, &fl);
 }
 
-int
-__libc_setutent (void)
+static bool
+internal_setutent (enum operation_mode_t mode)
 {
   if (file_fd < 0)
     {
-      const char *file_name;
-
-      file_name = utmp_file_name_time32 (__libc_utmp_file_name);
+      const char *file_name = mode == UTMP_TIME64
+	?__libc_utmp_file_name
+	: utmp_file_name_time32 (__libc_utmp_file_name);
 
       file_writable = false;
       file_fd = __open_nocancel
 	(file_name, O_RDONLY | O_LARGEFILE | O_CLOEXEC);
       if (file_fd == -1)
-	return 0;
+	return false;
+      cur_mode = mode;
     }
 
   __lseek64 (file_fd, 0, SEEK_SET);
   file_offset = 0;
 
-  return 1;
+  return true;
 }
 
 /* Preform initialization if necessary.  */
 static bool
-maybe_setutent (void)
+maybe_setutent (enum operation_mode_t mode)
 {
-  return file_fd >= 0 || __libc_setutent ();
+  if (file_fd >= 0 && cur_mode != mode)
+    {
+      __close_nocancel_nostatus (file_fd);
+      file_fd = -1;
+      file_offset = 0;
+    }
+  return file_fd >= 0 || internal_setutent (mode);
 }
 
 /* Reads the entry at file_offset, storing it in last_entry and
@@ -177,40 +228,34 @@ maybe_setutent (void)
    for EOF, and 1 for a successful read.  last_entry and file_offset
    are only updated on a successful and complete read.  */
 static ssize_t
-read_last_entry (void)
+read_last_entry (enum operation_mode_t mode)
 {
-  struct utmp buffer;
-  ssize_t nbytes = __pread64_nocancel (file_fd, &buffer, sizeof (buffer),
-				       file_offset);
+  char buffer[utmp_buffer_size];
+  const size_t size = last_entry_size (mode);
+  ssize_t nbytes = __pread64_nocancel (file_fd, &buffer, size, file_offset);
   if (nbytes < 0)
     return -1;
-  else if (nbytes != sizeof (buffer))
+  else if (nbytes != size)
     /* Assume EOF.  */
     return 0;
   else
     {
-      last_entry = buffer;
-      file_offset += sizeof (buffer);
+      memcpy (last_entry, buffer, size);
+      file_offset += size;
       return 1;
     }
 }
 
-int
-__libc_getutent_r (struct utmp *buffer, struct utmp **result)
+static int
+internal_getutent_r (enum operation_mode_t mode, void *buffer)
 {
   int saved_errno = errno;
 
-  if (!maybe_setutent ())
-    {
-      /* Not available.  */
-      *result = NULL;
-      return -1;
-    }
-
-  if (try_file_lock (file_fd, F_RDLCK))
+  if (!maybe_setutent (mode)
+      || try_file_lock (file_fd, F_RDLCK))
     return -1;
 
-  ssize_t nbytes = read_last_entry ();
+  ssize_t nbytes = read_last_entry (mode);
   file_unlock (file_fd);
 
   if (nbytes <= 0)		/* Read error or EOF.  */
@@ -220,111 +265,86 @@ __libc_getutent_r (struct utmp *buffer, struct utmp **result)
 	   EOF is treated like an EOF (missing complete record at the
 	   end).  */
 	__set_errno (saved_errno);
-      *result = NULL;
       return -1;
     }
 
-  memcpy (buffer, &last_entry, sizeof (struct utmp));
-  *result = buffer;
-
+  memcpy (buffer, &last_entry, last_entry_size (mode));
   return 0;
 }
 
-
 /* Search for *ID, updating last_entry and file_offset.  Return 0 on
    success and -1 on failure.  Does not perform locking; for that see
    internal_getut_r below.  */
-static int
-internal_getut_nolock (const struct utmp *id)
+static bool
+internal_getut_nolock (enum operation_mode_t mode, short int type,
+		       const char *id, const char *line)
 {
-  while (1)
+  while (true)
     {
-      ssize_t nbytes = read_last_entry ();
+      ssize_t nbytes = read_last_entry (mode);
       if (nbytes < 0)
-	return -1;
+	return false;
       if (nbytes == 0)
 	{
 	  /* End of file reached.  */
 	  __set_errno (ESRCH);
-	  return -1;
+	  return false;
 	}
 
-      if (matches_last_entry (id))
+      if (matches_last_entry (mode, type, id, line))
 	break;
     }
-
-  return 0;
+  return true;
 }
 
 /* Search for *ID, updating last_entry and file_offset.  Return 0 on
    success and -1 on failure.  If the locking operation failed, write
    true to *LOCK_FAILED.  */
-static int
-internal_getut_r (const struct utmp *id, bool *lock_failed)
+static bool
+internal_getut_r (enum operation_mode_t mode, short int type, const char *id,
+		  const char *line)
 {
   if (try_file_lock (file_fd, F_RDLCK))
-    {
-      *lock_failed = true;
-      return -1;
-    }
+    return false;
 
-  int result = internal_getut_nolock (id);
+  bool r = internal_getut_nolock (mode, type, id, line);
   file_unlock (file_fd);
-  return result;
+  return r;
 }
 
-/* For implementing this function we don't use the getutent_r function
-   because we can avoid the reposition on every new entry this way.  */
-int
-__libc_getutid_r (const struct utmp *id, struct utmp *buffer,
-		  struct utmp **result)
+static int
+internal_getutid_r (enum operation_mode_t mode, short int type,
+		    const char *id, const char *line, void *buffer)
 {
-  if (!maybe_setutent ())
-    {
-      *result = NULL;
-      return -1;
-    }
+  if (!maybe_setutent (mode))
+    return -1;
 
   /* We don't have to distinguish whether we can lock the file or
      whether there is no entry.  */
-  bool lock_failed = false;
-  if (internal_getut_r (id, &lock_failed) < 0)
-    {
-      *result = NULL;
-      return -1;
-    }
+  if (! internal_getut_r (mode, type, id, line))
+    return -1;
 
-  memcpy (buffer, &last_entry, sizeof (struct utmp));
-  *result = buffer;
+  memcpy (buffer, &last_entry, last_entry_size (mode));
 
   return 0;
 }
 
 /* For implementing this function we don't use the getutent_r function
    because we can avoid the reposition on every new entry this way.  */
-int
-__libc_getutline_r (const struct utmp *line, struct utmp *buffer,
-		    struct utmp **result)
+static int
+internal_getutline_r (enum operation_mode_t mode, const char *line,
+		      void *buffer)
 {
-  if (!maybe_setutent ())
-    {
-      *result = NULL;
-      return -1;
-    }
-
-  if (try_file_lock (file_fd, F_RDLCK))
-    {
-      *result = NULL;
-      return -1;
-    }
+  if (!maybe_setutent (mode)
+      || try_file_lock (file_fd, F_RDLCK))
+    return -1;
 
   while (1)
     {
-      ssize_t nbytes = read_last_entry ();
+      ssize_t nbytes = read_last_entry (mode);
       if (nbytes < 0)
 	{
 	  file_unlock (file_fd);
-	  *result = NULL;
 	  return -1;
 	}
       if (nbytes == 0)
@@ -332,48 +352,45 @@ __libc_getutline_r (const struct utmp *line, struct utmp *buffer,
 	  /* End of file reached.  */
 	  file_unlock (file_fd);
 	  __set_errno (ESRCH);
-	  *result = NULL;
 	  return -1;
 	}
 
       /* Stop if we found a user or login entry.  */
-      if ((last_entry.ut_type == USER_PROCESS
-	   || last_entry.ut_type == LOGIN_PROCESS)
-	  && (strncmp (line->ut_line, last_entry.ut_line, sizeof line->ut_line)
-	      == 0))
+      if ((last_entry_type (mode) == USER_PROCESS
+	   || last_entry_type (mode) == LOGIN_PROCESS)
+	  && (strncmp (line, last_entry_line (mode), UT_LINESIZE) == 0))
 	break;
     }
 
   file_unlock (file_fd);
-  memcpy (buffer, &last_entry, sizeof (struct utmp));
-  *result = buffer;
+  memcpy (buffer, &last_entry, last_entry_size (mode));
 
   return 0;
 }
 
-
-struct utmp *
-__libc_pututline (const struct utmp *data)
+static bool
+internal_pututline (enum operation_mode_t mode, short int type,
+		    const char *id, const char *line, const void *data)
 {
-  if (!maybe_setutent ())
-    return NULL;
-
-  struct utmp *pbuf;
+  if (!maybe_setutent (mode))
+    return false;
 
   if (! file_writable)
     {
       /* We must make the file descriptor writable before going on.  */
-      const char *file_name = utmp_file_name_time32 (__libc_utmp_file_name);
+      const char *file_name = mode == UTMP_TIME64
+	? __libc_utmp_file_name
+	: utmp_file_name_time32 (__libc_utmp_file_name);
 
       int new_fd = __open_nocancel
 	(file_name, O_RDWR | O_LARGEFILE | O_CLOEXEC);
       if (new_fd == -1)
-	return NULL;
+	return false;
 
       if (__dup2 (new_fd, file_fd) < 0)
 	{
 	  __close_nocancel_nostatus (new_fd);
-	  return NULL;
+	  return false;
 	}
       __close_nocancel_nostatus (new_fd);
       file_writable = true;
@@ -381,31 +398,32 @@ __libc_pututline (const struct utmp *data)
 
   /* Exclude other writers before validating the cache.  */
   if (try_file_lock (file_fd, F_WRLCK))
-    return NULL;
+    return false;
 
   /* Find the correct place to insert the data.  */
+  const size_t utmp_size = last_entry_size (mode);
   bool found = false;
-  if (matches_last_entry (data))
+  if (matches_last_entry (mode, type, id, line))
     {
       /* Read back the entry under the write lock.  */
-      file_offset -= sizeof (last_entry);
-      ssize_t nbytes = read_last_entry ();
+      file_offset -= utmp_size;
+      ssize_t nbytes = read_last_entry (mode);
       if (nbytes < 0)
 	{
 	  file_unlock (file_fd);
-	  return NULL;
+	  return false;
 	}
 
       if (nbytes == 0)
 	/* End of file reached.  */
 	found = false;
       else
-	found = matches_last_entry (data);
+	found = matches_last_entry (mode, type, id, line);
     }
 
   if (!found)
     /* Search forward for the entry.  */
-    found = internal_getut_nolock (data) >= 0;
+    found = internal_getut_nolock (mode, type, id, line);
 
   off64_t write_offset;
   if (!found)
@@ -416,26 +434,25 @@ __libc_pututline (const struct utmp *data)
       /* Round down to the next multiple of the entry size.  This
 	 ensures any partially-written record is overwritten by the
 	 new record.  */
-      write_offset = (write_offset / sizeof (struct utmp)
-		      * sizeof (struct utmp));
+      write_offset = write_offset / utmp_size * utmp_size;
     }
   else
     /* Overwrite last_entry.  */
-    write_offset = file_offset - sizeof (struct utmp);
+    write_offset = file_offset - utmp_size;
 
   /* Write the new data.  */
   ssize_t nbytes;
   if (__lseek64 (file_fd, write_offset, SEEK_SET) < 0
-      || (nbytes = __write_nocancel (file_fd, data, sizeof (struct utmp))) < 0)
+      || (nbytes = __write_nocancel (file_fd, data, utmp_size)) < 0)
     {
       /* There is no need to recover the file position because all
 	 reads use pread64, and any future write is preceded by
 	 another seek.  */
       file_unlock (file_fd);
-      return NULL;
+      return false;
     }
 
-  if (nbytes != sizeof (struct utmp))
+  if (nbytes != utmp_size)
     {
       /* If we appended a new record this is only partially written.
 	 Remove it.  */
@@ -445,30 +462,18 @@ __libc_pututline (const struct utmp *data)
       /* Assume that the write failure was due to missing disk
 	 space.  */
       __set_errno (ENOSPC);
-      return NULL;
+      return false;
     }
 
   file_unlock (file_fd);
-  file_offset = write_offset + sizeof (struct utmp);
-  pbuf = (struct utmp *) data;
-
-  return pbuf;
-}
-
+  file_offset = write_offset + utmp_size;
 
-void
-__libc_endutent (void)
-{
-  if (file_fd >= 0)
-    {
-      __close_nocancel_nostatus (file_fd);
-      file_fd = -1;
-    }
+  return true;
 }
 
-
-int
-__libc_updwtmp (const char *file, const struct utmp *utmp)
+static int
+internal_updwtmp (enum operation_mode_t mode, const char *file,
+		  const void *utmp)
 {
   int result = -1;
   off64_t offset;
@@ -487,9 +492,10 @@ __libc_updwtmp (const char *file, const struct utmp *utmp)
 
   /* Remember original size of log file.  */
   offset = __lseek64 (fd, 0, SEEK_END);
-  if (offset % sizeof (struct utmp) != 0)
+  const size_t utmp_size = last_entry_size (mode);
+  if (offset % utmp_size != 0)
     {
-      offset -= offset % sizeof (struct utmp);
+      offset -= offset % utmp_size;
       __ftruncate64 (fd, offset);
 
       if (__lseek64 (fd, 0, SEEK_END) < 0)
@@ -499,8 +505,7 @@ __libc_updwtmp (const char *file, const struct utmp *utmp)
   /* Write the entry.  If we can't write all the bytes, reset the file
      size back to the original size.  That way, no partial entries
      will remain.  */
-  if (__write_nocancel (fd, utmp, sizeof (struct utmp))
-      != sizeof (struct utmp))
+  if (__write_nocancel (fd, utmp, utmp_size) != utmp_size)
     {
       __ftruncate64 (fd, offset);
       goto unlock_return;
@@ -516,3 +521,113 @@ unlock_return:
 
   return result;
 }
+
+void
+__libc_setutent (void)
+{
+  internal_setutent (UTMP_TIME64);
+}
+
+void
+__libc_setutent32 (void)
+{
+  internal_setutent (UTMP_TIME32);
+}
+
+int
+__libc_getutent_r (struct utmp *buffer, struct utmp **result)
+{
+  int r = internal_getutent_r (UTMP_TIME64, buffer);
+  *result = r == 0 ? buffer : NULL;
+  return r;
+}
+
+/* For implementing this function we don't use the getutent_r function
+   because we can avoid the reposition on every new entry this way.  */
+int
+__libc_getutid_r (const struct utmp *id, struct utmp *buffer,
+		  struct utmp **result)
+{
+  int r = internal_getutid_r (UTMP_TIME64, id->ut_type, id->ut_id,
+			      id->ut_line, buffer);
+  *result = r == 0? buffer : NULL;
+  return r;
+}
+
+/* For implementing this function we don't use the getutent_r function
+   because we can avoid the reposition on every new entry this way.  */
+int
+__libc_getutline_r (const struct utmp *line, struct utmp *buffer,
+		    struct utmp **result)
+{
+  int r = internal_getutline_r (UTMP_TIME64, line->ut_line, buffer);
+  *result = r == 0 ? buffer : NULL;
+  return r;
+}
+
+struct utmp *
+__libc_pututline (const struct utmp *line)
+{
+  return internal_pututline (UTMP_TIME64, line->ut_type, line->ut_id,
+			     line->ut_line, line)
+	 ? (struct utmp *) line : NULL;
+}
+
+void
+__libc_endutent (void)
+{
+  if (file_fd >= 0)
+    {
+      __close_nocancel_nostatus (file_fd);
+      file_fd = -1;
+    }
+}
+
+int
+__libc_updwtmp (const char *file, const struct utmp *utmp)
+{
+  return internal_updwtmp (UTMP_TIME64, file, utmp);
+}
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE)
+int
+__libc_getutent32_r (struct utmp32 *buffer, struct utmp32 **result)
+{
+  int r = internal_getutent_r (UTMP_TIME32, buffer);
+  *result = r == 0 ? buffer : NULL;
+  return r;
+}
+
+int
+__libc_getutid32_r (const struct utmp32 *id, struct utmp32 *buffer,
+		    struct utmp32 **result)
+{
+  int r = internal_getutid_r (UTMP_TIME32, id->ut_type, id->ut_id,
+			      id->ut_line, buffer);
+  *result = r == 0 ? buffer : NULL;
+  return r;
+}
+
+int
+__libc_getutline32_r (const struct utmp32 *line, struct utmp32 *buffer,
+		      struct utmp32 **result)
+{
+  int r = internal_getutline_r (UTMP_TIME32, line->ut_line, buffer);
+  *result = r == 0 ? buffer : NULL;
+  return r;
+}
+
+struct utmp32 *
+__libc_pututline32 (const struct utmp32 *line)
+{
+  return internal_pututline (UTMP_TIME32, line->ut_type, line->ut_id,
+			     line->ut_line, line)
+	 ? (struct utmp32 *) line : NULL;
+}
+
+int
+__libc_updwtmp32 (const char *file, const struct utmp32 *utmp)
+{
+  return internal_updwtmp (UTMP_TIME32, file, utmp);
+}
+#endif
diff --git a/login/utmpname.c b/login/utmpname.c
index c85c27fe68..c5c5bc458a 100644
--- a/login/utmpname.c
+++ b/login/utmpname.c
@@ -29,6 +29,7 @@ static const char default_file_name[] = _PATH_UTMP;
 
 /* Current file name.  */
 const char *__libc_utmp_file_name = (const char *) default_file_name;
+enum __libc_utmpname_mode_t __libc_utmpname_mode = UTMPNAME_TIME64;
 
 /* We have to use the lock in getutent_r.c.  */
 __libc_lock_define (extern, __libc_utmp_lock attribute_hidden)
@@ -66,6 +67,13 @@ __utmpname (const char *file)
 	}
     }
 
+  if (strcmp (__libc_utmp_file_name, _PATH_UTMP) == 0)
+    __libc_utmpname_mode = UTMPNAME_TIME64;
+  else if (strcmp (__libc_utmp_file_name, _PATH_UTMP_BASE) == 0)
+    __libc_utmpname_mode = UTMPNAME_TIME32;
+  else
+    __libc_utmpname_mode = UTMPNAME_UNDEF;
+
   result = 0;
 
 done:
diff --git a/login/utmpx32.c b/login/utmpx32.c
new file mode 100644
index 0000000000..3bbfddf5fe
--- /dev/null
+++ b/login/utmpx32.c
@@ -0,0 +1,112 @@
+/* Compability symbols for utmpx with 32-bit entry times.
+   Copyright (C) 2008-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 <stddef.h>
+#include <sys/types.h>
+#include <string.h>
+#include <utmp.h>
+#include <errno.h>
+#include <libc-symbols.h>
+
+#include <utmp32.h>
+#include <utmpx32.h>
+
+#include <utmp-compat.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1, UTMP_COMPAT_BASE)
+
+# define CHECK_SIZE_AND_OFFSET(field) \
+  _Static_assert (sizeof ((struct utmp32){0}.field)		\
+		  == sizeof ((struct utmpx32){0}.field),		\
+		  "sizeof ((struct utmp32){0}." #field " != "	\
+		  "sizeof ((struct utmpx32){0}" #field);	\
+  _Static_assert (offsetof (struct utmp32, field)			\
+		  == offsetof (struct utmpx32, field),		\
+		  "offsetof (struct utmp32, " #field ") != "	\
+		  "offsetof (struct utmpx32, " #field ")");
+
+/* Sanity check to call the utmp symbols.  */
+_Static_assert (sizeof (struct utmpx32) == sizeof (struct utmp32),
+		"sizeof (struct utmpx32) != sizeof (struct utmp32)");
+CHECK_SIZE_AND_OFFSET (ut_type)
+CHECK_SIZE_AND_OFFSET (ut_pid)
+CHECK_SIZE_AND_OFFSET (ut_line)
+CHECK_SIZE_AND_OFFSET (ut_user)
+CHECK_SIZE_AND_OFFSET (ut_id)
+CHECK_SIZE_AND_OFFSET (ut_host)
+CHECK_SIZE_AND_OFFSET (ut_tv)
+
+struct utmpx32 *
+getutxent32 (void)
+{
+  return (struct utmpx32 *) __getutent32 ();
+}
+compat_symbol (libc, getutxent32, getutxent, GLIBC_2_1);
+
+struct utmpx32 *
+getutxid32 (const struct utmpx32 *id)
+{
+  return (struct utmpx32 *) __getutid32 ((const struct utmp32 *) id);
+}
+compat_symbol (libc, getutxid32, getutxid, GLIBC_2_1);
+
+struct utmpx32 *
+getutxline32 (const struct utmpx32 *line)
+{
+  return (struct utmpx32 *) __getutline32 ((const struct utmp32 *) line);
+}
+compat_symbol (libc, getutxline32, getutxline, GLIBC_2_1);
+
+struct utmpx32 *
+pututxline32 (const struct utmpx32 *utmpx)
+{
+  return (struct utmpx32 *) __pututline32 ((const struct utmp32 *) utmpx);
+}
+compat_symbol (libc, pututxline32, pututxline, GLIBC_2_1);
+
+void
+updwtmpx32 (const char *wtmpx_file, const struct utmpx32 *utmpx)
+{
+  __updwtmp32 (wtmpx_file, (const struct utmp32 *) utmpx);
+}
+compat_symbol (libc, updwtmpx32, updwtmpx, GLIBC_2_1);
+
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_1_1, UTMP_COMPAT_BASE)   */
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1_1, UTMP_COMPAT_BASE)
+
+void
+__getutmp32 (const struct utmpx32 *utmpx, struct utmp32 *utmp)
+{
+  memset (utmp, 0, sizeof (struct utmpx32));
+  utmp->ut_type = utmpx->ut_type;
+  utmp->ut_pid = utmpx->ut_pid;
+  memcpy (utmp->ut_line, utmpx->ut_line, sizeof (utmp->ut_line));
+  memcpy (utmp->ut_user, utmpx->ut_user, sizeof (utmp->ut_user));
+  memcpy (utmp->ut_id, utmpx->ut_id, sizeof (utmp->ut_id));
+  memcpy (utmp->ut_host, utmpx->ut_host, sizeof (utmp->ut_host));
+  utmp->ut_tv.tv_sec = utmpx->ut_tv.tv_sec;
+  utmp->ut_tv.tv_usec = utmpx->ut_tv.tv_usec;
+}
+compat_symbol (libc, __getutmp32, getutmp, GLIBC_2_1_1);
+
+strong_alias (__getutmp32, __getutmpx32)
+compat_symbol (libc, __getutmpx32, getutmpx, GLIBC_2_1_1);
+
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_1, UTMP_COMPAT_BASE)   */
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h b/login/utmpx32.h
similarity index 93%
rename from sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h
rename to login/utmpx32.h
index b9befad24e..ce1aa680a6 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h
+++ b/login/utmpx32.h
@@ -36,11 +36,11 @@ struct utmpx32
   char ut_host[__UT_HOSTSIZE];	/* Hostname for remote login.  */
   struct __exit_status ut_exit;	/* Exit status of a process marked
 				   as DEAD_PROCESS.  */
-  __int64_t ut_session;		/* Session ID, used for windowing.  */
+  __int32_t ut_session;		/* Session ID, used for windowing.  */
   struct
   {
-    __int64_t tv_sec;		/* Seconds.  */
-    __int64_t tv_usec;		/* Microseconds.  */
+    __int32_t tv_sec;		/* Seconds.  */
+    __int32_t tv_usec;		/* Microseconds.  */
   } ut_tv;			/* Time entry was made.  */
 
   __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h
index 99a791ce31..ab2980e14a 100644
--- a/sysdeps/generic/paths.h
+++ b/sysdeps/generic/paths.h
@@ -61,11 +61,12 @@
 #define	_PATH_TTY	"/dev/tty"
 #define	_PATH_UNIX	"/vmunix"
 #define	_PATH_UTMP_BASE	"/var/run/utmp"
-#define	_PATH_UTMP	_PATH_UTMP_BASE
-#define	_PATH_UTMP_DB	_PATH_UTMP_BASE ".db"
+#define _PATH_WUTMP_VER ".v2"
+#define	_PATH_UTMP	_PATH_UTMP_BASE _PATH_WUTMP_VER
+#define	_PATH_UTMP_DB	_PATH_UTMP_BASE _PATH_WUTMP_VER ".db"
 #define	_PATH_VI	"/usr/bin/vi"
 #define	_PATH_WTMP_BASE	"/var/log/wtmp"
-#define	_PATH_WTMP	_PATH_WTMP_BASE
+#define	_PATH_WTMP	_PATH_WTMP_BASE _PATH_WUTMP_VER
 
 /* Provide trailing slash, since mostly used for building pathnames. */
 #define	_PATH_DEV	"/dev/"
diff --git a/sysdeps/generic/utmp-compat.h b/sysdeps/generic/utmp-compat.h
new file mode 100644
index 0000000000..68cc4e0f46
--- /dev/null
+++ b/sysdeps/generic/utmp-compat.h
@@ -0,0 +1,3 @@
+/* This macro defines the glibc version tag at which the 64 bit struct
+   utmp functions have been added to the 32 bit glibc.  */
+#define UTMP_COMPAT_BASE GLIBC_2_34
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index e10a286d2e..3a657d5e0d 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2204,6 +2204,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/mach/hurd/i386/libutil.abilist b/sysdeps/mach/hurd/i386/libutil.abilist
index 1dd59e0afb..a64b052368 100644
--- a/sysdeps/mach/hurd/i386/libutil.abilist
+++ b/sysdeps/mach/hurd/i386/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.2.6 login_tty F
 GLIBC_2.2.6 logout F
 GLIBC_2.2.6 logwtmp F
 GLIBC_2.2.6 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index bac795262d..4f91e85ba0 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2172,3 +2172,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libutil.abilist b/sysdeps/unix/sysv/linux/aarch64/libutil.abilist
index 99889de22e..3294de79be 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.17 login_tty F
 GLIBC_2.17 logout F
 GLIBC_2.17 logwtmp F
 GLIBC_2.17 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 897f70db22..764ea51779 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2254,6 +2254,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/alpha/libutil.abilist b/sysdeps/unix/sysv/linux/alpha/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/alpha/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 604d259ad6..2ebd24f3a6 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -1932,3 +1932,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/arc/libutil.abilist b/sysdeps/unix/sysv/linux/arc/libutil.abilist
index 61f73bc34e..6950302484 100644
--- a/sysdeps/unix/sysv/linux/arc/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.32 login_tty F
 GLIBC_2.32 logout F
 GLIBC_2.32 logwtmp F
 GLIBC_2.32 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 094236f713..5cfcb00ddb 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -156,6 +156,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/be/libutil.abilist b/sysdeps/unix/sysv/linux/arm/be/libutil.abilist
index cc1420e68c..d2d7724fa0 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libutil.abilist
@@ -1,3 +1,4 @@
+GLIBC_2.34 login F
 GLIBC_2.4 forkpty F
 GLIBC_2.4 login F
 GLIBC_2.4 login_tty F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 2bb4d31e81..d140654389 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -153,6 +153,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libutil.abilist b/sysdeps/unix/sysv/linux/arm/le/libutil.abilist
index cc1420e68c..d2d7724fa0 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libutil.abilist
@@ -1,3 +1,4 @@
+GLIBC_2.34 login F
 GLIBC_2.4 forkpty F
 GLIBC_2.4 login F
 GLIBC_2.4 login_tty F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index d4291fecfb..11aa688b83 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2116,3 +2116,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/csky/libutil.abilist b/sysdeps/unix/sysv/linux/csky/libutil.abilist
index cbd11999a4..25006044fe 100644
--- a/sysdeps/unix/sysv/linux/csky/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.29 login_tty F
 GLIBC_2.29 logout F
 GLIBC_2.29 logwtmp F
 GLIBC_2.29 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 1fd2a862f6..14eef860ac 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2075,6 +2075,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/hppa/libutil.abilist b/sysdeps/unix/sysv/linux/hppa/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/hppa/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 943331f01e..e1db1488a9 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2242,6 +2242,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libutil.abilist b/sysdeps/unix/sysv/linux/i386/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/i386/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index f530151bde..f5b4433142 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2107,6 +2107,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libutil.abilist b/sysdeps/unix/sysv/linux/ia64/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/ia64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 6e76b6dcaa..213853a1f1 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -157,6 +157,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist
index cc1420e68c..d2d7724fa0 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist
@@ -1,3 +1,4 @@
+GLIBC_2.34 login F
 GLIBC_2.4 forkpty F
 GLIBC_2.4 login F
 GLIBC_2.4 login_tty F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 7541b8289f..15dda47ba8 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2187,6 +2187,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 6cf1936c42..3ffd49cbfb 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2167,3 +2167,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libutil.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libutil.abilist
index 0da0a40c22..eef306314b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.18 login_tty F
 GLIBC_2.18 logout F
 GLIBC_2.18 logwtmp F
 GLIBC_2.18 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 98730ebcda..2bccbe960a 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2164,3 +2164,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libutil.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libutil.abilist
index 0da0a40c22..eef306314b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.18 login_tty F
 GLIBC_2.18 logout F
 GLIBC_2.18 logwtmp F
 GLIBC_2.18 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 92fa6cbc73..209f5f588b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2158,6 +2158,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 265a49e74e..45d976790c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2156,6 +2156,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index cfa5e1111b..ab3156c917 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2164,6 +2164,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 8c03ac52cd..f8d0534156 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2158,6 +2158,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 17f5609e06..f56e5ad002 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2205,3 +2205,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/nios2/libutil.abilist b/sysdeps/unix/sysv/linux/nios2/libutil.abilist
index 19608bd74d..7ef9a41873 100644
--- a/sysdeps/unix/sysv/linux/nios2/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.21 login_tty F
 GLIBC_2.21 logout F
 GLIBC_2.21 logwtmp F
 GLIBC_2.21 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h
index 3b8aeab788..89686bcf88 100644
--- a/sysdeps/unix/sysv/linux/paths.h
+++ b/sysdeps/unix/sysv/linux/paths.h
@@ -62,10 +62,11 @@
 #define	_PATH_TTY	"/dev/tty"
 #define	_PATH_UNIX	"/boot/vmlinux"
 #define	_PATH_UTMP_BASE	"/var/run/utmp"
-#define	_PATH_UTMP	_PATH_UTMP_BASE
+#define	_PATH_UWTMP_VER	".v2"
+#define	_PATH_UTMP	_PATH_UTMP_BASE _PATH_UWTMP_VER
 #define	_PATH_VI	"/usr/bin/vi"
 #define	_PATH_WTMP_BASE	"/var/log/wtmp"
-#define	_PATH_WTMP	_PATH_WTMP_BASE
+#define	_PATH_WTMP	_PATH_WTMP_BASE _PATH_UWTMP_VER
 
 /* Provide trailing slash, since mostly used for building pathnames. */
 #define	_PATH_DEV	"/dev/"
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 76a16e2a6d..cfb457400c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2214,6 +2214,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 697f072fd4..e1fd74fbad 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2247,6 +2247,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 2647bb51f1..5c9cdb33b4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2077,6 +2077,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libutil.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libutil.abilist
index 9cf1da7aa4..fc74cb2c77 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.3 login_tty F
 GLIBC_2.3 logout F
 GLIBC_2.3 logwtmp F
 GLIBC_2.3 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 036b1c8345..4dcac4c766 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2367,3 +2367,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libutil.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libutil.abilist
index 99889de22e..3294de79be 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.17 login_tty F
 GLIBC_2.17 logout F
 GLIBC_2.17 logwtmp F
 GLIBC_2.17 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index ff3225e16f..69bc04c36c 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -1934,3 +1934,18 @@ GLIBC_2.33 write F
 GLIBC_2.33 writev F
 GLIBC_2.33 wscanf F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist
index 59ae944bda..eded210f0b 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.33 login_tty F
 GLIBC_2.33 logout F
 GLIBC_2.33 logwtmp F
 GLIBC_2.33 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index fb5ad9909f..dc4a3223e6 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2134,3 +2134,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist
index cbfec8d46e..ec3a638024 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.27 login_tty F
 GLIBC_2.27 logout F
 GLIBC_2.27 logwtmp F
 GLIBC_2.27 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c
deleted file mode 100644
index eebccece1c..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <libc-lock.h>
-#include <stdlib.h>
-#include <utmp.h>
-
-#include "utmp-compat.h"
-#include "utmp-private.h"
-
-#if defined SHARED
-weak_alias (__setutent, setutent)
-weak_alias (__endutent, endutent)
-
-# undef weak_alias
-# define weak_alias(n,a)
-#endif
-#include "login/getutent_r.c"
-
-#if defined SHARED
-default_symbol_version (__getutent_r, getutent_r, UTMP_COMPAT_BASE);
-default_symbol_version (__pututline, pututline, UTMP_COMPAT_BASE);
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c
deleted file mode 100644
index f50d633e48..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <stdlib.h>
-#include <utmp.h>
-
-#include "utmp-compat.h"
-
-#if defined SHARED
-# undef weak_alias
-# define weak_alias(n,a)
-#endif
-#include "login/getutid.c"
-
-#if defined SHARED
-default_symbol_version (__getutid, getutid, UTMP_COMPAT_BASE);
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c
deleted file mode 100644
index 5039b99a94..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <libc-lock.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <utmp.h>
-
-#include "utmp-compat.h"
-#include "utmp-private.h"
-
-#if defined SHARED
-# undef weak_alias
-# define weak_alias(n,a)
-#endif
-#include "login/getutid_r.c"
-
-#if defined SHARED
-default_symbol_version (__getutid_r, getutid_r, UTMP_COMPAT_BASE);
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c
deleted file mode 100644
index 32b39575b0..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <stdlib.h>
-#include <utmp.h>
-
-#include "utmp-compat.h"
-
-#if defined SHARED
-# undef weak_alias
-# define weak_alias(n,a)
-#endif
-#include "login/getutline.c"
-
-#if defined SHARED
-default_symbol_version (__getutline, getutline, UTMP_COMPAT_BASE);
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c
deleted file mode 100644
index c9238c5f60..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <libc-lock.h>
-#include <utmp.h>
-
-#include "utmp-compat.h"
-#include "utmp-private.h"
-
-#if defined SHARED
-# undef weak_alias
-# define weak_alias(n,a)
-#endif
-#include "login/getutline_r.c"
-
-#if defined SHARED
-default_symbol_version (__getutline_r, getutline_r, UTMP_COMPAT_BASE);;
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
deleted file mode 100644
index 6ffea2a553..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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/>.  */
-
-#undef weak_alias
-#define weak_alias(a, b)
-#undef strong_alias
-#define strong_alias(a, b)
-
-#include <login/getutmp.c>
-
-#include "utmp-compat.h"
-
-default_symbol_version (__getutmp, getutmp, UTMP_COMPAT_BASE);
-_strong_alias (__getutmp, __getutmpx)
-default_symbol_version (__getutmpx, getutmpx, UTMP_COMPAT_BASE);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c
deleted file mode 100644
index d91795af78..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <utmp.h>
-#include <utmpx.h>
-
-#include "utmp-compat.h"
-
-#undef weak_alias
-#define weak_alias(n,a)
-#define getutxent __getutxent
-#include "login/getutxent.c"
-#undef getutxent
-
-default_symbol_version (__getutxent, getutxent, UTMP_COMPAT_BASE);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c
deleted file mode 100644
index d5d457d98d..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <utmp.h>
-#include <utmpx.h>
-
-#include "utmp-compat.h"
-
-#undef weak_alias
-#define weak_alias(n,a)
-#define getutxid __getutxid
-#include "login/getutxid.c"
-#undef getutxid
-
-default_symbol_version (__getutxid, getutxid, UTMP_COMPAT_BASE);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c
deleted file mode 100644
index ab0189f653..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <utmp.h>
-#include <utmpx.h>
-
-#include "utmp-compat.h"
-
-#undef weak_alias
-#define weak_alias(n,a)
-#define getutxline __getutxline
-#include "login/getutxline.c"
-#undef getutxline
-
-default_symbol_version (__getutxline, getutxline, UTMP_COMPAT_BASE);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/login.c b/sysdeps/unix/sysv/linux/s390/s390-32/login.c
deleted file mode 100644
index 5df028298a..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/login.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <assert.h>
-#include <errno.h>
-#include <limits.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <utmp.h>
-
-#include "utmp-compat.h"
-
-#undef weak_alias
-#define weak_alias(n,a)
-#define login __login
-#include "login/login.c"
-#undef login
-
-default_symbol_version (__login, login, UTMP_COMPAT_BASE);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c b/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c
deleted file mode 100644
index 1dfabc8f37..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <utmp.h>
-#include <utmpx.h>
-
-#include "utmp-compat.h"
-
-#undef weak_alias
-#define weak_alias(n,a)
-#define pututxline __pututxline
-#include "login/pututxline.c"
-#undef pututxline
-
-default_symbol_version (__pututxline, pututxline, UTMP_COMPAT_BASE);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
deleted file mode 100644
index 7ef8e85c00..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <utmp.h>
-
-#include "utmp-compat.h"
-#include "utmp-private.h"
-
-#if defined SHARED
-# undef weak_alias
-# define weak_alias(n,a)
-#endif
-#include <login/updwtmp.c>
-
-#if defined SHARED
-default_symbol_version (__updwtmp, updwtmp, UTMP_COMPAT_BASE);
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c
deleted file mode 100644
index 51cf1f5ae3..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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 <utmp.h>
-#include <utmpx.h>
-
-#include "utmp-compat.h"
-
-#undef weak_alias
-#define weak_alias(n,a)
-#define updwtmpx __updwtmpx
-#include "login/updwtmpx.c"
-#undef updwtmpx
-
-default_symbol_version (__updwtmpx, updwtmpx, UTMP_COMPAT_BASE);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h
index 28632f72bd..dc4c926cca 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h
@@ -18,4 +18,4 @@
 
 /* This macro defines the glibc version tag at which the 64 bit struct
    utmp functions have been added to the 32 bit glibc.  */
-#define UTMP_COMPAT_BASE GLIBC_2.9
+#define UTMP_COMPAT_BASE GLIBC_2_9
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
deleted file mode 100644
index 32496e5421..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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/types.h>
-#include <utmp.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include "utmp32.h"
-#include "utmp-convert.h"
-
-/* Allocate a static buffer to be returned to the caller.  As well as
-   with the existing version of these functions the caller has to be
-   aware that the contents of this buffer will change with subsequent
-   calls.  */
-#define ALLOCATE_UTMP32_OUT(OUT)			\
-  static struct utmp32 *OUT = NULL;			\
-							\
-  if (OUT == NULL)					\
-    {							\
-      OUT = malloc (sizeof (struct utmp32));		\
-      if (OUT == NULL)					\
-	return NULL;					\
-    }
-
-/* Perform a lookup for a utmp entry matching FIELD using function
-   FUNC.  FIELD is converted to a 64 bit utmp and the result is
-   converted back to 32 bit utmp.  */
-#define ACCESS_UTMP_ENTRY(FUNC, FIELD)			\
-  struct utmp in64;					\
-  struct utmp *out64;					\
-  ALLOCATE_UTMP32_OUT (out32);				\
-							\
-  utmp_convert32to64 (FIELD, &in64);			\
-  out64 = FUNC (&in64);					\
-							\
-  if (out64 == NULL)					\
-    return NULL;					\
-							\
-  utmp_convert64to32 (out64, out32);			\
-							\
-  return out32;
-
-/* Search forward from the current point in the utmp file until the
-   next entry with a ut_type matching ID->ut_type.  */
-struct utmp32 *
-getutid32 (const struct utmp32 *id)
-{
-  ACCESS_UTMP_ENTRY (__getutid, id)
-}
-symbol_version (getutid32, getutid, GLIBC_2.0);
-
-/* Search forward from the current point in the utmp file until the
-   next entry with a ut_line matching LINE->ut_line.  */
-struct utmp32 *
-getutline32 (const struct utmp32 *line)
-{
-  ACCESS_UTMP_ENTRY (__getutline, line)
-}
-symbol_version (getutline32, getutline, GLIBC_2.0);
-
-/* Write out entry pointed to by UTMP_PTR into the utmp file.  */
-struct utmp32 *
-pututline32 (const struct utmp32 *utmp_ptr)
-{
-  ACCESS_UTMP_ENTRY (__pututline, utmp_ptr)
-}
-symbol_version (pututline32, pututline, GLIBC_2.0);
-
-/* Read next entry from a utmp-like file.  */
-struct utmp32 *
-getutent32 (void)
-{
-  struct utmp *out64;
-  ALLOCATE_UTMP32_OUT (out32);
-
-  out64 = __getutent ();
-  if (!out64)
-    return NULL;
-
-  utmp_convert64to32 (out64, out32);
-  return out32;
-}
-symbol_version (getutent32, getutent, GLIBC_2.0);
-
-/* Reentrant versions of the file for handling utmp files.  */
-
-int
-getutent32_r (struct utmp32 *buffer, struct utmp32 **result)
-{
-  struct utmp out64;
-  struct utmp *out64p;
-  int ret;
-
-  ret = __getutent_r (&out64, &out64p);
-  if (ret == -1)
-    {
-      *result = NULL;
-      return -1;
-    }
-
-  utmp_convert64to32 (out64p, buffer);
-  *result = buffer;
-
-  return 0;
-}
-symbol_version (getutent32_r, getutent_r, GLIBC_2.0);
-
-int
-getutid32_r (const struct utmp32 *id, struct utmp32 *buffer,
-	       struct utmp32 **result)
-{
-  struct utmp in64;
-  struct utmp out64;
-  struct utmp *out64p;
-  int ret;
-
-  utmp_convert32to64 (id, &in64);
-
-  ret = __getutid_r (&in64, &out64, &out64p);
-  if (ret == -1)
-    {
-      *result = NULL;
-      return -1;
-    }
-
-  utmp_convert64to32 (out64p, buffer);
-  *result = buffer;
-
-  return 0;
-}
-symbol_version (getutid32_r, getutid_r, GLIBC_2.0);
-
-int
-getutline32_r (const struct utmp32 *line,
-		 struct utmp32 *buffer, struct utmp32 **result)
-{
-  struct utmp in64;
-  struct utmp out64;
-  struct utmp *out64p;
-  int ret;
-
-  utmp_convert32to64 (line, &in64);
-
-  ret = __getutline_r (&in64, &out64, &out64p);
-  if (ret == -1)
-    {
-      *result = NULL;
-      return -1;
-    }
-
-  utmp_convert64to32 (out64p, buffer);
-  *result = buffer;
-
-  return 0;
-
-}
-symbol_version (getutline32_r, getutline_r, GLIBC_2.0);
-
-/* Append entry UTMP to the wtmp-like file WTMP_FILE.  */
-void
-updwtmp32 (const char *wtmp_file, const struct utmp32 *utmp)
-{
-  struct utmp in32;
-
-  utmp_convert32to64 (utmp, &in32);
-  __updwtmp (wtmp_file, &in32);
-}
-symbol_version (updwtmp32, updwtmp, GLIBC_2.0);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h
deleted file mode 100644
index ad7de5c455..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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/>.  */
-
-
-/* This file provides functions converting between the 32 and 64 bit
-   struct utmp variants.  */
-
-#ifndef _UTMPX_CONVERT_H
-#define _UTMPX_CONVERT_H 1
-
-#include <string.h>
-#include "utmpx32.h"
-
-/* Convert the 64 bit struct utmpx value in FROM to the 32 bit version
-   returned in TO.  */
-static inline void
-utmpx_convert64to32 (const struct utmpx *from, struct utmpx32 *to)
-{
-#if _HAVE_UT_TYPE - 0
-  to->ut_type = from->ut_type;
-#endif
-#if _HAVE_UT_PID - 0
-  to->ut_pid = from->ut_pid;
-#endif
-  memcpy (to->ut_line, from->ut_line, __UT_LINESIZE);
-  memcpy (to->ut_user, from->ut_user, __UT_NAMESIZE);
-#if _HAVE_UT_ID - 0
-  memcpy (to->ut_id, from->ut_id, 4);
-#endif
-#if _HAVE_UT_HOST - 0
-  memcpy (to->ut_host, from->ut_host, __UT_HOSTSIZE);
-#endif
-  to->ut_exit = from->ut_exit;
-  to->ut_session = (int32_t) from->ut_session;
-#if _HAVE_UT_TV - 0
-  to->ut_tv.tv_sec = (int32_t) from->ut_tv.tv_sec;
-  to->ut_tv.tv_usec = (int32_t) from->ut_tv.tv_usec;
-#endif
-  memcpy (to->ut_addr_v6, from->ut_addr_v6, 4 * 4);
-}
-
-/* Convert the 32 bit struct utmpx value in FROM to the 64 bit version
-   returned in TO.  */
-static inline void
-utmpx_convert32to64 (const struct utmpx32 *from, struct utmpx *to)
-{
-#if _HAVE_UT_TYPE - 0
-  to->ut_type = from->ut_type;
-#endif
-#if _HAVE_UT_PID - 0
-  to->ut_pid = from->ut_pid;
-#endif
-  memcpy (to->ut_line, from->ut_line, __UT_LINESIZE);
-  memcpy (to->ut_user, from->ut_user, __UT_NAMESIZE);
-#if _HAVE_UT_ID - 0
-  memcpy (to->ut_id, from->ut_id, 4);
-#endif
-#if _HAVE_UT_HOST - 0
-  memcpy (to->ut_host, from->ut_host, __UT_HOSTSIZE);
-#endif
-  to->ut_exit = from->ut_exit;
-  to->ut_session = (int64_t) from->ut_session;
-#if _HAVE_UT_TV - 0
-  to->ut_tv.tv_sec = (int64_t) from->ut_tv.tv_sec;
-  to->ut_tv.tv_usec = (int64_t) from->ut_tv.tv_usec;
-#endif
-  memcpy (to->ut_addr_v6, from->ut_addr_v6, 4 * 4);
-}
-
-#endif /* utmpx-convert.h */
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
deleted file mode 100644
index ed970961bf..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
-   Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
-   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/types.h>
-#include <utmp.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include "utmp32.h"
-#include "utmp-convert.h"
-
-#include "utmpx32.h"
-#include "utmpx-convert.h"
-
-/* Allocate a static buffer to be returned to the caller.  As well as
-   with the existing version of these functions the caller has to be
-   aware that the contents of this buffer will change with subsequent
-   calls.  */
-#define ALLOCATE_UTMPX32_OUT(OUT)			\
-  static struct utmpx32 *OUT = NULL;			\
-							\
-  if (OUT == NULL)					\
-    {							\
-      OUT = malloc (sizeof (struct utmpx32));		\
-      if (OUT == NULL)					\
-	return NULL;					\
-    }
-
-/* Perform a lookup for a utmpx entry matching FIELD using function
-   FUNC.  FIELD is converted to a 64 bit utmpx and the result is
-   converted back to 32 bit utmpx.  */
-#define ACCESS_UTMPX_ENTRY(FUNC, FIELD)			\
-  struct utmpx in64;					\
-  struct utmpx *out64;					\
-  ALLOCATE_UTMPX32_OUT (out32);				\
-							\
-  utmpx_convert32to64 (FIELD, &in64);			\
-  out64 = FUNC (&in64);					\
-							\
-  if (out64 == NULL)					\
-    return NULL;					\
-							\
-  utmpx_convert64to32 (out64, out32);			\
-							\
-  return out32;
-
-
-/* Get the next entry from the user accounting database.  */
-struct utmpx32 *
-getutxent32 (void)
-{
-  struct utmpx *out64;
-  ALLOCATE_UTMPX32_OUT (out32);
-
-  out64 = __getutxent ();
-  if (!out64)
-    return NULL;
-
-  utmpx_convert64to32 (out64, out32);
-  return out32;
-
-}
-symbol_version (getutxent32, getutxent, GLIBC_2.1);
-
-/* Get the user accounting database entry corresponding to ID.  */
-struct utmpx32 *
-getutxid32 (const struct utmpx32 *id)
-{
-  ACCESS_UTMPX_ENTRY (__getutxid, id);
-}
-symbol_version (getutxid32, getutxid, GLIBC_2.1);
-
-/* Get the user accounting database entry corresponding to LINE.  */
-struct utmpx32 *
-getutxline32 (const struct utmpx32 *line)
-{
-  ACCESS_UTMPX_ENTRY (__getutxline, line);
-}
-symbol_version (getutxline32, getutxline, GLIBC_2.1);
-
-/* Write the entry UTMPX into the user accounting database.  */
-struct utmpx32 *
-pututxline32 (const struct utmpx32 *utmpx)
-{
-  ACCESS_UTMPX_ENTRY (__pututxline, utmpx);
-}
-symbol_version (pututxline32, pututxline, GLIBC_2.1);
-
-/* Append entry UTMP to the wtmpx-like file WTMPX_FILE.  */
-void
-updwtmpx32 (const char *wtmpx_file, const struct utmpx32 *utmpx)
-{
-  struct utmpx in64;
-
-  utmpx_convert32to64 (utmpx, &in64);
-  __updwtmpx (wtmpx_file, &in64);
-}
-symbol_version (updwtmpx32, updwtmpx, GLIBC_2.1);
-
-/* Copy the information in UTMPX to UTMP.  */
-void
-getutmp32 (const struct utmpx32 *utmpx, struct utmp32 *utmp)
-{
-  struct utmpx in64;
-  struct utmp out64;
-
-  utmpx_convert32to64 (utmpx, &in64);
-  __getutmp (&in64, &out64);
-  utmp_convert64to32 (&out64, utmp);
-}
-symbol_version (getutmp32, getutmp, GLIBC_2.1.1);
-
-/* Copy the information in UTMP to UTMPX.  */
-void
-getutmpx32 (const struct utmp32 *utmp, struct utmpx32 *utmpx)
-{
-  struct utmp in64;
-  struct utmpx out64;
-
-  utmp_convert32to64 (utmp, &in64);
-  __getutmpx (&in64, &out64);
-  utmpx_convert64to32 (&out64, utmpx);
-}
-symbol_version (getutmpx32, getutmpx, GLIBC_2.1.1);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h b/sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h
new file mode 100644
index 0000000000..fee4b80cc0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h
@@ -0,0 +1,3 @@
+/* s390x already has 64-bit time for struct utmp{x} and lastlog.  This define
+   disable the compat symbols and support to 32-bit entries.  */
+#define UTMP_COMPAT_BASE GLIBC_2_0
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index a3a8be8910..6deb52d706 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2082,6 +2082,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libutil.abilist b/sysdeps/unix/sysv/linux/sh/be/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 8f505c5045..17a141d5b9 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2079,6 +2079,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libutil.abilist b/sysdeps/unix/sysv/linux/sh/le/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 53ef6304f1..b64b351797 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2203,6 +2203,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index eba0cb156d..e3e01c29fc 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2130,6 +2130,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist
index aa2d35b323..fbff40d968 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F
 GLIBC_2.0 logout F
 GLIBC_2.0 logwtmp F
 GLIBC_2.0 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/utmp-path.h b/sysdeps/unix/sysv/linux/utmp-path.h
index f39222d62f..3cbcf24a41 100644
--- a/sysdeps/unix/sysv/linux/utmp-path.h
+++ b/sysdeps/unix/sysv/linux/utmp-path.h
@@ -19,9 +19,8 @@
 #ifndef _UTMP_PATH_H
 #define _UTMP_PATH_H 1
 
-#include <string.h>
 #include <unistd.h>
-
+#include <string.h>
 
 /* The function returns the utmp database for 32-bit utmp{x} entries based
    on FILE_NAME:
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 17ce5dfd58..9995da84a8 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2089,6 +2089,21 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist
index 1356ed4115..f68fa6e9ba 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.2.5 login_tty F
 GLIBC_2.2.5 logout F
 GLIBC_2.2.5 logwtmp F
 GLIBC_2.2.5 openpty F
+GLIBC_2.34 login F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 17a1c83903..adccf45120 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2186,3 +2186,18 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 getutent F
+GLIBC_2.34 getutent_r F
+GLIBC_2.34 getutid F
+GLIBC_2.34 getutid_r F
+GLIBC_2.34 getutline F
+GLIBC_2.34 getutline_r F
+GLIBC_2.34 getutmp F
+GLIBC_2.34 getutmpx F
+GLIBC_2.34 getutxent F
+GLIBC_2.34 getutxid F
+GLIBC_2.34 getutxline F
+GLIBC_2.34 pututline F
+GLIBC_2.34 pututxline F
+GLIBC_2.34 updwtmp F
+GLIBC_2.34 updwtmpx F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist
index cff23106f5..5a66c2b333 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist
@@ -4,3 +4,4 @@ GLIBC_2.16 login_tty F
 GLIBC_2.16 logout F
 GLIBC_2.16 logwtmp F
 GLIBC_2.16 openpty F
+GLIBC_2.34 login F
-- 
2.25.1


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

* [PATCH 21/52] linux: Add pwrite64_nocancel
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (19 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 22/52] login: Use 64-bit time on struct lastlog [BZ #25844] Adhemerval Zanella via Libc-alpha
                   ` (32 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

It is not used internally yet.
---
 sysdeps/unix/sysv/linux/Makefile            |  2 +-
 sysdeps/unix/sysv/linux/not-cancel.h        |  4 +++
 sysdeps/unix/sysv/linux/pwrite64_nocancel.c | 29 +++++++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 sysdeps/unix/sysv/linux/pwrite64_nocancel.c

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index b206f77594..7b3bb30da2 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -280,7 +280,7 @@ sysdep_routines += xstatconv internal_statvfs \
 		   close_nocancel fcntl_nocancel \
 		   open_nocancel open64_nocancel \
 		   openat_nocancel openat64_nocancel \
-		   read_nocancel pread64_nocancel \
+		   read_nocancel pread64_nocancel pwrite64_nocancel \
 		   write_nocancel statx_cp stat_t64_cp
 
 sysdep_headers += bits/fcntl-linux.h
diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
index f06d57426a..27bb3811af 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -46,6 +46,9 @@ __typeof (__read) __read_nocancel;
 /* Non cancellable pread syscall (LFS version).  */
 __typeof (__pread64) __pread64_nocancel;
 
+/* Non cancellable pwrite syscall (LFS version).  */
+__typeof (__pwrite64) __pwrite64_nocancel;
+
 /* Uncancelable write.  */
 __typeof (__write) __write_nocancel;
 
@@ -78,6 +81,7 @@ hidden_proto (__openat_nocancel)
 hidden_proto (__openat64_nocancel)
 hidden_proto (__read_nocancel)
 hidden_proto (__pread64_nocancel)
+hidden_proto (__pwrite64_nocancel)
 hidden_proto (__write_nocancel)
 hidden_proto (__close_nocancel)
 hidden_proto (__fcntl64_nocancel)
diff --git a/sysdeps/unix/sysv/linux/pwrite64_nocancel.c b/sysdeps/unix/sysv/linux/pwrite64_nocancel.c
new file mode 100644
index 0000000000..06d0ae14d0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pwrite64_nocancel.c
@@ -0,0 +1,29 @@
+/* Linux pwrite64() syscall implementation -- non-cancellable.
+   Copyright (C) 2020 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
+   <http://www.gnu.org/licenses/>.  */
+
+#include <unistd.h>
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+ssize_t
+__pwrite64_nocancel (int fd, const void *buf, size_t count, off64_t offset)
+{
+  return INLINE_SYSCALL_CALL (pwrite64, fd, buf, count,
+			      SYSCALL_LL64_PRW (offset));
+}
+hidden_def (__pwrite64_nocancel)
-- 
2.25.1


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

* [PATCH 22/52] login: Use 64-bit time on struct lastlog [BZ #25844]
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (20 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 21/52] linux: Add pwrite64_nocancel Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-06  0:07   ` Joseph Myers
  2021-03-05 20:14 ` [PATCH 23/52] Remove __WORDSIZE_TIME64_COMPAT32 Adhemerval Zanella via Libc-alpha
                   ` (31 subsequent siblings)
  53 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

The new struct has the same size on both 32-bit and 64-bit
architectures.  As for utmp{x} 64-bit time_t support, a new file name
is defined for _PATH_LASTLOG.

Also two new symbols are added that read/write 'struct lastlog'
entries, 'lastlog_read' and 'lastlog_write'.  Both are GNU extensions
and handle the 32-bit entry operation if the argument is the old
_PATH_LASTLOG path.

Different than utmp{x}, no concurrent access is done (such as
advisory locking).  I modeled these function on how program that
access lastlog file uses (such as shadow-utils and util-linux).

The s390 is the only architecture that already defined the
'struct lastlog' with 64-bit time_t and to handle s390 has a specific
lastlog-compat.h header where 'is_path_lastlog_compat' already
return false (thus making both lastlog_read and lastlog_write
always read/write registers with 64-bit ll_time).

It also fixes BZ#25844 by adding the __attribute_nonstring__ on
ll_line and ll_host.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 bits/types/struct_lastlog.h                   | 10 +--
 login/Makefile                                |  4 +-
 login/Versions                                |  2 +
 .../lastlog-compat.h                          | 25 +++---
 login/lastlog_read.c                          | 78 ++++++++++++++++++
 login/lastlog_write.c                         | 64 +++++++++++++++
 login/tst-lastlog.c                           | 80 +++++++++++++++++++
 login/tst-lastlog.root/tst-lastlog.script     |  6 ++
 login/utmp.h                                  | 11 +++
 sysdeps/generic/paths.h                       |  3 +-
 sysdeps/mach/hurd/i386/libc.abilist           |  2 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  2 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  2 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      |  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 +
 sysdeps/unix/sysv/linux/ia64/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 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 +
 sysdeps/unix/sysv/linux/paths.h               |  3 +-
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  2 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  2 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |  2 +
 .../linux/powerpc/powerpc64/le/libc.abilist   |  2 +
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |  2 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/s390/lastlog-compat.h | 38 +++++++++
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  2 +
 .../unix/sysv/linux/s390/s390-64/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 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |  2 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  2 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  2 +
 45 files changed, 369 insertions(+), 21 deletions(-)
 rename sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h => login/lastlog-compat.h (77%)
 create mode 100644 login/lastlog_read.c
 create mode 100644 login/lastlog_write.c
 create mode 100644 login/tst-lastlog.c
 create mode 100644 login/tst-lastlog.root/tst-lastlog.script
 create mode 100644 sysdeps/unix/sysv/linux/s390/lastlog-compat.h

diff --git a/bits/types/struct_lastlog.h b/bits/types/struct_lastlog.h
index bde4dd2ad0..d267a24b1b 100644
--- a/bits/types/struct_lastlog.h
+++ b/bits/types/struct_lastlog.h
@@ -24,11 +24,7 @@
    previous logins.  */
 struct lastlog
 {
-#if __WORDSIZE_TIME64_COMPAT32
-  int32_t ll_time;
-#else
-  __time_t ll_time;
-#endif
-  char ll_line[UT_LINESIZE];
-  char ll_host[UT_HOSTSIZE];
+  int64_t ll_time;
+  char ll_line[UT_LINESIZE] __attribute_nonstring__;
+  char ll_host[UT_HOSTSIZE] __attribute_nonstring__;
 };
diff --git a/login/Makefile b/login/Makefile
index 794d061604..7d273d95bc 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -31,7 +31,8 @@ headers	:= utmp.h bits/utmp.h lastlog.h pty.h \
 routines := getlogin getlogin_r setlogin getlogin_r_chk \
 	    getutent getutent_r getutid getutline getutid_r getutline_r \
 	    utmp_file utmpname updwtmp getpt grantpt unlockpt ptsname \
-	    ptsname_r_chk utmp32 utmpx32 utmp-convert
+	    ptsname_r_chk utmp32 utmpx32 utmp-convert \
+	    lastlog_read lastlog_write
 
 CFLAGS-grantpt.c += -DLIBEXECDIR='"$(libexecdir)"'
 
@@ -53,6 +54,7 @@ ifeq ($(have-GLIBC_2.33),yes)
 tests-container-internal := tst-utmp32
 tests-container := tst-utmp-default
 endif
+tests-container += tst-lastlog
 
 # Build the -lutil library with these extra functions.
 extra-libs      := libutil
diff --git a/login/Versions b/login/Versions
index d28ecdca9f..5751fdcb71 100644
--- a/login/Versions
+++ b/login/Versions
@@ -57,6 +57,8 @@ libc {
     getutxent;
     getutxid;
     getutxline;
+    lastlog_read;
+    lastlog_write;
     pututline;
     pututxline;
     updwtmp;
diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h b/login/lastlog-compat.h
similarity index 77%
rename from sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h
rename to login/lastlog-compat.h
index 4faa9922f4..00403dd19a 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h
+++ b/login/lastlog-compat.h
@@ -16,19 +16,22 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _UTMP_H
-# error "Never include <bits/struct_lastlog.h> directly; use <utmp.h> instead."
-#endif
+#ifndef _LASTLOG_COMPAT_H
+#define _LASTLOG_COMPAT_H 1
+
+#include <string.h>
 
-/* The structure describing an entry in the database of
-   previous logins.  */
-struct lastlog
+struct lastlog_compat
 {
-#if __WORDSIZE == 32
-  int64_t ll_time;
-#else
-  __time_t ll_time;
-#endif
+  int32_t ll_time;
   char ll_line[UT_LINESIZE];
   char ll_host[UT_HOSTSIZE];
 };
+
+static inline bool
+is_path_lastlog_compat (const char *file)
+{
+  return strcmp (file, "/var/log/lastlog") == 0;
+}
+
+#endif
diff --git a/login/lastlog_read.c b/login/lastlog_read.c
new file mode 100644
index 0000000000..9880afdf00
--- /dev/null
+++ b/login/lastlog_read.c
@@ -0,0 +1,78 @@
+/* Read a lastlog entry.
+   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 <utmp.h>
+#include <stdbool.h>
+#include <not-cancel.h>
+#include <lastlog-compat.h>
+#include <shlib-compat.h>
+
+ssize_t
+lastlog_read (const char *file, uid_t uid, struct lastlog *ll)
+{
+  int fd = __open_nocancel (file, O_RDONLY | O_LARGEFILE | O_CLOEXEC);
+  if (fd == -1)
+    return -1;
+
+  size_t llsize;
+  void *data;
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+  struct lastlog_compat llcompat;
+  if (is_path_lastlog_compat (file))
+    {
+      llsize = sizeof (struct lastlog_compat);
+      data = &llcompat;
+    }
+  else
+#endif
+    {
+      llsize = sizeof (struct lastlog);
+      data = ll;
+    }
+
+  off64_t off = llsize * uid;
+  ssize_t r = __pread64_nocancel (fd, data, llsize, off);
+  __close_nocancel_nostatus (fd);
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+  if (r == llsize && data == &llcompat)
+    {
+      ll->ll_time = llcompat.ll_time;
+      memcpy (ll->ll_line, llcompat.ll_line, UT_LINESIZE);
+      memcpy (ll->ll_host, llcompat.ll_host, UT_HOSTSIZE);
+    }
+#endif
+
+  if (r == llsize)
+    {
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+      if (data == &llcompat)
+	{
+	  ll->ll_time = llcompat.ll_time;
+	  memcpy (ll->ll_line, llcompat.ll_line, UT_LINESIZE);
+	  memcpy (ll->ll_host, llcompat.ll_host, UT_HOSTSIZE);
+	}
+#endif
+      /* We need to return the expected 'struct lastlog' size in case of
+	 success.  */
+      r = sizeof (struct lastlog);
+    }
+
+  return r;
+}
diff --git a/login/lastlog_write.c b/login/lastlog_write.c
new file mode 100644
index 0000000000..37bad677d0
--- /dev/null
+++ b/login/lastlog_write.c
@@ -0,0 +1,64 @@
+/* Write a lastlog entry.
+   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 <utmp.h>
+#include <stdbool.h>
+#include <not-cancel.h>
+#include <lastlog-compat.h>
+#include <shlib-compat.h>
+
+ssize_t
+lastlog_write (const char *file, uid_t uid, const struct lastlog *ll)
+{
+  int fd = __open_nocancel (file, O_WRONLY | O_LARGEFILE | O_CLOEXEC);
+  if (fd == -1)
+    return -1;
+
+  size_t llsize;
+  const void *data;
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+  struct lastlog_compat llcompat;
+  if (is_path_lastlog_compat (file))
+    {
+      llcompat.ll_time = ll->ll_time;
+      memcpy (llcompat.ll_line, ll->ll_line, UT_LINESIZE);
+      memcpy (llcompat.ll_host, ll->ll_host, UT_HOSTSIZE);
+      llsize = sizeof (struct lastlog_compat);
+      data = &llcompat;
+    }
+  else
+#endif
+    {
+      llsize = sizeof (struct lastlog);
+      data = ll;
+    }
+
+  off64_t off = llsize * uid;
+  ssize_t r = __pwrite64_nocancel (fd, data, llsize, off);
+  __close_nocancel_nostatus (fd);
+
+  /* We need to return the expected 'struct lastlog' size in case of
+     success.  */
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+  if (r == llsize && data == &llcompat)
+    r = sizeof (struct lastlog);
+#endif
+
+  return r;
+}
diff --git a/login/tst-lastlog.c b/login/tst-lastlog.c
new file mode 100644
index 0000000000..f36602df3e
--- /dev/null
+++ b/login/tst-lastlog.c
@@ -0,0 +1,80 @@
+/* Tests for lastlog read/write functions.
+   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 <stdlib.h>
+#include <string.h>
+#include <utmp.h>
+
+#include <support/check.h>
+#include <support/temp_file.h>
+
+#include <stdio.h>
+
+static struct
+{
+  uid_t uid;
+  struct lastlog ll;
+} entry[] =
+{
+  { 0,    { .ll_time = 1000, .ll_line = "tty1" } },
+  { 1000, { .ll_time = 2000, .ll_line = "pts/0", .ll_host = "127.0.0.1" } },
+  { 20,   { .ll_time = 3000, .ll_line = "pts/1", .ll_host = "192.168.0.1" } },
+  { 30,   { .ll_time = 4000, .ll_line = "tty2" } },
+};
+const size_t entry_size = sizeof (entry) / sizeof (entry[0]);
+
+static void
+run_test (const char *filename)
+{
+  for (int n = 0; n < entry_size; n++)
+    TEST_COMPARE (lastlog_write (filename, entry[n].uid, &entry[n].ll),
+		  sizeof (struct lastlog));
+
+  for (int n = 0; n < entry_size; n++)
+    {
+      struct lastlog ll;
+      TEST_COMPARE (lastlog_read (filename, entry[n].uid, &ll),
+		    sizeof (struct lastlog));
+      TEST_COMPARE (ll.ll_time, entry[n].ll.ll_time);
+      TEST_COMPARE_BLOB (ll.ll_line, UT_LINESIZE,
+			 entry[n].ll.ll_line, UT_LINESIZE);
+      TEST_COMPARE_BLOB (ll.ll_host, UT_HOSTSIZE,
+			 entry[n].ll.ll_host, UT_HOSTSIZE);
+    }
+
+  /* Check with an non present uid.  */
+  {
+    struct lastlog ll;
+    TEST_COMPARE (lastlog_read (filename, 4000, &ll), 0);
+  }
+}
+
+static int
+do_test (void)
+{
+  /* The path triggers the read/write of compat (32-bit ll_time) entries
+     for ABI that used to support it.  */
+  run_test ("/var/run/lastlog");
+
+  /* Any other file handles new (64-bit ll_time) entries.  */
+  run_test ("/var/run/lastlog.v2");
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/login/tst-lastlog.root/tst-lastlog.script b/login/tst-lastlog.root/tst-lastlog.script
new file mode 100644
index 0000000000..ca34ce7021
--- /dev/null
+++ b/login/tst-lastlog.root/tst-lastlog.script
@@ -0,0 +1,6 @@
+mkdirp 0755 /var/run
+touch  0664 /var/run/lastlog
+touch  0664 /var/run/lastlog.v2
+
+# Must run localedef as root to write into default paths.
+su
diff --git a/login/utmp.h b/login/utmp.h
index 7fc2d5cdf1..02a445ee82 100644
--- a/login/utmp.h
+++ b/login/utmp.h
@@ -91,6 +91,17 @@ extern int getutline_r (const struct utmp *__line,
 
 #endif	/* Use misc.  */
 
+#ifdef __USE_GNU
+/* Read the struct lastlog LL with UID from file FILE.  */
+extern ssize_t lastlog_read (const char *__file, uid_t __uid,
+			     struct lastlog *__ll)
+     __THROW __nonnull ((1, 3));
+/* Write the struct lastlog LL with UID from file FILE.  */
+extern ssize_t lastlog_write (const char *__file, uid_t __uid,
+			      const struct lastlog *__ll)
+     __THROW __nonnull ((1, 3));
+#endif
+
 __END_DECLS
 
 #endif /* utmp.h  */
diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h
index ab2980e14a..9321ad7294 100644
--- a/sysdeps/generic/paths.h
+++ b/sysdeps/generic/paths.h
@@ -46,7 +46,8 @@
 #define	_PATH_DRUM	"/dev/drum"
 #define	_PATH_GSHADOW	"/etc/gshadow"
 #define	_PATH_KMEM	"/dev/kmem"
-#define	_PATH_LASTLOG	"/var/log/lastlog"
+#define _PATH_LASTLOG_VER ".v2"
+#define	_PATH_LASTLOG	"/var/log/lastlog" _PATH_LASTLOG_VER
 #define	_PATH_MAILDIR	"/var/mail"
 #define	_PATH_MAN	"/usr/share/man"
 #define	_PATH_MEM	"/dev/mem"
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 3a657d5e0d..d5e44b181b 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2215,6 +2215,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 4f91e85ba0..1516f80402 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2183,6 +2183,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 764ea51779..5ac4b37c02 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2265,6 +2265,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 2ebd24f3a6..cefb1394e8 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -1943,6 +1943,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 5cfcb00ddb..8111b49085 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -167,6 +167,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index d140654389..4dba1f2f46 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -164,6 +164,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 11aa688b83..a5ff3d90ca 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2127,6 +2127,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 14eef860ac..89a0f11166 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2086,6 +2086,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index e1db1488a9..a7c408d18c 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2253,6 +2253,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index f5b4433142..259b8020e8 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2118,6 +2118,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 213853a1f1..e1171a34aa 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -168,6 +168,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 15dda47ba8..a521506506 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2198,6 +2198,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 3ffd49cbfb..aba642460c 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2178,6 +2178,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 2bccbe960a..d3d653d144 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2175,6 +2175,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 209f5f588b..a4ce56c34f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2169,6 +2169,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 45d976790c..51fbf0b1e1 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2167,6 +2167,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index ab3156c917..5642781479 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2175,6 +2175,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index f8d0534156..10954ebee4 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2169,6 +2169,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index f56e5ad002..848cb2e599 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2216,6 +2216,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h
index 89686bcf88..b78dff7ae3 100644
--- a/sysdeps/unix/sysv/linux/paths.h
+++ b/sysdeps/unix/sysv/linux/paths.h
@@ -47,7 +47,8 @@
 #define	_PATH_GSHADOW	"/etc/gshadow"
 #define	_PATH_KLOG	"/proc/kmsg"
 #define	_PATH_KMEM	"/dev/kmem"
-#define	_PATH_LASTLOG	"/var/log/lastlog"
+#define _PATH_LASTLOG_VER ".v2"
+#define	_PATH_LASTLOG	"/var/log/lastlog" _PATH_LASTLOG_VER
 #define	_PATH_MAILDIR	"/var/mail"
 #define	_PATH_MAN	"/usr/share/man"
 #define	_PATH_MEM	"/dev/mem"
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index cfb457400c..93e83fa602 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2225,6 +2225,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index e1fd74fbad..ec0b6d69b1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2258,6 +2258,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 5c9cdb33b4..f5bd1db3a0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2088,6 +2088,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 4dcac4c766..27863e57af 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2378,6 +2378,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index 69bc04c36c..08c5a32d5d 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -1945,6 +1945,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index dc4a3223e6..88b6fa7fc9 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2145,6 +2145,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/s390/lastlog-compat.h b/sysdeps/unix/sysv/linux/s390/lastlog-compat.h
new file mode 100644
index 0000000000..56fadc3b3b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/lastlog-compat.h
@@ -0,0 +1,38 @@
+/* Compat lastlog definitions.  s390 definition.
+   Copyright (C) 2020 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 _LASTLOG_COMPAT_H
+#define _LASTLOG_COMPAT_H 1
+
+/* The s390 changes its lastlog to 64-bit on glibc 2.9 without any handling
+   of old format.  The is_path_lastlog_compat assumes 64-bit as default.  */
+
+struct lastlog_compat
+{
+  int64_t ll_time;
+  char ll_line[UT_LINESIZE];
+  char ll_host[UT_HOSTSIZE];
+};
+
+static inline bool
+is_path_lastlog_compat (const char *file)
+{
+  return false;
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index cead75acc5..7bc5c8866b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2212,6 +2212,8 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 31366dd7e6..e26a24fe65 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2113,6 +2113,8 @@ GLIBC_2.33 mknodat F
 GLIBC_2.33 stat F
 GLIBC_2.33 stat64 F
 GLIBC_2.34 __libc_start_main F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 6deb52d706..06143b0283 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2093,6 +2093,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 17a141d5b9..eab2af349b 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2090,6 +2090,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index b64b351797..4783a8fa97 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2214,6 +2214,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index e3e01c29fc..47ded40426 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2141,6 +2141,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 9995da84a8..0d144a0c10 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2100,6 +2100,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index adccf45120..a3580872d3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2197,6 +2197,8 @@ GLIBC_2.34 getutmpx F
 GLIBC_2.34 getutxent F
 GLIBC_2.34 getutxid F
 GLIBC_2.34 getutxline F
+GLIBC_2.34 lastlog_read F
+GLIBC_2.34 lastlog_write F
 GLIBC_2.34 pututline F
 GLIBC_2.34 pututxline F
 GLIBC_2.34 updwtmp F
-- 
2.25.1


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

* [PATCH 23/52] Remove __WORDSIZE_TIME64_COMPAT32
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (21 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 22/52] login: Use 64-bit time on struct lastlog [BZ #25844] Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 24/52] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella via Libc-alpha
                   ` (30 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 UTC (permalink / raw)
  To: libc-alpha

With 'struct utmpx', 'struct utmp', and 'struct lastlog' using
64-bit time unconditionally this macro is not used anymore.
---
 bits/wordsize.h                                 | 6 ------
 sysdeps/aarch64/bits/wordsize.h                 | 2 --
 sysdeps/mips/bits/wordsize.h                    | 6 ------
 sysdeps/powerpc/powerpc32/bits/wordsize.h       | 2 --
 sysdeps/powerpc/powerpc64/bits/wordsize.h       | 2 --
 sysdeps/riscv/bits/wordsize.h                   | 2 --
 sysdeps/s390/s390-32/bits/wordsize.h            | 2 --
 sysdeps/s390/s390-64/bits/wordsize.h            | 2 --
 sysdeps/sparc/sparc32/bits/wordsize.h           | 2 --
 sysdeps/sparc/sparc64/bits/wordsize.h           | 2 --
 sysdeps/unix/sysv/linux/alpha/bits/wordsize.h   | 1 -
 sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h | 2 --
 sysdeps/unix/sysv/linux/sparc/bits/wordsize.h   | 2 --
 sysdeps/wordsize-32/bits/wordsize.h             | 1 -
 sysdeps/wordsize-64/bits/wordsize.h             | 1 -
 sysdeps/x86/bits/wordsize.h                     | 3 ---
 16 files changed, 38 deletions(-)

diff --git a/bits/wordsize.h b/bits/wordsize.h
index 14edae3a11..e20fd2e4c2 100644
--- a/bits/wordsize.h
+++ b/bits/wordsize.h
@@ -19,9 +19,3 @@
    __WORDSIZE is 32 and ptrdiff_t is type 'int' and leave undefined if
    __WORDSIZE is 64.  */
 #define __WORDSIZE32_PTRDIFF_LONG
-
-/* Set to 1 in order to force time types to be 32 bits instead of 64 bits in
-   struct lastlog and struct utmp{,x} on 64-bit ports.  This may be done in
-   order to make 64-bit ports compatible with 32-bit ports.  Set to 0 for
-   64-bit ports where the time types are 64-bits or for any 32-bit ports.  */
-#define __WORDSIZE_TIME64_COMPAT32
diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
index 91da566b74..473ab82dbd 100644
--- a/sysdeps/aarch64/bits/wordsize.h
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -24,5 +24,3 @@
 # define __WORDSIZE32_SIZE_ULONG	1
 # define __WORDSIZE32_PTRDIFF_LONG	1
 #endif
-
-#define __WORDSIZE_TIME64_COMPAT32	0
diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h
index 18ef16c639..de2cfd844c 100644
--- a/sysdeps/mips/bits/wordsize.h
+++ b/sysdeps/mips/bits/wordsize.h
@@ -19,12 +19,6 @@
 
 #define __WORDSIZE			_MIPS_SZPTR
 
-#if _MIPS_SIM == _ABI64
-# define __WORDSIZE_TIME64_COMPAT32	1
-#else
-# define __WORDSIZE_TIME64_COMPAT32	0
-#endif
-
 #if __WORDSIZE == 32
 #define __WORDSIZE32_SIZE_ULONG		0
 #define __WORDSIZE32_PTRDIFF_LONG	0
diff --git a/sysdeps/powerpc/powerpc32/bits/wordsize.h b/sysdeps/powerpc/powerpc32/bits/wordsize.h
index 04ca9debf0..df1aa27244 100644
--- a/sysdeps/powerpc/powerpc32/bits/wordsize.h
+++ b/sysdeps/powerpc/powerpc32/bits/wordsize.h
@@ -2,10 +2,8 @@
 
 #if defined __powerpc64__
 # define __WORDSIZE	64
-# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
-# define __WORDSIZE_TIME64_COMPAT32	0
 # define __WORDSIZE32_SIZE_ULONG	0
 # define __WORDSIZE32_PTRDIFF_LONG	0
 #endif
diff --git a/sysdeps/powerpc/powerpc64/bits/wordsize.h b/sysdeps/powerpc/powerpc64/bits/wordsize.h
index 04ca9debf0..df1aa27244 100644
--- a/sysdeps/powerpc/powerpc64/bits/wordsize.h
+++ b/sysdeps/powerpc/powerpc64/bits/wordsize.h
@@ -2,10 +2,8 @@
 
 #if defined __powerpc64__
 # define __WORDSIZE	64
-# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
-# define __WORDSIZE_TIME64_COMPAT32	0
 # define __WORDSIZE32_SIZE_ULONG	0
 # define __WORDSIZE32_PTRDIFF_LONG	0
 #endif
diff --git a/sysdeps/riscv/bits/wordsize.h b/sysdeps/riscv/bits/wordsize.h
index e7fcc1932c..0d7508bf9c 100644
--- a/sysdeps/riscv/bits/wordsize.h
+++ b/sysdeps/riscv/bits/wordsize.h
@@ -22,8 +22,6 @@
 # error unsupported ABI
 #endif
 
-#define __WORDSIZE_TIME64_COMPAT32  1
-
 #if __WORDSIZE == 32
 # define __WORDSIZE32_SIZE_ULONG    0
 # define __WORDSIZE32_PTRDIFF_LONG  0
diff --git a/sysdeps/s390/s390-32/bits/wordsize.h b/sysdeps/s390/s390-32/bits/wordsize.h
index 129e47182b..755050861e 100644
--- a/sysdeps/s390/s390-32/bits/wordsize.h
+++ b/sysdeps/s390/s390-32/bits/wordsize.h
@@ -7,5 +7,3 @@
 # define __WORDSIZE32_SIZE_ULONG       1
 # define __WORDSIZE32_PTRDIFF_LONG      0
 #endif
-
-#define __WORDSIZE_TIME64_COMPAT32     0
diff --git a/sysdeps/s390/s390-64/bits/wordsize.h b/sysdeps/s390/s390-64/bits/wordsize.h
index 00e88b0628..01245a5b71 100644
--- a/sysdeps/s390/s390-64/bits/wordsize.h
+++ b/sysdeps/s390/s390-64/bits/wordsize.h
@@ -7,5 +7,3 @@
 # define __WORDSIZE32_SIZE_ULONG       1
 # define __WORDSIZE32_PTRDIFF_LONG     0
 #endif
-
-#define __WORDSIZE_TIME64_COMPAT32     0
diff --git a/sysdeps/sparc/sparc32/bits/wordsize.h b/sysdeps/sparc/sparc32/bits/wordsize.h
index 2f66f10d72..10b73267f0 100644
--- a/sysdeps/sparc/sparc32/bits/wordsize.h
+++ b/sysdeps/sparc/sparc32/bits/wordsize.h
@@ -2,10 +2,8 @@
 
 #if defined __arch64__ || defined __sparcv9
 # define __WORDSIZE	64
-# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
-# define __WORDSIZE_TIME64_COMPAT32	0
 # define __WORDSIZE32_SIZE_ULONG	0
 # define __WORDSIZE32_PTRDIFF_LONG	0
 #endif
diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h b/sysdeps/sparc/sparc64/bits/wordsize.h
index 2f66f10d72..10b73267f0 100644
--- a/sysdeps/sparc/sparc64/bits/wordsize.h
+++ b/sysdeps/sparc/sparc64/bits/wordsize.h
@@ -2,10 +2,8 @@
 
 #if defined __arch64__ || defined __sparcv9
 # define __WORDSIZE	64
-# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
-# define __WORDSIZE_TIME64_COMPAT32	0
 # define __WORDSIZE32_SIZE_ULONG	0
 # define __WORDSIZE32_PTRDIFF_LONG	0
 #endif
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
index cb3c41ddb4..72c5634c0a 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
@@ -16,4 +16,3 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define __WORDSIZE	64
-#define __WORDSIZE_TIME64_COMPAT32	0
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
index 04ca9debf0..df1aa27244 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
@@ -2,10 +2,8 @@
 
 #if defined __powerpc64__
 # define __WORDSIZE	64
-# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
-# define __WORDSIZE_TIME64_COMPAT32	0
 # define __WORDSIZE32_SIZE_ULONG	0
 # define __WORDSIZE32_PTRDIFF_LONG	0
 #endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
index 7562875ee2..10b73267f0 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
@@ -2,10 +2,8 @@
 
 #if defined __arch64__ || defined __sparcv9
 # define __WORDSIZE	64
-# define __WORDSIZE_TIME64_COMPAT32	1
 #else
 # define __WORDSIZE	32
 # define __WORDSIZE32_SIZE_ULONG	0
 # define __WORDSIZE32_PTRDIFF_LONG	0
-# define __WORDSIZE_TIME64_COMPAT32	0
 #endif
diff --git a/sysdeps/wordsize-32/bits/wordsize.h b/sysdeps/wordsize-32/bits/wordsize.h
index cfa60443fc..bcd2fef565 100644
--- a/sysdeps/wordsize-32/bits/wordsize.h
+++ b/sysdeps/wordsize-32/bits/wordsize.h
@@ -16,6 +16,5 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define __WORDSIZE			32
-#define __WORDSIZE_TIME64_COMPAT32	0
 #define __WORDSIZE32_SIZE_ULONG		0
 #define __WORDSIZE32_PTRDIFF_LONG	0
diff --git a/sysdeps/wordsize-64/bits/wordsize.h b/sysdeps/wordsize-64/bits/wordsize.h
index f4f0681de5..d875811fab 100644
--- a/sysdeps/wordsize-64/bits/wordsize.h
+++ b/sysdeps/wordsize-64/bits/wordsize.h
@@ -16,4 +16,3 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define __WORDSIZE			64
-#define __WORDSIZE_TIME64_COMPAT32	0
diff --git a/sysdeps/x86/bits/wordsize.h b/sysdeps/x86/bits/wordsize.h
index 70f652bca1..cf250cc6df 100644
--- a/sysdeps/x86/bits/wordsize.h
+++ b/sysdeps/x86/bits/wordsize.h
@@ -9,9 +9,6 @@
 #endif
 
 #ifdef __x86_64__
-# define __WORDSIZE_TIME64_COMPAT32	1
 /* Both x86-64 and x32 use the 64-bit system call interface.  */
 # define __SYSCALL_WORDSIZE		64
-#else
-# define __WORDSIZE_TIME64_COMPAT32	0
 #endif
-- 
2.25.1


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

* [PATCH 24/52] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (22 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 23/52] Remove __WORDSIZE_TIME64_COMPAT32 Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 25/52] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella via Libc-alpha
                   ` (29 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 25/52] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (23 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 24/52] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 26/52] linux: Add recvvmsg " Adhemerval Zanella via Libc-alpha
                   ` (28 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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 7b3bb30da2..6743936b5a 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 c35f783e2a..257ccbd3b4 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.25.1


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

* [PATCH 26/52] linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (24 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 25/52] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 27/52] y2038: Add __USE_TIME_BITS64 support for time_t Adhemerval Zanella via Libc-alpha
                   ` (27 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 27/52] y2038: Add __USE_TIME_BITS64 support for time_t
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (25 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 26/52] linux: Add recvvmsg " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 28/52] y2038: Add __USE_TIME_BITS64 support for struct timeval Adhemerval Zanella via Libc-alpha
                   ` (26 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 28/52] y2038: Add __USE_TIME_BITS64 support for struct timeval
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (26 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 27/52] y2038: Add __USE_TIME_BITS64 support for time_t Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 29/52] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella via Libc-alpha
                   ` (25 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 29/52] y2038: Add __USE_TIME_BITS64 support for struct timespec
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (27 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 28/52] y2038: Add __USE_TIME_BITS64 support for struct timeval Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 30/52] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Adhemerval Zanella via Libc-alpha
                   ` (24 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 30/52] y2038: Add __USE_TIME_BITS64 support for struct utimbuf
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (28 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 29/52] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 31/52] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Adhemerval Zanella via Libc-alpha
                   ` (23 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 31/52] y2038: linux: Add __USE_TIME_BITS64 support for struct timex
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (29 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 30/52] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 32/52] y2038: Use a common definition for stat Adhemerval Zanella via Libc-alpha
                   ` (22 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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.25.1


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

* [PATCH 32/52] y2038: Use a common definition for stat
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (30 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 31/52] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:14 ` [PATCH 33/52] y2038: Use a common definition for msqid_ds Adhemerval Zanella via Libc-alpha
                   ` (21 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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 ++++++-----
 sysdeps/unix/sysv/linux/struct_stat_time64.h  | 59 +-----------
 .../unix/sysv/linux/x86/bits/struct_stat.h    | 90 ++++++++++---------
 9 files changed, 285 insertions(+), 220 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 6743936b5a..3263b9c0e5 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/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.25.1


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

* [PATCH 33/52] y2038: Use a common definition for msqid_ds
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (31 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 32/52] y2038: Use a common definition for stat Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:14 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 34/52] y2038: Use a common definition for semid_ds Adhemerval Zanella via Libc-alpha
                   ` (20 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:14 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 3263b9c0e5..78e7be9ad5 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.25.1


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

* [PATCH 34/52] y2038: Use a common definition for semid_ds
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (32 preceding siblings ...)
  2021-03-05 20:14 ` [PATCH 33/52] y2038: Use a common definition for msqid_ds Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 35/52] y2038: Use a common definition for shmid_ds Adhemerval Zanella via Libc-alpha
                   ` (19 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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 78e7be9ad5..02f528883e 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.25.1


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

* [PATCH 35/52] y2038: Use a common definition for shmid_ds
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (33 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 34/52] y2038: Use a common definition for semid_ds Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 36/52] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Adhemerval Zanella via Libc-alpha
                   ` (18 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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 02f528883e..fc2a17307c 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.25.1


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

* [PATCH 36/52] y2038: Add __USE_TIME_BITS64 support for socket-constants.h
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (34 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 35/52] y2038: Use a common definition for shmid_ds Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 37/52] time: Add 64 bit time support for getdate Adhemerval Zanella via Libc-alpha
                   ` (17 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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.25.1


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

* [PATCH 37/52] time: Add 64 bit time support for getdate
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (35 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 36/52] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-08 21:27   ` Lukasz Majewski
  2021-03-05 20:15 ` [PATCH 38/52] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (16 subsequent siblings)
  53 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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/time.h     | 12 ++++++++++--
 time/getdate.c     | 22 ++++++++++------------
 time/tst-getdate.c | 14 ++++----------
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/include/time.h b/include/time.h
index caf2af5e74..36754695c9 100644
--- a/include/time.h
+++ b/include/time.h
@@ -280,8 +280,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.  */
@@ -502,6 +502,14 @@ time_now (void)
   __clock_gettime (TIME_CLOCK_GETTIME_CLOCKID, &ts);
   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;
+}
 #endif
 
 #endif
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.25.1


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

* [PATCH 38/52] y2038: Add support for 64 bit time on legacy ABIs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (36 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 37/52] time: Add 64 bit time support for getdate Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-08 21:27   ` Lukasz Majewski
  2021-03-05 20:15 ` [PATCH 39/52] posix: Add glob64 with 64 bit time_t support Adhemerval Zanella via Libc-alpha
                   ` (15 subsequent siblings)
  53 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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:
    - adjtimex
    - adjtime
    - clock_adjtime
    - clock_getres
    - clock_gettime
    - clock_nanosleep
    - clock_settime
    - ctime
    - ctime_r
    - difftime
    - futimens
    - futimes
    - futimesat
    - getitimer
    - getrusage
    - gettimeofday
    - gmtime
    - gmtime_r
    - localtime
    - localtime_r
    - lutimes
    - mktime
    - msgctl
    - nanosleep
    - ntp_gettime
    - ntp_gettimex
    - ppoll
    - pselect
    - recvmmsg
    - sched_rr_get_interval
    - select
    - semctl
    - semtimedop
    - setitimer
    - settimeofday
    - shmctl
    - sigtimedwait
    - thrd_sleep
    - time
    - timegm
    - timelocal (alias to mktime)
    - timerfd_gettime
    - timerfd_settime
    - timespec_get
    - utime
    - utimensat
    - utimes
    - wait3
    - wait4

  * libpthread:
    - mtx_timedlock
    - 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
    - sem_clockwait
    - sem_timedwait

  * 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 ++++
 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              | 113 ++++++++++++++++
 sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  52 +++++++
 .../unix/sysv/linux/arm/be/libpthread.abilist |  14 ++
 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   |  52 +++++++
 .../unix/sysv/linux/arm/le/libpthread.abilist |  14 ++
 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/csky/libanl.abilist   |   1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  52 +++++++
 .../unix/sysv/linux/csky/libpthread.abilist   |  14 ++
 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     |  52 +++++++
 .../unix/sysv/linux/hppa/libpthread.abilist   |  14 ++
 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     |  52 +++++++
 .../unix/sysv/linux/i386/libpthread.abilist   |  14 ++
 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     |  52 +++++++
 .../linux/m68k/coldfire/libpthread.abilist    |  14 ++
 .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
 .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  52 +++++++
 .../sysv/linux/m68k/m680x0/libpthread.abilist |  14 ++
 .../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     |  52 +++++++
 .../linux/microblaze/be/libpthread.abilist    |  14 ++
 .../sysv/linux/microblaze/be/librt.abilist    |   5 +
 .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
 .../sysv/linux/microblaze/le/libc.abilist     |  52 +++++++
 .../linux/microblaze/le/libpthread.abilist    |  14 ++
 .../sysv/linux/microblaze/le/librt.abilist    |   5 +
 .../sysv/linux/microblaze/time64-compat.h     |   2 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  52 +++++++
 .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
 .../sysv/linux/mips/mips32/libpthread.abilist |  14 ++
 .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  52 +++++++
 .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
 .../sysv/linux/mips/mips64/n32/libanl.abilist |   1 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  52 +++++++
 .../linux/mips/mips64/n32/libpthread.abilist  |  14 ++
 .../sysv/linux/mips/mips64/n32/librt.abilist  |   5 +
 .../linux/mips/mips64/n32/time64-compat.h     |   2 +
 sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  52 +++++++
 .../unix/sysv/linux/nios2/libpthread.abilist  |  14 ++
 sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
 sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  52 +++++++
 .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
 .../powerpc/powerpc32/libpthread.abilist      |  14 ++
 .../linux/powerpc/powerpc32/librt.abilist     |   5 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  52 +++++++
 .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
 .../sysv/linux/s390/s390-32/libanl.abilist    |   1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  52 +++++++
 .../linux/s390/s390-32/libpthread.abilist     |  14 ++
 .../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    |  52 +++++++
 .../unix/sysv/linux/sh/be/libpthread.abilist  |  14 ++
 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    |  52 +++++++
 .../unix/sysv/linux/sh/le/libpthread.abilist  |  14 ++
 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     |  52 +++++++
 .../linux/sparc/sparc32/libpthread.abilist    |  14 ++
 .../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           |  28 +++-
 sysvipc/sys/msg.h                             |  10 ++
 sysvipc/sys/sem.h                             |  21 +++
 sysvipc/sys/shm.h                             |  10 ++
 time/sys/time.h                               |  71 ++++++++++
 time/time.h                                   | 128 +++++++++++++++++-
 123 files changed, 2315 insertions(+), 29 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 71c7d8b5ec..2fd88294f5 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 73a1a0df97..7766db65a5 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,11 @@ Major new features:
   a dump of information related to IFUNC resolver operation and
   glibc-hwcaps subdirectory selection.
 
+* 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:
 
   [Add deprecations, removals and changes affecting compatibility here]
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 2431dd1e14..4a0ce7eaad 100644
--- a/io/sys/poll.h
+++ b/io/sys/poll.h
@@ -63,6 +63,17 @@ extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
 extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
 		  const struct timespec *__timeout,
 		  const __sigset_t *__ss);
+
+# 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);
+#  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/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 a04a3a2754..8f3a41279f 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.
@@ -773,16 +791,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.  */
@@ -919,16 +960,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.  */
@@ -941,16 +1007,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.  */
@@ -1027,10 +1119,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
@@ -1040,11 +1145,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 257ccbd3b4..45d31a46bc 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,75 @@ libc {
     getdents64; gettid; tgkill;
   }
   GLIBC_2.32 {
+  }
+  GLIBC_2.34 {
+%ifdef TIME64_NON_DEFAULT
+    # 64 bit time_t support
+    # io
+    __ppoll64;
+    __utime64;
+    __stat64_time64;
+    __lstat64_time64;
+    __fstat64_time64;
+    __fstatat64_time64;
+    # misc
+    __futimes64;
+    __futimesat64;
+    __lutimes64;
+    __select64;
+    __utimes64;
+    # posix
+    __nanosleep64;
+    __pselec64;
+    __wait3_time64;
+    __wait4_time64;
+    # nptl
+    __thrd_sleep64;
+    # resouces
+    __getrusage64;
+    # signal
+    __sigtimedwait64;
+    # sysvipc
+    __msgctl64;
+    __semctl64;
+    __semtimedop64;
+    __shmctl64;
+    # time
+    ___adjtimex64;
+    __adjtime64;
+    __clock_adjtime64;
+    __clock_getres64;
+    __clock_gettime64;
+    __clock_nanosleep_time64;
+    __clock_settime64;
+    __ctime64;
+    __ctime64_r;
+    __difftime64;
+    __futimens64;
+    __localtime64;
+    __localtime64_r;
+    __getitimer64;
+    __gettimeofday64;
+    __gmtime64;
+    __gmtime64_r;
+    __mktime64;
+    __nanosleep64;
+    __setitimer64;
+    __settimeofday64;
+    __time64;
+    __timegm64;
+    __timespec_get64;
+    __utimensat64;
+     __utimes64;
+    # misc
+    __ntp_gettime64;
+    __ntp_gettimex64;
+    __pselect64;
+    __recvmmsg64;
+    __sched_rr_get_interval64;
+    __timerfd_gettime64;
+    __timerfd_settime64;
+%endif
   }
   GLIBC_PRIVATE {
     # functions used in other libraries
@@ -182,3 +252,46 @@ libc {
     __netlink_assert_response;
   }
 }
+
+libpthread {
+  GLIBC_2.34 {
+%ifdef TIME64_NON_DEFAULT
+    # 64 bit time_t support
+    __cnd_timedwait64;
+    __mtx_timedlock64;
+    __pthread_clockjoin_np64;
+    __pthread_cond_timedwait64;
+    __pthread_cond_clockwait64;
+    __pthread_mutex_timedlock64;
+    __pthread_mutex_clocklock64;
+    __pthread_rwlock_clockrdlock64;
+    __pthread_rwlock_clockwrlock64;
+    __pthread_rwlock_timedrdlock64;
+    __pthread_rwlock_timedwrlock64;
+    __pthread_timedjoin_np64;
+    __sem_clockwait64;
+    __sem_timedwait64;
+%endif
+  }
+}
+
+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 8111b49085..d63e0dee75 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -155,7 +155,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
index b6c26c7a50..3fe358cc31 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
@@ -33,6 +33,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 _IO_flockfile F
 GLIBC_2.4 _IO_ftrylockfile F
 GLIBC_2.4 _IO_funlockfile 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 4dba1f2f46..1a0f0d1312 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -152,7 +152,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
index b6c26c7a50..3fe358cc31 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
@@ -33,6 +33,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 _IO_flockfile F
 GLIBC_2.4 _IO_ftrylockfile F
 GLIBC_2.4 _IO_funlockfile 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/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 a5ff3d90ca..120a3fc1ce 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2115,7 +2115,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
index 6ce59276a7..51d5822091 100644
--- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
@@ -211,3 +211,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 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 89a0f11166..77c7d2faf3 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2074,7 +2074,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
index cabc5af858..0cdb30a3c1 100644
--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
@@ -218,6 +218,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 a7c408d18c..7d1a9691e7 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2241,7 +2241,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
index 18177307c8..b3a825d60e 100644
--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
@@ -226,6 +226,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 e1171a34aa..da00a3d3c3 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -156,7 +156,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
index b6c26c7a50..3fe358cc31 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
@@ -33,6 +33,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 _IO_flockfile F
 GLIBC_2.4 _IO_ftrylockfile F
 GLIBC_2.4 _IO_funlockfile 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 a521506506..3e0f00210f 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2186,7 +2186,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
index 18177307c8..b3a825d60e 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
@@ -226,6 +226,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 aba642460c..9bed39a8e8 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2166,7 +2166,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
index 60397187b6..855c469c63 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
@@ -218,3 +218,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 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 d3d653d144..872321bbab 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2163,7 +2163,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
index 60397187b6..855c469c63 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
@@ -218,3 +218,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 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 a4ce56c34f..77dcc8ab7d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2157,7 +2157,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid 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/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
index b35d7f19ca..887a32a376 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
@@ -227,6 +227,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 51fbf0b1e1..c41f85ce01 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2155,7 +2155,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid 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 5642781479..4208f9df82 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2163,7 +2163,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
index b35d7f19ca..887a32a376 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
@@ -227,6 +227,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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/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 848cb2e599..ff0bb57cb6 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2204,7 +2204,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
index 924ad6e451..18407317e6 100644
--- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
@@ -218,3 +218,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 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 93e83fa602..57f1fe012a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2213,7 +2213,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid 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/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
index 13b41dafb6..711812931d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
@@ -228,6 +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 ec0b6d69b1..6c9fa9c098 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2246,7 +2246,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid 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 7bc5c8866b..d357619c55 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2211,7 +2211,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 lastlog_read F
 GLIBC_2.34 lastlog_write F
 GLIBC_2.4 _IO_fprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
index 0a60f1cca2..28db1e4b6d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
@@ -228,6 +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 06143b0283..725952a763 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2081,7 +2081,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
index cabc5af858..0cdb30a3c1 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
@@ -218,6 +218,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 eab2af349b..7f07b96287 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2078,7 +2078,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
index cabc5af858..0cdb30a3c1 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
@@ -218,6 +218,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 4783a8fa97..3b7af990d4 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2202,7 +2202,59 @@ 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 __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 __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 __recvmmsg64 F
+GLIBC_2.34 __sched_rr_get_interval64 F
+GLIBC_2.34 __select64 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 __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 getutent F
 GLIBC_2.34 getutent_r F
 GLIBC_2.34 getutid F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
index 390b6384d0..b5f763d9fd 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
@@ -228,6 +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F
 GLIBC_2.30 pthread_rwlock_clockwrlock F
 GLIBC_2.30 sem_clockwait F
 GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.34 __cnd_timedwait64 F
+GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
+GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
+GLIBC_2.34 __sem_timedwait64 F
 GLIBC_2.4 pthread_mutex_consistent_np F
 GLIBC_2.4 pthread_mutex_getprioceiling F
 GLIBC_2.4 pthread_mutex_setprioceiling 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 37931ff496..298f0ca6e7 100644
--- a/sysdeps/unix/sysv/linux/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/sys/timex.h
@@ -54,17 +54,33 @@ struct ntptimeval
 
 __BEGIN_DECLS
 
-extern int __adjtimex (struct timex *__ntx) __THROW;
+#ifndef __USE_TIME_BITS64
 extern int adjtimex (struct timex *__ntx) __THROW;
 
-#ifdef __REDIRECT_NTH
+# ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
-			   ntp_gettimex);
+                           __ntp_gettime64);
+# else
+#  define ntp_gettime ntp_gettimex
+# endif
+extern int ntp_adjtime (struct timex *__tntx) __THROW;
 #else
-extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
-# 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 3bf206be0b..91b81cb1c6 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
 
 #if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
 /* 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 || C2X */
 
 
@@ -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,9 +366,18 @@ 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
 
 
-- 
2.25.1


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

* [PATCH 39/52] posix: Add glob64 with 64 bit time_t support
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (37 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 38/52] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 40/52] io: Add fts64 " Adhemerval Zanella via Libc-alpha
                   ` (14 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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                                |  3 +-
 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, 306 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 8e31c721e1..aba66efde8 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -66,7 +66,8 @@ routines :=								      \
 	posix_madvise							      \
 	get_child_max sched_cpucount sched_cpualloc sched_cpufree \
 	streams-compat \
-	shm-directory
+	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 45d31a46bc..4df0ece1f3 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -187,6 +187,8 @@ libc {
     __select64;
     __utimes64;
     # posix
+    __glob64_time64;
+    __globfree64_time64;
     __nanosleep64;
     __pselec64;
     __wait3_time64;
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index d63e0dee75..9952c6936f 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -173,6 +173,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 1a0f0d1312..bf9c48fbcd 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -170,6 +170,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 120a3fc1ce..d0494fcd74 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2133,6 +2133,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 77c7d2faf3..33f9f0ba5c 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2092,6 +2092,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 7d1a9691e7..44e3e4fcb1 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2259,6 +2259,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/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index da00a3d3c3..84a4a1d60b 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -174,6 +174,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 3e0f00210f..eb290d2000 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2204,6 +2204,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 9bed39a8e8..a341137565 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2184,6 +2184,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 872321bbab..956291e8c0 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2181,6 +2181,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 77dcc8ab7d..ea5993d651 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2175,6 +2175,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 c41f85ce01..e167afac72 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2173,6 +2173,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 4208f9df82..0ebfc36f9b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2181,6 +2181,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 ff0bb57cb6..06febde125 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2222,6 +2222,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 57f1fe012a..e292d5afdd 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2231,6 +2231,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 6c9fa9c098..332bb8a3bc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2264,6 +2264,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 d357619c55..e2c81ee4fc 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2229,6 +2229,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 725952a763..adc5305c41 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2099,6 +2099,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 7f07b96287..4757127f97 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2096,6 +2096,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 3b7af990d4..25429967b0 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2220,6 +2220,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.25.1


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

* [PATCH 40/52] io: Add fts64 with 64 bit time_t support
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (38 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 39/52] posix: Add glob64 with 64 bit time_t support Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 41/52] io: Add ftw64 " Adhemerval Zanella via Libc-alpha
                   ` (13 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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 59d36e8782..f3a34854e1 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
@@ -96,6 +97,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 4df0ece1f3..ba5216e928 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -180,6 +180,11 @@ libc {
     __lstat64_time64;
     __fstat64_time64;
     __fstatat64_time64;
+    __fts64_open_time64;
+    __fts64_close_time64;
+    __fts64_read_time64;
+    __fts64_set_time64;
+    __fts64_children_time64;
     # misc
     __futimes64;
     __futimesat64;
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 9952c6936f..4034576f83 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -167,6 +167,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 bf9c48fbcd..655035d9b0 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -164,6 +164,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 d0494fcd74..51825b5516 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2127,6 +2127,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 33f9f0ba5c..8523f451f2 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2086,6 +2086,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 44e3e4fcb1..b85302318c 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2253,6 +2253,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 84a4a1d60b..eb9d2a23fe 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -168,6 +168,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 eb290d2000..496c57a039 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2198,6 +2198,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 a341137565..7216a031eb 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2178,6 +2178,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 956291e8c0..6e1b8ff3a7 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2175,6 +2175,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 ea5993d651..89e3621708 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2169,6 +2169,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 e167afac72..1080cc8332 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2167,6 +2167,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 0ebfc36f9b..98b2fc62f3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2175,6 +2175,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 06febde125..f5140aec1e 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2216,6 +2216,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 e292d5afdd..57daf51b4e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2225,6 +2225,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 332bb8a3bc..fae83acd3b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2258,6 +2258,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 e2c81ee4fc..47c86f2b03 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2223,6 +2223,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 adc5305c41..9d60db0845 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2093,6 +2093,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 4757127f97..5d6a69b751 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2090,6 +2090,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 25429967b0..c787962323 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2214,6 +2214,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.25.1


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

* [PATCH 41/52] io: Add ftw64 with 64 bit time_t support
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (39 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 40/52] io: Add fts64 " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 42/52] libsupport: Add 64 bit time_t support for time functions Adhemerval Zanella via Libc-alpha
                   ` (12 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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 f3a34854e1..6c637f7c6d 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
@@ -100,6 +101,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 ba5216e928..b53391f613 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -185,6 +185,8 @@ libc {
     __fts64_read_time64;
     __fts64_set_time64;
     __fts64_children_time64;
+    __ftw64_time64;
+    __nftw64_time64;
     # misc
     __futimes64;
     __futimesat64;
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 4034576f83..a34bca151d 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -172,6 +172,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
@@ -190,6 +191,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 655035d9b0..5a7c57afa7 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -169,6 +169,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
@@ -187,6 +188,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 51825b5516..c8b1890033 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2132,6 +2132,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
@@ -2150,6 +2151,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 8523f451f2..5eb997849b 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2091,6 +2091,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
@@ -2109,6 +2110,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 b85302318c..3549788a52 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2258,6 +2258,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
@@ -2276,6 +2277,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 eb9d2a23fe..f6b1b06ce9 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -173,6 +173,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
@@ -191,6 +192,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 496c57a039..2f92eae937 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2203,6 +2203,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
@@ -2221,6 +2222,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 7216a031eb..ae86eed8d0 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2183,6 +2183,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
@@ -2201,6 +2202,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 6e1b8ff3a7..9f6b846a71 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2180,6 +2180,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
@@ -2198,6 +2199,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 89e3621708..c16000604b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2174,6 +2174,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
@@ -2192,6 +2193,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 1080cc8332..76b864f9d2 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2172,6 +2172,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
@@ -2190,6 +2191,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 98b2fc62f3..a20fb835e4 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2180,6 +2180,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
@@ -2198,6 +2199,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 f5140aec1e..a8b7a8c92c 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2221,6 +2221,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
@@ -2239,6 +2240,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 57daf51b4e..d5ab432dc3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2230,6 +2230,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
@@ -2248,6 +2249,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 fae83acd3b..7885585950 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2263,6 +2263,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
@@ -2281,6 +2282,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 47c86f2b03..de75dc4ac8 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2228,6 +2228,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
@@ -2246,6 +2247,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 9d60db0845..573c2fcbbf 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2098,6 +2098,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
@@ -2116,6 +2117,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 5d6a69b751..ef942ed276 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2095,6 +2095,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
@@ -2113,6 +2114,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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 c787962323..802a2eb7ce 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2219,6 +2219,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
@@ -2237,6 +2238,7 @@ GLIBC_2.34 __lutimes64 F
 GLIBC_2.34 __mktime64 F
 GLIBC_2.34 __msgctl64 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.25.1


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

* [PATCH 42/52] libsupport: Add 64 bit time_t support for time functions
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (40 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 41/52] io: Add ftw64 " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 43/52] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella via Libc-alpha
                   ` (11 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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.
---
 support/Makefile                |  5 ++++
 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/xtime.h                 |  5 ++++
 10 files changed, 176 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

diff --git a/support/Makefile b/support/Makefile
index bb9889efb4..846e0dbb26 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -79,8 +79,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 \
@@ -90,6 +93,7 @@ libsupport-routines = \
   xchdir \
   xchroot \
   xclock_gettime \
+  xclock_gettime_time64 \
   xclose \
   xchmod \
   xconnect \
@@ -209,6 +213,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/xtime.h b/support/xtime.h
index 2482837dee..e5fb56a9fc 100644
--- a/support/xtime.h
+++ b/support/xtime.h
@@ -26,7 +26,12 @@ __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);
+#else
+void __REDIRECT (xclock_gettime, (clockid_t clock, struct timespec *ts),
+		 xclock_gettime_time64);
+#endif
 
 /* This helper can often simplify tests by avoiding an explicit
    variable declaration or allowing that declaration to be const. */
-- 
2.25.1


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

* [PATCH 43/52] libsupport: Add 64 bit time_t support for stat functions
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (41 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 42/52] libsupport: Add 64 bit time_t support for time functions Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:42   ` Florian Weimer via Libc-alpha
  2021-03-05 20:15 ` [PATCH 44/52] y2038: Add test coverage Adhemerval Zanella via Libc-alpha
                   ` (10 subsequent siblings)
  53 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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 846e0dbb26..6f696c70be 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 \
@@ -111,6 +113,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.25.1


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

* [PATCH 44/52] y2038: Add test coverage
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (42 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 43/52] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-06  0:13   ` Joseph Myers
  2021-03-08 21:28   ` Lukasz Majewski
  2021-03-05 20:15 ` [PATCH 45/52] Use 64 bit time_t stat internally Adhemerval Zanella via Libc-alpha
                   ` (9 subsequent siblings)
  53 siblings, 2 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 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
    - adjtimex
    - 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_nanoslee                tst-clock_nanosleep-time64,
				    tst-cpuclock1-time64
    - clock_settime                 tst-clock2-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
    - nanosleep                     tst-cpuclock{12}-time64,
				    tst-mqueue8-time64, tst-clock-time64
    - nftw / ftw                    ftwtest-time64
    - ntp_adjtime
    - ntp_gettime
    - ntp_gettimex
    - ppoll                         tst-ppoll-time64
    - pselect                       tst-pselect-time64
    - recvmmsg                      tst-cancel4_2-time64
    - sched_rr_get_interval         tst-sched_rr_get_interval-time64
    - select
    - semctl                        test-sysvsem-time64
    - semtimedop                    test-sysvsem-time64
    - setitimer                     tst-mqueue2-time64, tst-itimer-timer64
    - settimeofday
    - shmctl                        test-sysvshm-time64
    - sigtimedwait
    - stat                          tst-stat-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
    - utime                         tst-utime-time64
    - utimensat                     tst-utimensat-time64
    - utimes                        tst-utimes-time64
    - wait3                         tst-wait3-time64
    - wait4                         tst-wait4-time64

  * libpthread:
    - cnd_timedwait                 tst-cnd-timedwait-time64
    - mtx_timedlock                 tst-mtx-timedlock-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
    - sem_clockwait                 tst-sem5-time64
    - sem_timedwait                 tst-sem5-time64
    - thrd_sleep                    tst-thrd-sleep-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                                   |  16 ++-
 io/ftwtest-time64.c                           |   1 +
 io/tst-fts-time64.c                           |   1 +
 io/tst-futimesat-time64.c                     |   4 +
 io/tst-futimesat.c                            |  47 +++++---
 io/tst-stat-time64.c                          | 102 ++++++++++++++++++
 io/tst-utimensat-time64.c                     |   2 +
 misc/Makefile                                 |   2 +
 misc/tst-pselect-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              |   8 ++
 sysdeps/unix/sysv/linux/Versions              |   4 +-
 sysdeps/unix/sysv/linux/tst-futimens-time64.c |   2 +
 sysdeps/unix/sysv/linux/tst-futimens.c        |   8 +-
 sysdeps/unix/sysv/linux/tst-futimes-time64.c  |   2 +
 sysdeps/unix/sysv/linux/tst-lutimes-time64.c  |   2 +
 sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
 sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
 sysdeps/unix/sysv/linux/tst-utime-time64.c    |   2 +
 sysdeps/unix/sysv/linux/tst-utime.c           |   6 +-
 sysdeps/unix/sysv/linux/tst-utimes-time64.c   |   2 +
 sysdeps/unix/sysv/linux/tst-utimes.c          |   6 +-
 sysvipc/Makefile                              |   2 +
 sysvipc/test-sysvmsg-time64.c                 |   1 +
 sysvipc/test-sysvsem-time64.c                 |   1 +
 sysvipc/test-sysvshm-time64.c                 |   1 +
 time/Makefile                                 |  15 +++
 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-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-timegm-time64.c                      |   1 +
 time/tst-timespec_get-time64.c                |   1 +
 time/tst-y2039-time64.c                       |   1 +
 time/tst-y2039.c                              |  10 ++
 68 files changed, 346 insertions(+), 24 deletions(-)
 create mode 100644 io/ftwtest-time64.c
 create mode 100644 io/tst-fts-time64.c
 create mode 100644 io/tst-futimesat-time64.c
 create mode 100644 io/tst-stat-time64.c
 create mode 100644 io/tst-utimensat-time64.c
 create mode 100644 misc/tst-pselect-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-futimens-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-futimes-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-lutimes-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-utime-time64.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-utimes-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-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-timegm-time64.c
 create mode 100644 time/tst-timespec_get-time64.c
 create mode 100644 time/tst-y2039-time64.c

diff --git a/Makeconfig b/Makeconfig
index 0a4811b5e5..e12ee30eca 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1227,6 +1227,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 fc5251ffad..f4f641bb26 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 6c637f7c6d..a39f0ecfc1 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 \
@@ -72,12 +72,18 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-ftw-lnk tst-file_change_detection tst-lchmod \
 		   tst-ftw-bz26353 tst-utimensat
 
+tests-time64    := tst-fts-time64 \
+		   tst-stat-time64 \
+		   tst-futimesat-time64 \
+		   tst-utimensat-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
@@ -118,8 +124,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-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-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-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/misc/Makefile b/misc/Makefile
index cfc15355d6..a8363d4b76 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -90,6 +90,8 @@ 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
 
+tests-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/nptl/Makefile b/nptl/Makefile
index 33766eaf7a..d1c786e88b 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -380,6 +380,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 aba66efde8..e246ff1d14 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -109,7 +109,9 @@ tests-internal	:= bug-regex5 bug-regex20 bug-regex33 \
 		   tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 \
 		   tst-glob_lstat_compat tst-spawn4-compat
 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 7b374f2073..3ce98297f9 100644
--- a/rt/Makefile
+++ b/rt/Makefile
@@ -49,6 +49,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 53b65ef349..31df6f97e5 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -109,6 +109,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 fc2a17307c..94ee85d124 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -115,6 +115,14 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 tst-futimes tst-lutimes
 
 tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
+tests-time64 += \
+  tst-futimes-time64\
+  tst-futimens-time64 \
+  tst-lutimes-time64 \
+  tst-ppoll-time64 \
+  tst-utime-time64 \
+  tst-utimes-time64 \
+  tst-timerfd-time64
 
 CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
 
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index b53391f613..982b94e625 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -237,7 +237,9 @@ libc {
     __timegm64;
     __timespec_get64;
     __utimensat64;
-     __utimes64;
+    __utimes64;
+    __localtime64;
+    __localtime64_r;
     # misc
     __ntp_gettime64;
     __ntp_gettimex64;
diff --git a/sysdeps/unix/sysv/linux/tst-futimens-time64.c b/sysdeps/unix/sysv/linux/tst-futimens-time64.c
new file mode 100644
index 0000000000..88fcb38489
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-futimens-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-futimens.c"
diff --git a/sysdeps/unix/sysv/linux/tst-futimens.c b/sysdeps/unix/sysv/linux/tst-futimens.c
index 8f48cfee63..b5b240abf1 100644
--- a/sysdeps/unix/sysv/linux/tst-futimens.c
+++ b/sysdeps/unix/sysv/linux/tst-futimens.c
@@ -24,10 +24,14 @@
 #include <support/xunistd.h>
 #include <support/temp_file.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int temp_fd = -1;
 
 /* struct timespec array with Y2038 threshold minus 2 and 1 seconds.  */
-const struct timespec t1[2] = { { 0x7FFFFFFE, 0 },  { 0x7FFFFFFF, 0 } };
+const static struct timespec t1[2] = { { 0x7FFFFFFE, 0 },  { 0x7FFFFFFF, 0 } };
 
 /* struct timespec array with Y2038 threshold plus 1 and 2 seconds.  */
 const struct timespec t2[2] = { { 0x80000001ULL, 0 },  { 0x80000002ULL, 0 } };
@@ -46,7 +50,7 @@ do_prepare (int argc, char *argv[])
 static int
 test_futimens_helper (const struct timespec *ts)
 {
-  struct stat64 st;
+  struct_stat st;
   int result;
   time_t t;
 
diff --git a/sysdeps/unix/sysv/linux/tst-futimes-time64.c b/sysdeps/unix/sysv/linux/tst-futimes-time64.c
new file mode 100644
index 0000000000..d489c265d1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-futimes-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-futimes.c"
diff --git a/sysdeps/unix/sysv/linux/tst-lutimes-time64.c b/sysdeps/unix/sysv/linux/tst-lutimes-time64.c
new file mode 100644
index 0000000000..06caec0a91
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-lutimes-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-lutimes.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-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/sysdeps/unix/sysv/linux/tst-utime-time64.c b/sysdeps/unix/sysv/linux/tst-utime-time64.c
new file mode 100644
index 0000000000..eb62f59126
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-utime-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-utime.c"
diff --git a/sysdeps/unix/sysv/linux/tst-utime.c b/sysdeps/unix/sysv/linux/tst-utime.c
index 6735421657..d413f130e8 100644
--- a/sysdeps/unix/sysv/linux/tst-utime.c
+++ b/sysdeps/unix/sysv/linux/tst-utime.c
@@ -26,6 +26,10 @@
 #include <support/xunistd.h>
 #include <support/temp_file.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int temp_fd = -1;
 char *testfile;
 
@@ -49,7 +53,7 @@ do_prepare (int argc, char *argv[])
 static int
 test_utime_helper (const struct utimbuf *ut)
 {
-  struct stat64 st;
+  struct_stat st;
   int result;
   time_t t;
 
diff --git a/sysdeps/unix/sysv/linux/tst-utimes-time64.c b/sysdeps/unix/sysv/linux/tst-utimes-time64.c
new file mode 100644
index 0000000000..234ec02541
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-utimes-time64.c
@@ -0,0 +1,2 @@
+#define struct_stat struct stat
+#include "tst-utimes.c"
diff --git a/sysdeps/unix/sysv/linux/tst-utimes.c b/sysdeps/unix/sysv/linux/tst-utimes.c
index 8c7b006a22..c521c89dfa 100644
--- a/sysdeps/unix/sysv/linux/tst-utimes.c
+++ b/sysdeps/unix/sysv/linux/tst-utimes.c
@@ -25,6 +25,10 @@
 #include <support/xunistd.h>
 #include <support/temp_file.h>
 
+#ifndef struct_stat
+# define struct_stat struct stat64
+#endif
+
 static int temp_fd = -1;
 char *testfile;
 
@@ -50,7 +54,7 @@ do_prepare (int argc, char *argv[])
 static int
 test_utime_helper (const struct timeval *tv)
 {
-  struct stat64 st;
+  struct_stat st;
   int result;
   time_t t;
 
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 f14022b334..fee206d3c7 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -51,6 +51,21 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \
 	   tst-gmtime tst-timegm tst-timespec_get
 
+tests-time64 := \
+  tst-adjtime-time64 \
+  tst-clock-time64 \
+  tst-clock2-time64 \
+  tst-clock_nanosleep-time64 \
+  tst-cpuclock1-time64 \
+  tst-ctime-time64 \
+  tst-difftime-time64 \
+  tst-gmtime-time64 \
+  tst-itimer-time64 \
+  tst-mktime4-time64 \
+  tst-timegm-time64 \
+  tst-timespec_get-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-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-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-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.25.1


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

* [PATCH 45/52] Use 64 bit time_t stat internally
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (43 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 44/52] y2038: Add test coverage Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 46/52] debug: build pcprofiledump with LFS and 64 bit time support Adhemerval Zanella via Libc-alpha
                   ` (8 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 UTC (permalink / raw)
  To: libc-alpha

For the legacy ABI with supports 32 bit time_t it calls the 64 bit
time directly, since the LFS symbols calls the 64 bit time_t ones
internally.

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 csu/check_fds.c                     |  8 ++++----
 elf/dl-load.c                       |  8 ++++----
 elf/dl-misc.c                       |  4 ++--
 elf/dl-profile.c                    |  4 ++--
 iconv/gconv_cache.c                 |  4 ++--
 include/dirent.h                    |  2 +-
 include/file_change_detection.h     |  6 +++---
 include/sys/stat.h                  |  2 +-
 inet/rcmd.c                         |  6 +++---
 intl/loadmsgcat.c                   |  4 ++--
 io/Makefile                         |  4 ++--
 io/file_change_detection.c          | 16 +++++++++-------
 io/getdirname.c                     |  6 +++---
 libio/filedoalloc.c                 |  2 +-
 libio/fileops.c                     |  8 ++++----
 libio/oldfileops.c                  |  2 +-
 libio/wfileops.c                    |  2 +-
 locale/loadarchive.c                |  8 ++++----
 locale/loadlocale.c                 |  6 +++---
 nscd/nscd_helper.c                  |  4 ++--
 nss/nss_database.c                  |  4 ++--
 sysdeps/posix/dl-fileid.h           |  4 ++--
 sysdeps/posix/euidaccess.c          |  4 ++--
 sysdeps/posix/getaddrinfo.c         | 21 +++++++++++----------
 sysdeps/posix/getcwd.c              | 15 ++++++++-------
 sysdeps/posix/pathconf.c            |  4 ++--
 sysdeps/posix/sysconf.c             |  4 ++--
 sysdeps/posix/tempname.c            |  8 ++++----
 sysdeps/unix/sysv/linux/fdopendir.c |  4 ++--
 sysdeps/unix/sysv/linux/fexecve.c   |  4 ++--
 sysdeps/unix/sysv/linux/opendir.c   |  7 ++++---
 sysdeps/unix/sysv/linux/pathconf.c  |  5 +++--
 sysdeps/unix/sysv/linux/ttyname.c   | 17 +++++++++--------
 sysdeps/unix/sysv/linux/ttyname.h   | 10 ++--------
 sysdeps/unix/sysv/linux/ttyname_r.c | 16 ++++++++--------
 sysvipc/ftok.c                      |  4 ++--
 time/tzfile.c                       |  6 +++---
 37 files changed, 122 insertions(+), 121 deletions(-)

diff --git a/csu/check_fds.c b/csu/check_fds.c
index fbab28c284..6dc67334af 100644
--- a/csu/check_fds.c
+++ b/csu/check_fds.c
@@ -69,10 +69,10 @@ check_one_fd (int fd, int mode)
 	 Note that the following code assumes that STDIN_FILENO,
 	 STDOUT_FILENO, STDERR_FILENO are the three lowest file
 	 decsriptor numbers, in this order.  */
-      struct stat64 st;
-      if (__builtin_expect (nullfd != fd, 0)
-	  || __builtin_expect (__fstat64 (fd, &st), 0) != 0
-	  || __builtin_expect (S_ISCHR (st.st_mode), 1) == 0
+      struct __stat64_t64 st;
+      if (__glibc_unlikely (nullfd != fd)
+	  || __glibc_likely (__fstat64_time64 (fd, &st) != 0)
+	  || __glibc_unlikely (S_ISCHR (st.st_mode) == 0)
 	  || st.st_rdev != dev)
 	/* We cannot even give an error message here since it would
 	   run into the same problems.  */
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 9e2089cfaa..3de2d8722c 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1925,11 +1925,11 @@ open_path (const char *name, size_t namelen, int mode,
 		{
 		  /* We failed to open machine dependent library.  Let's
 		     test whether there is any directory at all.  */
-		  struct stat64 st;
+		  struct __stat64_t64 st;
 
 		  buf[buflen - namelen - 1] = '\0';
 
-		  if (__stat64 (buf, &st) != 0
+		  if (__stat64_time64 (buf, &st) != 0
 		      || ! S_ISDIR (st.st_mode))
 		    /* The directory does not exist or it is no directory.  */
 		    this_dir->status[cnt] = nonexisting;
@@ -1947,9 +1947,9 @@ open_path (const char *name, size_t namelen, int mode,
 	      /* This is an extra security effort to make sure nobody can
 		 preload broken shared objects which are in the trusted
 		 directories and so exploit the bugs.  */
-	      struct stat64 st;
+	      struct __stat64_t64 st;
 
-	      if (__fstat64 (fd, &st) != 0
+	      if (__fstat64_time64 (fd, &st) != 0
 		  || (st.st_mode & S_ISUID) == 0)
 		{
 		  /* The shared object cannot be tested for being SUID
diff --git a/elf/dl-misc.c b/elf/dl-misc.c
index 082f75f459..6d82eb8df3 100644
--- a/elf/dl-misc.c
+++ b/elf/dl-misc.c
@@ -43,11 +43,11 @@ void *
 _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot)
 {
   void *result = MAP_FAILED;
-  struct stat64 st;
+  struct __stat64_t64 st;
   int fd = __open64_nocancel (file, O_RDONLY | O_CLOEXEC);
   if (fd >= 0)
     {
-      if (__fstat64 (fd, &st) >= 0)
+      if (__fstat64_time64 (fd, &st) >= 0)
 	{
 	  *sizep = st.st_size;
 
diff --git a/elf/dl-profile.c b/elf/dl-profile.c
index 35b03959bc..088c023d95 100644
--- a/elf/dl-profile.c
+++ b/elf/dl-profile.c
@@ -185,7 +185,7 @@ _dl_start_profile (void)
 {
   char *filename;
   int fd;
-  struct stat64 st;
+  struct __stat64_t64 st;
   const ElfW(Phdr) *ph;
   ElfW(Addr) mapstart = ~((ElfW(Addr)) 0);
   ElfW(Addr) mapend = 0;
@@ -342,7 +342,7 @@ _dl_start_profile (void)
       return;
     }
 
-  if (__fstat64 (fd, &st) < 0 || !S_ISREG (st.st_mode))
+  if (__fstat64_time64 (fd, &st) < 0 || !S_ISREG (st.st_mode))
     {
       /* Not stat'able or not a regular file => don't use it.  */
       errstr = "%s: cannot stat file: %s\n";
diff --git a/iconv/gconv_cache.c b/iconv/gconv_cache.c
index 642cc731eb..68d6386d01 100644
--- a/iconv/gconv_cache.c
+++ b/iconv/gconv_cache.c
@@ -48,7 +48,7 @@ int
 __gconv_load_cache (void)
 {
   int fd;
-  struct stat64 st;
+  struct __stat64_t64 st;
   struct gconvcache_header *header;
 
   /* We cannot use the cache if the GCONV_PATH environment variable is
@@ -64,7 +64,7 @@ __gconv_load_cache (void)
     return -1;
 
   /* Get information about the file.  */
-  if (__builtin_expect (__fstat64 (fd, &st), 0) < 0
+  if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 0)
       /* We do not have to start looking at the file if it cannot contain
 	 at least the cache header.  */
       || (size_t) st.st_size < sizeof (struct gconvcache_header))
diff --git a/include/dirent.h b/include/dirent.h
index f1d7e8359c..d7567f5e86 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -49,7 +49,7 @@ extern int __versionsort64 (const struct dirent64 **a,
 			    const struct dirent64 **b)
      __attribute_pure__;
 extern DIR *__alloc_dir (int fd, bool close_fd, int flags,
-			 const struct stat64 *statp)
+			 const struct __stat64_t64 *statp)
      __nonnull (4) attribute_hidden;
 extern __typeof (rewinddir) __rewinddir;
 extern __typeof (seekdir) __seekdir;
diff --git a/include/file_change_detection.h b/include/file_change_detection.h
index 9de2bd0b79..953de7c7fd 100644
--- a/include/file_change_detection.h
+++ b/include/file_change_detection.h
@@ -33,8 +33,8 @@ struct file_change_detection
   off64_t size;
 
   ino64_t ino;
-  struct timespec mtime;
-  struct timespec ctime;
+  struct __timespec64 mtime;
+  struct __timespec64 ctime;
 };
 
 /* Returns true if *LEFT and *RIGHT describe the same version of the
@@ -45,7 +45,7 @@ bool __file_is_unchanged (const struct file_change_detection *left,
 /* Extract file change information to *FILE from the stat buffer
    *ST.  */
 void __file_change_detection_for_stat (struct file_change_detection *file,
-                                       const struct stat64 *st);
+                                       const struct __stat64_t64 *st);
 
 /* Writes file change information for PATH to *FILE.  Returns true on
    success.  For benign errors, *FILE is cleared, and true is
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/inet/rcmd.c b/inet/rcmd.c
index 452ff7d099..8aef75e280 100644
--- a/inet/rcmd.c
+++ b/inet/rcmd.c
@@ -467,14 +467,14 @@ ruserok (const char *rhost, int superuser, const char *ruser,
 static FILE *
 iruserfopen (const char *file, uid_t okuser)
 {
-  struct stat64 st;
+  struct __stat64_t64 st;
   char *cp = NULL;
   FILE *res = NULL;
 
   /* If not a regular file, if owned by someone other than user or
      root, if writeable by anyone but the owner, or if hardlinked
      anywhere, quit.  */
-  if (__lstat64 (file, &st))
+  if (__lstat64_time64 (file, &st))
     cp = _("lstat failed");
   else if (!S_ISREG (st.st_mode))
     cp = _("not regular file");
@@ -483,7 +483,7 @@ iruserfopen (const char *file, uid_t okuser)
       res = fopen (file, "rce");
       if (!res)
 	cp = _("cannot open");
-      else if (__fstat64 (fileno (res), &st) < 0)
+      else if (__fstat64_time64 (fileno (res), &st) < 0)
 	cp = _("fstat failed");
       else if (st.st_uid && st.st_uid != okuser)
 	cp = _("bad owner");
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index 4fda9b0219..30588e9996 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -756,7 +756,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
   int fd = -1;
   size_t size;
 #ifdef _LIBC
-  struct stat64 st;
+  struct __stat64_t64 st;
 #else
   struct stat st;
 #endif
@@ -804,7 +804,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
   /* We must know about the size of the file.  */
   if (
 #ifdef _LIBC
-      __builtin_expect (__fstat64 (fd, &st) != 0, 0)
+      __builtin_expect (__fstat64_time64 (fd, &st) != 0, 0)
 #else
       __builtin_expect (fstat (fd, &st) != 0, 0)
 #endif
diff --git a/io/Makefile b/io/Makefile
index a39f0ecfc1..18650c21a8 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -69,7 +69,7 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-posix_fallocate tst-posix_fallocate64 \
 		   tst-fts tst-fts-lfs tst-open-tmpfile \
 		   tst-copy_file_range tst-getcwd-abspath tst-lockf \
-		   tst-ftw-lnk tst-file_change_detection tst-lchmod \
+		   tst-ftw-lnk tst-lchmod \
 		   tst-ftw-bz26353 tst-utimensat
 
 tests-time64    := tst-fts-time64 \
@@ -78,7 +78,7 @@ tests-time64    := tst-fts-time64 \
 		   tst-utimensat-time64
 
 # Likewise for statx, but we do not need static linking here.
-tests-internal += tst-statx
+tests-internal += tst-statx tst-file_change_detection
 tests-static += tst-statx
 
 ifeq ($(run-built-tests),yes)
diff --git a/io/file_change_detection.c b/io/file_change_detection.c
index 9871bc9166..ac5e451513 100644
--- a/io/file_change_detection.c
+++ b/io/file_change_detection.c
@@ -44,7 +44,7 @@ libc_hidden_def (__file_is_unchanged)
 
 void
 __file_change_detection_for_stat (struct file_change_detection *file,
-                                  const struct stat64 *st)
+                                  const struct __stat64_t64 *st)
 {
   if (S_ISDIR (st->st_mode))
     /* Treat as empty file.  */
@@ -56,8 +56,10 @@ __file_change_detection_for_stat (struct file_change_detection *file,
     {
       file->size = st->st_size;
       file->ino = st->st_ino;
-      file->mtime = st->st_mtim;
-      file->ctime = st->st_ctim;
+      file->mtime = (struct __timespec64 ) { .tv_sec  = st->st_mtim.tv_sec,
+					     .tv_nsec = st->st_mtim.tv_nsec };
+      file->ctime = (struct __timespec64 ) { .tv_sec  = st->st_ctim.tv_sec,
+					     .tv_nsec = st->st_mtim.tv_nsec };
     }
 }
 libc_hidden_def (__file_change_detection_for_stat)
@@ -66,8 +68,8 @@ bool
 __file_change_detection_for_path (struct file_change_detection *file,
                                   const char *path)
 {
-  struct stat64 st;
-  if (__stat64 (path, &st) != 0)
+  struct __stat64_t64 st;
+  if (__stat64_time64 (path, &st) != 0)
     switch (errno)
       {
       case EACCES:
@@ -104,8 +106,8 @@ __file_change_detection_for_fp (struct file_change_detection *file,
     }
   else
     {
-      struct stat64 st;
-      if (__fstat64 (__fileno (fp), &st) != 0)
+      struct __stat64_t64 st;
+      if (__fstat64_time64 (__fileno (fp), &st) != 0)
         /* If we already have a file descriptor, all errors are fatal.  */
         return false;
       else
diff --git a/io/getdirname.c b/io/getdirname.c
index 32b5ab4b6c..f29e910b37 100644
--- a/io/getdirname.c
+++ b/io/getdirname.c
@@ -28,12 +28,12 @@ char *
 get_current_dir_name (void)
 {
   char *pwd;
-  struct stat64 dotstat, pwdstat;
+  struct __stat64_t64 dotstat, pwdstat;
 
   pwd = getenv ("PWD");
   if (pwd != NULL
-      && __stat64 (".", &dotstat) == 0
-      && __stat64 (pwd, &pwdstat) == 0
+      && __stat64_time64 (".", &dotstat) == 0
+      && __stat64_time64 (pwd, &pwdstat) == 0
       && pwdstat.st_dev == dotstat.st_dev
       && pwdstat.st_ino == dotstat.st_ino)
     /* The PWD value is correct.  Use it.  */
diff --git a/libio/filedoalloc.c b/libio/filedoalloc.c
index 7afa3cb683..c792eec88f 100644
--- a/libio/filedoalloc.c
+++ b/libio/filedoalloc.c
@@ -78,7 +78,7 @@ _IO_file_doallocate (FILE *fp)
 {
   size_t size;
   char *p;
-  struct stat64 st;
+  struct __stat64_t64 st;
 
   size = BUFSIZ;
   if (fp->_fileno >= 0 && __builtin_expect (_IO_SYSSTAT (fp, &st), 0) >= 0)
diff --git a/libio/fileops.c b/libio/fileops.c
index a71a567547..e8ee374821 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -545,7 +545,7 @@ libc_hidden_ver (_IO_new_file_underflow, _IO_file_underflow)
 static int
 mmap_remap_check (FILE *fp)
 {
-  struct stat64 st;
+  struct __stat64_t64 st;
 
   if (_IO_SYSSTAT (fp, &st) == 0
       && S_ISREG (st.st_mode) && st.st_size != 0
@@ -663,7 +663,7 @@ decide_maybe_mmap (FILE *fp)
      file descriptors are for mmap-able objects and on 32-bit
      machines we don't want to map files which are too large since
      this would require too much virtual memory.  */
-  struct stat64 st;
+  struct __stat64_t64 st;
 
   if (_IO_SYSSTAT (fp, &st) == 0
       && S_ISREG (st.st_mode) && st.st_size != 0
@@ -962,7 +962,7 @@ _IO_new_file_seekoff (FILE *fp, off64_t offset, int dir, int mode)
       break;
     case _IO_seek_end:
       {
-	struct stat64 st;
+	struct __stat64_t64 st;
 	if (_IO_SYSSTAT (fp, &st) == 0 && S_ISREG (st.st_mode))
 	  {
 	    offset += st.st_size;
@@ -1145,7 +1145,7 @@ libc_hidden_def (_IO_file_seek)
 int
 _IO_file_stat (FILE *fp, void *st)
 {
-  return __fstat64 (fp->_fileno, (struct stat64 *) st);
+  return __fstat64_time64 (fp->_fileno, (struct __stat64_t64 *) st);
 }
 libc_hidden_def (_IO_file_stat)
 
diff --git a/libio/oldfileops.c b/libio/oldfileops.c
index ed235360ad..ed3c98bd6d 100644
--- a/libio/oldfileops.c
+++ b/libio/oldfileops.c
@@ -487,7 +487,7 @@ _IO_old_file_seekoff (FILE *fp, off64_t offset, int dir, int mode)
       break;
     case _IO_seek_end:
       {
-	struct stat64 st;
+	struct __stat64_t64 st;
 	if (_IO_SYSSTAT (fp, &st) == 0 && S_ISREG (st.st_mode))
 	  {
 	    offset += st.st_size;
diff --git a/libio/wfileops.c b/libio/wfileops.c
index 5d23566171..37f44780f8 100644
--- a/libio/wfileops.c
+++ b/libio/wfileops.c
@@ -840,7 +840,7 @@ _IO_wfile_seekoff (FILE *fp, off64_t offset, int dir, int mode)
       break;
     case _IO_seek_end:
       {
-	struct stat64 st;
+	struct __stat64_t64 st;
 	if (_IO_SYSSTAT (fp, &st) == 0 && S_ISREG (st.st_mode))
 	  {
 	    offset += st.st_size;
diff --git a/locale/loadarchive.c b/locale/loadarchive.c
index 4177fc8972..512769eaec 100644
--- a/locale/loadarchive.c
+++ b/locale/loadarchive.c
@@ -78,7 +78,7 @@ static struct archmapped *archmapped;
    ARCHMAPPED points to this; if mapping the archive header failed,
    then headmap.ptr is null.  */
 static struct archmapped headmap;
-static struct stat64 archive_stat; /* stat of archive when header mapped.  */
+static struct __stat64_t64 archive_stat; /* stat of archive when header mapped.  */
 
 /* Record of locales that we have already loaded from the archive.  */
 struct locale_in_archive
@@ -207,7 +207,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
 	/* Cannot open the archive, for whatever reason.  */
 	return NULL;
 
-      if (__fstat64 (fd, &archive_stat) == -1)
+      if (__fstat64_time64 (fd, &archive_stat) == -1)
 	{
 	  /* stat failed, very strange.  */
 	close_and_out:
@@ -396,7 +396,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
 	  /* Open the file if it hasn't happened yet.  */
 	  if (fd == -1)
 	    {
-	      struct stat64 st;
+	      struct __stat64_t64 st;
 	      fd = __open_nocancel (archfname,
 				    O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 	      if (fd == -1)
@@ -405,7 +405,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
 	      /* Now verify we think this is really the same archive file
 		 we opened before.  If it has been changed we cannot trust
 		 the header we read previously.  */
-	      if (__fstat64 (fd, &st) < 0
+	      if (__fstat64_time64 (fd, &st) < 0
 		  || st.st_size != archive_stat.st_size
 		  || st.st_mtime != archive_stat.st_mtime
 		  || st.st_dev != archive_stat.st_dev
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 9c03490883..f4e6cc9fc2 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -167,7 +167,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
 {
   int fd;
   void *filedata;
-  struct stat64 st;
+  struct __stat64_t64 st;
   struct __locale_data *newdata;
   int save_err;
   int alloc = ld_mapped;
@@ -180,7 +180,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
     /* Cannot open the file.  */
     return;
 
-  if (__builtin_expect (__fstat64 (fd, &st), 0) < 0)
+  if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 0))
     {
     puntfd:
       __close_nocancel_nostatus (fd);
@@ -206,7 +206,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
       if (__builtin_expect (fd, 0) < 0)
 	return;
 
-      if (__builtin_expect (__fstat64 (fd, &st), 0) < 0)
+      if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 0))
 	goto puntfd;
     }
 
diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c
index 462504d828..06ba7476e5 100644
--- a/nscd/nscd_helper.c
+++ b/nscd/nscd_helper.c
@@ -324,8 +324,8 @@ __nscd_get_mapping (request_type type, const char *key,
 
   if (__glibc_unlikely (n == keylen))
     {
-      struct stat64 st;
-      if (__builtin_expect (__fstat64 (mapfd, &st) != 0, 0)
+      struct __stat64_t64 st;
+      if (__glibc_unlikely (__fstat64_time64 (mapfd, &st) != 0)
 	  || __builtin_expect (st.st_size < sizeof (struct database_pers_head),
 			       0))
 	goto out_close;
diff --git a/nss/nss_database.c b/nss/nss_database.c
index fb72d0cc03..788177871d 100644
--- a/nss/nss_database.c
+++ b/nss/nss_database.c
@@ -363,7 +363,7 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
                                    nss_action_list *result,
                                    enum nss_database database_index)
 {
-  struct stat64 str;
+  struct __stat64_t64 str;
 
   /* Acquire MO is needed because the thread that sets reload_disabled
      may have loaded the configuration first, so synchronize with the
@@ -393,7 +393,7 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
      errors here are very unlikely, but the chance that we're entering
      a container is also very unlikely, so we err on the side of both
      very unlikely things not happening at the same time.  */
-  if (__stat64 ("/", &str) != 0
+  if (__stat64_time64 ("/", &str) != 0
       || (local->root_ino != 0
 	  && (str.st_ino != local->root_ino
 	      ||  str.st_dev != local->root_dev)))
diff --git a/sysdeps/posix/dl-fileid.h b/sysdeps/posix/dl-fileid.h
index 0bb6794dbe..bf437f3d71 100644
--- a/sysdeps/posix/dl-fileid.h
+++ b/sysdeps/posix/dl-fileid.h
@@ -32,9 +32,9 @@ struct r_file_id
 static inline bool
 _dl_get_file_id (int fd, struct r_file_id *id)
 {
-  struct stat64 st;
+  struct __stat64_t64 st;
 
-  if (__glibc_unlikely (__fstat64 (fd, &st) < 0))
+  if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 0))
     return false;
 
   id->dev = st.st_dev;
diff --git a/sysdeps/posix/euidaccess.c b/sysdeps/posix/euidaccess.c
index 26ebb432a2..86f3285471 100644
--- a/sysdeps/posix/euidaccess.c
+++ b/sysdeps/posix/euidaccess.c
@@ -119,7 +119,7 @@ int group_member ();
 int
 euidaccess (const char *path, int mode)
 {
-  struct stat64 stats;
+  struct __stat64_t64 stats;
   int granted;
 
 #ifdef	_LIBC
@@ -140,7 +140,7 @@ euidaccess (const char *path, int mode)
     return access (path, mode);
 #endif
 
-  if (__stat64 (path, &stats))
+  if (__stat64_time64 (path, &stats))
     return -1;
 
   mode &= (X_OK | W_OK | R_OK);	/* Clear any bogus bits. */
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 92d2a1c284..44ed985730 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -1638,16 +1638,17 @@ static int gaiconf_reload_flag_ever_set;
 /* Last modification time.  */
 #ifdef _STATBUF_ST_NSEC
 
-static struct timespec gaiconf_mtime;
+static struct __timespec64 gaiconf_mtime;
 
 static inline void
-save_gaiconf_mtime (const struct stat64 *st)
+save_gaiconf_mtime (const struct __stat64_t64 *st)
 {
-  gaiconf_mtime = st->st_mtim;
+  gaiconf_mtime = (struct __timespec64) { .tv_sec  = st->st_mtim.tv_sec,
+					  .tv_nsec = st->st_mtim.tv_nsec };
 }
 
 static inline bool
-check_gaiconf_mtime (const struct stat64 *st)
+check_gaiconf_mtime (const struct __stat64_t64 *st)
 {
   return (st->st_mtim.tv_sec == gaiconf_mtime.tv_sec
           && st->st_mtim.tv_nsec == gaiconf_mtime.tv_nsec);
@@ -1658,13 +1659,13 @@ check_gaiconf_mtime (const struct stat64 *st)
 static time_t gaiconf_mtime;
 
 static inline void
-save_gaiconf_mtime (const struct stat64 *st)
+save_gaiconf_mtime (const struct __stat64_t64 *st)
 {
   gaiconf_mtime = st->st_mtime;
 }
 
 static inline bool
-check_gaiconf_mtime (const struct stat64 *st)
+check_gaiconf_mtime (const struct __stat64_t64 *st)
 {
   return st->st_mtime == gaiconf_mtime;
 }
@@ -1779,8 +1780,8 @@ gaiconf_init (void)
   FILE *fp = fopen (GAICONF_FNAME, "rce");
   if (fp != NULL)
     {
-      struct stat64 st;
-      if (__fstat64 (fileno (fp), &st) != 0)
+      struct __stat64_t64 st;
+      if (__fstat64_time64 (fileno (fp), &st) != 0)
 	{
 	  fclose (fp);
 	  goto no_file;
@@ -2132,8 +2133,8 @@ gaiconf_init (void)
 static void
 gaiconf_reload (void)
 {
-  struct stat64 st;
-  if (__stat64 (GAICONF_FNAME, &st) != 0
+  struct __stat64_t64 st;
+  if (__stat64_time64 (GAICONF_FNAME, &st) != 0
       || !check_gaiconf_mtime (&st))
     gaiconf_init ();
 }
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index f11644aae7..13680026ff 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -183,7 +183,7 @@ __getcwd_generic (char *buf, size_t size)
   ino_t rootino, thisino;
   char *dir;
   register char *dirp;
-  struct stat64 st;
+  struct __stat64_t64 st;
   size_t allocated = size;
   size_t used;
 
@@ -249,12 +249,12 @@ __getcwd_generic (char *buf, size_t size)
   dirp = dir + allocated;
   *--dirp = '\0';
 
-  if (__lstat64 (".", &st) < 0)
+  if (__lstat64_time64 (".", &st) < 0)
     goto lose;
   thisdev = st.st_dev;
   thisino = st.st_ino;
 
-  if (__lstat64 ("/", &st) < 0)
+  if (__lstat64_time64 ("/", &st) < 0)
     goto lose;
   rootdev = st.st_dev;
   rootino = st.st_ino;
@@ -276,12 +276,12 @@ __getcwd_generic (char *buf, size_t size)
       if (fd < 0)
         goto lose;
       fd_needs_closing = true;
-      parent_status = __fstat64 (fd, &st);
+      parent_status = __fstat64_time64 (fd, &st);
 #else
       dotlist[dotlen++] = '.';
       dotlist[dotlen++] = '.';
       dotlist[dotlen] = '\0';
-      parent_status = __lstat64 (dotlist, &st);
+      parent_status = __lstat64_time64 (dotlist, &st);
 #endif
       if (parent_status != 0)
         goto lose;
@@ -353,7 +353,8 @@ __getcwd_generic (char *buf, size_t size)
           {
             int entry_status;
 #if HAVE_OPENAT_SUPPORT
-            entry_status = __fstatat64 (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW);
+            entry_status = __fstatat64_time64 (fd, d->d_name, &st,
+					       AT_SYMLINK_NOFOLLOW);
 #else
             /* Compute size needed for this file name, or for the file
                name ".." in the same directory, whichever is larger.
@@ -390,7 +391,7 @@ __getcwd_generic (char *buf, size_t size)
               }
 
             memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN (d));
-            entry_status = __lstat64 (dotlist, &st);
+            entry_status = __lstat64_time64 (dotlist, &st);
 #endif
             /* We don't fail here if we cannot stat() a directory entry.
                This can happen when (network) file systems fail.  If this
diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c
index 9eb17d1536..89fcfad49d 100644
--- a/sysdeps/posix/pathconf.c
+++ b/sysdeps/posix/pathconf.c
@@ -129,9 +129,9 @@ __pathconf (const char *path, int name)
 #ifdef	_POSIX_ASYNC_IO
       {
 	/* AIO is only allowed on regular files and block devices.  */
-	struct stat64 st;
+	struct __stat64_t64 st;
 
-	if (__stat64 (path, &st) < 0
+	if (__stat64_time64 (path, &st) < 0
 	    || (! S_ISREG (st.st_mode) && ! S_ISBLK (st.st_mode)))
 	  return -1;
 	else
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index 54d6046d00..3e8ec5cd51 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -1215,8 +1215,8 @@ __sysconf_check_spec (const char *spec)
 		   "/POSIX_V6_", sizeof ("/POSIX_V6_") - 1),
 	  spec, speclen + 1);
 
-  struct stat64 st;
-  long int ret = __stat64 (name, &st) >= 0 ? 1 : -1;
+  struct __stat64_t64 st;
+  long int ret = __stat64_time64 (name, &st) >= 0 ? 1 : -1;
 
   __set_errno (save_errno);
   return ret;
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
index 5f804b38d7..ff38f1e31f 100644
--- a/sysdeps/posix/tempname.c
+++ b/sysdeps/posix/tempname.c
@@ -55,14 +55,14 @@
 #include <time.h>
 
 #if _LIBC
-# define struct_stat64 struct stat64
+# define struct_stat64 struct __stat64_t64
 # define __secure_getenv __libc_secure_getenv
 #else
 # define struct_stat64 struct stat
 # define __gen_tempname gen_tempname
 # define __mkdir mkdir
 # define __open open
-# define __lstat64(file, buf) lstat (file, buf)
+# define __lstat64_time64(file, buf) lstat (file, buf)
 # define __stat64(file, buf) stat (file, buf)
 # define __getrandom getrandom
 # define __clock_gettime64 clock_gettime
@@ -99,7 +99,7 @@ static int
 direxists (const char *dir)
 {
   struct_stat64 buf;
-  return __stat64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+  return __stat64_time64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
 }
 
 /* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
@@ -191,7 +191,7 @@ try_nocreate (char *tmpl, void *flags _GL_UNUSED)
 {
   struct_stat64 st;
 
-  if (__lstat64 (tmpl, &st) == 0 || errno == EOVERFLOW)
+  if (__lstat64_time64 (tmpl, &st) == 0 || errno == EOVERFLOW)
     __set_errno (EEXIST);
   return errno == ENOENT ? 0 : -1;
 }
diff --git a/sysdeps/unix/sysv/linux/fdopendir.c b/sysdeps/unix/sysv/linux/fdopendir.c
index ede43f2485..32ec10e206 100644
--- a/sysdeps/unix/sysv/linux/fdopendir.c
+++ b/sysdeps/unix/sysv/linux/fdopendir.c
@@ -27,9 +27,9 @@
 DIR *
 __fdopendir (int fd)
 {
-  struct stat64 statbuf;
+  struct __stat64_t64 statbuf;
 
-  if (__builtin_expect (__fstat64 (fd, &statbuf), 0) < 0)
+  if (__glibc_unlikely (__fstat64_time64 (fd, &statbuf) < 0))
     return NULL;
   if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
     {
diff --git a/sysdeps/unix/sysv/linux/fexecve.c b/sysdeps/unix/sysv/linux/fexecve.c
index f37c245396..7e7a47c91a 100644
--- a/sysdeps/unix/sysv/linux/fexecve.c
+++ b/sysdeps/unix/sysv/linux/fexecve.c
@@ -60,8 +60,8 @@ fexecve (int fd, char *const argv[], char *const envp[])
 
   /* We come here only if the 'execve' call fails.  Determine whether
      /proc is mounted.  If not we return ENOSYS.  */
-  struct stat64 st;
-  if (__stat64 ("/proc/self/fd", &st) != 0 && errno == ENOENT)
+  struct __stat64_t64 st;
+  if (__stat64_time64 ("/proc/self/fd", &st) != 0 && errno == ENOENT)
     save = ENOSYS;
 
   __set_errno (save);
diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
index 4020a826f9..48f254d169 100644
--- a/sysdeps/unix/sysv/linux/opendir.c
+++ b/sysdeps/unix/sysv/linux/opendir.c
@@ -49,8 +49,8 @@ opendir_tail (int fd)
   /* Now make sure this really is a directory and nothing changed since the
      `stat' call.  The S_ISDIR check is superfluous if O_DIRECTORY works,
      but it's cheap and we need the stat call for st_blksize anyway.  */
-  struct stat64 statbuf;
-  if (__glibc_unlikely (__fstat64 (fd, &statbuf) < 0))
+  struct __stat64_t64 statbuf;
+  if (__glibc_unlikely (__fstat64_time64 (fd, &statbuf) < 0))
     goto lose;
   if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
     {
@@ -88,7 +88,8 @@ __opendir (const char *name)
 weak_alias (__opendir, opendir)
 
 DIR *
-__alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp)
+__alloc_dir (int fd, bool close_fd, int flags,
+	     const struct __stat64_t64 *statp)
 {
   /* We have to set the close-on-exit flag if the user provided the
      file descriptor.  */
diff --git a/sysdeps/unix/sysv/linux/pathconf.c b/sysdeps/unix/sysv/linux/pathconf.c
index f37e8aaf68..b599a66c93 100644
--- a/sysdeps/unix/sysv/linux/pathconf.c
+++ b/sysdeps/unix/sysv/linux/pathconf.c
@@ -65,9 +65,10 @@ distinguish_extX (const struct statfs *fsbuf, const char *file, int fd)
 {
   char buf[64];
   char path[PATH_MAX];
-  struct stat64 st;
+  struct __stat64_t64 st;
 
-  if ((file == NULL ? __fstat64 (fd, &st) : __stat64 (file, &st)) != 0)
+  if ((file == NULL ? __fstat64_time64 (fd, &st)
+		    : __stat64_time64 (file, &st)) != 0)
     /* Strange.  The statfd call worked, but stat fails.  Default to
        the more pessimistic value.  */
     return EXT2_LINK_MAX;
diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c
index d561ac12f2..b026c589ca 100644
--- a/sysdeps/unix/sysv/linux/ttyname.c
+++ b/sysdeps/unix/sysv/linux/ttyname.c
@@ -35,17 +35,18 @@
 char *__ttyname;
 #endif
 
-static char *getttyname (const char *dev, const struct stat64 *mytty,
+static char *getttyname (const char *dev, const struct __stat64_t64 *mytty,
 			 int save, int *dostat);
 
 libc_freeres_ptr (static char *getttyname_name);
 
 static char *
 attribute_compat_text_section
-getttyname (const char *dev, const struct stat64 *mytty, int save, int *dostat)
+getttyname (const char *dev, const struct __stat64_t64 *mytty, int save,
+	    int *dostat)
 {
   static size_t namelen;
-  struct stat64 st;
+  struct __stat64_t64 st;
   DIR *dirstream;
   struct dirent64 *d;
   size_t devlen = strlen (dev) + 1;
@@ -84,7 +85,7 @@ getttyname (const char *dev, const struct stat64 *mytty, int save, int *dostat)
 	    *((char *) __mempcpy (getttyname_name, dev, devlen - 1)) = '/';
 	  }
 	memcpy (&getttyname_name[devlen], d->d_name, dlen);
-	if (__stat64 (getttyname_name, &st) == 0
+	if (__stat64_time64 (getttyname_name, &st) == 0
 	    && is_mytty (mytty, &st))
 	  {
 	    (void) __closedir (dirstream);
@@ -113,7 +114,7 @@ ttyname (int fd)
 {
   static size_t buflen;
   char procname[30];
-  struct stat64 st, st1;
+  struct __stat64_t64 st, st1;
   int dostat = 0;
   int doispty = 0;
   char *name;
@@ -125,7 +126,7 @@ ttyname (int fd)
   if (__glibc_unlikely (__tcgetattr (fd, &term) < 0))
     return NULL;
 
-  if (__fstat64 (fd, &st) < 0)
+  if (__fstat64_time64 (fd, &st) < 0)
     return NULL;
 
   /* We try using the /proc filesystem.  */
@@ -162,14 +163,14 @@ ttyname (int fd)
 
       /* Verify readlink result, fall back on iterating through devices.  */
       if (ttyname_buf[0] == '/'
-	  && __stat64 (ttyname_buf, &st1) == 0
+	  && __stat64_time64 (ttyname_buf, &st1) == 0
 	  && is_mytty (&st, &st1))
 	return ttyname_buf;
 
       doispty = 1;
     }
 
-  if (__stat64 ("/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
+  if (__stat64_time64 ("/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
     {
       name = getttyname ("/dev/pts", &st, save, &dostat);
     }
diff --git a/sysdeps/unix/sysv/linux/ttyname.h b/sysdeps/unix/sysv/linux/ttyname.h
index 0a0048cc02..5dcbfef973 100644
--- a/sysdeps/unix/sysv/linux/ttyname.h
+++ b/sysdeps/unix/sysv/linux/ttyname.h
@@ -25,24 +25,18 @@
    linux/Documentation/devices.txt (on linux < 4.10) or
    linux/Documentation/admin-guide/devices.txt (on linux >= 4.10).  */
 static inline bool
-is_pty (struct stat64 *sb)
+is_pty (struct __stat64_t64 *sb)
 {
-#ifdef _STATBUF_ST_RDEV
   int m = __gnu_dev_major (sb->st_rdev);
   return (136 <= m && m <= 143);
-#else
-  return false;
-#endif
 }
 
 static inline bool
-is_mytty (const struct stat64 *mytty, const struct stat64 *maybe)
+is_mytty (const struct __stat64_t64 *mytty, const struct __stat64_t64 *maybe)
 {
   return (maybe->st_ino == mytty->st_ino
 	  && maybe->st_dev == mytty->st_dev
-#ifdef _STATBUF_ST_RDEV
 	  && S_ISCHR (maybe->st_mode)
 	  && maybe->st_rdev == mytty->st_rdev
-#endif
 	  );
 }
diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c
index c1092d1695..0ee809458d 100644
--- a/sysdeps/unix/sysv/linux/ttyname_r.c
+++ b/sysdeps/unix/sysv/linux/ttyname_r.c
@@ -31,15 +31,15 @@
 #include "ttyname.h"
 
 static int getttyname_r (char *buf, size_t buflen,
-			 const struct stat64 *mytty, int save,
+			 const struct __stat64_t64 *mytty, int save,
 			 int *dostat);
 
 static int
 attribute_compat_text_section
-getttyname_r (char *buf, size_t buflen, const struct stat64 *mytty,
+getttyname_r (char *buf, size_t buflen, const struct __stat64_t64 *mytty,
 	      int save, int *dostat)
 {
-  struct stat64 st;
+  struct __stat64_t64 st;
   DIR *dirstream;
   struct dirent64 *d;
   size_t devlen = strlen (buf);
@@ -71,7 +71,7 @@ getttyname_r (char *buf, size_t buflen, const struct stat64 *mytty,
 	cp = __stpncpy (buf + devlen, d->d_name, needed);
 	cp[0] = '\0';
 
-	if (__stat64 (buf, &st) == 0
+	if (__stat64_time64 (buf, &st) == 0
 	    && is_mytty (mytty, &st))
 	  {
 	    (void) __closedir (dirstream);
@@ -93,7 +93,7 @@ int
 __ttyname_r (int fd, char *buf, size_t buflen)
 {
   char procname[30];
-  struct stat64 st, st1;
+  struct __stat64_t64 st, st1;
   int dostat = 0;
   int doispty = 0;
   int save = errno;
@@ -118,7 +118,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
   if (__glibc_unlikely (__tcgetattr (fd, &term) < 0))
     return errno;
 
-  if (__fstat64 (fd, &st) < 0)
+  if (__fstat64_time64 (fd, &st) < 0)
     return errno;
 
   /* We try using the /proc filesystem.  */
@@ -146,7 +146,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
 
       /* Verify readlink result, fall back on iterating through devices.  */
       if (buf[0] == '/'
-	  && __stat64 (buf, &st1) == 0
+	  && __stat64_time64 (buf, &st1) == 0
 	  && is_mytty (&st, &st1))
 	return 0;
 
@@ -157,7 +157,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
   memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/"));
   buflen -= sizeof ("/dev/pts/") - 1;
 
-  if (__stat64 (buf, &st1) == 0 && S_ISDIR (st1.st_mode))
+  if (__stat64_time64 (buf, &st1) == 0 && S_ISDIR (st1.st_mode))
     {
       ret = getttyname_r (buf, buflen, &st, save,
 			  &dostat);
diff --git a/sysvipc/ftok.c b/sysvipc/ftok.c
index 2e39c74415..bd633bd395 100644
--- a/sysvipc/ftok.c
+++ b/sysvipc/ftok.c
@@ -22,10 +22,10 @@
 key_t
 ftok (const char *pathname, int proj_id)
 {
-  struct stat64 st;
+  struct __stat64_t64 st;
   key_t key;
 
-  if (__stat64 (pathname, &st) < 0)
+  if (__stat64_time64 (pathname, &st) < 0)
     return (key_t) -1;
 
   key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16)
diff --git a/time/tzfile.c b/time/tzfile.c
index 040a5e341f..4377018a55 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -150,9 +150,9 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
     }
 
   /* If we were already using tzfile, check whether the file changed.  */
-  struct stat64 st;
+  struct __stat64_t64 st;
   if (was_using_tzfile
-      && __stat64 (file, &st) == 0
+      && __stat64_time64 (file, &st) == 0
       && tzfile_ino == st.st_ino && tzfile_dev == st.st_dev
       && tzfile_mtime == st.st_mtime)
     goto done;  /* Nothing to do.  */
@@ -164,7 +164,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
     goto ret_free_transitions;
 
   /* Get information about the file we are actually using.  */
-  if (__fstat64 (__fileno (f), &st) != 0)
+  if (__fstat64_time64 (__fileno (f), &st) != 0)
     goto lose;
 
   free ((void *) transitions);
-- 
2.25.1


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

* [PATCH 46/52] debug: build pcprofiledump with LFS and 64 bit time support
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (44 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 45/52] Use 64 bit time_t stat internally Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 47/52] elf: Use LFS and 64 bit time_t for installed programs Adhemerval Zanella via Libc-alpha
                   ` (7 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 UTC (permalink / raw)
  To: libc-alpha

---
 debug/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debug/Makefile b/debug/Makefile
index 3f66666c6c..8e74e63050 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -213,6 +213,7 @@ $(objpfx)catchsegv: catchsegv.sh $(common-objpfx)soversions.mk \
 	mv -f $@.new $@
 
 $(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o
+CFLAGS-pcprofiledump.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
 
 $(objpfx)xtrace: xtrace.sh
 	rm -f $@.new
-- 
2.25.1


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

* [PATCH 47/52] elf: Use LFS and 64 bit time_t for installed programs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (45 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 46/52] debug: build pcprofiledump with LFS and 64 bit time support Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:43   ` Florian Weimer via Libc-alpha
  2021-03-05 20:15 ` [PATCH 48/52] iconv: " Adhemerval Zanella via Libc-alpha
                   ` (6 subsequent siblings)
  53 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 UTC (permalink / raw)
  To: libc-alpha

The patch enables for pldd, sprof, ldconfig, and sln.

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 elf/Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/elf/Makefile b/elf/Makefile
index b06bf6ca20..bad8594e64 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -79,6 +79,8 @@ ifeq (yes,$(have-loop-to-function))
 CFLAGS-rtld.c += -fno-tree-loop-distribute-patterns
 endif
 
+CFLAGS-pldd.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
+
 # Compile rtld itself without stack protection.
 # Also compile all routines in the static library that are elided from
 # the shared libc because they are in libc.a in the same way.
@@ -663,14 +665,23 @@ $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \
 	mv -f $@.new $@
 
 $(objpfx)sprof: $(libdl)
+CFLAGS-sprof.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
 
 $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
+CFLAGS-sln.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
 
 $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
+include $(o-iterator)
+define o-iterator-doit
+$(foreach f,$(ldconfig-modules),$(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
 
 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
 CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-		    -D'SLIBDIR="$(slibdir)"'
+		    -D'SLIBDIR="$(slibdir)"' \
+		    -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
 libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c += $(SYSCONF-FLAGS)
 CFLAGS-cache.c += $(SYSCONF-FLAGS)
-- 
2.25.1


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

* [PATCH 48/52] iconv: Use LFS and 64 bit time_t for installed programs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (46 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 47/52] elf: Use LFS and 64 bit time_t for installed programs Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 49/52] locale: " Adhemerval Zanella via Libc-alpha
                   ` (5 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 UTC (permalink / raw)
  To: libc-alpha

It is enabled for iconv and iconvconfig.
---
 iconv/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/iconv/Makefile b/iconv/Makefile
index 659857dd8c..b7494efd0c 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -94,6 +94,14 @@ $(inst_bindir)/iconv: $(objpfx)iconv_prog $(+force)
 
 $(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
 $(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
+include $(o-iterator)
+define o-iterator-doit
+$(foreach f,$(others:%s=$(objpfx)%.o) $(iconv_prog-modules) \
+	    $(iconvconfig-modules), \
+	    $(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
 
 $(objpfx)test-iconvconfig.out: /dev/null $(objpfx)iconvconfig
 	(set -e; \
-- 
2.25.1


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

* [PATCH 49/52] locale: Use LFS and 64 bit time_t for installed programs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (47 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 48/52] iconv: " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 50/52] nss: " Adhemerval Zanella via Libc-alpha
                   ` (4 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 UTC (permalink / raw)
  To: libc-alpha

It is enabled for locale and localedef.
---
 locale/Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/locale/Makefile b/locale/Makefile
index b7c60681fa..6d082ac13c 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -81,6 +81,15 @@ $(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
 
+include $(o-iterator)
+define o-iterator-doit
+$(foreach f,$(localedef-modules) $(localedef-aux) $(locale-modules) \
+	    $(lib-modules),$(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
+
+
 $(objpfx)C-translit.h: C-translit.h.in gen-translit.py
 	$(make-target-directory)
 	$(PYTHON) gen-translit.py < $< > $@.tmp
-- 
2.25.1


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

* [PATCH 50/52] nss: Use LFS and 64 bit time_t for installed programs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (48 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 49/52] locale: " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 51/52] posix: " Adhemerval Zanella via Libc-alpha
                   ` (3 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 UTC (permalink / raw)
  To: libc-alpha

It is enabled for getend and makedb.
---
 nss/Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/nss/Makefile b/nss/Makefile
index 0906202db9..eb1b604b0c 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -45,7 +45,8 @@ have-sunrpc		:= 1
 else
 have-sunrpc		:= 0
 endif
-CPPFLAGS-getent.c	= -DHAVE_SUNRPC=$(have-sunrpc)
+CPPFLAGS-getent.c	= -DHAVE_SUNRPC=$(have-sunrpc) \
+			  -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
 
 others                  := getent makedb
 install-bin             := getent makedb
@@ -148,6 +149,14 @@ $(libnss_db-dbs:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
 
 
 $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
+include $(o-iterator)
+define o-iterator-doit
+$(foreach f,$(makedb-modules),$(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
+
+
 
 $(inst_vardbdir)/Makefile: db-Makefile $(+force)
 	$(do-install)
-- 
2.25.1


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

* [PATCH 51/52] posix: Use LFS and 64 bit time_t for installed programs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (49 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 50/52] nss: " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:15 ` [PATCH 52/52] timezone: " Adhemerval Zanella via Libc-alpha
                   ` (2 subsequent siblings)
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 UTC (permalink / raw)
  To: libc-alpha

It is enabled for getconf.
---
 posix/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/posix/Makefile b/posix/Makefile
index e246ff1d14..174cb4114c 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -244,7 +244,8 @@ CFLAGS-spawni.c += -fexceptions
 CFLAGS-spawni.os = -fomit-frame-pointer
 CFLAGS-glob.c += $(uses-callbacks) -fexceptions
 CFLAGS-glob64.c += $(uses-callbacks) -fexceptions
-CFLAGS-getconf.c += -DGETCONF_DIR='"$(libexecdir)/getconf"'
+CFLAGS-getconf.c += -DGETCONF_DIR='"$(libexecdir)/getconf"' \
+		    -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
 CFLAGS-execve.os = -fomit-frame-pointer
 CFLAGS-fexecve.os = -fomit-frame-pointer
 CFLAGS-execv.os = -fomit-frame-pointer
-- 
2.25.1


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

* [PATCH 52/52] timezone: Use LFS and 64 bit time_t for installed programs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (50 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 51/52] posix: " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:15 ` Adhemerval Zanella via Libc-alpha
  2021-03-05 23:57 ` [PATCH 00/52] Add 64 bit time support on legacy ABIs Joseph Myers
  2021-03-07 10:42 ` Lukasz Majewski
  53 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-05 20:15 UTC (permalink / raw)
  To: libc-alpha

It is enabled for zdump and zic.
---
 timezone/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/timezone/Makefile b/timezone/Makefile
index 395abfeebd..cb95fb792f 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -61,6 +61,7 @@ tz-cflags = -DTZDIR='"$(zonedir)"' \
 	    -DTZDEFRULES='"$(posixrules-file)"' \
 	    -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone \
 	    -DHAVE_GETTEXT -DUSE_LTZ=0 -D_ISOMAC -DTZ_DOMAIN='"libc"' \
+	    -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 \
 	    -include $(common-objpfx)config.h -Wno-maybe-uninitialized
 
 # The -Wno-unused-variable flag is used to prevent GCC 6
-- 
2.25.1


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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-05 20:14 ` [PATCH 02/52] linux: Add futimes test Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:30   ` Florian Weimer via Libc-alpha
  2021-03-08 13:01     ` Adhemerval Zanella via Libc-alpha
  2021-03-05 20:33   ` Florian Weimer via Libc-alpha
  2021-03-06  0:02   ` Joseph Myers
  2 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-05 20:30 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> +#define PREPARE do_prepare
> +static void
> +do_prepare (int argc, char *argv[])
> +{
> +  temp_fd = create_temp_file ("utimes", &testfile);
> +  TEST_VERIFY_EXIT (temp_fd > 0);
> +}

I believe this should use /dev/shm.

Thanks,
Florian


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

* Re: [PATCH 03/52] linux: Add lutimes test
  2021-03-05 20:14 ` [PATCH 03/52] linux: Add lutimes test Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:31   ` Florian Weimer via Libc-alpha
  2021-03-06  0:02   ` Joseph Myers
  1 sibling, 0 replies; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-05 20:31 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> +#define PREPARE do_prepare
> +static void
> +do_prepare (int argc, char *argv[])
> +{
> +  temp_fd = create_temp_file ("utimes", &testfile);
> +  TEST_VERIFY_EXIT (temp_fd > 0);
> +
> +  testlink = xasprintf ("%s-symlink", testfile);
> +  xsymlink (testfile, testlink);
> +  add_temp_file (testlink);
> +}

Likewise, this should use /dev/shm.

Thanks,
Florian


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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-05 20:14 ` [PATCH 02/52] linux: Add futimes test Adhemerval Zanella via Libc-alpha
  2021-03-05 20:30   ` Florian Weimer via Libc-alpha
@ 2021-03-05 20:33   ` Florian Weimer via Libc-alpha
  2021-03-08 13:02     ` Adhemerval Zanella via Libc-alpha
  2021-03-06  0:02   ` Joseph Myers
  2 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-05 20:33 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif

This isn't necessary because xfstat is hard-wired to struct stat64.

Thanks,
Florian


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

* Re: [PATCH 11/52] linux: mips: Split libpthread.abilist in n32 and n64
  2021-03-05 20:14 ` [PATCH 11/52] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:39   ` Florian Weimer via Libc-alpha
  2021-03-08 13:05     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-05 20:39 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.

These are starting out as unchanged copies, right?  If yes, this is
okay.

Thanks,
Florian


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

* Re: [PATCH 43/52] libsupport: Add 64 bit time_t support for stat functions
  2021-03-05 20:15 ` [PATCH 43/52] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:42   ` Florian Weimer via Libc-alpha
  2021-03-08 13:06     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-05 20:42 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> 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.
> */

The comment seems inappropriate.  I think the file name could be
standard: there is no xfstat_time64.c that could be overridden by this.
This applies to the other functions as well.

Rest looks okay.

Thanks,
Florian


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

* Re: [PATCH 47/52] elf: Use LFS and 64 bit time_t for installed programs
  2021-03-05 20:15 ` [PATCH 47/52] elf: Use LFS and 64 bit time_t for installed programs Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:43   ` Florian Weimer via Libc-alpha
  2021-03-08 13:14     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-05 20:43 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> The patch enables for pldd, sprof, ldconfig, and sln.

Should we do this globally at the Makerules level?

Thanks,
Florian


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

* Re: [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh
  2021-03-05 20:14 ` [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella via Libc-alpha
@ 2021-03-05 20:56   ` Andreas Schwab
  2021-03-05 23:53   ` Joseph Myers
  1 sibling, 0 replies; 95+ messages in thread
From: Andreas Schwab @ 2021-03-05 20:56 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

On Mär 05 2021, Adhemerval Zanella via Libc-alpha wrote:

> diff --git a/io/ftwtest-sh b/io/ftwtest-sh
> index a9ae33ff30..6d553dad5d 100644
> --- a/io/ftwtest-sh
> +++ b/io/ftwtest-sh
> @@ -42,16 +42,12 @@ LC_ALL=C
>  export LC_ALL
>  
>  # First create our scenario:
> -tmp=${objpfx}io

This is already outside the source dir, so why is that needed?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh
  2021-03-05 20:14 ` [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella via Libc-alpha
  2021-03-05 20:56   ` Andreas Schwab
@ 2021-03-05 23:53   ` Joseph Myers
  2021-03-08 13:00     ` Adhemerval Zanella via Libc-alpha
  1 sibling, 1 reply; 95+ messages in thread
From: Joseph Myers @ 2021-03-05 23:53 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:

>  # First create our scenario:
> -tmp=${objpfx}io
> -tmpdir=$tmp/ftwtest.d
> +tmp=/tmp
> +tmpdir=$(mktemp -d $tmp/ftwtest.d.XXXXXX)
> +ftwtest=$(basename $tmpdir)

/tmp on the system on which glibc is built may not be the same as /tmp on 
the system on which programs linked with the glibc under test are run - in 
general with cross-test-ssh.sh they won't be, only the source and build 
directories can be assumed to be shared between the two systems.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 00/52] Add 64 bit time support on legacy ABIs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (51 preceding siblings ...)
  2021-03-05 20:15 ` [PATCH 52/52] timezone: " Adhemerval Zanella via Libc-alpha
@ 2021-03-05 23:57 ` Joseph Myers
  2021-03-08 13:18   ` Adhemerval Zanella via Libc-alpha
  2021-03-07 10:42 ` Lukasz Majewski
  53 siblings, 1 reply; 95+ messages in thread
From: Joseph Myers @ 2021-03-05 23:57 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:

> 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 4.12.13 kernel.  As expected,
> the arm shows some tests failures due the missing kernel support:

I'd expect tests on an older kernel to be UNSUPPORTED, not FAIL.

More precisely: tests of times that can be represented in 32 bits, but 
using the 64-bit interfaces, should be PASS, and tests of times that can't 
be represented in 64 bits should be UNSUPPORTED as long as those are in a 
separate testcase from the tests of times that can be represented in 32 
bits.  If in the same testcase, FAIL seems the worst result, since it's 
not indicating any bug in glibc.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-05 20:14 ` [PATCH 02/52] linux: Add futimes test Adhemerval Zanella via Libc-alpha
  2021-03-05 20:30   ` Florian Weimer via Libc-alpha
  2021-03-05 20:33   ` Florian Weimer via Libc-alpha
@ 2021-03-06  0:02   ` Joseph Myers
  2021-03-06  3:52     ` Paul Zimmermann
  2021-03-08 13:03     ` Adhemerval Zanella via Libc-alpha
  2 siblings, 2 replies; 95+ messages in thread
From: Joseph Myers @ 2021-03-06  0:02 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:

> diff --git a/sysdeps/unix/sysv/linux/tst-futimes.c b/sysdeps/unix/sysv/linux/tst-futimes.c
> new file mode 100644
> index 0000000000..026b0af023
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-futimes.c
> @@ -0,0 +1,85 @@
> +/* Basix test for utimes.

If it's testing futimes, the comment should say futimes not utimes.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 03/52] linux: Add lutimes test
  2021-03-05 20:14 ` [PATCH 03/52] linux: Add lutimes test Adhemerval Zanella via Libc-alpha
  2021-03-05 20:31   ` Florian Weimer via Libc-alpha
@ 2021-03-06  0:02   ` Joseph Myers
  1 sibling, 0 replies; 95+ messages in thread
From: Joseph Myers @ 2021-03-06  0:02 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:

> diff --git a/sysdeps/unix/sysv/linux/tst-lutimes.c b/sysdeps/unix/sysv/linux/tst-lutimes.c
> new file mode 100644
> index 0000000000..9e30691bbe
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-lutimes.c
> @@ -0,0 +1,95 @@
> +/* Basix test for utimes.

If it's testing lutimes, the comment should say lutimes not utimes.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 22/52] login: Use 64-bit time on struct lastlog [BZ #25844]
  2021-03-05 20:14 ` [PATCH 22/52] login: Use 64-bit time on struct lastlog [BZ #25844] Adhemerval Zanella via Libc-alpha
@ 2021-03-06  0:07   ` Joseph Myers
  2021-03-08 13:05     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Joseph Myers @ 2021-03-06  0:07 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:

> The new struct has the same size on both 32-bit and 64-bit
> architectures.  As for utmp{x} 64-bit time_t support, a new file name
> is defined for _PATH_LASTLOG.

I'd expect a NEWS entry, whether in this patch or another one, that goes 
into detail about how the different formats are handled for all affected 
files using the utmp and lastlog formats (so giving sufficient information 
for a distributor to implement upgrade support that avoids corrupting the 
files or losing any existing data in them, for example, and for anyone who 
wishes to write applications that access old files in the old formats).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 44/52] y2038: Add test coverage
  2021-03-05 20:15 ` [PATCH 44/52] y2038: Add test coverage Adhemerval Zanella via Libc-alpha
@ 2021-03-06  0:13   ` Joseph Myers
  2021-03-08 13:12     ` Adhemerval Zanella via Libc-alpha
  2021-03-08 21:28   ` Lukasz Majewski
  1 sibling, 1 reply; 95+ messages in thread
From: Joseph Myers @ 2021-03-06  0:13 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha 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.

I'm not convinced it's correct not to build them for ABIs that already 
have 64-bit time_t.  _TIME_BITS=64 should work, and do nothing, for such 
ABIs; it seems useful to build and run the tests to verify that the 
headers don't have any incorrect redirections in that case, for example.

(On the other hand, if any systems - Hurd? - don't get support for 64-bit 
time, it's correct not to build the tests for such systems.)

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-06  0:02   ` Joseph Myers
@ 2021-03-06  3:52     ` Paul Zimmermann
  2021-03-08 13:03     ` Adhemerval Zanella via Libc-alpha
  1 sibling, 0 replies; 95+ messages in thread
From: Paul Zimmermann @ 2021-03-06  3:52 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

> > diff --git a/sysdeps/unix/sysv/linux/tst-futimes.c b/sysdeps/unix/sysv/linux/tst-futimes.c
> > new file mode 100644
> > index 0000000000..026b0af023
> > --- /dev/null
> > +++ b/sysdeps/unix/sysv/linux/tst-futimes.c
> > @@ -0,0 +1,85 @@
> > +/* Basix test for utimes.
> 
> If it's testing futimes, the comment should say futimes not utimes.

and in addition: Basix -> Basic.

Paul

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

* Re: [PATCH 00/52] Add 64 bit time support on legacy ABIs
  2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
                   ` (52 preceding siblings ...)
  2021-03-05 23:57 ` [PATCH 00/52] Add 64 bit time support on legacy ABIs Joseph Myers
@ 2021-03-07 10:42 ` Lukasz Majewski
  53 siblings, 0 replies; 95+ messages in thread
From: Lukasz Majewski @ 2021-03-07 10:42 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha; +Cc: libc-alpha

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

Hi Adhemerval,

> 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 as 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 5 subparts:
> 
>   1. Patches from 01/52 to 14/52 are newer tests and infrastructure
>      changes that are independent of 64 bit time support.
> 
>   2. Patches from 15/52 to 23/52 add the 64 bit time support on
>      utmp/utmpx/lastlog and it affects *all* the ABIs with the
>      exception of s390.
> 
>   3. Patches from 24/52 to 41/52 are the one that adjust the exported
>      API, add some specific newer symbols (glob, ftw, and fts) and
>      enable the _TIME_BITS on the installed headers.
> 
>   4. Patches from 42/52 to 44/52 enables basic test coverage.
> Although it does not cover all the newer symbol redirection, the idea
> is to use Lukasz patches and newer tests to cover all the symbols for
>      2.34 release.

There are still floating some patches, which would allow changing time
on target machines (usually in VM). I hope to get them pulled soon.

> 
>   5. Patches from 45/52 to 52/52 make glibc itself to use the newer
>      64 bit symbol internally and on installed programs.
> 
> 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 4.12.13 kernel.  As expected,
> the arm shows some tests failures due the missing kernel support:
> 

Big thanks for preparing this patch set - this is a huge step to have
64 bit time_t support on ports with __TIMESIZE != 64 and __WORDSIZE ==
32

> FAIL: io/tst-utimensat-time64
> FAIL: misc/tst-futimens-time64
> FAIL: misc/tst-futimes-time64
> FAIL: misc/tst-lutimes-time64
> FAIL: misc/tst-utime-time64
> FAIL: misc/tst-utimes-time64
> 
> Adhemerval Zanella (50):
>   io: Use temporary directory and file for ftwtest-sh
>   linux: Add futimes test
>   linux: Add lutimes test
>   time: Add getitimer and setitimer basic tests
>   time: Add gmtime/gmtime_r tests
>   time: Add timegm/timelocal basic tests
>   time: Add basic timespec_get tests
>   time: Add 64 bit tests for getdate / getdate_r
>   io: Add basic tests for utimensat
>   posix: Add wait3 tests
>   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
>   login: Consolidate utmp and utmpx headers
>   login: Move gnu utmpx to default implementation
>   Consolidate and simplify internal utmp definitions
>   support: Add 'touch' command
>   Add tests-container-internal rules
>   login: Add 64-bit time support to utmp/utmpx
>   linux: Add pwrite64_nocancel
>   login: Use 64-bit time on struct lastlog [BZ #25844]
>   Remove __WORDSIZE_TIME64_COMPAT32
>   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
>   Use 64 bit time_t stat internally
>   debug: build pcprofiledump with LFS and 64 bit time support
>   elf: Use LFS and 64 bit time_t for installed programs
>   iconv: Use LFS and 64 bit time_t for installed programs
>   locale: Use LFS and 64 bit time_t for installed programs
>   nss: Use LFS and 64 bit time_t for installed programs
>   posix: Use LFS and 64 bit time_t for installed programs
>   timezone: Use LFS and 64 bit time_t for installed programs
> 
> Lukasz Majewski (2):
>   y2038: Use a common definition for stat
>   y2038: Use a common definition for msqid_ds
> 
>  Makeconfig                                    |  14 +
>  Makefile                                      |   4 +-
>  Makerules                                     |  21 +-
>  NEWS                                          |   5 +
>  Rules                                         |  12 +-
>  .../updwtmp.c => bits/types/struct_lastlog.h  |  26 +-
>  bits/types/struct_utmp.h                      |  53 ++
>  bits/types/struct_utmpx.h                     |  54 +++
>  bits/utmp.h                                   |  48 +-
>  .../sysv/linux/s390/bits => bits}/utmpx.h     |  34 +-
>  bits/wordsize.h                               |   6 -
>  csu/check_fds.c                               |   8 +-
>  debug/Makefile                                |   1 +
>  elf/Makefile                                  |  13 +-
>  elf/dl-load.c                                 |   8 +-
>  elf/dl-misc.c                                 |   4 +-
>  elf/dl-profile.c                              |   4 +-
>  iconv/Makefile                                |   8 +
>  iconv/gconv_cache.c                           |   4 +-
>  include/dirent.h                              |   2 +-
>  include/features-time64.h                     |   1 +
>  include/features.h                            |   2 +
>  include/file_change_detection.h               |   6 +-
>  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 +-
>  include/utmp.h                                |   5 +-
>  include/utmpx.h                               |   1 +
>  inet/rcmd.c                                   |   6 +-
>  intl/loadmsgcat.c                             |   4 +-
>  io/Makefile                                   |  28 +-
>  io/file_change_detection.c                    |  16 +-
>  io/fts.h                                      |  43 +-
>  io/fts64-time64.c                             |  35 ++
>  io/ftw.c                                      |   5 +-
>  io/ftw.h                                      |  46 +-
>  .../s390-32/getutent_r.c => io/ftw64-time64.c |  34 +-
>  io/ftwtest-sh                                 | 246 +++++-----
>  io/ftwtest-time64.c                           |   1 +
>  io/getdirname.c                               |   6 +-
>  io/sys/poll.h                                 |  11 +
>  io/sys/stat.h                                 | 113 ++++-
>  io/tst-fts-time64.c                           |   1 +
>  io/tst-futimesat-time64.c                     |   4 +
>  io/tst-futimesat.c                            |  47 +-
>  io/tst-stat-time64.c                          | 102 ++++
>  io/tst-utimensat-time64.c                     |   2 +
>  io/tst-utimensat.c                            | 115 +++++
>  io/utime.h                                    |  16 +
>  libio/filedoalloc.c                           |   2 +-
>  libio/fileops.c                               |   8 +-
>  libio/oldfileops.c                            |   2 +-
>  libio/wfileops.c                              |   2 +-
>  locale/Makefile                               |   9 +
>  locale/loadarchive.c                          |   8 +-
>  locale/loadlocale.c                           |   6 +-
>  login/Makefile                                |  16 +-
>  login/Versions                                |  26 +
>  login/getutent.c                              |   7 +-
>  login/getutent_r.c                            |  48 +-
>  login/getutid.c                               |   7 +-
>  login/getutid_r.c                             |  33 +-
>  login/getutline.c                             |   7 +-
>  login/getutline_r.c                           |  33 +-
>  login/getutmp.c                               |  42 +-
>  login/getutmpx.c                              |  35 +-
>  login/getutxent.c                             |   9 +-
>  login/getutxid.c                              |   9 +-
>  login/getutxline.c                            |   9 +-
>  .../getutent.c => login/lastlog-compat.h      |  29 +-
>  login/lastlog_read.c                          |  78 +++
>  login/lastlog_write.c                         |  64 +++
>  login/login.c                                 |  10 +-
>  .../linux/s390/s390-32 => login}/login32.c    |  16 +-
>  login/pututxline.c                            |   9 +-
>  login/tst-lastlog.c                           |  80 ++++
>  login/tst-lastlog.root/tst-lastlog.script     |   6 +
>  login/tst-utmp-default.c                      | 292 ++++++++++++
>  .../tst-utmp-default.script                   |  10 +
>  login/tst-utmp32.c                            | 318 ++++++++++++
>  login/tst-utmp32.root/tst-utmp32.script       |   7 +
>  login/updwtmp.c                               |  32 +-
>  login/updwtmpx.c                              |   9 +-
>  .../utmp-convert.h => login/utmp-convert.c    |  59 +--
>  .../s390-32/getutmp.c => login/utmp-convert.h |  39 +-
>  .../sysv/linux/updwtmp.c => login/utmp-path.h |  42 +-
>  login/utmp-private.h                          |  24 +-
>  login/utmp.h                                  |  11 +
>  login/utmp32.c                                | 247 ++++++++++
>  .../linux/s390/s390-32 => login}/utmp32.h     |   9 +
>  login/utmp_file.c                             | 451
> +++++++++++------- login/utmpname.c                              |
> 8 + {sysdeps/gnu => login}/utmpx.h                |   0
>  login/utmpx32.c                               | 112 +++++
>  .../linux/s390/s390-32 => login}/utmpx32.h    |   6 +-
>  manual/creature.texi                          |  44 ++
>  manual/users.texi                             |   4 +-
>  misc/Makefile                                 |   2 +
>  misc/sys/select.h                             |  27 ++
>  misc/tst-pselect-time64.c                     |   1 +
>  nptl/Makefile                                 |   3 +
>  nptl/tst-cancel4_2-time64.c                   |   1 +
>  nscd/nscd_helper.c                            |   4 +-
>  nss/Makefile                                  |  11 +-
>  nss/nss_database.c                            |   4 +-
>  posix/Makefile                                |  10 +-
>  posix/glob.c                                  |  46 +-
>  posix/glob.h                                  |  22 +
>  posix/glob64-lstat-compat.c                   |   3 +-
>  posix/glob64-time64.c                         |  49 ++
>  .../getutid.c => posix/globfree64-time64.c    |  22 +-
>  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-wait-skeleton.c                     | 209 ++++++++
>  posix/tst-wait3-time64.c                      |   1 +
>  .../s390-32/updwtmpx.c => posix/tst-wait3.c   |  18 +-
>  posix/tst-wait4-time64.c                      |   1 +
>  posix/tst-wait4.c                             | 193 +-------
>  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                              |   8 +
>  support/support-xfstat-time64.c               |  32 ++
>  .../support-xstat-time64.c                    |  28 +-
>  support/test-container.c                      |  11 +
>  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 +-
>  .../xclock_gettime_time64.c                   |  22 +-
>  support/xlstat-time64.c                       |  32 ++
>  support/xtime.h                               |   5 +
>  support/xunistd.h                             |  13 +
>  sysdeps/aarch64/bits/wordsize.h               |   2 -
>  .../getutxent.c => generic/features-time64.h} |  17 +-
>  sysdeps/generic/paths.h                       |  12 +-
>  sysdeps/generic/time64-compat.h               |   3 +
>  sysdeps/generic/utmp-compat.h                 |   3 +
>  sysdeps/generic/utmp-equal.h                  |  42 --
>  sysdeps/gnu/getutmpx.c                        |   1 -
>  sysdeps/gnu/glob64-lstat-compat.c             |   3 +-
>  sysdeps/gnu/utmp_file.c                       |  31 --
>  sysdeps/mach/hurd/i386/libc.abilist           |  17 +
>  sysdeps/mach/hurd/i386/libutil.abilist        |   1 +
>  sysdeps/mips/bits/wordsize.h                  |   6 -
>  sysdeps/nptl/pthread.h                        | 119 +++++
>  sysdeps/posix/dl-fileid.h                     |   4 +-
>  sysdeps/posix/euidaccess.c                    |   4 +-
>  sysdeps/posix/getaddrinfo.c                   |  21 +-
>  sysdeps/posix/getcwd.c                        |  15 +-
>  sysdeps/posix/pathconf.c                      |   4 +-
>  sysdeps/posix/sysconf.c                       |   4 +-
>  sysdeps/posix/tempname.c                      |   8 +-
>  sysdeps/powerpc/powerpc32/bits/wordsize.h     |   2 -
>  sysdeps/powerpc/powerpc64/bits/wordsize.h     |   2 -
>  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/riscv/bits/wordsize.h                 |   2 -
>  sysdeps/s390/s390-32/bits/wordsize.h          |   2 -
>  sysdeps/s390/s390-64/bits/wordsize.h          |   2 -
>  sysdeps/sparc/sparc32/bits/wordsize.h         |   2 -
>  sysdeps/sparc/sparc64/bits/wordsize.h         |   2 -
>  sysdeps/unix/sysv/linux/Makefile              |  22 +-
>  sysdeps/unix/sysv/linux/Versions              | 125 +++++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  17 +
>  .../unix/sysv/linux/aarch64/libutil.abilist   |   1 +
>  sysdeps/unix/sysv/linux/alpha/bits/wordsize.h |   1 -
>  sysdeps/unix/sysv/linux/alpha/libc.abilist    |  17 +
>  sysdeps/unix/sysv/linux/alpha/libutil.abilist |   1 +
>  sysdeps/unix/sysv/linux/arc/libc.abilist      |  17 +
>  sysdeps/unix/sysv/linux/arc/libutil.abilist   |   1 +
>  sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  78 +++
>  .../unix/sysv/linux/arm/be/libpthread.abilist |  14 +
>  sysdeps/unix/sysv/linux/arm/be/librt.abilist  |   5 +
>  .../unix/sysv/linux/arm/be/libutil.abilist    |   1 +
>  sysdeps/unix/sysv/linux/arm/le/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  78 +++
>  .../unix/sysv/linux/arm/le/libpthread.abilist |  14 +
>  sysdeps/unix/sysv/linux/arm/le/librt.abilist  |   5 +
>  .../unix/sysv/linux/arm/le/libutil.abilist    |   1 +
>  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 +-
>  .../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}    |  25 +-
>  .../sysv/linux/bits/types/struct_shmid_ds.h   |  10 +-
>  .../unix/sysv/linux/convert_scm_timestamps.c  |  96 ++++
>  sysdeps/unix/sysv/linux/csky/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  78 +++
>  .../unix/sysv/linux/csky/libpthread.abilist   |  14 +
>  sysdeps/unix/sysv/linux/csky/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/csky/libutil.abilist  |   1 +
>  sysdeps/unix/sysv/linux/csky/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/fdopendir.c           |   4 +-
>  sysdeps/unix/sysv/linux/features-time64.h     |  37 ++
>  sysdeps/unix/sysv/linux/fexecve.c             |   4 +-
>  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 +-
>  .../getutid_r.c => globfree64-time64.c}       |  30 +-
>  .../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     |  78 +++
>  .../unix/sysv/linux/hppa/libpthread.abilist   |  14 +
>  sysdeps/unix/sysv/linux/hppa/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/hppa/libutil.abilist  |   1 +
>  .../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     |  78 +++
>  .../unix/sysv/linux/i386/libpthread.abilist   |  14 +
>  sysdeps/unix/sysv/linux/i386/librt.abilist    |   5 +
>  sysdeps/unix/sysv/linux/i386/libutil.abilist  |   1 +
>  sysdeps/unix/sysv/linux/i386/time64-compat.h  |   2 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist     |  17 +
>  sysdeps/unix/sysv/linux/ia64/libutil.abilist  |   1 +
>  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     |  78 +++
>  .../linux/m68k/coldfire/libpthread.abilist    |  14 +
>  .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
>  .../sysv/linux/m68k/coldfire/libutil.abilist  |   1 +
>  .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  78 +++
>  .../sysv/linux/m68k/m680x0/libpthread.abilist |  14 +
>  .../unix/sysv/linux/m68k/m680x0/librt.abilist |   5 +
>  .../sysv/linux/m68k/m680x0/libutil.abilist    |   1 +
>  sysdeps/unix/sysv/linux/m68k/time64-compat.h  |   2 +
>  .../sysv/linux/microblaze/be/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/be/libc.abilist     |  78 +++
>  .../linux/microblaze/be/libpthread.abilist    |  14 +
>  .../sysv/linux/microblaze/be/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/be/libutil.abilist  |   1 +
>  .../sysv/linux/microblaze/bits/struct_stat.h  |  48 +-
>  .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  78 +++
>  .../linux/microblaze/le/libpthread.abilist    |  14 +
>  .../sysv/linux/microblaze/le/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/le/libutil.abilist  |   1 +
>  .../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   |  78 +++
>  .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
>  .../sysv/linux/mips/mips32/libpthread.abilist |  14 +
>  .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
>  .../sysv/linux/mips/mips32/libutil.abilist    |   1 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  78 +++
>  .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
>  .../sysv/linux/mips/mips64/libutil.abilist    |   1 +
>  .../sysv/linux/mips/mips64/n32/libanl.abilist |   5 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  78 +++
>  .../linux/mips/mips64/n32/libpthread.abilist  | 252 ++++++++++
>  .../sysv/linux/mips/mips64/n32/librt.abilist  |  42 ++
>  .../linux/mips/mips64/n32/time64-compat.h     |   2 +
>  .../mips/mips64/{ => n64}/libanl.abilist      |   0
>  .../sysv/linux/mips/mips64/n64/libc.abilist   |  17 +
>  .../mips/mips64/{ => n64}/libpthread.abilist  |   0
>  .../linux/mips/mips64/{ => n64}/librt.abilist |   0
>  .../sysv/linux/mips/socket-constants-time64.h |  35 ++
>  sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  78 +++
>  .../unix/sysv/linux/nios2/libpthread.abilist  |  14 +
>  sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/nios2/libutil.abilist |   1 +
>  sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
>  sysdeps/unix/sysv/linux/not-cancel.h          |   4 +
>  sysdeps/unix/sysv/linux/oldglob.c             |  11 +-
>  sysdeps/unix/sysv/linux/opendir.c             |   7 +-
>  sysdeps/unix/sysv/linux/pathconf.c            |   5 +-
>  sysdeps/unix/sysv/linux/paths.h               |  10 +-
>  .../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 +-
>  .../unix/sysv/linux/powerpc/bits/wordsize.h   |   2 -
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  78 +++
>  .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
>  .../powerpc/powerpc32/libpthread.abilist      |  14 +
>  .../linux/powerpc/powerpc32/librt.abilist     |   5 +
>  .../linux/powerpc/powerpc32/libutil.abilist   |   1 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  78 +++
>  .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
>  .../linux/powerpc/powerpc64/be/libc.abilist   |  17 +
>  .../powerpc/powerpc64/be/libutil.abilist      |   1 +
>  .../linux/powerpc/powerpc64/le/libc.abilist   |  17 +
>  .../powerpc/powerpc64/le/libutil.abilist      |   1 +
>  .../linux/powerpc/socket-constants-time64.h   |  35 ++
>  .../s390-32/login.c => pwrite64_nocancel.c}   |  30 +-
>  sysdeps/unix/sysv/linux/recvmmsg.c            |  17 +-
>  sysdeps/unix/sysv/linux/recvmsg.c             |  23 +-
>  .../unix/sysv/linux/riscv/rv32/libc.abilist   |  17 +
>  .../sysv/linux/riscv/rv32/libutil.abilist     |   1 +
>  .../unix/sysv/linux/riscv/rv64/libc.abilist   |  17 +
>  .../sysv/linux/riscv/rv64/libutil.abilist     |   1 +
>  .../unix/sysv/linux/s390/bits/struct_utmp.h   |  51 ++
>  .../sysv/linux/s390/bits/struct_utmpx.h}      |  65 +--
>  sysdeps/unix/sysv/linux/s390/bits/utmp.h      | 127 -----
>  .../sysv/linux/s390/lastlog-compat.h}         |  34 +-
>  .../unix/sysv/linux/s390/s390-32/getutxline.c |  30 --
>  .../sysv/linux/s390/s390-32/libanl.abilist    |   5 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  63 +++
>  .../linux/s390/s390-32/libpthread.abilist     |  14 +
>  .../sysv/linux/s390/s390-32/librt.abilist     |   5 +
>  .../unix/sysv/linux/s390/s390-32/pututxline.c |  30 --
>  .../sysv/linux/s390/s390-32/time64-compat.h   |   2 +
>  .../sysv/linux/s390/s390-32/utmp-compat.h     |   2 +-
>  sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c | 184 -------
>  .../sysv/linux/s390/s390-32/utmpx-convert.h   |  85 ----
>  .../unix/sysv/linux/s390/s390-32/utmpx32.c    | 139 ------
>  .../linux/s390/{ => s390-64}/libanl.abilist   |   0
>  .../unix/sysv/linux/s390/s390-64/libc.abilist |   2 +
>  .../sysv/linux/s390/s390-64/utmp-compat.h     |   3 +
>  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    |  78 +++
>  .../unix/sysv/linux/sh/be/libpthread.abilist  |  14 +
>  sysdeps/unix/sysv/linux/sh/be/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/sh/be/libutil.abilist |   1 +
>  sysdeps/unix/sysv/linux/sh/le/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  78 +++
>  .../unix/sysv/linux/sh/le/libpthread.abilist  |  14 +
>  sysdeps/unix/sysv/linux/sh/le/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/sh/le/libutil.abilist |   1 +
>  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 +-
>  sysdeps/unix/sysv/linux/sparc/bits/wordsize.h |   2 -
>  .../linux/sparc/socket-constants-time64.h     |  35 ++
>  .../sysv/linux/sparc/sparc32/libanl.abilist   |   1 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  78 +++
>  .../linux/sparc/sparc32/libpthread.abilist    |  14 +
>  .../sysv/linux/sparc/sparc32/librt.abilist    |   5 +
>  .../sysv/linux/sparc/sparc32/libutil.abilist  |   1 +
>  .../sysv/linux/sparc/sparc32/time64-compat.h  |   2 +
>  .../sysv/linux/sparc/sparc64/libc.abilist     |  17 +
>  .../sysv/linux/sparc/sparc64/libutil.abilist  |   1 +
>  sysdeps/unix/sysv/linux/struct_stat_time64.h  |  59 +--
>  sysdeps/unix/sysv/linux/sys/timerfd.h         |  22 +
>  sysdeps/unix/sysv/linux/sys/timex.h           |  28 +-
>  sysdeps/unix/sysv/linux/tst-futimens-time64.c |   2 +
>  sysdeps/unix/sysv/linux/tst-futimens.c        |   8 +-
>  sysdeps/unix/sysv/linux/tst-futimes-time64.c  |   2 +
>  sysdeps/unix/sysv/linux/tst-futimes.c         |  85 ++++
>  sysdeps/unix/sysv/linux/tst-lutimes-time64.c  |   2 +
>  sysdeps/unix/sysv/linux/tst-lutimes.c         |  95 ++++
>  sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
>  sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
>  sysdeps/unix/sysv/linux/tst-utime-time64.c    |   2 +
>  sysdeps/unix/sysv/linux/tst-utime.c           |   6 +-
>  sysdeps/unix/sysv/linux/tst-utimes-time64.c   |   2 +
>  sysdeps/unix/sysv/linux/tst-utimes.c          |   6 +-
>  sysdeps/unix/sysv/linux/ttyname.c             |  17 +-
>  sysdeps/unix/sysv/linux/ttyname.h             |  10 +-
>  sysdeps/unix/sysv/linux/ttyname_r.c           |  16 +-
>  sysdeps/unix/sysv/linux/utmp-path.h           |  54 +++
>  sysdeps/unix/sysv/linux/utmp_file.c           |  37 --
>  .../unix/sysv/linux/x86/bits/struct_stat.h    |  90 ++--
>  .../linux/x86/bits/types/struct_semid_ds.h    |   4 +
>  .../unix/sysv/linux/x86_64/64/libc.abilist    |  17 +
>  .../unix/sysv/linux/x86_64/64/libutil.abilist |   1 +
>  .../unix/sysv/linux/x86_64/x32/libc.abilist   |  17 +
>  .../sysv/linux/x86_64/x32/libutil.abilist     |   1 +
>  sysdeps/wordsize-32/bits/wordsize.h           |   1 -
>  sysdeps/wordsize-64/bits/wordsize.h           |   1 -
>  sysdeps/x86/bits/wordsize.h                   |   3 -
>  sysvipc/Makefile                              |   2 +
>  sysvipc/ftok.c                                |   4 +-
>  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                                   | 128 ++++-
>  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-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                            | 147 +++---
>  time/tst-gmtime-time64.c                      |   1 +
>  time/tst-gmtime.c                             | 125 +++++
>  time/tst-itimer-time64.c                      |   1 +
>  time/tst-itimer.c                             | 175 +++++++
>  time/tst-mktime4-time64.c                     |   1 +
>  time/tst-timegm-time64.c                      |   1 +
>  time/tst-timegm.c                             |  95 ++++
>  time/tst-timespec_get-time64.c                |   1 +
>  time/tst-timespec_get.c                       |  40 ++
>  time/tst-y2039-time64.c                       |   1 +
>  time/tst-y2039.c                              |  10 +
>  time/tzfile.c                                 |   6 +-
>  timezone/Makefile                             |   1 +
>  463 files changed, 9068 insertions(+), 2386 deletions(-)
>  rename sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c =>
> bits/types/struct_lastlog.h (64%) create mode 100644
> bits/types/struct_utmp.h create mode 100644 bits/types/struct_utmpx.h
>  rename {sysdeps/unix/sysv/linux/s390/bits => bits}/utmpx.h (64%)
>  create mode 100644 include/features-time64.h
>  create mode 100644 include/utmpx.h
>  create mode 100644 io/fts64-time64.c
>  rename sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c =>
> io/ftw64-time64.c (55%) create mode 100644 io/ftwtest-time64.c
>  create mode 100644 io/tst-fts-time64.c
>  create mode 100644 io/tst-futimesat-time64.c
>  create mode 100644 io/tst-stat-time64.c
>  create mode 100644 io/tst-utimensat-time64.c
>  create mode 100644 io/tst-utimensat.c
>  rename sysdeps/unix/sysv/linux/s390/s390-32/getutent.c =>
> login/lastlog-compat.h (66%) create mode 100644 login/lastlog_read.c
>  create mode 100644 login/lastlog_write.c
>  rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/login32.c
> (72%) create mode 100644 login/tst-lastlog.c
>  create mode 100644 login/tst-lastlog.root/tst-lastlog.script
>  create mode 100644 login/tst-utmp-default.c
>  create mode 100644
> login/tst-utmp-default.root/tst-utmp-default.script create mode
> 100644 login/tst-utmp32.c create mode 100644
> login/tst-utmp32.root/tst-utmp32.script rename
> sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h =>
> login/utmp-convert.c (58%) rename
> sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c =>
> login/utmp-convert.h (59%) rename sysdeps/unix/sysv/linux/updwtmp.c
> => login/utmp-path.h (50%) create mode 100644 login/utmp32.c rename
> {sysdeps/unix/sysv/linux/s390/s390-32 => login}/utmp32.h (78%) rename
> {sysdeps/gnu => login}/utmpx.h (100%) create mode 100644
> login/utmpx32.c rename {sysdeps/unix/sysv/linux/s390/s390-32 =>
> login}/utmpx32.h (93%) create mode 100644 misc/tst-pselect-time64.c
> create mode 100644 nptl/tst-cancel4_2-time64.c create mode 100644
> posix/glob64-time64.c rename
> sysdeps/unix/sysv/linux/s390/s390-32/getutid.c =>
> posix/globfree64-time64.c (67%) create mode 100644
> posix/tst-gnuglob64-time64.c create mode 100644
> posix/tst-sched_rr_get_interval-time64.c create mode 100644
> posix/tst-wait-skeleton.c create mode 100644 posix/tst-wait3-time64.c
> rename sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c =>
> posix/tst-wait3.c (66%) 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
>  rename sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c =>
> support/support-xstat-time64.c (63%) create mode 100644
> support/timespec-add-time64.c create mode 100644
> support/timespec-sub-time64.c create mode 100644
> support/timespec-time64.c rename
> sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c =>
> support/xclock_gettime_time64.c (66%) create mode 100644
> support/xlstat-time64.c rename
> sysdeps/{unix/sysv/linux/s390/s390-32/getutxent.c =>
> generic/features-time64.h} (66%) create mode 100644
> sysdeps/generic/time64-compat.h create mode 100644
> sysdeps/generic/utmp-compat.h delete mode 100644
> sysdeps/generic/utmp-equal.h delete mode 100644
> sysdeps/gnu/getutmpx.c delete mode 100644 sysdeps/gnu/utmp_file.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/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
> rename sysdeps/unix/sysv/linux/{s390/s390-32/getutline.c =>
> bits/types/struct_semid64_ds_helper.h} (64%) rename
> sysdeps/{gnu/updwtmp.c =>
> unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h} (57%) 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 rename
> sysdeps/unix/sysv/linux/{s390/s390-32/getutid_r.c =>
> globfree64-time64.c} (62%) 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
> create mode 100644
> sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist 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%)
> rename sysdeps/unix/sysv/linux/mips/mips64/{ =>
> n64}/libpthread.abilist (100%) 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 rename
> sysdeps/unix/sysv/linux/{s390/s390-32/login.c => pwrite64_nocancel.c}
> (62%) create mode 100644
> sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h rename
> sysdeps/{gnu/bits/utmpx.h =>
> unix/sysv/linux/s390/bits/struct_utmpx.h} (51%) delete mode 100644
> sysdeps/unix/sysv/linux/s390/bits/utmp.h rename
> sysdeps/{gnu/getutmp.c => unix/sysv/linux/s390/lastlog-compat.h}
> (61%) delete mode 100644
> sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c create mode 100644
> sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist delete mode
> 100644 sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c create mode
> 100644 sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h delete
> mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c delete mode
> 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h delete
> mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c rename
> sysdeps/unix/sysv/linux/s390/{ => s390-64}/libanl.abilist (100%)
> create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h
> 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-futimens-time64.c create mode
> 100644 sysdeps/unix/sysv/linux/tst-futimes-time64.c create mode
> 100644 sysdeps/unix/sysv/linux/tst-futimes.c create mode 100644
> sysdeps/unix/sysv/linux/tst-lutimes-time64.c create mode 100644
> sysdeps/unix/sysv/linux/tst-lutimes.c create mode 100644
> sysdeps/unix/sysv/linux/tst-ppoll-time64.c create mode 100644
> sysdeps/unix/sysv/linux/tst-timerfd-time64.c create mode 100644
> sysdeps/unix/sysv/linux/tst-utime-time64.c create mode 100644
> sysdeps/unix/sysv/linux/tst-utimes-time64.c create mode 100644
> sysdeps/unix/sysv/linux/utmp-path.h delete mode 100644
> sysdeps/unix/sysv/linux/utmp_file.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-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-gmtime.c create mode 100644 time/tst-itimer-time64.c create
> mode 100644 time/tst-itimer.c create mode 100644
> time/tst-mktime4-time64.c create mode 100644 time/tst-timegm-time64.c
> create mode 100644 time/tst-timegm.c create mode 100644
> time/tst-timespec_get-time64.c create mode 100644
> time/tst-timespec_get.c create mode 100644 time/tst-y2039-time64.c
> 




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] 95+ messages in thread

* Re: [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh
  2021-03-05 23:53   ` Joseph Myers
@ 2021-03-08 13:00     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:00 UTC (permalink / raw)
  To: Joseph Myers, Andreas Schwab; +Cc: libc-alpha



On 05/03/2021 20:53, Joseph Myers wrote:
> On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:
> 
>>  # First create our scenario:
>> -tmp=${objpfx}io
>> -tmpdir=$tmp/ftwtest.d
>> +tmp=/tmp
>> +tmpdir=$(mktemp -d $tmp/ftwtest.d.XXXXXX)
>> +ftwtest=$(basename $tmpdir)
> 
> /tmp on the system on which glibc is built may not be the same as /tmp on 
> the system on which programs linked with the glibc under test are run - in 
> general with cross-test-ssh.sh they won't be, only the source and build 
> directories can be assumed to be shared between the two systems.
> 

I will use a temporary directory on the build directory instead as
noted by Andreas.

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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-05 20:30   ` Florian Weimer via Libc-alpha
@ 2021-03-08 13:01     ` Adhemerval Zanella via Libc-alpha
  2021-03-08 13:08       ` Florian Weimer via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:01 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 05/03/2021 17:30, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> +#define PREPARE do_prepare
>> +static void
>> +do_prepare (int argc, char *argv[])
>> +{
>> +  temp_fd = create_temp_file ("utimes", &testfile);
>> +  TEST_VERIFY_EXIT (temp_fd > 0);
>> +}
> 
> I believe this should use /dev/shm.

I still don't this we should gloss over buggy filesystem.

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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-05 20:33   ` Florian Weimer via Libc-alpha
@ 2021-03-08 13:02     ` Adhemerval Zanella via Libc-alpha
  2021-03-08 13:23       ` Adhemerval Zanella via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:02 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 05/03/2021 17:33, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> +#ifndef struct_stat
>> +# define struct_stat struct stat64
>> +#endif
> 
> This isn't necessary because xfstat is hard-wired to struct stat64.

This is necessary once the time64 support is done on a subsequent patch,
but I will move this snippet later in the set.

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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-06  0:02   ` Joseph Myers
  2021-03-06  3:52     ` Paul Zimmermann
@ 2021-03-08 13:03     ` Adhemerval Zanella via Libc-alpha
  1 sibling, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:03 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha



On 05/03/2021 21:02, Joseph Myers wrote:
> On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:
> 
>> diff --git a/sysdeps/unix/sysv/linux/tst-futimes.c b/sysdeps/unix/sysv/linux/tst-futimes.c
>> new file mode 100644
>> index 0000000000..026b0af023
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/tst-futimes.c
>> @@ -0,0 +1,85 @@
>> +/* Basix test for utimes.
> 
> If it's testing futimes, the comment should say futimes not utimes.
> 

I will fix on the other occurrences as well. 

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

* Re: [PATCH 11/52] linux: mips: Split libpthread.abilist in n32 and n64
  2021-03-05 20:39   ` Florian Weimer via Libc-alpha
@ 2021-03-08 13:05     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:05 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 05/03/2021 17:39, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> The n32 will require the 64 bit time symbols for y2038 support.
> 
> These are starting out as unchanged copies, right?  If yes, this is
> okay.

Yes and I think 'git send-mail -C -M' could not make this clear.

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

* Re: [PATCH 22/52] login: Use 64-bit time on struct lastlog [BZ #25844]
  2021-03-06  0:07   ` Joseph Myers
@ 2021-03-08 13:05     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:05 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha



On 05/03/2021 21:07, Joseph Myers wrote:
> On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:
> 
>> The new struct has the same size on both 32-bit and 64-bit
>> architectures.  As for utmp{x} 64-bit time_t support, a new file name
>> is defined for _PATH_LASTLOG.
> 
> I'd expect a NEWS entry, whether in this patch or another one, that goes 
> into detail about how the different formats are handled for all affected 
> files using the utmp and lastlog formats (so giving sufficient information 
> for a distributor to implement upgrade support that avoids corrupting the 
> files or losing any existing data in them, for example, and for anyone who 
> wishes to write applications that access old files in the old formats).
> 

Fair enough, I will update the patch with a proper NEWS entry.

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

* Re: [PATCH 43/52] libsupport: Add 64 bit time_t support for stat functions
  2021-03-05 20:42   ` Florian Weimer via Libc-alpha
@ 2021-03-08 13:06     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:06 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 05/03/2021 17:42, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> 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.
>> */
> 
> The comment seems inappropriate.  I think the file name could be
> standard: there is no xfstat_time64.c that could be overridden by this.
> This applies to the other functions as well.

Ack.

> 
> Rest looks okay.

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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-08 13:01     ` Adhemerval Zanella via Libc-alpha
@ 2021-03-08 13:08       ` Florian Weimer via Libc-alpha
  2021-03-08 13:26         ` Adhemerval Zanella via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-08 13:08 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella:

> On 05/03/2021 17:30, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>> 
>>> +#define PREPARE do_prepare
>>> +static void
>>> +do_prepare (int argc, char *argv[])
>>> +{
>>> +  temp_fd = create_temp_file ("utimes", &testfile);
>>> +  TEST_VERIFY_EXIT (temp_fd > 0);
>>> +}
>> 
>> I believe this should use /dev/shm.
>
> I still don't this we should gloss over buggy filesystem.

I view this as exactly the same thing as disabling post-Y2038 for 32-bit
time_t.

We should make it easy for contributors to test their patches.  Tests
where you need to remember why they fail on some systems make this
difficult.

Thanks,
Florian


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

* Re: [PATCH 44/52] y2038: Add test coverage
  2021-03-06  0:13   ` Joseph Myers
@ 2021-03-08 13:12     ` Adhemerval Zanella via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:12 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha



On 05/03/2021 21:13, Joseph Myers wrote:
> On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha 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.
> 
> I'm not convinced it's correct not to build them for ABIs that already 
> have 64-bit time_t.  _TIME_BITS=64 should work, and do nothing, for such 
> ABIs; it seems useful to build and run the tests to verify that the 
> headers don't have any incorrect redirections in that case, for example.

I was not sure about enabling or not the tests for ABI with already
support 64 bit time as default (my initial approach was to enable them
to all ABIs).  If we prefer, I can re-enabled it regardless.

I disabled because of two reasons:

  1. Different than LFS where redirections does happen for ABI with 
     64-bit off_t as default; _TIME_BITS=64 is really a no-op for
     such ABIS (there is no redirection involved, neither any new type or
     type redefinition).
     It means that issues on 64-bit time_t default ABI that might happen
     will mostly likely trigger build issues (like type mismatch or symbol
     redirection to nonexistent symbol).   It also speed up the glibc test
     on such architectures.

  2. It is simpler to handle systems (Hurd) that do not support 64-bit
     time_t as well.

> 
> (On the other hand, if any systems - Hurd? - don't get support for 64-bit 
> time, it's correct not to build the tests for such systems.)
> 
The patch already does it.

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

* Re: [PATCH 47/52] elf: Use LFS and 64 bit time_t for installed programs
  2021-03-05 20:43   ` Florian Weimer via Libc-alpha
@ 2021-03-08 13:14     ` Adhemerval Zanella via Libc-alpha
  2021-03-08 15:26       ` Florian Weimer via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:14 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 05/03/2021 17:43, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> The patch enables for pldd, sprof, ldconfig, and sln.
> 
> Should we do this globally at the Makerules level?

Do we have a simple way to accomplish it?  _TIME_SIZE and LFS defines
should work for 64-bit ABIs, so we have a global rule to enable it
I think it would be better indeed.

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

* Re: [PATCH 00/52] Add 64 bit time support on legacy ABIs
  2021-03-05 23:57 ` [PATCH 00/52] Add 64 bit time support on legacy ABIs Joseph Myers
@ 2021-03-08 13:18   ` Adhemerval Zanella via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:18 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha



On 05/03/2021 20:57, Joseph Myers wrote:
> On Fri, 5 Mar 2021, Adhemerval Zanella via Libc-alpha wrote:
> 
>> 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 4.12.13 kernel.  As expected,
>> the arm shows some tests failures due the missing kernel support:
> 
> I'd expect tests on an older kernel to be UNSUPPORTED, not FAIL.
> 
> More precisely: tests of times that can be represented in 32 bits, but 
> using the 64-bit interfaces, should be PASS, and tests of times that can't 
> be represented in 64 bits should be UNSUPPORTED as long as those are in a 
> separate testcase from the tests of times that can be represented in 32 
> bits.  If in the same testcase, FAIL seems the worst result, since it's 
> not indicating any bug in glibc.
> 

The problem is how to recognize a glibc failure over, a kernel failure,
and a kernel missing support.  I think we add a syscall probe for 64-bit
time_t syscall and assume a kernel without support for ENOSYS and act 
accordingly. 



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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-08 13:02     ` Adhemerval Zanella via Libc-alpha
@ 2021-03-08 13:23       ` Adhemerval Zanella via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:23 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 08/03/2021 10:02, Adhemerval Zanella wrote:
> 
> 
> On 05/03/2021 17:33, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>>
>>> +#ifndef struct_stat
>>> +# define struct_stat struct stat64
>>> +#endif
>>
>> This isn't necessary because xfstat is hard-wired to struct stat64.
> 
> This is necessary once the time64 support is done on a subsequent patch,
> but I will move this snippet later in the set.
> 

In fact it is not really required because it was a leftover when I had
not fix tiem64 support for LARFGEFILE64. I will remove it and adjust
the libsupport accordingly.

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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-08 13:08       ` Florian Weimer via Libc-alpha
@ 2021-03-08 13:26         ` Adhemerval Zanella via Libc-alpha
  2021-03-08 13:30           ` Florian Weimer via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2021-03-08 13:26 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha



On 08/03/2021 10:08, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 05/03/2021 17:30, Florian Weimer wrote:
>>> * Adhemerval Zanella via Libc-alpha:
>>>
>>>> +#define PREPARE do_prepare
>>>> +static void
>>>> +do_prepare (int argc, char *argv[])
>>>> +{
>>>> +  temp_fd = create_temp_file ("utimes", &testfile);
>>>> +  TEST_VERIFY_EXIT (temp_fd > 0);
>>>> +}
>>>
>>> I believe this should use /dev/shm.
>>
>> I still don't this we should gloss over buggy filesystem.
> 
> I view this as exactly the same thing as disabling post-Y2038 for 32-bit
> time_t.
> 
> We should make it easy for contributors to test their patches.  Tests
> where you need to remember why they fail on some systems make this
> difficult.

On the other hand we are hiding a potentially y2038 issues and 
reporting a success that might fail when users do use the interface.

I do prefer users to actually test and report failures so we can
iron out the y2038 support *now*.

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

* Re: [PATCH 02/52] linux: Add futimes test
  2021-03-08 13:26         ` Adhemerval Zanella via Libc-alpha
@ 2021-03-08 13:30           ` Florian Weimer via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-08 13:30 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella:

> On 08/03/2021 10:08, Florian Weimer wrote:
>> * Adhemerval Zanella:
>> 
>>> On 05/03/2021 17:30, Florian Weimer wrote:
>>>> * Adhemerval Zanella via Libc-alpha:
>>>>
>>>>> +#define PREPARE do_prepare
>>>>> +static void
>>>>> +do_prepare (int argc, char *argv[])
>>>>> +{
>>>>> +  temp_fd = create_temp_file ("utimes", &testfile);
>>>>> +  TEST_VERIFY_EXIT (temp_fd > 0);
>>>>> +}
>>>>
>>>> I believe this should use /dev/shm.
>>>
>>> I still don't this we should gloss over buggy filesystem.
>> 
>> I view this as exactly the same thing as disabling post-Y2038 for 32-bit
>> time_t.
>> 
>> We should make it easy for contributors to test their patches.  Tests
>> where you need to remember why they fail on some systems make this
>> difficult.
>
> On the other hand we are hiding a potentially y2038 issues and 
> reporting a success that might fail when users do use the interface.

I did not suggest to disable the test.  I suggested to change so that it
uses /dev/shm because tmpfs does not have this problem (and if it does,
it can be fixed there by a simple kernel update).

Tests for exercising file systems should be maintained in xfstests
(which is actually file system independent these days, if I understand
it correctly) or LTP.

Thanks,
Florian


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

* Re: [PATCH 47/52] elf: Use LFS and 64 bit time_t for installed programs
  2021-03-08 13:14     ` Adhemerval Zanella via Libc-alpha
@ 2021-03-08 15:26       ` Florian Weimer via Libc-alpha
  0 siblings, 0 replies; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-03-08 15:26 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella:

> On 05/03/2021 17:43, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>> 
>>> The patch enables for pldd, sprof, ldconfig, and sln.
>> 
>> Should we do this globally at the Makerules level?
>
> Do we have a simple way to accomplish it?  _TIME_SIZE and LFS defines
> should work for 64-bit ABIs, so we have a global rule to enable it
> I think it would be better indeed.

Would it be okay to do this for MODULE_NAME=nonlib and
MODULE_NAME=ldconfig?  Then I think there would be various ways of
achieving the desired effect.

Thanks,
Florian


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

* Re: [PATCH 37/52] time: Add 64 bit time support for getdate
  2021-03-05 20:15 ` [PATCH 37/52] time: Add 64 bit time support for getdate Adhemerval Zanella via Libc-alpha
@ 2021-03-08 21:27   ` Lukasz Majewski
  0 siblings, 0 replies; 95+ messages in thread
From: Lukasz Majewski @ 2021-03-08 21:27 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

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

On Fri,  5 Mar 2021 17:15:03 -0300
Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.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.
> ---
>  include/time.h     | 12 ++++++++++--
>  time/getdate.c     | 22 ++++++++++------------
>  time/tst-getdate.c | 14 ++++----------
>  3 files changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/include/time.h b/include/time.h
> index caf2af5e74..36754695c9 100644
> --- a/include/time.h
> +++ b/include/time.h
> @@ -280,8 +280,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.  */
> @@ -502,6 +502,14 @@ time_now (void)
>    __clock_gettime (TIME_CLOCK_GETTIME_CLOCKID, &ts);
>    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;
> +}
>  #endif
>  
>  #endif
> 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);

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] 95+ messages in thread

* Re: [PATCH 38/52] y2038: Add support for 64 bit time on legacy ABIs
  2021-03-05 20:15 ` [PATCH 38/52] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella via Libc-alpha
@ 2021-03-08 21:27   ` Lukasz Majewski
  0 siblings, 0 replies; 95+ messages in thread
From: Lukasz Majewski @ 2021-03-08 21:27 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

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

On Fri,  5 Mar 2021 17:15:04 -0300
Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.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:
>     - adjtimex
>     - adjtime
>     - clock_adjtime
>     - clock_getres
>     - clock_gettime
>     - clock_nanosleep
>     - clock_settime
>     - ctime
>     - ctime_r
>     - difftime
>     - futimens
>     - futimes
>     - futimesat
>     - getitimer
>     - getrusage
>     - gettimeofday
>     - gmtime
>     - gmtime_r
>     - localtime
>     - localtime_r
>     - lutimes
>     - mktime
>     - msgctl
>     - nanosleep
>     - ntp_gettime
>     - ntp_gettimex
>     - ppoll
>     - pselect
>     - recvmmsg
>     - sched_rr_get_interval
>     - select
>     - semctl
>     - semtimedop
>     - setitimer
>     - settimeofday
>     - shmctl
>     - sigtimedwait
>     - thrd_sleep
>     - time
>     - timegm
>     - timelocal (alias to mktime)
>     - timerfd_gettime
>     - timerfd_settime
>     - timespec_get
>     - utime
>     - utimensat
>     - utimes
>     - wait3
>     - wait4
> 
>   * libpthread:
>     - mtx_timedlock
>     - 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
>     - sem_clockwait
>     - sem_timedwait
> 
>   * 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 ++++
>  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              | 113 ++++++++++++++++
>  sysdeps/unix/sysv/linux/arm/be/libanl.abilist |   1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  52 +++++++
>  .../unix/sysv/linux/arm/be/libpthread.abilist |  14 ++
>  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   |  52 +++++++
>  .../unix/sysv/linux/arm/le/libpthread.abilist |  14 ++
>  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/csky/libanl.abilist   |   1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  52 +++++++
>  .../unix/sysv/linux/csky/libpthread.abilist   |  14 ++
>  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     |  52 +++++++
>  .../unix/sysv/linux/hppa/libpthread.abilist   |  14 ++
>  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     |  52 +++++++
>  .../unix/sysv/linux/i386/libpthread.abilist   |  14 ++
>  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     |  52 +++++++
>  .../linux/m68k/coldfire/libpthread.abilist    |  14 ++
>  .../sysv/linux/m68k/coldfire/librt.abilist    |   5 +
>  .../sysv/linux/m68k/m680x0/libanl.abilist     |   1 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  52 +++++++
>  .../sysv/linux/m68k/m680x0/libpthread.abilist |  14 ++
>  .../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     |  52 +++++++
>  .../linux/microblaze/be/libpthread.abilist    |  14 ++
>  .../sysv/linux/microblaze/be/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/le/libanl.abilist   |   1 +
>  .../sysv/linux/microblaze/le/libc.abilist     |  52 +++++++
>  .../linux/microblaze/le/libpthread.abilist    |  14 ++
>  .../sysv/linux/microblaze/le/librt.abilist    |   5 +
>  .../sysv/linux/microblaze/time64-compat.h     |   2 +
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  52 +++++++
>  .../sysv/linux/mips/mips32/libanl.abilist     |   1 +
>  .../sysv/linux/mips/mips32/libpthread.abilist |  14 ++
>  .../unix/sysv/linux/mips/mips32/librt.abilist |   5 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  52 +++++++
>  .../sysv/linux/mips/mips32/time64-compat.h    |   2 +
>  .../sysv/linux/mips/mips64/n32/libanl.abilist |   1 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  52 +++++++
>  .../linux/mips/mips64/n32/libpthread.abilist  |  14 ++
>  .../sysv/linux/mips/mips64/n32/librt.abilist  |   5 +
>  .../linux/mips/mips64/n32/time64-compat.h     |   2 +
>  sysdeps/unix/sysv/linux/nios2/libanl.abilist  |   1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  52 +++++++
>  .../unix/sysv/linux/nios2/libpthread.abilist  |  14 ++
>  sysdeps/unix/sysv/linux/nios2/librt.abilist   |   5 +
>  sysdeps/unix/sysv/linux/nios2/time64-compat.h |   2 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  52 +++++++
>  .../linux/powerpc/powerpc32/libanl.abilist    |   1 +
>  .../powerpc/powerpc32/libpthread.abilist      |  14 ++
>  .../linux/powerpc/powerpc32/librt.abilist     |   5 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  52 +++++++
>  .../linux/powerpc/powerpc32/time64-compat.h   |   2 +
>  .../sysv/linux/s390/s390-32/libanl.abilist    |   1 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  52 +++++++
>  .../linux/s390/s390-32/libpthread.abilist     |  14 ++
>  .../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    |  52 +++++++
>  .../unix/sysv/linux/sh/be/libpthread.abilist  |  14 ++
>  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    |  52 +++++++
>  .../unix/sysv/linux/sh/le/libpthread.abilist  |  14 ++
>  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     |  52 +++++++
>  .../linux/sparc/sparc32/libpthread.abilist    |  14 ++
>  .../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           |  28 +++-
>  sysvipc/sys/msg.h                             |  10 ++
>  sysvipc/sys/sem.h                             |  21 +++
>  sysvipc/sys/shm.h                             |  10 ++
>  time/sys/time.h                               |  71 ++++++++++
>  time/time.h                                   | 128
> +++++++++++++++++- 123 files changed, 2315 insertions(+), 29
> 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 71c7d8b5ec..2fd88294f5 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 73a1a0df97..7766db65a5 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -18,6 +18,11 @@ Major new features:
>    a dump of information related to IFUNC resolver operation and
>    glibc-hwcaps subdirectory selection.
>  
> +* 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: 
>    [Add deprecations, removals and changes affecting compatibility
> here] 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 2431dd1e14..4a0ce7eaad 100644
> --- a/io/sys/poll.h
> +++ b/io/sys/poll.h
> @@ -63,6 +63,17 @@ extern int poll (struct pollfd *__fds, nfds_t
> __nfds, int __timeout); extern int ppoll (struct pollfd *__fds,
> nfds_t __nfds, const struct timespec *__timeout,
>  		  const __sigset_t *__ss);
> +
> +# 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);
> +#  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/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 a04a3a2754..8f3a41279f 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. @@ -773,16 +791,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.  */
> @@ -919,16 +960,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.  */
> @@ -941,16 +1007,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.  */
> @@ -1027,10 +1119,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
> @@ -1040,11 +1145,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 257ccbd3b4..45d31a46bc 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,75 @@ libc {
>      getdents64; gettid; tgkill;
>    }
>    GLIBC_2.32 {
> +  }
> +  GLIBC_2.34 {
> +%ifdef TIME64_NON_DEFAULT
> +    # 64 bit time_t support
> +    # io
> +    __ppoll64;
> +    __utime64;
> +    __stat64_time64;
> +    __lstat64_time64;
> +    __fstat64_time64;
> +    __fstatat64_time64;
> +    # misc
> +    __futimes64;
> +    __futimesat64;
> +    __lutimes64;
> +    __select64;
> +    __utimes64;
> +    # posix
> +    __nanosleep64;
> +    __pselec64;
> +    __wait3_time64;
> +    __wait4_time64;
> +    # nptl
> +    __thrd_sleep64;
> +    # resouces
> +    __getrusage64;
> +    # signal
> +    __sigtimedwait64;
> +    # sysvipc
> +    __msgctl64;
> +    __semctl64;
> +    __semtimedop64;
> +    __shmctl64;
> +    # time
> +    ___adjtimex64;
> +    __adjtime64;
> +    __clock_adjtime64;
> +    __clock_getres64;
> +    __clock_gettime64;
> +    __clock_nanosleep_time64;
> +    __clock_settime64;
> +    __ctime64;
> +    __ctime64_r;
> +    __difftime64;
> +    __futimens64;
> +    __localtime64;
> +    __localtime64_r;
> +    __getitimer64;
> +    __gettimeofday64;
> +    __gmtime64;
> +    __gmtime64_r;
> +    __mktime64;
> +    __nanosleep64;
> +    __setitimer64;
> +    __settimeofday64;
> +    __time64;
> +    __timegm64;
> +    __timespec_get64;
> +    __utimensat64;
> +     __utimes64;
> +    # misc
> +    __ntp_gettime64;
> +    __ntp_gettimex64;
> +    __pselect64;
> +    __recvmmsg64;
> +    __sched_rr_get_interval64;
> +    __timerfd_gettime64;
> +    __timerfd_settime64;
> +%endif
>    }
>    GLIBC_PRIVATE {
>      # functions used in other libraries
> @@ -182,3 +252,46 @@ libc {
>      __netlink_assert_response;
>    }
>  }
> +
> +libpthread {
> +  GLIBC_2.34 {
> +%ifdef TIME64_NON_DEFAULT
> +    # 64 bit time_t support
> +    __cnd_timedwait64;
> +    __mtx_timedlock64;
> +    __pthread_clockjoin_np64;
> +    __pthread_cond_timedwait64;
> +    __pthread_cond_clockwait64;
> +    __pthread_mutex_timedlock64;
> +    __pthread_mutex_clocklock64;
> +    __pthread_rwlock_clockrdlock64;
> +    __pthread_rwlock_clockwrlock64;
> +    __pthread_rwlock_timedrdlock64;
> +    __pthread_rwlock_timedwrlock64;
> +    __pthread_timedjoin_np64;
> +    __sem_clockwait64;
> +    __sem_timedwait64;
> +%endif
> +  }
> +}
> +
> +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
> 8111b49085..d63e0dee75 100644 ---
> a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -155,7 +155,59 @@
> 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist index
> b6c26c7a50..3fe358cc31 100644 ---
> a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist @@ -33,6 +33,20
> @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 _IO_flockfile F
>  GLIBC_2.4 _IO_ftrylockfile F
>  GLIBC_2.4 _IO_funlockfile 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
> 4dba1f2f46..1a0f0d1312 100644 ---
> a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -152,7 +152,59 @@
> 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist index
> b6c26c7a50..3fe358cc31 100644 ---
> a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist @@ -33,6 +33,20
> @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 _IO_flockfile F
>  GLIBC_2.4 _IO_ftrylockfile F
>  GLIBC_2.4 _IO_funlockfile 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/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
> a5ff3d90ca..120a3fc1ce 100644 ---
> a/sysdeps/unix/sysv/linux/csky/libc.abilist +++
> b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2115,7 +2115,59 @@
> 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> b/sysdeps/unix/sysv/linux/csky/libpthread.abilist index
> 6ce59276a7..51d5822091 100644 ---
> a/sysdeps/unix/sysv/linux/csky/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/csky/libpthread.abilist @@ -211,3 +211,17
> @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 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
> 89a0f11166..77c7d2faf3 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++
> b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2074,7 +2074,59 @@
> 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist index
> cabc5af858..0cdb30a3c1 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist @@ -218,6 +218,20
> @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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
> a7c408d18c..7d1a9691e7 100644 ---
> a/sysdeps/unix/sysv/linux/i386/libc.abilist +++
> b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2241,7 +2241,59 @@
> 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> b/sysdeps/unix/sysv/linux/i386/libpthread.abilist index
> 18177307c8..b3a825d60e 100644 ---
> a/sysdeps/unix/sysv/linux/i386/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/i386/libpthread.abilist @@ -226,6 +226,20
> @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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
> e1171a34aa..da00a3d3c3 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -156,7
> +156,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist index
> b6c26c7a50..3fe358cc31 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist @@ -33,6
> +33,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 _IO_flockfile F
>  GLIBC_2.4 _IO_ftrylockfile F
>  GLIBC_2.4 _IO_funlockfile 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
> a521506506..3e0f00210f 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2186,7
> +2186,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist index
> 18177307c8..b3a825d60e 100644 ---
> a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist @@ -226,6
> +226,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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
> aba642460c..9bed39a8e8 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2166,7
> +2166,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist index
> 60397187b6..855c469c63 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist @@ -218,3
> +218,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 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
> d3d653d144..872321bbab 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2163,7
> +2163,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist index
> 60397187b6..855c469c63 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist @@ -218,3
> +218,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 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
> a4ce56c34f..77dcc8ab7d 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2157,7
> +2157,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid 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/libpthread.abilist
> b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist index
> b35d7f19ca..887a32a376 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist @@ -227,6
> +227,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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
> 51fbf0b1e1..c41f85ce01 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2155,7
> +2155,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid 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
> 5642781479..4208f9df82 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2163,7
> +2163,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist index
> b35d7f19ca..887a32a376 100644 ---
> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist @@
> -227,6 +227,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31
> pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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/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
> 848cb2e599..ff0bb57cb6 100644 ---
> a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++
> b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2204,7 +2204,59 @@
> 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist index
> 924ad6e451..18407317e6 100644 ---
> a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist @@ -218,3 +218,17
> @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 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
> 93e83fa602..57f1fe012a 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@
> -2213,7 +2213,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid 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/libpthread.abilist
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist index
> 13b41dafb6..711812931d 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist @@
> -228,6 +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31
> pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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
> ec0b6d69b1..6c9fa9c098 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@
> -2246,7 +2246,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid 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
> 7bc5c8866b..d357619c55 100644 ---
> a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2211,7
> +2211,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 lastlog_read F
>  GLIBC_2.34 lastlog_write F
>  GLIBC_2.4 _IO_fprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist index
> 0a60f1cca2..28db1e4b6d 100644 ---
> a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist @@ -228,6
> +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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
> 06143b0283..725952a763 100644 ---
> a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2081,7 +2081,59 @@
> 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist index
> cabc5af858..0cdb30a3c1 100644 ---
> a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist @@ -218,6 +218,20
> @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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
> eab2af349b..7f07b96287 100644 ---
> a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2078,7 +2078,59 @@
> 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist index
> cabc5af858..0cdb30a3c1 100644 ---
> a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist @@ -218,6 +218,20
> @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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
> 4783a8fa97..3b7af990d4 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2202,7
> +2202,59 @@ 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 __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 __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 __recvmmsg64 F
> +GLIBC_2.34 __sched_rr_get_interval64 F
> +GLIBC_2.34 __select64 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 __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 getutent F
>  GLIBC_2.34 getutent_r F
>  GLIBC_2.34 getutid F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist index
> 390b6384d0..b5f763d9fd 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist @@ -228,6
> +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30
> pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F
>  GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.34 __cnd_timedwait64 F
> +GLIBC_2.34 __mtx_timedlock64 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_mutex_clocklock64 F
> +GLIBC_2.34 __pthread_mutex_timedlock64 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 __sem_clockwait64 F
> +GLIBC_2.34 __sem_timedwait64 F
>  GLIBC_2.4 pthread_mutex_consistent_np F
>  GLIBC_2.4 pthread_mutex_getprioceiling F
>  GLIBC_2.4 pthread_mutex_setprioceiling 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 37931ff496..298f0ca6e7
> 100644 --- a/sysdeps/unix/sysv/linux/sys/timex.h
> +++ b/sysdeps/unix/sysv/linux/sys/timex.h
> @@ -54,17 +54,33 @@ struct ntptimeval
>  
>  __BEGIN_DECLS
>  
> -extern int __adjtimex (struct timex *__ntx) __THROW;
> +#ifndef __USE_TIME_BITS64
>  extern int adjtimex (struct timex *__ntx) __THROW;
>  
> -#ifdef __REDIRECT_NTH
> +# ifdef __REDIRECT_NTH
>  extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
> -			   ntp_gettimex);
> +                           __ntp_gettime64);
> +# else
> +#  define ntp_gettime ntp_gettimex
> +# endif
> +extern int ntp_adjtime (struct timex *__tntx) __THROW;
>  #else
> -extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
> -# 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 3bf206be0b..91b81cb1c6 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
>  
>  #if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
>  /* 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 || C2X */
>  
>  
> @@ -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,9 +366,18 @@ 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
>  
>  

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] 95+ messages in thread

* Re: [PATCH 44/52] y2038: Add test coverage
  2021-03-05 20:15 ` [PATCH 44/52] y2038: Add test coverage Adhemerval Zanella via Libc-alpha
  2021-03-06  0:13   ` Joseph Myers
@ 2021-03-08 21:28   ` Lukasz Majewski
  1 sibling, 0 replies; 95+ messages in thread
From: Lukasz Majewski @ 2021-03-08 21:28 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

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

On Fri,  5 Mar 2021 17:15:10 -0300
Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.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
>     - adjtimex
>     - 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_nanoslee                tst-clock_nanosleep-time64,
> 				    tst-cpuclock1-time64
>     - clock_settime                 tst-clock2-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
>     - nanosleep                     tst-cpuclock{12}-time64,
> 				    tst-mqueue8-time64,
> tst-clock-time64
>     - nftw / ftw                    ftwtest-time64
>     - ntp_adjtime
>     - ntp_gettime
>     - ntp_gettimex
>     - ppoll                         tst-ppoll-time64
>     - pselect                       tst-pselect-time64
>     - recvmmsg                      tst-cancel4_2-time64
>     - sched_rr_get_interval         tst-sched_rr_get_interval-time64
>     - select
>     - semctl                        test-sysvsem-time64
>     - semtimedop                    test-sysvsem-time64
>     - setitimer                     tst-mqueue2-time64,
> tst-itimer-timer64
>     - settimeofday
>     - shmctl                        test-sysvshm-time64
>     - sigtimedwait
>     - stat                          tst-stat-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
>     - utime                         tst-utime-time64
>     - utimensat                     tst-utimensat-time64
>     - utimes                        tst-utimes-time64
>     - wait3                         tst-wait3-time64
>     - wait4                         tst-wait4-time64
> 
>   * libpthread:
>     - cnd_timedwait                 tst-cnd-timedwait-time64
>     - mtx_timedlock                 tst-mtx-timedlock-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
>     - sem_clockwait                 tst-sem5-time64
>     - sem_timedwait                 tst-sem5-time64
>     - thrd_sleep                    tst-thrd-sleep-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                                   |  16 ++-
>  io/ftwtest-time64.c                           |   1 +
>  io/tst-fts-time64.c                           |   1 +
>  io/tst-futimesat-time64.c                     |   4 +
>  io/tst-futimesat.c                            |  47 +++++---
>  io/tst-stat-time64.c                          | 102
> ++++++++++++++++++ io/tst-utimensat-time64.c                     |
> 2 + misc/Makefile                                 |   2 +
>  misc/tst-pselect-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              |   8 ++
>  sysdeps/unix/sysv/linux/Versions              |   4 +-
>  sysdeps/unix/sysv/linux/tst-futimens-time64.c |   2 +
>  sysdeps/unix/sysv/linux/tst-futimens.c        |   8 +-
>  sysdeps/unix/sysv/linux/tst-futimes-time64.c  |   2 +
>  sysdeps/unix/sysv/linux/tst-lutimes-time64.c  |   2 +
>  sysdeps/unix/sysv/linux/tst-ppoll-time64.c    |   1 +
>  sysdeps/unix/sysv/linux/tst-timerfd-time64.c  |   1 +
>  sysdeps/unix/sysv/linux/tst-utime-time64.c    |   2 +
>  sysdeps/unix/sysv/linux/tst-utime.c           |   6 +-
>  sysdeps/unix/sysv/linux/tst-utimes-time64.c   |   2 +
>  sysdeps/unix/sysv/linux/tst-utimes.c          |   6 +-
>  sysvipc/Makefile                              |   2 +
>  sysvipc/test-sysvmsg-time64.c                 |   1 +
>  sysvipc/test-sysvsem-time64.c                 |   1 +
>  sysvipc/test-sysvshm-time64.c                 |   1 +
>  time/Makefile                                 |  15 +++
>  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-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-timegm-time64.c                      |   1 +
>  time/tst-timespec_get-time64.c                |   1 +
>  time/tst-y2039-time64.c                       |   1 +
>  time/tst-y2039.c                              |  10 ++
>  68 files changed, 346 insertions(+), 24 deletions(-)
>  create mode 100644 io/ftwtest-time64.c
>  create mode 100644 io/tst-fts-time64.c
>  create mode 100644 io/tst-futimesat-time64.c
>  create mode 100644 io/tst-stat-time64.c
>  create mode 100644 io/tst-utimensat-time64.c
>  create mode 100644 misc/tst-pselect-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-futimens-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-futimes-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-lutimes-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-utime-time64.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-utimes-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-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-timegm-time64.c
>  create mode 100644 time/tst-timespec_get-time64.c
>  create mode 100644 time/tst-y2039-time64.c
> 
> diff --git a/Makeconfig b/Makeconfig
> index 0a4811b5e5..e12ee30eca 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -1227,6 +1227,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 fc5251ffad..f4f641bb26 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 6c637f7c6d..a39f0ecfc1 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 \
> @@ -72,12 +72,18 @@ tests		:= test-utime test-stat
> test-stat2 test-lfs tst-getcwd \ tst-ftw-lnk
> tst-file_change_detection tst-lchmod \ tst-ftw-bz26353 tst-utimensat
>  
> +tests-time64    := tst-fts-time64 \
> +		   tst-stat-time64 \
> +		   tst-futimesat-time64 \
> +		   tst-utimensat-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
> @@ -118,8 +124,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-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-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-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/misc/Makefile b/misc/Makefile
> index cfc15355d6..a8363d4b76 100644
> --- a/misc/Makefile
> +++ b/misc/Makefile
> @@ -90,6 +90,8 @@ 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
>  
> +tests-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/nptl/Makefile b/nptl/Makefile
> index 33766eaf7a..d1c786e88b 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -380,6 +380,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 aba66efde8..e246ff1d14 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -109,7 +109,9 @@ tests-internal	:= bug-regex5 bug-regex20
> bug-regex33 \ tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 \
>  		   tst-glob_lstat_compat tst-spawn4-compat
>  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 7b374f2073..3ce98297f9 100644
> --- a/rt/Makefile
> +++ b/rt/Makefile
> @@ -49,6 +49,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 53b65ef349..31df6f97e5 100644
> --- a/sysdeps/pthread/Makefile
> +++ b/sysdeps/pthread/Makefile
> @@ -109,6 +109,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 fc2a17307c..94ee85d124 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -115,6 +115,14 @@ tests += tst-clone tst-clone2 tst-clone3
> tst-fanotify tst-personality \ tst-futimes tst-lutimes
>  
>  tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
> +tests-time64 += \
> +  tst-futimes-time64\
> +  tst-futimens-time64 \
> +  tst-lutimes-time64 \
> +  tst-ppoll-time64 \
> +  tst-utime-time64 \
> +  tst-utimes-time64 \
> +  tst-timerfd-time64
>  
>  CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
>  
> diff --git a/sysdeps/unix/sysv/linux/Versions
> b/sysdeps/unix/sysv/linux/Versions index b53391f613..982b94e625 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -237,7 +237,9 @@ libc {
>      __timegm64;
>      __timespec_get64;
>      __utimensat64;
> -     __utimes64;
> +    __utimes64;
> +    __localtime64;
> +    __localtime64_r;
>      # misc
>      __ntp_gettime64;
>      __ntp_gettimex64;
> diff --git a/sysdeps/unix/sysv/linux/tst-futimens-time64.c
> b/sysdeps/unix/sysv/linux/tst-futimens-time64.c new file mode 100644
> index 0000000000..88fcb38489
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-futimens-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-futimens.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-futimens.c
> b/sysdeps/unix/sysv/linux/tst-futimens.c index 8f48cfee63..b5b240abf1
> 100644 --- a/sysdeps/unix/sysv/linux/tst-futimens.c
> +++ b/sysdeps/unix/sysv/linux/tst-futimens.c
> @@ -24,10 +24,14 @@
>  #include <support/xunistd.h>
>  #include <support/temp_file.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int temp_fd = -1;
>  
>  /* struct timespec array with Y2038 threshold minus 2 and 1 seconds.
>  */ -const struct timespec t1[2] = { { 0x7FFFFFFE, 0 },  {
> 0x7FFFFFFF, 0 } }; +const static struct timespec t1[2] = { {
> 0x7FFFFFFE, 0 },  { 0x7FFFFFFF, 0 } }; 
>  /* struct timespec array with Y2038 threshold plus 1 and 2 seconds.
> */ const struct timespec t2[2] = { { 0x80000001ULL, 0 },  {
> 0x80000002ULL, 0 } }; @@ -46,7 +50,7 @@ do_prepare (int argc, char
> *argv[]) static int
>  test_futimens_helper (const struct timespec *ts)
>  {
> -  struct stat64 st;
> +  struct_stat st;
>    int result;
>    time_t t;
>  
> diff --git a/sysdeps/unix/sysv/linux/tst-futimes-time64.c
> b/sysdeps/unix/sysv/linux/tst-futimes-time64.c new file mode 100644
> index 0000000000..d489c265d1
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-futimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-futimes.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-lutimes-time64.c
> b/sysdeps/unix/sysv/linux/tst-lutimes-time64.c new file mode 100644
> index 0000000000..06caec0a91
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-lutimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-lutimes.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-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/sysdeps/unix/sysv/linux/tst-utime-time64.c
> b/sysdeps/unix/sysv/linux/tst-utime-time64.c new file mode 100644
> index 0000000000..eb62f59126
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-utime-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-utime.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-utime.c
> b/sysdeps/unix/sysv/linux/tst-utime.c index 6735421657..d413f130e8
> 100644 --- a/sysdeps/unix/sysv/linux/tst-utime.c
> +++ b/sysdeps/unix/sysv/linux/tst-utime.c
> @@ -26,6 +26,10 @@
>  #include <support/xunistd.h>
>  #include <support/temp_file.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int temp_fd = -1;
>  char *testfile;
>  
> @@ -49,7 +53,7 @@ do_prepare (int argc, char *argv[])
>  static int
>  test_utime_helper (const struct utimbuf *ut)
>  {
> -  struct stat64 st;
> +  struct_stat st;
>    int result;
>    time_t t;
>  
> diff --git a/sysdeps/unix/sysv/linux/tst-utimes-time64.c
> b/sysdeps/unix/sysv/linux/tst-utimes-time64.c new file mode 100644
> index 0000000000..234ec02541
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-utimes-time64.c
> @@ -0,0 +1,2 @@
> +#define struct_stat struct stat
> +#include "tst-utimes.c"
> diff --git a/sysdeps/unix/sysv/linux/tst-utimes.c
> b/sysdeps/unix/sysv/linux/tst-utimes.c index 8c7b006a22..c521c89dfa
> 100644 --- a/sysdeps/unix/sysv/linux/tst-utimes.c
> +++ b/sysdeps/unix/sysv/linux/tst-utimes.c
> @@ -25,6 +25,10 @@
>  #include <support/xunistd.h>
>  #include <support/temp_file.h>
>  
> +#ifndef struct_stat
> +# define struct_stat struct stat64
> +#endif
> +
>  static int temp_fd = -1;
>  char *testfile;
>  
> @@ -50,7 +54,7 @@ do_prepare (int argc, char *argv[])
>  static int
>  test_utime_helper (const struct timeval *tv)
>  {
> -  struct stat64 st;
> +  struct_stat st;
>    int result;
>    time_t t;
>  
> 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 f14022b334..fee206d3c7 100644
> --- a/time/Makefile
> +++ b/time/Makefile
> @@ -51,6 +51,21 @@ tests	:= test_time clocktest tst-posixtz
> tst-strptime tst_wcsftime \ tst-adjtime tst-ctime tst-difftime
> tst-mktime4 tst-itimer \ tst-gmtime tst-timegm tst-timespec_get
>  
> +tests-time64 := \
> +  tst-adjtime-time64 \
> +  tst-clock-time64 \
> +  tst-clock2-time64 \
> +  tst-clock_nanosleep-time64 \
> +  tst-cpuclock1-time64 \
> +  tst-ctime-time64 \
> +  tst-difftime-time64 \
> +  tst-gmtime-time64 \
> +  tst-itimer-time64 \
> +  tst-mktime4-time64 \
> +  tst-timegm-time64 \
> +  tst-timespec_get-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-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-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-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");

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] 95+ messages in thread

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-03-05 20:14 ` [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx Adhemerval Zanella via Libc-alpha
@ 2021-04-27 12:30   ` Florian Weimer via Libc-alpha
  2021-04-27 13:58     ` Andreas Schwab
  2021-04-27 18:03     ` Joseph Myers
  0 siblings, 2 replies; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-04-27 12:30 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> The new struct has the same size for 32-bit and 64-bit architecture with
> two main differences compared to the 32-bit time one:

I think we should deprecate the interfaces instead.

Due to a local denial-of-service vulnerability (bug 24492), we would
have to switch to a daemon.

However, the wtmp logging is rather useless these days because the main
key is ut_id, the “terminal name suffix” (so presumably S0 for the first
serial console).  But most terminals are pseudo-terminals today, and it
is fairly meaningless which user was logged on on which pseudo-terminal.
glibc offers an additional lookup procedure with unique ut_line keys as
an extension.  But even if meaningful keys are used there (such as host
names), another issue appears: the interface is designed in such a way
that the set of lookup keys must be very small because old entries are
never expired, only overwritten if the lookup key is used again.  The
challenge with the present interface is that applications need to come
up with a lookup key that is unique, meaningful, and will be reused
quickly in case the session terminates.  Historically, it was possible
to use the PID (and vfsftpd does that), but the PID limit is gone on
some distributions, and the PID in the index leads to essentially
unbounded utmp file growth.

The interface was fine when a system had a few fixed terminal lines that
weren't equivalent.  But I think it's mostly useless today.

Thanks,
Florian


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

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-04-27 12:30   ` Florian Weimer via Libc-alpha
@ 2021-04-27 13:58     ` Andreas Schwab
  2021-04-27 14:18       ` Florian Weimer via Libc-alpha
  2021-04-27 18:03     ` Joseph Myers
  1 sibling, 1 reply; 95+ messages in thread
From: Andreas Schwab @ 2021-04-27 13:58 UTC (permalink / raw)
  To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer

On Apr 27 2021, Florian Weimer via Libc-alpha wrote:

> never expired, only overwritten if the lookup key is used again.

wtmp entries are never overwritten, they are only appended.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-04-27 13:58     ` Andreas Schwab
@ 2021-04-27 14:18       ` Florian Weimer via Libc-alpha
  2021-04-27 14:51         ` Andreas Schwab
  0 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-04-27 14:18 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Florian Weimer via Libc-alpha

* Andreas Schwab:

> On Apr 27 2021, Florian Weimer via Libc-alpha wrote:
>
>> never expired, only overwritten if the lookup key is used again.
>
> wtmp entries are never overwritten, they are only appended.

So do you think that the wtmp interfaces are worth preserving?  That
would be updwtmp/updwtmx and logwtmp?

Thanks,
Florian


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

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-04-27 14:18       ` Florian Weimer via Libc-alpha
@ 2021-04-27 14:51         ` Andreas Schwab
  0 siblings, 0 replies; 95+ messages in thread
From: Andreas Schwab @ 2021-04-27 14:51 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Florian Weimer via Libc-alpha

On Apr 27 2021, Florian Weimer wrote:

> So do you think that the wtmp interfaces are worth preserving?

I don't see anything wrong with the concept.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-04-27 12:30   ` Florian Weimer via Libc-alpha
  2021-04-27 13:58     ` Andreas Schwab
@ 2021-04-27 18:03     ` Joseph Myers
  2021-04-30 10:03       ` Florian Weimer via Libc-alpha
  1 sibling, 1 reply; 95+ messages in thread
From: Joseph Myers @ 2021-04-27 18:03 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha

On Tue, 27 Apr 2021, Florian Weimer via Libc-alpha wrote:

> The interface was fine when a system had a few fixed terminal lines that
> weren't equivalent.  But I think it's mostly useless today.

At a higher level, I think it's still useful to be able to list logged-in 
user sessions (and e.g. how long they have been idle) on a multi-user 
system, to help identify e.g. users to consult about a possible reboot.  
In the absence of utmp, you need some other system for tracking such 
information about sessions, and applications such as "w" and "who" need to 
be taught to use such other API in place of utmp, before it can be 
considered obsolete.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-04-27 18:03     ` Joseph Myers
@ 2021-04-30 10:03       ` Florian Weimer via Libc-alpha
  2021-04-30 12:17         ` Andreas Schwab
  0 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-04-30 10:03 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Adhemerval Zanella via Libc-alpha

* Joseph Myers:

> On Tue, 27 Apr 2021, Florian Weimer via Libc-alpha wrote:
>
>> The interface was fine when a system had a few fixed terminal lines that
>> weren't equivalent.  But I think it's mostly useless today.
>
> At a higher level, I think it's still useful to be able to list logged-in 
> user sessions (and e.g. how long they have been idle) on a multi-user 
> system, to help identify e.g. users to consult about a possible reboot.  
> In the absence of utmp, you need some other system for tracking such 
> information about sessions, and applications such as "w" and "who" need to 
> be taught to use such other API in place of utmp, before it can be 
> considered obsolete.

True, but even for that, it's been reported (I forgot where I'm afraid)
that the ut_id field is to short if the straightforward PTY encoding is
used.  Most users are probably interested in sessions (who is not logged
in), not a list of PTYs and users (which also includes sub-shells in
Emacs and screen).

Thanks,
Florian


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

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-04-30 10:03       ` Florian Weimer via Libc-alpha
@ 2021-04-30 12:17         ` Andreas Schwab
  2021-04-30 12:22           ` Florian Weimer via Libc-alpha
  0 siblings, 1 reply; 95+ messages in thread
From: Andreas Schwab @ 2021-04-30 12:17 UTC (permalink / raw)
  To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer, Joseph Myers

On Apr 30 2021, Florian Weimer via Libc-alpha wrote:

> True, but even for that, it's been reported (I forgot where I'm afraid)
> that the ut_id field is to short if the straightforward PTY encoding is
> used.  Most users are probably interested in sessions (who is not logged
> in), not a list of PTYs and users (which also includes sub-shells in
> Emacs and screen).

Both Emacs and screen create new sessions for their sub-shells/windows.
But Emacs does not do utmp accouting.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-04-30 12:17         ` Andreas Schwab
@ 2021-04-30 12:22           ` Florian Weimer via Libc-alpha
  2021-04-30 14:11             ` Andreas Schwab
  0 siblings, 1 reply; 95+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-04-30 12:22 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Florian Weimer via Libc-alpha, Joseph Myers

* Andreas Schwab:

> On Apr 30 2021, Florian Weimer via Libc-alpha wrote:
>
>> True, but even for that, it's been reported (I forgot where I'm afraid)
>> that the ut_id field is to short if the straightforward PTY encoding is
>> used.  Most users are probably interested in sessions (who is not logged
>> in), not a list of PTYs and users (which also includes sub-shells in
>> Emacs and screen).
>
> Both Emacs and screen create new sessions for their sub-shells/windows.
> But Emacs does not do utmp accouting.

Sorry, I meant the higher-level session concept (related to containers
and cgroups).  That's not something screen nor Emacs do.

Thanks,
Florian


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

* Re: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx
  2021-04-30 12:22           ` Florian Weimer via Libc-alpha
@ 2021-04-30 14:11             ` Andreas Schwab
  0 siblings, 0 replies; 95+ messages in thread
From: Andreas Schwab @ 2021-04-30 14:11 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Florian Weimer via Libc-alpha, Joseph Myers

On Apr 30 2021, Florian Weimer wrote:

> * Andreas Schwab:
>
>> On Apr 30 2021, Florian Weimer via Libc-alpha wrote:
>>
>>> True, but even for that, it's been reported (I forgot where I'm afraid)
>>> that the ut_id field is to short if the straightforward PTY encoding is
>>> used.  Most users are probably interested in sessions (who is not logged
>>> in), not a list of PTYs and users (which also includes sub-shells in
>>> Emacs and screen).
>>
>> Both Emacs and screen create new sessions for their sub-shells/windows.
>> But Emacs does not do utmp accouting.
>
> Sorry, I meant the higher-level session concept (related to containers
> and cgroups).  That's not something screen nor Emacs do.

A session has nothing to do with containers and cgroups.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

end of thread, other threads:[~2021-04-30 14:11 UTC | newest]

Thread overview: 95+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 20:14 [PATCH 00/52] Add 64 bit time support on legacy ABIs Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella via Libc-alpha
2021-03-05 20:56   ` Andreas Schwab
2021-03-05 23:53   ` Joseph Myers
2021-03-08 13:00     ` Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 02/52] linux: Add futimes test Adhemerval Zanella via Libc-alpha
2021-03-05 20:30   ` Florian Weimer via Libc-alpha
2021-03-08 13:01     ` Adhemerval Zanella via Libc-alpha
2021-03-08 13:08       ` Florian Weimer via Libc-alpha
2021-03-08 13:26         ` Adhemerval Zanella via Libc-alpha
2021-03-08 13:30           ` Florian Weimer via Libc-alpha
2021-03-05 20:33   ` Florian Weimer via Libc-alpha
2021-03-08 13:02     ` Adhemerval Zanella via Libc-alpha
2021-03-08 13:23       ` Adhemerval Zanella via Libc-alpha
2021-03-06  0:02   ` Joseph Myers
2021-03-06  3:52     ` Paul Zimmermann
2021-03-08 13:03     ` Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 03/52] linux: Add lutimes test Adhemerval Zanella via Libc-alpha
2021-03-05 20:31   ` Florian Weimer via Libc-alpha
2021-03-06  0:02   ` Joseph Myers
2021-03-05 20:14 ` [PATCH 04/52] time: Add getitimer and setitimer basic tests Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 05/52] time: Add gmtime/gmtime_r tests Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 06/52] time: Add timegm/timelocal basic tests Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 07/52] time: Add basic timespec_get tests Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 08/52] time: Add 64 bit tests for getdate / getdate_r Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 09/52] io: Add basic tests for utimensat Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 10/52] posix: Add wait3 tests Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 11/52] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella via Libc-alpha
2021-03-05 20:39   ` Florian Weimer via Libc-alpha
2021-03-08 13:05     ` Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 12/52] linux: mips: Split librt.abilist " Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 13/52] linux: mips: Split libanl.abilist " Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 14/52] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 15/52] login: Consolidate utmp and utmpx headers Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 16/52] login: Move gnu utmpx to default implementation Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 17/52] Consolidate and simplify internal utmp definitions Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 18/52] support: Add 'touch' command Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 19/52] Add tests-container-internal rules Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx Adhemerval Zanella via Libc-alpha
2021-04-27 12:30   ` Florian Weimer via Libc-alpha
2021-04-27 13:58     ` Andreas Schwab
2021-04-27 14:18       ` Florian Weimer via Libc-alpha
2021-04-27 14:51         ` Andreas Schwab
2021-04-27 18:03     ` Joseph Myers
2021-04-30 10:03       ` Florian Weimer via Libc-alpha
2021-04-30 12:17         ` Andreas Schwab
2021-04-30 12:22           ` Florian Weimer via Libc-alpha
2021-04-30 14:11             ` Andreas Schwab
2021-03-05 20:14 ` [PATCH 21/52] linux: Add pwrite64_nocancel Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 22/52] login: Use 64-bit time on struct lastlog [BZ #25844] Adhemerval Zanella via Libc-alpha
2021-03-06  0:07   ` Joseph Myers
2021-03-08 13:05     ` Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 23/52] Remove __WORDSIZE_TIME64_COMPAT32 Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 24/52] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 25/52] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 26/52] linux: Add recvvmsg " Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 27/52] y2038: Add __USE_TIME_BITS64 support for time_t Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 28/52] y2038: Add __USE_TIME_BITS64 support for struct timeval Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 29/52] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 30/52] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 31/52] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 32/52] y2038: Use a common definition for stat Adhemerval Zanella via Libc-alpha
2021-03-05 20:14 ` [PATCH 33/52] y2038: Use a common definition for msqid_ds Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 34/52] y2038: Use a common definition for semid_ds Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 35/52] y2038: Use a common definition for shmid_ds Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 36/52] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 37/52] time: Add 64 bit time support for getdate Adhemerval Zanella via Libc-alpha
2021-03-08 21:27   ` Lukasz Majewski
2021-03-05 20:15 ` [PATCH 38/52] y2038: Add support for 64 bit time on legacy ABIs Adhemerval Zanella via Libc-alpha
2021-03-08 21:27   ` Lukasz Majewski
2021-03-05 20:15 ` [PATCH 39/52] posix: Add glob64 with 64 bit time_t support Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 40/52] io: Add fts64 " Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 41/52] io: Add ftw64 " Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 42/52] libsupport: Add 64 bit time_t support for time functions Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 43/52] libsupport: Add 64 bit time_t support for stat functions Adhemerval Zanella via Libc-alpha
2021-03-05 20:42   ` Florian Weimer via Libc-alpha
2021-03-08 13:06     ` Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 44/52] y2038: Add test coverage Adhemerval Zanella via Libc-alpha
2021-03-06  0:13   ` Joseph Myers
2021-03-08 13:12     ` Adhemerval Zanella via Libc-alpha
2021-03-08 21:28   ` Lukasz Majewski
2021-03-05 20:15 ` [PATCH 45/52] Use 64 bit time_t stat internally Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 46/52] debug: build pcprofiledump with LFS and 64 bit time support Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 47/52] elf: Use LFS and 64 bit time_t for installed programs Adhemerval Zanella via Libc-alpha
2021-03-05 20:43   ` Florian Weimer via Libc-alpha
2021-03-08 13:14     ` Adhemerval Zanella via Libc-alpha
2021-03-08 15:26       ` Florian Weimer via Libc-alpha
2021-03-05 20:15 ` [PATCH 48/52] iconv: " Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 49/52] locale: " Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 50/52] nss: " Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 51/52] posix: " Adhemerval Zanella via Libc-alpha
2021-03-05 20:15 ` [PATCH 52/52] timezone: " Adhemerval Zanella via Libc-alpha
2021-03-05 23:57 ` [PATCH 00/52] Add 64 bit time support on legacy ABIs Joseph Myers
2021-03-08 13:18   ` Adhemerval Zanella via Libc-alpha
2021-03-07 10:42 ` Lukasz Majewski

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).