azathoth_core/os/linux/consts.rs
1
2/// Load all symbols immediately (`dlopen` flag).
3pub const RTLD_NOW: i32 = 0x00002;
4
5/// Lazy-load symbols as they are used (`dlopen` flag).
6pub const RTLD_LAZY: i32 = 1;
7/// Program header type: Loadable segment.
8pub const PT_LOAD: u32 = 1;
9
10/// Program header type: Dynamic linking information segment.
11pub const PT_DYNAMIC: u32 = 2;
12
13/// Initialize cURL with SSL support.
14pub const CURL_GLOBAL_SSL: u64 = 1 << 0;
15
16/// Initialize cURL with Windows-specific socket support (no-op on Linux).
17pub const CURL_GLOBAL_WIN32: u64 = 1 << 1;
18
19/// Initialize cURL with all common features enabled (SSL + Win32).
20pub const CURL_GLOBAL_ALL: u64 = CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32;
21
22/// cURL option: Specify custom write data pointer.
23pub const CURLOPT_WRITEDATA: u32 = 10001;
24
25/// cURL option: Set the target URL for the request.
26pub const CURLOPT_URL: u32 = 10002;
27
28/// cURL option: Provide a custom write callback function.
29pub const CURLOPT_WRITEFUNCTION: u32 = 20011;
30
31/// cURL option: Set a custom User-Agent string for the request.
32pub const CURLOPT_USERAGENT: u32 = 10018;
33
34/// GZIP file magic number (first two bytes).
35pub const GZIP_MAGIC: [u8; 2] = [0x1f, 0x8b];
36
37/// Zlib-compressed data magic byte (first byte).
38pub const ZLIB_MAGIC: u8 = 0x78;
39
40/// File permission: Read access for the file owner.
41pub const S_IRUSR: u16 = 0o400;
42
43/// File permission: Write access for the file owner.
44pub const S_IWUSR: u16 = 0o200;
45
46/// File permission: Execute/search access for the file owner.
47pub const S_IXUSR: u16 = 0o100;
48
49/// Open file read-only flag.
50pub const O_RDONLY: usize = 0;
51
52/// File descriptor for standard output (`stdout`).
53pub const STDOUT: usize = 1;
54
55/// File descriptor for standard error (`stderr`).
56pub const STDERR: usize = 2;
57
58/// Memory protection flag: Readable memory region.
59pub const PROT_READ: i32 = 1;
60
61/// Memory protection flag: Executable memory region.
62pub const PROT_EXEC: i32 = 4;
63
64/// Memory protection flag: Writable memory region.
65pub const PROT_WRITE: i32 = 2;
66
67/// Mapping flag: Map memory that is not backed by a file (anonymous mapping).
68pub const MAP_ANONYMOUS: i32 = 0x20;
69
70/// Mapping flag: Create a private copy-on-write mapping.
71pub const MAP_PRIVATE: i32 = 2;
72
73/// Flag for `mremap`: Allow relocation of the memory region if necessary.
74pub const MREMAP_MAYMOVE: i32 = 1;
75
76/// Signal number for abnormal process termination (abort).
77pub const SIG_ABRT: usize = 134;
78
79/// Linux syscall number for `write`.
80pub const SYS_WRITE: usize = 1;
81
82/// Linux syscall number for `mmap`.
83pub const SYS_MMAP: usize = 9;
84
85/// Linux syscall number for `munmap`.
86pub const SYS_MUNMAP: usize = 11;
87
88/// Linux syscall number for `close`.
89pub const SYS_CLOSE: usize = 3;
90
91/// Linux syscall number for `getdents64` (read directory entries).
92pub const SYS_GETDENTS64: usize = 217;
93
94/// Linux syscall number for `open`.
95pub const SYS_OPEN: usize = 2;
96
97/// Linux syscall number for `read`.
98pub const SYS_READ: usize = 0;
99
100/// Linux syscall number for `lseek`.
101pub const SYS_LSEEK: usize = 8;
102
103/// Linux syscall number for `pread64` (read at offset).
104pub const SYS_PREAD64: usize = 17;
105
106/// Linux syscall number for `mremap` (resize/move memory mapping).
107pub const SYS_MREMAP: usize = 25;
108
109/// Linux syscall number for `exit`.
110pub const SYS_EXIT: usize = 60;
111
112/// Linux syscall number for `exit_group` (terminate all threads).
113pub const SYS_EXIT_GROUP: usize = 231;
114
115/// Move the file offset to the end of the file.
116pub const SEEK_END: usize = 2;