strat9_syscall/flag.rs
1pub use strat9_abi::flag::{posix_oflags_to_strat9, CallFlags, MapFlags, OpenFlags, UnlinkFlags};
2
3// ============================================================================
4// POSIX O_* constants for open()
5// ============================================================================
6
7/// Open for reading only
8pub const O_RDONLY: u32 = 0o000000;
9/// Open for writing only
10pub const O_WRONLY: u32 = 0o000001;
11/// Open for reading and writing
12pub const O_RDWR: u32 = 0o000002;
13/// Create file if it does not exist
14pub const O_CREAT: u32 = 0o000100;
15/// Truncate file to zero length if it exists
16pub const O_TRUNC: u32 = 0o001000;
17/// Create file exclusively (with O_CREAT)
18pub const O_EXCL: u32 = 0o000200;
19/// Append to file (writes always go to end)
20pub const O_APPEND: u32 = 0o002000;
21/// Non-blocking mode
22pub const O_NONBLOCK: u32 = 0o004000;
23/// Don't follow symbolic links
24/// F8 FIX (testing-findings.md): was 0o100000, which is O_CLOEXEC on Linux!
25/// Linux x86_64: O_NOFOLLOW = 0o400000.
26pub const O_NOFOLLOW: u32 = 0o400000;
27/// Open directory only
28pub const O_DIRECTORY: u32 = 0o200000;
29/// Don't assign controlling terminal
30/// F8 FIX (found by the golden-value test): was 0o400000 (= O_NOFOLLOW on
31/// Linux!). Linux x86_64: O_NOCTTY = 0o000400.
32pub const O_NOCTTY: u32 = 0o000400;
33/// Synchronized I/O (data + metadata)
34pub const O_SYNC: u32 = 0o4010000;
35/// Synchronized I/O data integrity
36/// F8 FIX: was 0o02000000 = O_CLOEXEC on Linux! Linux x86_64: 0o10000.
37pub const O_DSYNC: u32 = 0o10000;
38/// Synchronized I/O read operations (Linux defines O_RSYNC == O_SYNC on x86_64)
39pub const O_RSYNC: u32 = 0o4010000;
40/// Access mask for read/write mode
41pub const O_ACCMODE: u32 = 0o3;