|
|
1.1 root 1: .TH DIRENT 4 "Standard Extension"
2: .SH NAME
3: dirent \- file system independent directory entry
4: .SH SYNOPSIS
5: .B "#include <sys/types.h>"
6: .br
7: .B "#include <sys/dirent.h>"
8: .SH DESCRIPTION
9: Different file system types
10: may have different directory entries.
11: The
12: .I dirent
13: structure defines a
14: file system independent directory entry,
15: which contains information common to
16: directory entries in different file system types.
17: A set of these structures is returned by the
18: .IR getdents (2)
19: system call.
20: .P
21: The
22: .I dirent
23: structure is defined below.
24: .br
25: struct dirent {
26: .br
27: long d_ino;
28: .br
29: off_t d_off;
30: .br
31: unsigned short d_reclen;
32: .br
33: char d_name[1];
34: .br
35: };
36: .P
37: The field
38: .I d_ino
39: is a number which is unique
40: for each file in the file system.
41: The field
42: .I d_off\^
43: represents an offset of that directory entry
44: in the actual file system directory.
45: The field
46: .I d_name
47: is the beginning of the character array
48: giving the name of the directory entry.
49: This name is null terminated
50: and may have at most
51: .SM NAME_MAX
52: characters in addition to the null terminator.
53: This results in file system independent directory entries
54: being variable-length entities.
55: The value of
56: .I d_reclen
57: is the record length of this entry.
58: This length is defined to be the number of bytes
59: between the beginning of the current entry and the next one,
60: adjusted so that the next entry
61: will start on a long boundary.
62: .SH FILES
63: /usr/include/sys/dirent.h
64: .SH "SEE ALSO"
65: getdents(2).
66: .SH WARNING
67: The field
68: .I d_off\^
69: does not have a simple interpretation
70: for some file system types
71: and should not be used directly by applications.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.