]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/uclibc/lib/contrib/uclibc/test/misc/tst-scandir.c
Update
[l4.git] / l4 / pkg / l4re-core / uclibc / lib / contrib / uclibc / test / misc / tst-scandir.c
1 #include <dirent.h>
2 #include <errno.h>
3 #include <stdio.h> /* perror() */
4 #include <stdlib.h>
5
6 int skip_all(const struct dirent *dirbuf)
7 {
8         errno = EBADF;
9         return 0;
10 }
11
12 int main(void)
13 {
14         struct dirent **namelist;
15         int n;
16
17         n = scandir(".", &namelist, skip_all, 0);
18         if (n < 0) {
19                 perror("scandir");
20                 return EXIT_FAILURE;
21         }
22         return EXIT_SUCCESS;
23 }