code wiki / (root) / nx_fcntl.nx

nx_fcntl.nx

buildroot/runtime/nx_fcntl.nx

6483 B166 linesdepth 3pulls 3 transitivereach 982 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_fcntl.nx -- fcntl(2) + open-flag constants. The existing fs.nx + sys_openat in syscalls.nx open files with minimal flag awareness. Real callers need to pick read/write/ create/append/truncate/sync/cloexec semantics, set close-on-exec on existing fds, mark fds nonblocking, query / change file descriptor flags. This module provides the constants + a thin wrapper around the fcntl(2) syscall (number 25 on RV64). Pairs with fs.nx + nx_proc (so children don't inherit FD_CLOEXEC fds across exec).

dependencies 1 imports · 23 importers

syscalls.nx nx_fcntl.nx _si_walk_probe.nx nx_bundle_gen.nx nx_connect.nx nx_connect_gate.nx nx_corpus_to_meta.nx nx_dedup_audit.nx nx_dir.nx nx_dirent.nx nx_emit_journal.nx nx_fcntl_probe.nx

diagram shows first 10 each side; +0 more imports, +13 more importers in the complete lists below.

imports: syscalls.nx

imported by: _si_walk_probe.nxnx_bundle_gen.nxnx_connect.nxnx_connect_gate.nxnx_corpus_to_meta.nxnx_dedup_audit.nxnx_dir.nxnx_dirent.nxnx_emit_journal.nxnx_fcntl_probe.nxnx_fcntlprobe.nxnx_gate_baseline_sweep.nxnx_gate_mutation_sweep.nxnx_macroprobe.nxnx_pipe.nxnx_primitive_synth.nxnx_sensor_gap_census.nxnx_sovereign_format_census.nxnx_substrate_diagram.nxnx_substrate_diagram_ascii.nxnx_substrate_evolve.nxnx_template_instantiate.nxnx_wall_scan_native.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_dup nx_fcntl

structs

none

consts

24const NX_O_RDONLY: i64 = 0x0
25const NX_O_WRONLY: i64 = 0x1
26const NX_O_RDWR: i64 = 0x2
27const NX_O_CREAT: i64 = 0x40
28const NX_O_EXCL: i64 = 0x80
29const NX_O_TRUNC: i64 = 0x200
30const NX_O_APPEND: i64 = 0x400
31const NX_O_NONBLOCK: i64 = 0x800
32const NX_O_SYNC: i64 = 0x101000
33const NX_O_DIRECTORY: i64 = 0x10000
34const NX_O_CLOEXEC: i64 = 0x80000
37const NX_F_DUPFD: i64 = 0
38const NX_F_GETFD: i64 = 1
39const NX_F_SETFD: i64 = 2
40const NX_F_GETFL: i64 = 3
41const NX_F_SETFL: i64 = 4
42const NX_F_DUPFD_CLOEXEC: i64 = 1030
45const NX_FD_CLOEXEC: i64 = 1
51const NX_AT_FDCWD: i64 = 0xFFFFFFFFFFFFFF9C
59const NX_SYS_FCNTL: i64 = 72
60const NX_SYS_OPENAT: i64 = 257
61const NX_SYS_DUP: i64 = 32
62const NX_SYS_DUP3: i64 = 292
75const NX_SYS_FCNTL: i64 = 72
76const NX_SYS_OPENAT: i64 = 56
77const NX_SYS_DUP: i64 = 23
78const NX_SYS_DUP3: i64 = 24

functions

82func nx_fcntl(fd: i64, cmd: i64, arg: i64) -> i64
87func nx_fcntl_set_cloexec(fd: i64) -> i64
calls 1: nx_fcntl
94func nx_fcntl_set_nonblock(fd: i64) -> i64
calls 1: nx_fcntl
101func nx_dup(oldfd: i64) -> i64
called by 1: main
107func nx_dup3(oldfd: i64, newfd: i64, flags: i64) -> i64
114func nx_openat(dirfd: i64, path: *u8, flags: i64, mode: i64) -> i64
119func nx_open_rd(path: *u8) -> i64
called by 3: mainlh2_harvest_dirmain calls 1: nx_openat
124func nx_open_wr(path: *u8) -> i64
129func nx_open_append(path: *u8) -> i64
calls 1: nx_openat
135func main() -> i64
calls 2: nx_dupnx_fcntl