From 7988979a722b4cdf287b2093956a76a3f19b9897 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 24 Oct 2016 20:22:12 +0200 Subject: add uClibc-ng test directory --- test/misc/tst-scandir.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/misc/tst-scandir.c (limited to 'test/misc/tst-scandir.c') 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 +#include +#include /* perror() */ +#include + +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; +} -- cgit v1.2.3