Skip to content

Commit 86d0141

Browse files
committed
initial commit
1 parent f7b539b commit 86d0141

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

chapter08/dirent.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#define NAME_MAX 14 /* longest filename; system-dependent */
2+
3+
typedef struct { /* portable directory entry; */
4+
long ino; /* inode number */
5+
char name[NAME_MAX]; /* name + '\0' terminator */
6+
} Dirent;
7+
8+
typedef struct { /* minimal DIR: no buffering, etc. */
9+
int fd; /* file descriptor for directory */
10+
Dirent d; /* the directory entry */
11+
} DIR;
12+
13+
DIR *opendir(char *dirname);
14+
Dirent *readdir(DIR *dfd);
15+
void closedir(DIR *dfd);

0 commit comments

Comments
 (0)