code wiki / (root) / nx_syscalls.nx

nx_syscalls.nx

buildroot/runtime/nx_syscalls.nx

41870 B869 linesdepth 1pulls 1 transitivereach 17702 importersview sourcekind librarytopic syscalls
docsdependenciesstructsconstsfunctions

about

syscalls.nx -- thin __syscall wrappers used across modules. Sovereign path: no libc. Every memory allocation, file op, and clock read in the rest of the runtime routes through one of these helpers. Numbers match Linux RV64; NishiOS uses the same set. Extracted from runtime.nx and ir.nx's copy-pasted helpers so the module-import build doesn't produce duplicate symbols.

dependencies 1 imports · 14553 importers

nx_tier.nx nx_syscalls.nx _4kpage_gate.nx _ab_mk_erf.nx _ad_gate.nx _aes128_gcm_throughput_bench.nx _ale_agent_gate.nx _ale_aggregate_gate.nx _ale_exec_gate.nx _ale_format_gate.nx _ale_grade_gate.nx _ale_plan_gate.nx

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

imports: nx_tier.nx

imported by: _4kpage_gate.nx_ab_mk_erf.nx_ad_gate.nx_aes128_gcm_throughput_bench.nx_ale_agent_gate.nx_ale_aggregate_gate.nx_ale_exec_gate.nx_ale_format_gate.nx_ale_grade_gate.nx_ale_plan_gate.nx_ale_verify_gate.nx_an_honest.nx_an_score_test.nx_andor_probe.nx_ar2_minrepro.nx_ar2_perf_probe.nx_arg7_minrepro.nx_arg9_delegate_probe.nx_ark_gate_authored.nx_ark_gate_test.nx_assign_next_gate_authored.nx_attn_exp_hoist_gate.nx_authored.nx_autograd_authored.nx_autonomy_meter_gate_authored.nx_bf_atan_gate_authored.nx_bf_erf_gate_authored.nx_bf_erfc_oracle_gate.nx_bf_gamma_gate_authored.nx_bf_pow_gate_authored.nx_bf_regen_gate_authored.nx_bf_sinhcosh_gate_authored.nx_bf_tan_gate_authored.nx_bf_trig_gate_authored.nx_bitreader_authored.nx_bits_rotr64_kat.nx_bm25_rank_authored.nx_boot_stub_gate.nx_bpe_vocab_authored.nx_bs_poison.nx_cbz_list_authored.nx_cegis_authored.nx_cegis_bitfield.nx_cegis_clamp.nx_cegis_validator.nx_census_run_gate_authored.nx_cl_probe.nx_cl_probe2.nx_claude_ch_census.nx_claude_jpeg_census.nx_claude_meter_authored.nx_claude_novel_lane.nx_clksched_probe.nx_cn_fetch.nx_cn_fetch_test.nx_cn_flow.nx_cn_flow_test.nx_cn_jam.nx_cn_jam_test.nx_codec_bench.nx_codec_bench2.nx_codec_bench_med.nx_codec_real_med.nx_cond_healed.nx_constarg_probe.nx_coopsched_gate.nx_csv_field_authored.nx_ctxsw_gate.nx_dcb_probe2.nx_debolt_gate.nx_derefcast_minrepro.nx_dfl_comp_test.nx_dfl_enc_gate.nx_dfl_rtgate.nx_dfl_rtgate_sa.nx_dfl_rtgate_sa_test.nx_dfl_rtgate_test.nx_dfl_specgate.nx_dfl_specgate_test.nx_dga0.nx_dga1.nx_dga10.nx_dga11.nx_dga2.nx_dga3.nx_dga4.nx_dga5.nx_dga6.nx_dga7.nx_dga8.nx_dga9.nx_dgb0.nx_dgb1.nx_dgb10.nx_dgb11.nx_dgb2.nx_dgb3.nx_dgb4.nx_dgb5.nx_dgb6.nx +14453 more (shown cap 100 declared)

structs

none

consts

18const SYS_MAGIC_1024: i64 = 1024
19const SYS_MAGIC_1000000: i64 = 1000000
20const SYS_MAGIC_4294967296: i64 = 4294967296
21const SYS_MAGIC_100000: i64 = 100000
39const SYS_READ: i64 = 0
40const SYS_WRITE: i64 = 1
41const SYS_CLOSE: i64 = 3
42const SYS_LSEEK: i64 = 8
43const SYS_OPENAT: i64 = 257
44const SYS_EXIT: i64 = 60
45const SYS_MMAP: i64 = 9
46const SYS_CLOCK_GETTIME: i64 = 228
47const SYS_IOCTL: i64 = 16
48const SYS_CLOCK_NANOSLEEP: i64 = 230
52const SYS_CHROOT: i64 = 161
53const SYS_MOUNT: i64 = 165
54const SYS_UNSHARE: i64 = 272
55const SYS_GETUID: i64 = 102
56const SYS_GETGID: i64 = 104
57const SYS_POLL: i64 = 7
61const SYS_READ: i64 = 63
62const SYS_WRITE: i64 = 64
63const SYS_CLOSE: i64 = 57
64const SYS_LSEEK: i64 = 62
65const SYS_OPENAT: i64 = 56
66const SYS_EXIT: i64 = 93
67const SYS_MMAP: i64 = 222
68const SYS_CLOCK_GETTIME: i64 = 113
69const SYS_IOCTL: i64 = 29
70const SYS_CLOCK_NANOSLEEP: i64 = 115
77const SYS_CHROOT: i64 = 51
78const SYS_MOUNT: i64 = 40
79const SYS_UNSHARE: i64 = 97
80const SYS_GETUID: i64 = 174
81const SYS_GETGID: i64 = 176
82const SYS_POLL: i64 = 73
134const AT_FDCWD: i64 = -100
229const O_RDONLY: i64 = 0
230const O_WRONLY_CT: i64 = 0x241 // O_CREAT | O_WRONLY | O_TRUNC
231const O_WRONLY_CA: i64 = 0x441 // O_CREAT | O_WRONLY | O_APPEND
239const O_RDWR_CREATE: i64 = 0x42
315const SYS_LOCK_SH: i64 = 1
316const SYS_LOCK_EX: i64 = 2
317const SYS_LOCK_NB: i64 = 4
318const SYS_LOCK_UN: i64 = 8
374const RLIMIT_CPU: i64 = 0
375const RLIMIT_AS: i64 = 9
376const WNOHANG: i64 = 1
458const SYS_CLONE: i64 = 56
459const SYS_EXECVE: i64 = 59
460const SYS_WAIT4: i64 = 61
461const SYS_PIPE2: i64 = 293
462const SYS_DUP3: i64 = 292
466const SYS_CLONE: i64 = 220
467const SYS_EXECVE: i64 = 221
468const SYS_WAIT4: i64 = 260
469const SYS_PIPE2: i64 = 59
470const SYS_DUP3: i64 = 24
476const CLONE_VM: i64 = 0x00000100
477const CLONE_VFORK: i64 = 0x00004000
478const SIGCHLD: i64 = 17
622const SYS_GETDENTS64: i64 = 217
625const SYS_GETDENTS64: i64 = 61
628const DT_UNKNOWN: i64 = 0
629const DT_FIFO: i64 = 1
630const DT_CHR: i64 = 2
631const DT_DIR: i64 = 4
632const DT_BLK: i64 = 6
633const DT_REG: i64 = 8
634const DT_LNK: i64 = 10
635const DT_SOCK: i64 = 12
770const SYS_SOCKET: i64 = 41
771const SYS_BIND: i64 = 49
772const SYS_LISTEN: i64 = 50
773const SYS_ACCEPT: i64 = 43
774const SYS_CONNECT: i64 = 42
775const SYS_SETSOCKOPT: i64 = 54
776const SYS_SENDTO: i64 = 44
777const SYS_RECVFROM: i64 = 45
778const SYS_SHUTDOWN: i64 = 48
782const SYS_SOCKET: i64 = 198
783const SYS_BIND: i64 = 200
784const SYS_LISTEN: i64 = 201
785const SYS_ACCEPT: i64 = 202
786const SYS_CONNECT: i64 = 203
787const SYS_SETSOCKOPT: i64 = 208
788const SYS_SENDTO: i64 = 206
789const SYS_RECVFROM: i64 = 207
790const SYS_SHUTDOWN: i64 = 210
794const SOL_SOCKET: i64 = 1
795const SO_REUSEADDR: i64 = 2
800const SO_SNDTIMEO: i64 = 21
801const SO_RCVTIMEO: i64 = 20
829const SYS_ALARM: i64 = 37
832const AF_INET: i64 = 2
833const SOCK_STREAM: i64 = 1
834const SOCK_DGRAM: i64 = 2

functions

85func sys_ioctl(fd: i64, request: i64, arg: i64) -> i64
96func sys_poll(fds: *u8, nfds: i64, timeout_ms: i64) -> i64
102func sys_write(fd: i64, buf: *u8, count: i64) -> i64
called by 12780: g_pg_fpg_fng_pg_fpg_fn+12774
106func sys_read(fd: i64, buf: *u8, count: i64) -> i64
110func sys_close(fd: i64) -> i64
120func sys_chdir(path: *u8) -> i64
139func sys_unlinkat(path: *u8) -> i64
146func sys_fchmodat(path: *u8, mode: i64) -> i64
called by 2: eq_buildg_chmod calls 1: sys_mmap
162func sys_exit_group(code: i64) -> i64
179func sys_setpriority(prio: i64) -> i64
called by 1: main
187func sys_setpriority_of(pid: i64, prio: i64) -> i64
called by 1: main
196func sys_munmap(addr: *u8, len: i64) -> i64
202func sys_lseek(fd: i64, offset: i64, whence: i64) -> i64
206func sys_exit(code: i64) -> i64
212func sys_mmap(size: i64) -> *u8
called by 20939: g_fng_runmainnx_f64_erfg_fng_run+20933
221func sys_mmap_shared(size: i64) -> *u8
233func sys_openat_rd(path: *u8) -> i64
240func sys_openat_rdwr(path: *u8, mode: i64) -> i64
244func sys_openat_wr(path: *u8, mode: i64) -> i64
251func sys_openat_append(path: *u8, mode: i64) -> i64
called by 1457: mainmainmainmainmainmain+1451
259func sys_symlinkat(target: *u8, linkpath: *u8) -> i64
271func sys_readlinkat(path: *u8, buf: *u8, cap: i64) -> i64
288func sys_renameat(oldpath: *u8, newpath: *u8) -> i64
called by 182: mainmainmainmainmainak_snap+176
301func sys_fsync(fd: i64) -> i64
319func sys_flock(fd: i64, op: i64) -> i64
327func sys_fstatat(path: *u8, statbuf: *u8) -> i64
334func sys_utimensat(path: *u8, times: *i64) -> i64
353func nx_kill(pid: i64, sig: i64) -> i64 { return __syscall(129, pid, sig, 0, 0, 0, 0) }
367func nx_prlimit(pid: i64, resource: i64, new_limit: *u8, old_limit: *u8) -> i64
379func sys_mkdir(path: *u8, mode: i64) -> i64 { return __syscall(34, AT_FDCWD, path, mode, 0, 0, 0) }
called by 251: mainmainmainmainmainmain+245
382func nx_chmod(path: *u8, mode: i64) -> i64 { return __syscall(53, AT_FDCWD, path, mode, 0, 0, 0) }
386func nx_setsid() -> i64 { return __syscall(112, 0, 0, 0, 0, 0, 0) }
390func sys_clock_gettime_mono(ts: *i64) -> i64
398func sys_clock_gettime_real(ts: *i64) -> i64
403func sys_now_realtime_sec() -> i64
410func sys_now_realtime_ms() -> i64
419func sys_now_ms() -> i64
430func sys_now_us() -> i64
441func sys_clock_now_us() -> i64
called by 20: mainmainmainmainmainmain+14 calls 1: sys_now_us
491func sys_unshare(flags: i64) -> i64
494func sys_mount(source: *u8, target: *u8, fs_type: *u8, mountflags: i64, data: *u8) -> i64
497func sys_chroot(path: *u8) -> i64
500func sys_getuid() -> i64
called by 1: main
503func sys_getgid() -> i64
called by 1: main
507func sys_fork() -> i64
525func sys_execve_clean(path: *u8, argv: *i64, envp: *i64) -> i64
531func sys_execve(path: *u8, argv: *i64, envp: *i64) -> i64
540func sys_wait4(pid: i64, status: *i64, options: i64) -> i64
546func wait_exit_code(status: i64) -> i64
554func wait_term_signal(status: i64) -> i64
called by 1: main
575func sys_default_signal(sig: i64) -> i64
584func sys_ignore_sigpipe() -> i64
599func sys_pipe2(fds: *i64, flags: i64) -> i64
605func sys_dup3(oldfd: i64, newfd: i64, flags: i64) -> i64
639func sys_getdents64(fd: i64, buf: *u8, buf_len: i64) -> i64
645func dirent_reclen(rec: *u8) -> i64
652func dirent_type(rec: *u8) -> i64
657func dirent_name(rec: *u8) -> *u8
664func sys_read_file(path: *u8, out_len: *i64) -> *u8
704func sys_map_file(path: *u8, out_len: *i64) -> *u8
722func sys_sleep_ms(ms: i64) -> i64
806func sys_setsockopt(fd: i64, level: i64, optname: i64,
called by 124: mainmainmainmainmainmain+118
816func sys_set_socket_timeout(fd: i64, secs: i64) -> i64
830func sys_alarm(secs: i64) -> i64 { return __syscall(SYS_ALARM, secs, 0, 0, 0, 0, 0) }
called by 2: mainmain
836func sys_socket(domain: i64, sock_type: i64, protocol: i64) -> i64
called by 338: mainmainmainmainmainmain+332
839func sys_bind(fd: i64, addr: *u8, addr_len: i64) -> i64
called by 127: mainmainmainmainmainmain+121
842func sys_listen(fd: i64, backlog: i64) -> i64
called by 116: mainmainmainmainmainmain+110
849func sys_accept(fd: i64) -> i64
called by 96: mainmainmainmainmainmain+90
852func sys_accept_with_addr(fd: i64, addr: *u8, addr_len: *i64) -> i64
856func sys_shutdown(fd: i64, how: i64) -> i64
859func sys_connect(fd: i64, addr: *u8, addr_len: i64) -> i64
862func sys_sendto(fd: i64, buf: *u8, n: i64, flags: i64,
866func sys_recvfrom(fd: i64, buf: *u8, n: i64, flags: i64,