Skip to content

Commit ef31fb9

Browse files
feat: added source before constants
1 parent 8d1e3e2 commit ef31fb9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/RawPOSIX/src/constants/fs_constants.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ pub const STDOUT_FILENO: i32 = 1; // File descriptor for standard output
1010
pub const STDERR_FILENO: i32 = 2; // File descriptor for standard error
1111

1212
// ===== 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;
1415

1516
// ===== File Access Permission Flags =====
1617
pub const F_OK: u32 = 0; // Test for existence
@@ -26,6 +27,7 @@ pub const O_RDWR: i32 = 0o2; // Open read-write
2627
pub const O_RDWRFLAGS: i32 = 0o3; // Mask for access modes
2728

2829
// ===== File Creation and Status Flags =====
30+
// Source: include/linux/coda.h
2931
pub const O_CREAT: i32 = 0o100; // Create file if it doesn't exist
3032
pub const O_EXCL: i32 = 0o200; // Error if O_CREAT and file exists
3133
pub const O_NOCTTY: i32 = 0o400; // Don't assign controlling terminal
@@ -53,6 +55,7 @@ pub const S_IWOTH: u32 = 0o002; // Others write
5355
pub const S_IXOTH: u32 = 0o001; // Others execute
5456

5557
//Commands for FCNTL
58+
// Source: include/linux/fcntl.h
5659
pub const F_DUPFD: i32 = 0;
5760
pub const F_GETFD: i32 = 1;
5861
pub const F_SETFD: i32 = 2;
@@ -77,6 +80,7 @@ pub const FIONBIO: u32 = 21537;
7780
pub const FIOASYNC: u32 = 21586;
7881

7982
//File types for open/stat etc.
83+
// Source: include/linux/stat.h
8084
pub const S_IFBLK: i32 = 0o60000;
8185
pub const S_IFCHR: i32 = 0o20000;
8286
pub const S_IFDIR: i32 = 0o40000;
@@ -97,11 +101,12 @@ pub const MAP_ANONYMOUS: u32 = 32;
97101
pub const MAP_HUGE_SHIFT: i32 = 26;
98102
pub const MAP_HUGETLB: i32 = 262144;
99103

100-
104+
// Source: include/linux/fs.h
101105
pub const SEEK_SET: i32 = 0; // Seek from beginning of file
102106
pub const SEEK_CUR: i32 = 1; // Seek from current position
103107
pub const SEEK_END: i32 = 2; // Seek from end of file
104108

109+
// Source: include/linux/ipc.h
105110
pub const IPC_PRIVATE: i32 = 0o0;
106111
pub const IPC_CREAT: i32 = 0o1000;
107112
pub const IPC_EXCL: i32 = 0o2000;
@@ -110,6 +115,7 @@ pub const IPC_RMID: i32 = 0;
110115
pub const IPC_SET: i32 = 1;
111116
pub const IPC_STAT: i32 = 2;
112117

118+
// Source: linux/bits/shm.h
113119
pub const SHM_DEST: i32 = 0o1000; // Destroy segment when last process detaches
114120
pub const SHM_LOCKED: i32 = 0o2000; // Lock segment in memory
115121
pub const SHM_HUGETLB: i32 = 0o4000; // Use huge TLB pages

0 commit comments

Comments
 (0)