Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
b=5188
[fs/lustre-release.git]
/
lustre
/
tests
/
getdents.c
1
#include <stdio.h>
2
#include <sys/types.h>
3
#include <dirent.h>
4
#include <errno.h>
5
6
int main(int argc, char **argv)
7
{
8
DIR *dir;
9
struct dirent64 *entry;
10
11
if (argc < 2) {
12
fprintf(stderr, "Usage: %s dirname\n", argv[0]);
13
return 1;
14
}
15
16
dir = opendir(argv[1]);
17
if (!dir) {
18
int rc = errno;
19
perror("opendir");
20
return rc;
21
}
22
23
while ((entry = readdir64(dir))) {
24
puts(entry->d_name);
25
}
26
27
closedir(dir);
28
29
return 0;
30
}
31