repo.or.cz
/
uclibc-ng.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
h8300: Assembly functions
[uclibc-ng.git]
/
test
/
misc
/
tst-scandir.c
blob
e1c72e3c9c46eba544ee4bf04a715e79fd55e388
1
#include <dirent.h>
2
#include <errno.h>
3
#include <stdio.h>
/* perror() */
4
#include <stdlib.h>
5
6
static 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
}