From 84f7ce84474c1648ce96884f1c91ca7b97ca3fc2 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 2 Mar 2021 20:17:07 -0300 Subject: posix: Add glob64 with 64-bit time_t support 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-bit time version that also uses 64-bit time stat functions. Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- include/glob.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include') 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 #ifndef _ISOMAC +# include + 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 + +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, -- cgit v1.2.3