@@ -10,7 +10,8 @@ pub const STDOUT_FILENO: i32 = 1; // File descriptor for standard output
10
10
pub const STDERR_FILENO : i32 = 2 ; // File descriptor for standard error
11
11
12
12
// ===== Directory Entry Constant =====
13
- pub const DT_UNKNOWN : u8 = 0 ; //source: include/dirent.h
13
+ // Source: include/dirent.h
14
+ pub const DT_UNKNOWN : u8 = 0 ;
14
15
15
16
// ===== File Access Permission Flags =====
16
17
pub const F_OK : u32 = 0 ; // Test for existence
@@ -26,6 +27,7 @@ pub const O_RDWR: i32 = 0o2; // Open read-write
26
27
pub const O_RDWRFLAGS : i32 = 0o3 ; // Mask for access modes
27
28
28
29
// ===== File Creation and Status Flags =====
30
+ // Source: include/linux/coda.h
29
31
pub const O_CREAT : i32 = 0o100 ; // Create file if it doesn't exist
30
32
pub const O_EXCL : i32 = 0o200 ; // Error if O_CREAT and file exists
31
33
pub const O_NOCTTY : i32 = 0o400 ; // Don't assign controlling terminal
@@ -53,6 +55,7 @@ pub const S_IWOTH: u32 = 0o002; // Others write
53
55
pub const S_IXOTH : u32 = 0o001 ; // Others execute
54
56
55
57
//Commands for FCNTL
58
+ // Source: include/linux/fcntl.h
56
59
pub const F_DUPFD : i32 = 0 ;
57
60
pub const F_GETFD : i32 = 1 ;
58
61
pub const F_SETFD : i32 = 2 ;
@@ -77,6 +80,7 @@ pub const FIONBIO: u32 = 21537;
77
80
pub const FIOASYNC : u32 = 21586 ;
78
81
79
82
//File types for open/stat etc.
83
+ // Source: include/linux/stat.h
80
84
pub const S_IFBLK : i32 = 0o60000 ;
81
85
pub const S_IFCHR : i32 = 0o20000 ;
82
86
pub const S_IFDIR : i32 = 0o40000 ;
@@ -97,11 +101,12 @@ pub const MAP_ANONYMOUS: u32 = 32;
97
101
pub const MAP_HUGE_SHIFT : i32 = 26 ;
98
102
pub const MAP_HUGETLB : i32 = 262144 ;
99
103
100
-
104
+ // Source: include/linux/fs.h
101
105
pub const SEEK_SET : i32 = 0 ; // Seek from beginning of file
102
106
pub const SEEK_CUR : i32 = 1 ; // Seek from current position
103
107
pub const SEEK_END : i32 = 2 ; // Seek from end of file
104
108
109
+ // Source: include/linux/ipc.h
105
110
pub const IPC_PRIVATE : i32 = 0o0 ;
106
111
pub const IPC_CREAT : i32 = 0o1000 ;
107
112
pub const IPC_EXCL : i32 = 0o2000 ;
@@ -110,6 +115,7 @@ pub const IPC_RMID: i32 = 0;
110
115
pub const IPC_SET : i32 = 1 ;
111
116
pub const IPC_STAT : i32 = 2 ;
112
117
118
+ // Source: linux/bits/shm.h
113
119
pub const SHM_DEST : i32 = 0o1000 ; // Destroy segment when last process detaches
114
120
pub const SHM_LOCKED : i32 = 0o2000 ; // Lock segment in memory
115
121
pub const SHM_HUGETLB : i32 = 0o4000 ; // Use huge TLB pages
0 commit comments