diff options
Diffstat (limited to 'posix')
-rw-r--r-- | posix/Makefile | 2 | ||||
-rw-r--r-- | posix/Versions | 2 | ||||
-rw-r--r-- | posix/glob.h | 50 |
3 files changed, 43 insertions, 11 deletions
diff --git a/posix/Makefile b/posix/Makefile index 201cb781b7..77471c8eee 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -44,7 +44,7 @@ routines := \ getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \ getlogin getlogin_r setlogin \ pathconf sysconf fpathconf \ - glob fnmatch regex \ + glob glob64 fnmatch regex \ confstr \ getopt getopt1 getopt_init \ sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \ diff --git a/posix/Versions b/posix/Versions index afb7242359..985281d99a 100644 --- a/posix/Versions +++ b/posix/Versions @@ -73,7 +73,7 @@ libc { __pread64; __pwrite64; # g* - gai_strerror; getnameinfo; + gai_strerror; getnameinfo; glob64; globfree64; # p* pread; pread64; pwrite; pwrite64; diff --git a/posix/glob.h b/posix/glob.h index da719c2a45..609f2177e5 100644 --- a/posix/glob.h +++ b/posix/glob.h @@ -77,21 +77,13 @@ extern "C" { #define GLOB_NOSPACE 1 /* Ran out of memory. */ #define GLOB_ABORTED 2 /* Read error. */ #define GLOB_NOMATCH 3 /* No matches found. */ - +#define GLOB_NOSYS 4 /* Not implemented. */ #ifdef _GNU_SOURCE /* Previous versions of this file defined GLOB_ABEND instead of GLOB_ABORTED. Provide a compatibility definition here. */ # define GLOB_ABEND GLOB_ABORTED #endif -/* This value is returned if the implementation does not support - `glob'. Since this is not the case here it will never be - returned but the conformance test suites still require the symbol - to be defined. */ -#ifdef _XOPEN_SOURCE -# define GLOB_NOSYS (-1) -#endif - /* Structure describing a globbing run. */ #if !defined _AMIGA && !defined VMS /* Buggy compiler. */ struct stat; @@ -112,6 +104,25 @@ typedef struct int (*gl_stat) __PMT ((__const char *, struct stat *)); } glob_t; +#ifdef _LARGEFILE64_SOURCE +struct stat64; +typedef struct + { + size_t gl_pathc; + char **gl_pathv; + size_t gl_offs; + int gl_flags; + + /* If the GLOB_ALTDIRFUNC flag is set, the following functions + are used instead of the normal file access functions. */ + void (*gl_closedir) __PMT ((void *)); + struct dirent64 *(*gl_readdir) __PMT ((void *)); + __ptr_t (*gl_opendir) __PMT ((__const char *)); + int (*gl_lstat) __PMT ((__const char *, struct stat64 *)); + int (*gl_stat) __PMT ((__const char *, struct stat64 *)); + } glob64_t; +#endif + /* 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, @@ -120,12 +131,33 @@ typedef struct `glob' returns GLOB_ABEND; if it returns zero, the error is ignored. If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. Otherwise, `glob' returns zero. */ +#if _FILE_OFFSET_BITS != 64 extern int glob __P ((__const char *__pattern, int __flags, int (*__errfunc) __P ((__const char *, int)), glob_t *__pglob)); /* Free storage allocated in PGLOB by a previous `glob' call. */ extern void globfree __P ((glob_t *__pglob)); +#else +# if __GNUC__ >= 2 +extern int glob __P ((__const char *__pattern, int __flags, + int (*__errfunc) __P ((__const char *, int)), + glob_t *__pglob)) __asm__ ("glob64"); + +extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64"); +# else +# define glob glob64 +# define globfree globfree64 +# endif +#endif + +#ifdef _LARGEFILE64_SOURCE +extern int glob64 __P ((__const char *__pattern, int __flags, + int (*__errfunc) __P ((__const char *, int)), + glob64_t *__pglob)); + +extern void globfree64 __P ((glob64_t *__pglob)); +#endif #ifdef _GNU_SOURCE |