blob: df62a40d4945cce3b601c26772605f9d7246188f [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <dirent.h>
2#include <errno.h>
3#include <stdio.h> /* perror() */
4#include <stdlib.h>
5
6int skip_all(const struct dirent *dirbuf)
7{
8 errno = EBADF;
9 return 0;
10}
11
12int 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}