aboutsummaryrefslogtreecommitdiff
path: root/include/glob.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-03-02 20:17:07 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-15 10:42:11 -0300
commit84f7ce84474c1648ce96884f1c91ca7b97ca3fc2 (patch)
tree4a19687d260d69a380414d41a592fb261841e5cd /include/glob.h
parent47f24c21ee38701ae275aa9e451f70fa3e77478c (diff)
downloadglibc-84f7ce84474c1648ce96884f1c91ca7b97ca3fc2.tar.xz
glibc-84f7ce84474c1648ce96884f1c91ca7b97ca3fc2.zip
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 <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'include/glob.h')
-rw-r--r--include/glob.h28
1 files changed, 28 insertions, 0 deletions
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,