[v2,21/25] io: Add fts64 with 64 bit time_t support

Message ID 20210518205613.1487824-22-adhemerval.zanella@linaro.org
State New
Headers show
Series
  • Add 64 bit time support on legacy ABIs
Related show

Commit Message

Florian Weimer via Libc-alpha May 18, 2021, 8:56 p.m.
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

-- 
2.30.2

Comments

Lukasz Majewski May 19, 2021, 10:50 a.m. | #1
On Tue, 18 May 2021 17:56:09 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> Similar to glob, fts routines passes a stat pointer that might

> differ of size and layout when 64 bit time API is used.

> 

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


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


> ---

>  include/fts.h                                 | 51

> +++++++++++++++++++ io/Makefile                                   |

> 4 +- io/fts.h                                      | 43

> ++++++++++++++-- io/fts64-time64.c                             | 35

> +++++++++++++ sysdeps/unix/sysv/linux/Versions              |  5 ++

>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  5 ++

>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  5 ++

>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  5 ++

>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  5 ++

>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  5 ++

>  .../sysv/linux/m68k/coldfire/libc.abilist     |  5 ++

>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  5 ++

>  .../sysv/linux/microblaze/be/libc.abilist     |  5 ++

>  .../sysv/linux/microblaze/le/libc.abilist     |  5 ++

>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  5 ++

>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  5 ++

>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  5 ++

>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  5 ++

>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  5 ++

>  .../powerpc/powerpc32/nofpu/libc.abilist      |  5 ++

>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  5 ++

>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  5 ++

>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  5 ++

>  .../sysv/linux/sparc/sparc32/libc.abilist     |  5 ++

>  24 files changed, 227 insertions(+), 6 deletions(-)

>  create mode 100644 io/fts64-time64.c

> 

> diff --git a/include/fts.h b/include/fts.h

> index 145dce6779..ea36a9b9be 100644

> --- a/include/fts.h

> +++ b/include/fts.h

> @@ -1 +1,52 @@

> +#ifndef _FTS_H

>  #include <io/fts.h>

> +

> +#ifndef _ISOMAC

> +# if __TIMESIZE != 64

> +#  include <sys/stat.h>

> +

> +typedef struct

> +{

> +  struct _ftsent64_time64 *fts_cur;

> +  struct _ftsent64_time64 *fts_child;

> +  struct _ftsent64_time64 **fts_array;

> +  dev_t fts_dev;

> +  char *fts_path;

> +  int fts_rfd;

> +  int fts_pathlen;

> +  int fts_nitems;

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

> +  int fts_options;

> +} FTS64_TIME64;

> +

> +typedef struct _ftsent64_time64

> +{

> +  struct _ftsent64_time64 *fts_cycle;

> +  struct _ftsent64_time64 *fts_parent;

> +  struct _ftsent64_time64 *fts_link;

> +  long fts_number;

> +  void *fts_pointer;

> +  char *fts_accpath;

> +  char *fts_path;

> +  int fts_errno;

> +  int fts_symfd;

> +  unsigned short fts_pathlen;

> +  unsigned short fts_namelen;

> +

> +  ino64_t fts_ino;

> +  dev_t fts_dev;

> +  nlink_t fts_nlink;

> +

> +  short fts_level;

> +  unsigned short fts_info;

> +  unsigned short fts_flags;

> +  unsigned short fts_instr;

> +

> +  struct __stat64_t64 *fts_statp;

> +  char fts_name[1];

> +} FSTENT64_TIME64;

> +

> +# endif

> +#endif

> +

> +#endif /* _FTS_H  */

> diff --git a/io/Makefile b/io/Makefile

> index a22492f3f3..12c832cfcb 100644

> --- a/io/Makefile

> +++ b/io/Makefile

> @@ -54,7 +54,8 @@ routines :=

> 			\ posix_fadvise posix_fadvise64

> 				\ posix_fallocate

> posix_fallocate64				\ sendfile

> sendfile64 copy_file_range 				\

> -	utimensat futimens file_change_detection

> +	utimensat futimens file_change_detection

> 	\

> +	fts64-time64

>  

>  others		:= pwd

>  test-srcs	:= ftwtest

> @@ -102,6 +103,7 @@ CFLAGS-statvfs.c += -fexceptions

>  CFLAGS-fstatvfs.c += -fexceptions

>  CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions

>  CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions

> +CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks)

> -fexceptions CFLAGS-ftw.c += $(uses-callbacks) -fexceptions

>  CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions

>  CFLAGS-posix_fallocate.c += -fexceptions

> diff --git a/io/fts.h b/io/fts.h

> index 867677a27e..8d3395fa31 100644

> --- a/io/fts.h

> +++ b/io/fts.h

> @@ -187,6 +187,7 @@ FTSENT	*fts_read (FTS *);

>  int	 fts_set (FTS *, FTSENT *, int) __THROW;

>  #else

>  # ifdef __REDIRECT

> +#  ifndef __USE_TIME_BITS64

>  FTSENT	*__REDIRECT (fts_children, (FTS *, int),

> fts64_children); int	 __REDIRECT (fts_close, (FTS *),

> fts64_close); FTS	*__REDIRECT (fts_open, (char * const *, int,

> @@ -194,21 +195,53 @@ FTS	*__REDIRECT (fts_open, (char * const

> *, int, fts64_open);

>  FTSENT	*__REDIRECT (fts_read, (FTS *), fts64_read);

>  int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),

> fts64_set); +#  else

> +FTSENT	*__REDIRECT (fts_children, (FTS *, int),

> __fts64_children_time64); +int	 __REDIRECT (fts_close, (FTS

> *), __fts64_close_time64); +FTS	*__REDIRECT (fts_open, (char *

> const *, int,

> +				int (*)(const FTSENT **, const

> FTSENT **)),

> +		     __fts64_open_time64);

> +FTSENT	*__REDIRECT (fts_read, (FTS *), __fts64_read_time64);

> +int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),

> +			 __fts64_set_time64);

> +#  endif

>  # else

> -#  define fts_children fts64_children

> -#  define fts_close fts64_close

> -#  define fts_open fts64_open

> -#  define fts_read fts64_read

> -#  define fts_set fts64_set

> +#  ifndef __USE_TIME_BITS64

> +#   define fts_children fts64_children

> +#   define fts_close fts64_close

> +#   define fts_open fts64_open

> +#   define fts_read fts64_read

> +#   define fts_set fts64_set

> +#  else

> +#  endif

>  # endif

>  #endif

>  #ifdef __USE_LARGEFILE64

> +# ifndef __USE_TIME_BITS64

>  FTSENT64 *fts64_children (FTS64 *, int);

>  int	  fts64_close (FTS64 *);

>  FTS64	 *fts64_open (char * const *, int,

>  		      int (*)(const FTSENT64 **, const FTSENT64 **));

>  FTSENT64 *fts64_read (FTS64 *);

>  int	 fts64_set (FTS64 *, FTSENT64 *, int) __THROW;

> +# else

> +#  ifdef __REDIRECT

> +FTSENT	*__REDIRECT (fts64_children, (FTS64 *, int),

> __fts64_children_time64); +int	 __REDIRECT (fts64_close,

> (FTS64 *), __fts64_close_time64); +FTS	*__REDIRECT

> (fts64_open, (char * const *, int,

> +				int (*)(const FTSENT64 **, const

> FTSENT64 **)),

> +		     __fts64_open_time64);

> +FTSENT	*__REDIRECT (fts64_read, (FTS64 *),

> __fts64_read_time64); +int	 __REDIRECT_NTH (fts64_set, (FTS64

> *, FTSENT64 *, int),

> +			 __fts64_set_time64);

> +#  else

> +#   define fts_children __fts64_children_time64

> +#   define fts_close __fts64_close_time64

> +#   define fts_open __fts64_open_time64

> +#   define fts_read __fts64_read_time64

> +#   define fts_set __fts64_set_time64

> +#  endif

> +# endif

>  #endif

>  __END_DECLS

>  

> diff --git a/io/fts64-time64.c b/io/fts64-time64.c

> new file mode 100644

> index 0000000000..c8885ca79b

> --- /dev/null

> +++ b/io/fts64-time64.c

> @@ -0,0 +1,35 @@

> +/* File tree traversal functions LFS version.

> +   Copyright (C) 2015-2021 Free Software Foundation, Inc.

> +   This file is part of the GNU C Library.

> +

> +   The GNU C Library is free software; you can redistribute it and/or

> +   modify it under the terms of the GNU Lesser General Public

> +   License as published by the Free Software Foundation; either

> +   version 2.1 of the License, or (at your option) any later version.

> +

> +   The GNU C Library is distributed in the hope that it will be

> useful,

> +   but WITHOUT ANY WARRANTY; without even the implied warranty of

> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

> +   Lesser General Public License for more details.

> +

> +   You should have received a copy of the GNU Lesser General Public

> +   License along with the GNU C Library; if not, see

> +   <https://www.gnu.org/licenses/>.  */

> +

> +#include <time.h>

> +

> +#if __TIMESIZE != 64

> +# define FTS_OPEN __fts64_open_time64

> +# define FTS_CLOSE __fts64_close_time64

> +# define FTS_READ __fts64_read_time64

> +# define FTS_SET __fts64_set_time64

> +# define FTS_CHILDREN __fts64_children_time64

> +# define FTSOBJ FTS64_TIME64

> +# define FTSENTRY FSTENT64_TIME64

> +# define INO_T ino64_t

> +# define STRUCT_STAT __stat64_t64

> +# define STAT __stat64_time64

> +# define LSTAT __lstat64_time64

> +

> +# include "fts.c"

> +#endif

> diff --git a/sysdeps/unix/sysv/linux/Versions

> b/sysdeps/unix/sysv/linux/Versions index 27a464483b..eb258a7333 100644

> --- a/sysdeps/unix/sysv/linux/Versions

> +++ b/sysdeps/unix/sysv/linux/Versions

> @@ -189,6 +189,11 @@ libc {

>      __futimens64;

>      __futimes64;

>      __futimesat64;

> +    __fts64_open_time64;

> +    __fts64_close_time64;

> +    __fts64_read_time64;

> +    __fts64_set_time64;

> +    __fts64_children_time64;

>      __getitimer64;

>      __getrusage64;

>      __gettimeofday64;

> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist

> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index

> 397c97cc16..4bdf41cae0 100644 ---

> a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++

> b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -202,6 +202,11 @@

> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist

> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index

> 9bc948703c..e7bd82b036 100644 ---

> a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++

> b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -199,6 +199,11 @@

> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist

> b/sysdeps/unix/sysv/linux/csky/libc.abilist index

> 0f84021d9f..857bc753e3 100644 ---

> a/sysdeps/unix/sysv/linux/csky/libc.abilist +++

> b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2279,6 +2279,11 @@

> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist

> b/sysdeps/unix/sysv/linux/hppa/libc.abilist index

> 31caf8ebc3..3c94e046c5 100644 ---

> a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++

> b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2232,6 +2232,11 @@

> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist

> b/sysdeps/unix/sysv/linux/i386/libc.abilist index

> 75b71b8a5b..6b2f6e3ba9 100644 ---

> a/sysdeps/unix/sysv/linux/i386/libc.abilist +++

> b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2414,6 +2414,11 @@

> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist

> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index

> 2f93afc071..9379012dd9 100644 ---

> a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++

> b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -203,6

> +203,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist

> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index

> dc074cf576..15142aae53 100644 ---

> a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++

> b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2358,6

> +2358,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist

> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index

> a8b8366c48..fb73ff10d0 100644 ---

> a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++

> b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2330,6

> +2330,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist

> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index

> 63e3b096e3..fafcf2f255 100644 ---

> a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++

> b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2327,6

> +2327,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist

> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index

> 3d17b78b42..af82e41244 100644 ---

> a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++

> b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2323,6

> +2323,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist

> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index

> ba96f15040..9d7afa11f3 100644 ---

> a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++

> b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2321,6

> +2321,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist

> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index

> 04cc170344..3bbd2468d7 100644 ---

> a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++

> b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2329,6

> +2329,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist

> b/sysdeps/unix/sysv/linux/nios2/libc.abilist index

> ce21e19622..e3b4f8bd9d 100644 ---

> a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++

> b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2369,6 +2369,11 @@

> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git

> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist

> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index

> 4cfae3b735..f0756a3997 100644 ---

> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++

> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@

> -2385,6 +2385,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64

> F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git

> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist

> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index

> 3e03f313b1..9e4bf76ba1 100644 ---

> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++

> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@

> -2418,6 +2418,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64

> F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist

> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index

> 4dfdc61761..56db45a52d 100644 ---

> a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++

> b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2383,6

> +2383,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist

> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index

> 2c00100dd6..dbfdc3571f 100644 ---

> a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++

> b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2239,6 +2239,11 @@

> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist

> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index

> 2bcf38af9b..4b959c0f79 100644 ---

> a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++

> b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2236,6 +2236,11 @@

> GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist

> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index

> dad08de21f..95fea73af5 100644 ---

> a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++

> b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2376,6

> +2376,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
Florian Weimer via Libc-alpha June 4, 2021, 7:39 p.m. | #2
On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> Similar to glob, fts routines passes a stat pointer that might

> differ of size and layout when 64 bit time API is used.


LGTM.

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

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

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

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

> ---

>  include/fts.h                                 | 51 +++++++++++++++++++

>  io/Makefile                                   |  4 +-

>  io/fts.h                                      | 43 ++++++++++++++--

>  io/fts64-time64.c                             | 35 +++++++++++++

>  sysdeps/unix/sysv/linux/Versions              |  5 ++

>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  5 ++

>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  5 ++

>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  5 ++

>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  5 ++

>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  5 ++

>  .../sysv/linux/m68k/coldfire/libc.abilist     |  5 ++

>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  5 ++

>  .../sysv/linux/microblaze/be/libc.abilist     |  5 ++

>  .../sysv/linux/microblaze/le/libc.abilist     |  5 ++

>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  5 ++

>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  5 ++

>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  5 ++

>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  5 ++

>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  5 ++

>  .../powerpc/powerpc32/nofpu/libc.abilist      |  5 ++

>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  5 ++

>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  5 ++

>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  5 ++

>  .../sysv/linux/sparc/sparc32/libc.abilist     |  5 ++

>  24 files changed, 227 insertions(+), 6 deletions(-)

>  create mode 100644 io/fts64-time64.c

> 

> diff --git a/include/fts.h b/include/fts.h

> index 145dce6779..ea36a9b9be 100644

> --- a/include/fts.h

> +++ b/include/fts.h

> @@ -1 +1,52 @@

> +#ifndef _FTS_H

>  #include <io/fts.h>

> +

> +#ifndef _ISOMAC

> +# if __TIMESIZE != 64

> +#  include <sys/stat.h>

> +

> +typedef struct

> +{

> +  struct _ftsent64_time64 *fts_cur;

> +  struct _ftsent64_time64 *fts_child;

> +  struct _ftsent64_time64 **fts_array;


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

> +  dev_t fts_dev;

> +  char *fts_path;

> +  int fts_rfd;

> +  int fts_pathlen;

> +  int fts_nitems;


OK, dev_t, char, int int int.

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


OK, function pointer.

> +  int fts_options;


OK. Int.

> +} FTS64_TIME64;

> +

> +typedef struct _ftsent64_time64

> +{

> +  struct _ftsent64_time64 *fts_cycle;

> +  struct _ftsent64_time64 *fts_parent;

> +  struct _ftsent64_time64 *fts_link;


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

> +  long fts_number;

> +  void *fts_pointer;

> +  char *fts_accpath;

> +  char *fts_path;

> +  int fts_errno;

> +  int fts_symfd;

> +  unsigned short fts_pathlen;

> +  unsigned short fts_namelen;


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

> +

> +  ino64_t fts_ino;

> +  dev_t fts_dev;

> +  nlink_t fts_nlink;


OK. ino64_t, dev_t, nlink_t.

> +

> +  short fts_level;

> +  unsigned short fts_info;

> +  unsigned short fts_flags;

> +  unsigned short fts_instr;


OK. Short, ushort, ushort, ushort.

> +

> +  struct __stat64_t64 *fts_statp;


OK. A stat64 with time64.

> +  char fts_name[1];


OK. char.

> +} FSTENT64_TIME64;

> +

> +# endif

> +#endif

> +

> +#endif /* _FTS_H  */

> diff --git a/io/Makefile b/io/Makefile

> index a22492f3f3..12c832cfcb 100644

> --- a/io/Makefile

> +++ b/io/Makefile

> @@ -54,7 +54,8 @@ routines :=								\

>  	posix_fadvise posix_fadvise64					\

>  	posix_fallocate posix_fallocate64				\

>  	sendfile sendfile64 copy_file_range 				\

> -	utimensat futimens file_change_detection

> +	utimensat futimens file_change_detection			\

> +	fts64-time64


OK. New test.

>  

>  others		:= pwd

>  test-srcs	:= ftwtest

> @@ -102,6 +103,7 @@ CFLAGS-statvfs.c += -fexceptions

>  CFLAGS-fstatvfs.c += -fexceptions

>  CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions

>  CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions

> +CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions


OK.

>  CFLAGS-ftw.c += $(uses-callbacks) -fexceptions

>  CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions

>  CFLAGS-posix_fallocate.c += -fexceptions

> diff --git a/io/fts.h b/io/fts.h

> index 867677a27e..8d3395fa31 100644

> --- a/io/fts.h

> +++ b/io/fts.h

> @@ -187,6 +187,7 @@ FTSENT	*fts_read (FTS *);

>  int	 fts_set (FTS *, FTSENT *, int) __THROW;

>  #else

>  # ifdef __REDIRECT

> +#  ifndef __USE_TIME_BITS64

>  FTSENT	*__REDIRECT (fts_children, (FTS *, int), fts64_children);

>  int	 __REDIRECT (fts_close, (FTS *), fts64_close);

>  FTS	*__REDIRECT (fts_open, (char * const *, int,

> @@ -194,21 +195,53 @@ FTS	*__REDIRECT (fts_open, (char * const *, int,

>  		     fts64_open);

>  FTSENT	*__REDIRECT (fts_read, (FTS *), fts64_read);

>  int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), fts64_set);

> +#  else

> +FTSENT	*__REDIRECT (fts_children, (FTS *, int), __fts64_children_time64);

> +int	 __REDIRECT (fts_close, (FTS *), __fts64_close_time64);

> +FTS	*__REDIRECT (fts_open, (char * const *, int,

> +				int (*)(const FTSENT **, const FTSENT **)),

> +		     __fts64_open_time64);

> +FTSENT	*__REDIRECT (fts_read, (FTS *), __fts64_read_time64);

> +int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),

> +			 __fts64_set_time64);


OK. Redirects with new type.

> +#  endif

>  # else

> -#  define fts_children fts64_children

> -#  define fts_close fts64_close

> -#  define fts_open fts64_open

> -#  define fts_read fts64_read

> -#  define fts_set fts64_set

> +#  ifndef __USE_TIME_BITS64

> +#   define fts_children fts64_children

> +#   define fts_close fts64_close

> +#   define fts_open fts64_open

> +#   define fts_read fts64_read

> +#   define fts_set fts64_set


OK. Macros for new functions.

> +#  else

> +#  endif

>  # endif

>  #endif

>  #ifdef __USE_LARGEFILE64

> +# ifndef __USE_TIME_BITS64

>  FTSENT64 *fts64_children (FTS64 *, int);

>  int	  fts64_close (FTS64 *);

>  FTS64	 *fts64_open (char * const *, int,

>  		      int (*)(const FTSENT64 **, const FTSENT64 **));

>  FTSENT64 *fts64_read (FTS64 *);

>  int	 fts64_set (FTS64 *, FTSENT64 *, int) __THROW;

> +# else

> +#  ifdef __REDIRECT

> +FTSENT	*__REDIRECT (fts64_children, (FTS64 *, int), __fts64_children_time64);

> +int	 __REDIRECT (fts64_close, (FTS64 *), __fts64_close_time64);

> +FTS	*__REDIRECT (fts64_open, (char * const *, int,

> +				int (*)(const FTSENT64 **, const FTSENT64 **)),

> +		     __fts64_open_time64);

> +FTSENT	*__REDIRECT (fts64_read, (FTS64 *), __fts64_read_time64);

> +int	 __REDIRECT_NTH (fts64_set, (FTS64 *, FTSENT64 *, int),

> +			 __fts64_set_time64);

> +#  else

> +#   define fts_children __fts64_children_time64

> +#   define fts_close __fts64_close_time64

> +#   define fts_open __fts64_open_time64

> +#   define fts_read __fts64_read_time64

> +#   define fts_set __fts64_set_time64

> +#  endif

> +# endif

>  #endif

>  __END_DECLS

>  

> diff --git a/io/fts64-time64.c b/io/fts64-time64.c

> new file mode 100644

> index 0000000000..c8885ca79b

> --- /dev/null

> +++ b/io/fts64-time64.c

> @@ -0,0 +1,35 @@

> +/* File tree traversal functions LFS version.

> +   Copyright (C) 2015-2021 Free Software Foundation, Inc.

> +   This file is part of the GNU C Library.

> +

> +   The GNU C Library is free software; you can redistribute it and/or

> +   modify it under the terms of the GNU Lesser General Public

> +   License as published by the Free Software Foundation; either

> +   version 2.1 of the License, or (at your option) any later version.

> +

> +   The GNU C Library is distributed in the hope that it will be useful,

> +   but WITHOUT ANY WARRANTY; without even the implied warranty of

> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

> +   Lesser General Public License for more details.

> +

> +   You should have received a copy of the GNU Lesser General Public

> +   License along with the GNU C Library; if not, see

> +   <https://www.gnu.org/licenses/>.  */

> +

> +#include <time.h>

> +

> +#if __TIMESIZE != 64

> +# define FTS_OPEN __fts64_open_time64

> +# define FTS_CLOSE __fts64_close_time64

> +# define FTS_READ __fts64_read_time64

> +# define FTS_SET __fts64_set_time64

> +# define FTS_CHILDREN __fts64_children_time64

> +# define FTSOBJ FTS64_TIME64

> +# define FTSENTRY FSTENT64_TIME64

> +# define INO_T ino64_t

> +# define STRUCT_STAT __stat64_t64

> +# define STAT __stat64_time64

> +# define LSTAT __lstat64_time64

> +

> +# include "fts.c"


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

> +#endif

> diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions

> index 27a464483b..eb258a7333 100644

> --- a/sysdeps/unix/sysv/linux/Versions

> +++ b/sysdeps/unix/sysv/linux/Versions

> @@ -189,6 +189,11 @@ libc {

>      __futimens64;

>      __futimes64;

>      __futimesat64;

> +    __fts64_open_time64;

> +    __fts64_close_time64;

> +    __fts64_read_time64;

> +    __fts64_set_time64;

> +    __fts64_children_time64;


OK.

>      __getitimer64;

>      __getrusage64;

>      __gettimeofday64;

> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist

> index 397c97cc16..4bdf41cae0 100644

> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist

> @@ -202,6 +202,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist

> index 9bc948703c..e7bd82b036 100644

> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist

> @@ -199,6 +199,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist

> index 0f84021d9f..857bc753e3 100644

> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist

> @@ -2279,6 +2279,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist

> index 31caf8ebc3..3c94e046c5 100644

> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist

> @@ -2232,6 +2232,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist

> index 75b71b8a5b..6b2f6e3ba9 100644

> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist

> @@ -2414,6 +2414,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist

> index 2f93afc071..9379012dd9 100644

> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist

> @@ -203,6 +203,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist

> index dc074cf576..15142aae53 100644

> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist

> @@ -2358,6 +2358,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist

> index a8b8366c48..fb73ff10d0 100644

> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist

> @@ -2330,6 +2330,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist

> index 63e3b096e3..fafcf2f255 100644

> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist

> @@ -2327,6 +2327,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist

> index 3d17b78b42..af82e41244 100644

> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist

> @@ -2323,6 +2323,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist

> index ba96f15040..9d7afa11f3 100644

> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist

> @@ -2321,6 +2321,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist

> index 04cc170344..3bbd2468d7 100644

> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist

> @@ -2329,6 +2329,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist

> index ce21e19622..e3b4f8bd9d 100644

> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist

> @@ -2369,6 +2369,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist

> index 4cfae3b735..f0756a3997 100644

> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist

> @@ -2385,6 +2385,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist

> index 3e03f313b1..9e4bf76ba1 100644

> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist

> @@ -2418,6 +2418,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist

> index 4dfdc61761..56db45a52d 100644

> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist

> @@ -2383,6 +2383,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist

> index 2c00100dd6..dbfdc3571f 100644

> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist

> @@ -2239,6 +2239,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist

> index 2bcf38af9b..4b959c0f79 100644

> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist

> @@ -2236,6 +2236,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist

> index dad08de21f..95fea73af5 100644

> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist

> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist

> @@ -2376,6 +2376,11 @@ GLIBC_2.34 __ctime64_r F

>  GLIBC_2.34 __difftime64 F

>  GLIBC_2.34 __fstat64_time64 F

>  GLIBC_2.34 __fstatat64_time64 F

> +GLIBC_2.34 __fts64_children_time64 F

> +GLIBC_2.34 __fts64_close_time64 F

> +GLIBC_2.34 __fts64_open_time64 F

> +GLIBC_2.34 __fts64_read_time64 F

> +GLIBC_2.34 __fts64_set_time64 F

>  GLIBC_2.34 __futimens64 F

>  GLIBC_2.34 __futimes64 F

>  GLIBC_2.34 __futimesat64 F

> 



-- 
Cheers,
Carlos.

Patch

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