mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 22:40:05 +00:00
40176158f1
The POSIX function scandir calls scandirat, which is not a POSIX function. This patch fixes this by making it use __scandirat and making scandirat a weak alias. There are no changes for scandir64 / scandirat64 because those are both _GNU_SOURCE-only functions so no namespace issue arises for them. Tested for x86_64 that the disassembly of installed shared libraries is unchanged by this patch. [BZ #17999] * dirent/scandir.c [!SCANDIR] (SCANDIRAT): Define to __scandirat instead of scandirat. * dirent/scandirat.c [!SCANDIRAT] (SCANDIRAT): Likewise. [!SCANDIRAT] (SCANDIRAT_WEAK_ALIAS): Define. [SCANDIRAT_WEAK_ALIAS] (scandirat): Define as weak alias of __scandirat. * include/dirent.h (scandirat): Do not use libc_hidden_proto. (__scandirat): Declare. Use libc_hidden_proto. * conform/Makefile (test-xfail-POSIX2008/dirent.h/linknamespace): Remove variable. (test-xfail-XOPEN2K8/dirent.h/linknamespace): Likewise.
59 lines
1.8 KiB
C
59 lines
1.8 KiB
C
#ifndef _DIRENT_H
|
|
# ifndef _ISOMAC
|
|
# include <dirstream.h>
|
|
# endif
|
|
# include <dirent/dirent.h>
|
|
# ifndef _ISOMAC
|
|
# include <sys/stat.h>
|
|
# include <stdbool.h>
|
|
|
|
struct scandir_cancel_struct
|
|
{
|
|
DIR *dp;
|
|
void *v;
|
|
size_t cnt;
|
|
};
|
|
|
|
/* Now define the internal interfaces. */
|
|
extern DIR *__opendir (const char *__name);
|
|
extern DIR *__opendirat (int dfd, const char *__name) internal_function;
|
|
extern DIR *__fdopendir (int __fd);
|
|
extern int __closedir (DIR *__dirp);
|
|
extern struct dirent *__readdir (DIR *__dirp);
|
|
extern struct dirent64 *__readdir64 (DIR *__dirp);
|
|
extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
|
|
struct dirent **__result);
|
|
extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
|
|
struct dirent64 **__result);
|
|
extern int __scandir64 (const char * __dir,
|
|
struct dirent64 *** __namelist,
|
|
int (*__selector) (const struct dirent64 *),
|
|
int (*__cmp) (const struct dirent64 **,
|
|
const struct dirent64 **));
|
|
extern __ssize_t __getdirentries (int __fd, char *__restrict __buf,
|
|
size_t __nbytes,
|
|
__off_t *__restrict __basep)
|
|
__THROW __nonnull ((2, 4));
|
|
extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
|
|
internal_function;
|
|
extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
|
|
internal_function;
|
|
extern int __alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
|
|
__attribute_pure__;
|
|
extern int __versionsort64 (const struct dirent64 **a,
|
|
const struct dirent64 **b)
|
|
__attribute_pure__;
|
|
extern DIR *__alloc_dir (int fd, bool close_fd, int flags,
|
|
const struct stat64 *statp)
|
|
internal_function;
|
|
extern void __scandir_cancel_handler (void *arg);
|
|
extern __typeof (rewinddir) __rewinddir;
|
|
|
|
libc_hidden_proto (__rewinddir)
|
|
extern __typeof (scandirat) __scandirat;
|
|
libc_hidden_proto (__scandirat)
|
|
libc_hidden_proto (scandirat64)
|
|
# endif
|
|
|
|
#endif
|