summaryrefslogtreecommitdiff
path: root/libc/misc/ftw/ftw.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/ftw/ftw.c')
-rw-r--r--libc/misc/ftw/ftw.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c
index 4bd186561..8a6db98d3 100644
--- a/libc/misc/ftw/ftw.c
+++ b/libc/misc/ftw/ftw.c
@@ -36,7 +36,6 @@
#define _GNU_SOURCE
#include <features.h>
-
#if defined (__UCLIBC_HAS_LFS__) && defined L_ftw64
#ifndef L_ftw
#define L_ftw
@@ -59,17 +58,20 @@
#define NFTW_NAME nftw64
#define INO_T ino64_t
#define STAT stat64
-#define LSTAT lstat64
-#define XSTAT stat64
+#define LSTAT __lstat64
+#define XSTAT __stat64
#define FTW_FUNC_T __ftw64_func_t
#define NFTW_FUNC_T __nftw64_func_t
+#define __readdir __readdir64
#else
+#undef __stat
+#undef __lstat
#define FTW_NAME ftw
#define NFTW_NAME nftw
#define INO_T ino_t
#define STAT stat
-#define LSTAT lstat
-#define XSTAT stat
+#define LSTAT __lstat
+#define XSTAT __stat
#define FTW_FUNC_T __ftw_func_t
#define NFTW_FUNC_T __nftw_func_t
#endif
@@ -89,6 +91,12 @@
#include <assert.h>
#include <dirent.h>
+#if 1 /*ndef L_ftw64*/
+extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden;
+#else
+extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden;
+#endif
+
/* We define PATH_MAX if the system does not provide a definition.
This does not artificially limit any operation. PATH_MAX is simply
used as a guesstimate for the expected maximal path length.