diff options
author | Ulrich Drepper <drepper@redhat.com> | 2009-03-15 21:33:19 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2009-03-15 21:33:19 +0000 |
commit | eee6b1432794967d4272394dfed1e2b5cca4be39 (patch) | |
tree | 23224c276f09d0b733872790fa41c1a4cbe76787 /dirent/dirent.h | |
parent | cd2d01faa53a48640e97d55aa0bf2fee99a7c8cb (diff) | |
download | glibc-eee6b1432794967d4272394dfed1e2b5cca4be39.tar glibc-eee6b1432794967d4272394dfed1e2b5cca4be39.tar.gz glibc-eee6b1432794967d4272394dfed1e2b5cca4be39.tar.bz2 glibc-eee6b1432794967d4272394dfed1e2b5cca4be39.zip |
[BZ #9759]
* dirent/dirent.h: Adjust prototypes of scandir, scandir64, alphasort,
alphasort64, versionsort, and versionsort64 to POSIX 2008.
* dirent/alphasort.c: Adjust implementation to type change.
* dirent/alphasort64.c: Likewise.
* dirent/scandir.c: Likewise.
* dirent/versionsort.c: Likewise.
* dirent/versionsort64.c: Likewise.
* sysdeps/wordsize-64/alphasort.c: Add hack to hide alphasort64
declaration.
* sysdeps/wordsize-64/versionsort.c: Add hack to hide versionsort64
declaration.
Diffstat (limited to 'dirent/dirent.h')
-rw-r--r-- | dirent/dirent.h | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/dirent/dirent.h b/dirent/dirent.h index cb6d0bc2d5..369ccdc9ee 100644 --- a/dirent/dirent.h +++ b/dirent/dirent.h @@ -252,7 +252,8 @@ extern int dirfd (DIR *__dirp) __THROW __nonnull ((1)); extern int scandir (__const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (__const struct dirent *), - int (*__cmp) (__const void *, __const void *)) + int (*__cmp) (__const struct dirent **, + __const struct dirent **)) __nonnull ((1, 2)); # else # ifdef __REDIRECT @@ -260,7 +261,8 @@ extern int __REDIRECT (scandir, (__const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (__const struct dirent *), - int (*__cmp) (__const void *, __const void *)), + int (*__cmp) (__const struct dirent **, + __const struct dirent **)), scandir64) __nonnull ((1, 2)); # else # define scandir scandir64 @@ -273,18 +275,21 @@ extern int __REDIRECT (scandir, extern int scandir64 (__const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (__const struct dirent64 *), - int (*__cmp) (__const void *, __const void *)) + int (*__cmp) (__const struct dirent64 **, + __const struct dirent64 **)) __nonnull ((1, 2)); # endif /* Function to compare two `struct dirent's alphabetically. */ # ifndef __USE_FILE_OFFSET64 -extern int alphasort (__const void *__e1, __const void *__e2) +extern int alphasort (__const struct dirent **__e1, + __const struct dirent **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH (alphasort, - (__const void *__e1, __const void *__e2), + (__const struct dirent **__e1, + __const struct dirent **__e2), alphasort64) __attribute_pure__ __nonnull ((1, 2)); # else # define alphasort alphasort64 @@ -292,51 +297,54 @@ extern int __REDIRECT_NTH (alphasort, # endif # if defined __USE_GNU && defined __USE_LARGEFILE64 -extern int alphasort64 (__const void *__e1, __const void *__e2) +extern int alphasort64 (__const struct dirent64 **__e1, + __const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # endif +#endif /* Use BSD or misc or XPG7. */ -# if defined __USE_BSD || defined __USE_MISC +#if defined __USE_BSD || defined __USE_MISC /* Read directory entries from FD into BUF, reading at most NBYTES. Reading starts at offset *BASEP, and *BASEP is updated with the new position after reading. Returns the number of bytes read; zero when at end of directory; or -1 for errors. */ -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off_t *__restrict __basep) __THROW __nonnull ((2, 4)); -# else -# ifdef __REDIRECT +# else +# ifdef __REDIRECT extern __ssize_t __REDIRECT_NTH (getdirentries, (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep), getdirentries64) __nonnull ((2, 4)); -# else -# define getdirentries getdirentries64 -# endif +# else +# define getdirentries getdirentries64 # endif +# endif -# ifdef __USE_LARGEFILE64 +# ifdef __USE_LARGEFILE64 extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __THROW __nonnull ((2, 4)); -# endif -# endif /* Use BSD or misc. */ -#endif /* Use BSD or misc or XPG7. */ +# endif +#endif /* Use BSD or misc. */ #ifdef __USE_GNU /* Function to compare two `struct dirent's by name & version. */ # ifndef __USE_FILE_OFFSET64 -extern int versionsort (__const void *__e1, __const void *__e2) +extern int versionsort (__const struct dirent **__e1, + __const struct dirent **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH (versionsort, - (__const void *__e1, __const void *__e2), + (__const struct dirent **__e1, + __const struct dirent **__e2), versionsort64) __attribute_pure__ __nonnull ((1, 2)); # else @@ -345,7 +353,8 @@ extern int __REDIRECT_NTH (versionsort, # endif # ifdef __USE_LARGEFILE64 -extern int versionsort64 (__const void *__e1, __const void *__e2) +extern int versionsort64 (__const struct dirent64 **__e1, + __const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # endif #endif /* Use GNU. */ |