glibc: don't redirect fts to fts64 before glibc 2.23

This commit is contained in:
Hugo Beauzée-Luyssen 2025-02-13 12:10:35 +01:00 committed by Alex Rønne Petersen
parent cb5547e3de
commit 462d26171b

View File

@ -147,6 +147,8 @@ typedef struct _ftsent {
} FTSENT; } FTSENT;
#ifdef __USE_LARGEFILE64 #ifdef __USE_LARGEFILE64
// zig patch: 64bits variants appeared starting from glibc 2.23
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 23) || __GLIBC__ > 2
typedef struct _ftsent64 { typedef struct _ftsent64 {
struct _ftsent64 *fts_cycle; /* cycle node */ struct _ftsent64 *fts_cycle; /* cycle node */
struct _ftsent64 *fts_parent; /* parent directory */ struct _ftsent64 *fts_parent; /* parent directory */
@ -175,9 +177,15 @@ typedef struct _ftsent64 {
struct stat64 *fts_statp; /* stat(2) information */ struct stat64 *fts_statp; /* stat(2) information */
char fts_name[1]; /* file name */ char fts_name[1]; /* file name */
} FTSENT64; } FTSENT64;
# endif
#endif #endif
__BEGIN_DECLS __BEGIN_DECLS
// zig patch: 64bits variants appeared starting from glibc 2.23
// before that version, we can't declare nor redirect to them
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 23) || __GLIBC__ > 2
#ifndef __USE_FILE_OFFSET64 #ifndef __USE_FILE_OFFSET64
FTSENT *fts_children (FTS *, int); FTSENT *fts_children (FTS *, int);
int fts_close (FTS *); int fts_close (FTS *);
@ -216,6 +224,19 @@ int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),
# endif # endif
# endif # endif
#endif #endif
#else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 23) || __GLIBC__ > 2 */
FTSENT *fts_children (FTS *, int);
int fts_close (FTS *);
FTS *fts_open (char * const *, int,
int (*)(const FTSENT **, const FTSENT **));
FTSENT *fts_read (FTS *);
int fts_set (FTS *, FTSENT *, int) __THROW;
#endif
// zig patch: 64bits time variants appeared starting from glibc 2.34
// before that version, there is nothing to declare
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2
#ifdef __USE_LARGEFILE64 #ifdef __USE_LARGEFILE64
# ifndef __USE_TIME64_REDIRECTS # ifndef __USE_TIME64_REDIRECTS
FTSENT64 *fts64_children (FTS64 *, int); FTSENT64 *fts64_children (FTS64 *, int);
@ -243,6 +264,8 @@ int __REDIRECT_NTH (fts64_set, (FTS64 *, FTSENT64 *, int),
# endif # endif
# endif # endif
#endif #endif
#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2 */
__END_DECLS __END_DECLS
#endif /* fts.h */ #endif /* fts.h */