Skip to main content

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
24pub const O_NOFOLLOW: u32 = 0o100000;
25/// Open directory only
26pub const O_DIRECTORY: u32 = 0o200000;
27/// Don't assign controlling terminal
28pub const O_NOCTTY: u32 = 0o400000;
29/// Synchronized I/O (data + metadata)
30pub const O_SYNC: u32 = 0o4010000;
31/// Synchronized I/O data integrity
32pub const O_DSYNC: u32 = 0o02000000;
33/// Synchronized I/O read operations
34pub const O_RSYNC: u32 = 0o04010000;
35/// Access mask for read/write mode
36pub const O_ACCMODE: u32 = 0o3;