Added ftw64, nftw64
Bug: 13076637
Change-Id: I5b926526f935b00bba14c2807b61d85f95089c33
diff --git a/libc/bionic/lfs64_support.cpp b/libc/bionic/lfs64_support.cpp
index 138094e..ab795f5 100644
--- a/libc/bionic/lfs64_support.cpp
+++ b/libc/bionic/lfs64_support.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <ftw.h>
#include <stdlib.h>
int mkstemp64(char* filename) {
@@ -22,3 +23,17 @@
// open (our open is actually open64) and stat and stat64 are the same.
return mkstemp(filename);
}
+
+typedef int (*ftw_fn)(const char*, const struct stat*, int);
+typedef int (*nftw_fn)(const char*, const struct stat*, int, struct FTW*);
+
+int ftw64(const char *dirpath,
+ int (*fn)(const char*, const struct stat64*, int), int nopenfd) {
+ return ftw(dirpath, reinterpret_cast<ftw_fn>(fn), nopenfd);
+}
+
+int nftw64(const char * dirpath,
+ int (*fn)(const char*, const struct stat64*, int, struct FTW*),
+ int nopenfd, int flags) {
+ return nftw(dirpath, reinterpret_cast<nftw_fn>(fn), nopenfd, flags);
+}