diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-24 20:22:12 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-24 20:22:12 +0200 |
commit | 7988979a722b4cdf287b2093956a76a3f19b9897 (patch) | |
tree | d35e251d0472ceca55a2eef61cff261c8ee68fab /test/misc/tst-scandir.c |
add uClibc-ng test directory
Diffstat (limited to 'test/misc/tst-scandir.c')
-rw-r--r-- | test/misc/tst-scandir.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/misc/tst-scandir.c b/test/misc/tst-scandir.c new file mode 100644 index 0000000..e1c72e3 --- /dev/null +++ b/test/misc/tst-scandir.c @@ -0,0 +1,23 @@ +#include <dirent.h> +#include <errno.h> +#include <stdio.h> /* perror() */ +#include <stdlib.h> + +static int skip_all(const struct dirent *dirbuf) +{ + errno = EBADF; + return 0; +} + +int main(void) +{ + struct dirent **namelist; + int n; + + n = scandir(".", &namelist, skip_all, 0); + if (n < 0) { + perror("scandir"); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} |