Merge "Added ftw64, nftw64"
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <ftw.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int mkstemp64(char* filename) {
|
||||
@@ -22,3 +23,17 @@ int mkstemp64(char* filename) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,9 @@ __BEGIN_DECLS
|
||||
int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
|
||||
int nftw(const char *, int (*)(const char *, const struct stat *, int,
|
||||
struct FTW *), int, int);
|
||||
int ftw64(const char *, int (*)(const char *, const struct stat64 *, int), int);
|
||||
int nftw64(const char *, int (*)(const char *, const struct stat64 *, int,
|
||||
struct FTW *), int, int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_FTW_H */
|
||||
|
||||
Reference in New Issue
Block a user