posix: Sync glob with gnulib [BZ #1062]
[glibc.git] / sysdeps / unix / sysv / linux / oldglob.c
blob8233e57ce941d5d9bd72530c78e0654696728edd
1 #include <shlib-compat.h>
3 #if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
5 #include <dirent.h>
6 #include <glob.h>
7 #include <sys/stat.h>
9 #include <sysdeps/unix/sysv/linux/i386/olddirent.h>
11 int __old_glob64 (const char *__pattern, int __flags,
12 int (*__errfunc) (const char *, int),
13 glob64_t *__pglob);
14 libc_hidden_proto (__old_glob64);
16 #define dirent __old_dirent64
17 #define GL_READDIR(pglob, stream) \
18 ((struct __old_dirent64 *) (pglob)->gl_readdir (stream))
19 #undef __readdir
20 #define __readdir(dirp) __old_readdir64 (dirp)
22 #define glob_t glob64_t
23 #define glob(pattern, flags, errfunc, pglob) \
24 __old_glob64 (pattern, flags, errfunc, pglob)
25 #define globfree(pglob) globfree64(pglob)
27 #define convert_dirent __old_convert_dirent
28 #define glob_in_dir __old_glob_in_dir
30 #undef stat
31 #define stat stat64
32 #undef __stat
33 #define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
35 #define GLOB_ATTRIBUTE attribute_compat_text_section
37 #include <posix/glob.c>
39 libc_hidden_def (__old_glob64);
41 compat_symbol (libc, __old_glob64, glob64, GLIBC_2_1);
42 #endif