interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / libc / src / new / qurt / fcntl.rs

51 lines · 1339 bytes Raw Blame History
1//! Header: `fcntl.h`
2
3use super::*;
4use crate::prelude::*;
5
6// File access modes
7pub const O_RDONLY: c_int = 0x0000;
8pub const O_WRONLY: c_int = 0x0001;
9pub const O_RDWR: c_int = 0x0002;
10pub const O_ACCMODE: c_int = 0x0003;
11
12// File creation flags
13pub const O_CREAT: c_int = 0x0040;
14pub const O_EXCL: c_int = 0x0080;
15pub const O_NOCTTY: c_int = 0x0100;
16pub const O_TRUNC: c_int = 0x0200;
17
18// File status flags
19pub const O_APPEND: c_int = 0x0400;
20pub const O_NONBLOCK: c_int = 0x0800;
21pub const O_SYNC: c_int = 0x1000;
22pub const O_FSYNC: c_int = O_SYNC;
23pub const O_DSYNC: c_int = 0x1000;
24pub const O_DIRECTORY: c_int = 0x10000;
25pub const O_NOFOLLOW: c_int = 0x20000;
26pub const O_CLOEXEC: c_int = 0x80000;
27
28// fcntl() commands
29pub const F_DUPFD: c_int = 0;
30pub const F_GETFD: c_int = 1;
31pub const F_SETFD: c_int = 2;
32pub const F_GETFL: c_int = 3;
33pub const F_SETFL: c_int = 4;
34pub const F_GETLK: c_int = 5;
35pub const F_SETLK: c_int = 6;
36pub const F_SETLKW: c_int = 7;
37pub const F_DUPFD_CLOEXEC: c_int = 1030;
38
39// File descriptor flags
40pub const FD_CLOEXEC: c_int = 1;
41
42// Lock types for fcntl()
43pub const F_RDLCK: c_int = 0;
44pub const F_WRLCK: c_int = 1;
45pub const F_UNLCK: c_int = 2;
46
47// Functions
48extern "C" {
49 pub fn open(pathname: *const c_char, flags: c_int, ...) -> c_int;
50 pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int;
51}