diff options
| author | Jakob Kaivo <jkk@ung.org> | 2022-04-21 19:11:02 -0400 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2022-04-21 19:11:02 -0400 |
| commit | 07e6d999712be764a20365becb145f7cd1e3119c (patch) | |
| tree | f6711f8a7ee134949bd7c6b355ef9453b02001db /src/ftw/__ftw.c | |
| parent | 29c25171fbd4394c6007935c31f7d0e0995a6792 (diff) | |
prep common (n)ftw() implementation
Diffstat (limited to 'src/ftw/__ftw.c')
| -rw-r--r-- | src/ftw/__ftw.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ftw/__ftw.c b/src/ftw/__ftw.c new file mode 100644 index 00000000..2acee0cb --- /dev/null +++ b/src/ftw/__ftw.c @@ -0,0 +1,12 @@ +#include "_ftw.h" + +int __ftw(const char *path, int (*fn)(), int fd_limit, int flags) +{ + struct FTW ft; + struct stat st; + int type = 0; + + int ret = (flags == __FTW_OLD) ? fn(path, &st, type) : fn(path, &st, type, &ft); + + return ret; +} |
