nx_syscalls_mapping_candidate_t181.nx
buildroot/runtime/nx_syscalls_mapping_candidate_t181.nx
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 · 0 importers
imports: nx_tier.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 18 | const SYS_MAGIC_1024: i64 = 1024 |
| 19 | const SYS_MAGIC_1000000: i64 = 1000000 |
| 20 | const SYS_MAGIC_4294967296: i64 = 4294967296 |
| 22 | const SYS_READ_GROW_INIT: i64 = 65536 |
| 23 | const SYS_MAGIC_100000: i64 = 100000 |
| 41 | const SYS_READ: i64 = 0 |
| 42 | const SYS_WRITE: i64 = 1 |
| 43 | const SYS_CLOSE: i64 = 3 |
| 44 | const SYS_LSEEK: i64 = 8 |
| 45 | const SYS_OPENAT: i64 = 257 |
| 46 | const SYS_EXIT: i64 = 60 |
| 47 | const SYS_MMAP: i64 = 9 |
| 48 | const SYS_CLOCK_GETTIME: i64 = 228 |
| 49 | const SYS_IOCTL: i64 = 16 |
| 50 | const SYS_CLOCK_NANOSLEEP: i64 = 230 |
| 54 | const SYS_CHROOT: i64 = 161 |
| 55 | const SYS_MOUNT: i64 = 165 |
| 56 | const SYS_UNSHARE: i64 = 272 |
| 57 | const SYS_GETUID: i64 = 102 |
| 58 | const SYS_GETGID: i64 = 104 |
| 59 | const SYS_POLL: i64 = 7 |
| 63 | const SYS_READ: i64 = 63 |
| 64 | const SYS_WRITE: i64 = 64 |
| 65 | const SYS_CLOSE: i64 = 57 |
| 66 | const SYS_LSEEK: i64 = 62 |
| 67 | const SYS_OPENAT: i64 = 56 |
| 68 | const SYS_EXIT: i64 = 93 |
| 69 | const SYS_MMAP: i64 = 222 |
| 70 | const SYS_CLOCK_GETTIME: i64 = 113 |
| 71 | const SYS_IOCTL: i64 = 29 |
| 72 | const SYS_CLOCK_NANOSLEEP: i64 = 115 |
| 79 | const SYS_CHROOT: i64 = 51 |
| 80 | const SYS_MOUNT: i64 = 40 |
| 81 | const SYS_UNSHARE: i64 = 97 |
| 82 | const SYS_GETUID: i64 = 174 |
| 83 | const SYS_GETGID: i64 = 176 |
| 84 | const SYS_POLL: i64 = 73 |
| 142 | const SYS_PATH_MAX: i64 = 4096 // Linux PATH_MAX; getcwd returns -ERANGE below it |
| 146 | const MODE_0755: i64 = 0x1ed // rwxr-xr-x : default mode for a created directory |
| 161 | const AT_FDCWD: i64 = -100 |
| 266 | const NX_MO_RELAXED: i64 = 0 |
| 267 | const NX_MO_CONSUME: i64 = 1 |
| 268 | const NX_MO_ACQUIRE: i64 = 2 |
| 269 | const NX_MO_RELEASE: i64 = 3 |
| 270 | const NX_MO_ACQ_REL: i64 = 4 |
| 271 | const NX_MO_SEQ_CST: i64 = 5 |
| 273 | const NXA_SMALL_MAX: i64 = 256 |
| 274 | const NXA_CHUNK: i64 = 262144 |
| 275 | const NXA_ALIGN: i64 = 16 |
| 276 | const NXA_GAP: i64 = 16 |
| 277 | const NXA_STATE: i64 = 4096 |
| 283 | const NXA_RING: i64 = 128 |
| 284 | const NXA_RBASE: i64 = 64 |
| 319 | const NXA_LOCK: i64 = 4 |
| 327 | const NXA_LOCK_WARN: i64 = NXA_RING * 8 |
| 331 | const NXA_LOCK_WARNED: i64 = 5 |
| 333 | const NXA_CHUNKBASE: i64 = 320 |
| 334 | const NXA_CHUNKMAX: i64 = 192 |
| 355 | const NXA_MAP_INVALID:i64=0-22 // Linux EINVAL, a protocol value rather than a resource budget. |
| 407 | const SYS_STATFS_X86_MEASURED: i64 = 137 |
| 408 | const STATFS_BUF_BYTES: i64 = 144 |
| 409 | const STATFS_I_BSIZE: i64 = 1 |
| 410 | const STATFS_I_BLOCKS: i64 = 2 |
| 411 | const STATFS_I_BAVAIL: i64 = 4 |
| 412 | const STATFS_PERMIL: i64 = 1000 |
| 413 | const STATFS_ERR: i64 = 0 - 1 |
| 758 | const O_RDONLY: i64 = 0 |
| 759 | const O_WRONLY_CT: i64 = 0x241 // O_CREAT | O_WRONLY | O_TRUNC |
| 760 | const O_WRONLY_CA: i64 = 0x441 // O_CREAT | O_WRONLY | O_APPEND |
| 768 | const O_RDWR_CREATE: i64 = 0x42 |
| 789 | const MODE_0644: i64 = 0x1a4 // rw-r--r-- : default mode for a generated artifact |
| 794 | const MODE_0755: i64 = 0x1ed |
| 807 | const ACCEPT_TMO_S: i64 = 30 |
| 814 | const O_WRONLY_CREATE_EXCLUSIVE: i64 = 0x1 | 0x40 | 0x80 |
| 820 | const O_DIRECTORY: i64 = 0x10000 |
| 834 | const O_CLOEXEC: i64 = 0x80000 |
| 835 | const O_NOFOLLOW: i64 = 0x20000 |
| 836 | const O_NONBLOCK: i64 = 0x800 |
| 837 | const MODE_0600: i64 = 0x180 |
| 902 | const SYS_LOCK_SH: i64 = 1 |
| 903 | const SYS_LOCK_EX: i64 = 2 |
| 904 | const SYS_LOCK_NB: i64 = 4 |
| 905 | const SYS_LOCK_UN: i64 = 8 |
| 950 | const SYS_SETPGID: i64 = 109 |
| 953 | const SYS_SETPGID: i64 = 154 |
| 976 | const RLIMIT_CPU: i64 = 0 |
| 977 | const RLIMIT_AS: i64 = 9 |
| 978 | const WNOHANG: i64 = 1 |
| 1072 | const SYS_CLONE: i64 = 56 |
| 1073 | const SYS_EXECVE: i64 = 59 |
| 1074 | const SYS_WAIT4: i64 = 61 |
| 1075 | const SYS_PIPE2: i64 = 293 |
| 1076 | const SYS_DUP3: i64 = 292 |
| 1080 | const SYS_CLONE: i64 = 220 |
| 1081 | const SYS_EXECVE: i64 = 221 |
| 1082 | const SYS_WAIT4: i64 = 260 |
| 1083 | const SYS_PIPE2: i64 = 59 |
| 1084 | const SYS_DUP3: i64 = 24 |
| 1090 | const CLONE_VM: i64 = 0x00000100 |
| 1091 | const CLONE_VFORK: i64 = 0x00004000 |
| 1092 | const SIGCHLD: i64 = 17 |
| 1142 | const NX_SYS_PRCTL: i64 = 167 |
| 1143 | const NX_PR_SET_PDEATHSIG: i64 = 1 |
| 1144 | const NX_PR_SET_CHILD_SUBREAPER: i64 = 36 |
| 1159 | const SYS_WAITID_PORTABLE: i64 = 95 |
| 1160 | const NX_WAIT_P_PID: i64 = 1 |
| 1161 | const NX_WAIT_EXITED: i64 = 4 |
| 1162 | const NX_WAIT_NOWAIT: i64 = 0x01000000 |
| 1163 | const NX_WAIT_SIGINFO_BYTES: i64 = 128 |
| 1170 | const NX_FD_DENT_BUFFER: i64 = 4096 |
| 1171 | const NX_SYS_CLOSE_RANGE: i64 = 436 // Linux x86_64 and asm-generic ABI |
| 1172 | const NX_FD_UINT_MAX: i64 = 4294967295 |
| 1344 | const SYS_GETDENTS64: i64 = 217 |
| 1347 | const SYS_GETDENTS64: i64 = 61 |
| 1350 | const DT_UNKNOWN: i64 = 0 |
| 1351 | const DT_FIFO: i64 = 1 |
| 1352 | const DT_CHR: i64 = 2 |
| 1353 | const DT_DIR: i64 = 4 |
| 1354 | const DT_BLK: i64 = 6 |
| 1355 | const DT_REG: i64 = 8 |
| 1356 | const DT_LNK: i64 = 10 |
| 1357 | const DT_SOCK: i64 = 12 |
| 1545 | const SYS_SOCKET: i64 = 41 |
| 1546 | const SYS_BIND: i64 = 49 |
| 1547 | const SYS_LISTEN: i64 = 50 |
| 1548 | const SYS_ACCEPT: i64 = 43 |
| 1549 | const SYS_CONNECT: i64 = 42 |
| 1550 | const SYS_SETSOCKOPT: i64 = 54 |
| 1551 | const SYS_SENDTO: i64 = 44 |
| 1552 | const SYS_RECVFROM: i64 = 45 |
| 1553 | const SYS_SHUTDOWN: i64 = 48 |
| 1557 | const SYS_SOCKET: i64 = 198 |
| 1558 | const SYS_BIND: i64 = 200 |
| 1559 | const SYS_LISTEN: i64 = 201 |
| 1560 | const SYS_ACCEPT: i64 = 202 |
| 1561 | const SYS_CONNECT: i64 = 203 |
| 1562 | const SYS_SETSOCKOPT: i64 = 208 |
| 1563 | const SYS_SENDTO: i64 = 206 |
| 1564 | const SYS_RECVFROM: i64 = 207 |
| 1565 | const SYS_SHUTDOWN: i64 = 210 |
| 1569 | const SOL_SOCKET: i64 = 1 |
| 1570 | const SO_REUSEADDR: i64 = 2 |
| 1575 | const SO_SNDTIMEO: i64 = 21 |
| 1576 | const SO_RCVTIMEO: i64 = 20 |
| 1604 | const SYS_ALARM: i64 = 37 |
| 1607 | const AF_INET: i64 = 2 |
| 1608 | const SOCK_STREAM: i64 = 1 |
| 1609 | const SOCK_DGRAM: i64 = 2 |
| 1715 | const SYS_SENDMSG: i64 = 46 |
| 1716 | const SYS_RECVMSG: i64 = 47 |
| 1717 | const SYS_SOCKETPAIR: i64 = 53 |
| 1718 | const SCM_AF_UNIX: i64 = 1 |
| 1719 | const SCM_SOL_SOCKET: i64 = 1 |
| 1720 | const SCM_RIGHTS_TYPE: i64 = 1 |
| 1721 | const SCM_MSG_CMSG_CLOEXEC: i64 = 1073741824 |
| 1722 | const SCM_MSGHDR_BYTES: i64 = 56 |
| 1723 | const SCM_MSGHDR_OFF_IOV: i64 = 16 |
| 1724 | const SCM_MSGHDR_OFF_IOVLEN: i64 = 24 |
| 1725 | const SCM_MSGHDR_OFF_CTRL: i64 = 32 |
| 1726 | const SCM_MSGHDR_OFF_CTRLLEN: i64 = 40 |
| 1727 | const SCM_IOVEC_BYTES: i64 = 16 |
| 1728 | const SCM_IOVEC_OFF_BASE: i64 = 0 |
| 1729 | const SCM_IOVEC_OFF_LEN: i64 = 8 |
| 1730 | const SCM_CMSG_OFF_LEN: i64 = 0 |
| 1731 | const SCM_CMSG_OFF_LEVEL: i64 = 8 |
| 1732 | const SCM_CMSG_OFF_TYPE: i64 = 12 |
| 1733 | const SCM_CMSG_OFF_DATA: i64 = 16 |
| 1734 | const SCM_CMSG_LEN_1FD: i64 = 20 |
| 1735 | const SCM_CMSG_SPACE_1FD: i64 = 24 |
| 1736 | const SCM_IOV_COUNT_ONE: i64 = 1 |
| 1737 | const SCM_U32_BYTES: i64 = 4 |
| 1738 | const SCM_BYTE_RADIX: i64 = 256 |
| 1739 | const SCM_FDPAIR_BYTES: i64 = 8 |
| 1742 | const SCM_PAYLOAD_BYTES: i64 = 1 |
| 1743 | const SCM_PAYLOAD_BYTE: i64 = 70 |
| 1747 | const SCM_ERR_NO_CMSG: i64 = 0 - 901 |
| 1748 | const SCM_ERR_CMSG_LEN: i64 = 0 - 902 |
| 1749 | const SCM_ERR_CMSG_LEVEL: i64 = 0 - 903 |
| 1750 | const SCM_ERR_CMSG_TYPE: i64 = 0 - 904 |
| 1822 | const SCM_SUN_PATH_OFF: i64 = 2 // sockaddr_un = [sa_family: u16][sun_path: 108] |
| 1823 | const SCM_SUN_BYTES: i64 = 110 |
| 1824 | const SCM_SUN_PATH_MAX: i64 = 107 |
functions
| 87 | func sys_ioctl(fd: i64, request: i64, arg: i64) -> i64 |
| 98 | func sys_poll(fds: *u8, nfds: i64, timeout_ms: i64) -> i64 |
| 104 | func sys_write(fd: i64, buf: *u8, count: i64) -> i64 |
| 108 | func sys_read(fd: i64, buf: *u8, count: i64) -> i64 called by 1: sys_read_file |
| 112 | func sys_close(fd: i64) -> i64 |
| 122 | func sys_chdir(path: *u8) -> i64 calls 1: sys_mmap |
| 147 | func sys_getcwd(buf: *u8, cap: i64) -> i64 calls 1: sys_mmap |
| 166 | func sys_unlinkat(path: *u8) -> i64 |
| 173 | func sys_fchmodat(path: *u8, mode: i64) -> i64 calls 1: sys_mmap |
| 189 | func sys_exit_group(code: i64) -> i64 |
| 206 | func sys_setpriority(prio: i64) -> i64 |
| 214 | func sys_setpriority_of(pid: i64, prio: i64) -> i64 |
| 356 | func sys_munmap_direct(addr:*u8,len:i64)->i64 |
| 361 | func sys_munmap(addr: *u8, len: i64) -> i64 |
| 368 | func sys_lseek(fd: i64, offset: i64, whence: i64) -> i64 |
| 416 | func sys_statfs(path: *u8, buf: *i64) -> i64 |
| 421 | func sys_fs_avail_bytes(path: *u8) -> i64 |
| 430 | func sys_fs_used_permil(path: *u8) -> i64 |
| 439 | func sys_exit(code: i64) -> i64 called by 1: nxa_die |
| 473 | func nxa_dump_printable(src: i64, n: i64) -> i64 |
| 494 | func nxa_dump_sizes() -> i64 |
| 519 | func nxa_report_overrun(sz: i64, gs: i64) -> i64 |
| 549 | func nxa_die(msg: *u8) -> i64 |
| 559 | func nxa_lock_addr() -> *i64 |
| 567 | func nxa_lock_take() -> i64 |
| 596 | func nxa_lock_give() -> i64 |
| 610 | func sys_mmap_try(size:i64)->*u8 |
| 617 | func sys_mmap(size: i64) -> *u8 |
| 699 | func sys_arena_mark() -> i64 calls 1: sys_mmap |
| 713 | func sys_arena_reset() -> i64 |
| 737 | func sys_mmap_shared(size: i64) -> *u8 |
| 751 | func sys_madvise(addr: *u8, len: i64, advice: i64) -> i64 |
| 762 | func sys_openat_rd(path: *u8) -> i64 |
| 769 | func sys_openat_rdwr(path: *u8, mode: i64) -> i64 |
| 808 | func sys_openat_wr(path: *u8, mode: i64) -> i64 |
| 815 | func sys_openat_exclusive(path: *u8, mode: i64) -> i64 |
| 821 | func sys_openat_directory(path: *u8) -> i64 |
| 828 | func sys_openat_append(path: *u8, mode: i64) -> i64 |
| 838 | func sys_openat_lock(path: *u8) -> i64 |
| 846 | func sys_symlinkat(target: *u8, linkpath: *u8) -> i64 |
| 858 | func sys_readlinkat(path: *u8, buf: *u8, cap: i64) -> i64 |
| 875 | func sys_renameat(oldpath: *u8, newpath: *u8) -> i64 |
| 888 | func sys_fsync(fd: i64) -> i64 |
| 906 | func sys_flock(fd: i64, op: i64) -> i64 |
| 914 | func sys_fstatat(path: *u8, statbuf: *u8) -> i64 |
| 921 | func sys_utimensat(path: *u8, times: *i64) -> i64 |
| 940 | func nx_kill(pid: i64, sig: i64) -> i64 { return __syscall(129, pid, sig, 0, 0, 0, 0) } |
| 955 | func sys_setpgid(pid: i64, pgid: i64) -> i64 { return __syscall(SYS_SETPGID, pid, pgid, 0, 0, 0, 0) } |
| 969 | func nx_prlimit(pid: i64, resource: i64, new_limit: *u8, old_limit: *u8) -> i64 |
| 981 | func sys_mkdir(path: *u8, mode: i64) -> i64 { return __syscall(34, AT_FDCWD, path, mode, 0, 0, 0) } |
| 984 | func nx_chmod(path: *u8, mode: i64) -> i64 { return __syscall(53, AT_FDCWD, path, mode, 0, 0, 0) } |
| 988 | func nx_setsid() -> i64 { return __syscall(112, 0, 0, 0, 0, 0, 0) } |
| 992 | func sys_clock_gettime_mono(ts: *i64) -> i64 |
| 1000 | func sys_clock_gettime_real(ts: *i64) -> i64 |
| 1005 | func sys_now_realtime_sec() -> i64 |
| 1012 | func sys_now_realtime_ms() -> i64 |
| 1024 | func sys_now_realtime_us() -> i64 |
| 1033 | func sys_now_ms() -> i64 |
| 1044 | func sys_now_us() -> i64 |
| 1055 | func sys_clock_now_us() -> i64 calls 1: sys_now_us |
| 1105 | func sys_unshare(flags: i64) -> i64 |
| 1108 | func sys_mount(source: *u8, target: *u8, fs_type: *u8, mountflags: i64, data: *u8) -> i64 |
| 1111 | func sys_chroot(path: *u8) -> i64 |
| 1114 | func sys_getuid() -> i64 |
| 1117 | func sys_getgid() -> i64 |
| 1121 | func sys_fork() -> i64 |
| 1145 | func sys_prctl(option: i64, arg: i64) -> i64 called by 1: sys_bind_parent_lifetime |
| 1148 | func sys_bind_parent_lifetime(expected_parent: i64, signal: i64) -> i64 calls 1: sys_prctl |
| 1164 | func sys_waitid(idtype: i64, id: i64, info: *u8, options: i64) -> i64 |
| 1173 | func sys_close_inherited_proc(first: i64) -> i64 called by 1: sys_close_inherited calls 6: sys_openat_rdsys_mmapsys_getdents64dirent_reclensys_closesys_munmap |
| 1214 | func sys_close_inherited(first: i64) -> i64 |
| 1220 | func sys_execve_clean(path: *u8, argv: *i64, envp: *i64) -> i64 |
| 1226 | func sys_execve(path: *u8, argv: *i64, envp: *i64) -> i64 called by 1: sys_execve_clean |
| 1235 | func sys_wait4(pid: i64, status: *i64, options: i64) -> i64 |
| 1241 | func wait_exit_code(status: i64) -> i64 called by 1: wait_status_rc |
| 1249 | func wait_term_signal(status: i64) -> i64 called by 1: wait_status_rc |
| 1274 | func wait_status_rc(status: i64) -> i64 |
| 1297 | func sys_default_signal(sig: i64) -> i64 calls 1: sys_mmap |
| 1306 | func sys_ignore_sigpipe() -> i64 calls 1: sys_mmap |
| 1321 | func sys_pipe2(fds: *i64, flags: i64) -> i64 |
| 1327 | func sys_dup3(oldfd: i64, newfd: i64, flags: i64) -> i64 |
| 1361 | func sys_getdents64(fd: i64, buf: *u8, buf_len: i64) -> i64 called by 1: sys_close_inherited_proc |
| 1367 | func dirent_reclen(rec: *u8) -> i64 called by 1: sys_close_inherited_proc |
| 1374 | func dirent_type(rec: *u8) -> i64 |
| 1379 | func dirent_name(rec: *u8) -> *u8 |
| 1386 | func sys_read_file(path: *u8, out_len: *i64) -> *u8 |
| 1468 | func sys_free_file(buf: *u8, len: i64) -> i64 calls 1: sys_munmap |
| 1479 | func sys_map_file(path: *u8, out_len: *i64) -> *u8 |
| 1497 | func sys_sleep_ms(ms: i64) -> i64 |
| 1581 | func sys_setsockopt(fd: i64, level: i64, optname: i64, called by 1: sys_set_socket_timeout |
| 1591 | func sys_set_socket_timeout(fd: i64, secs: i64) -> i64 |
| 1605 | func sys_alarm(secs: i64) -> i64 { return __syscall(SYS_ALARM, secs, 0, 0, 0, 0, 0) } |
| 1611 | func sys_socket(domain: i64, sock_type: i64, protocol: i64) -> i64 |
| 1623 | func sockaddr_in_init(addr: *u8, port: i64) -> i64 |
| 1646 | func sys_bind(fd: i64, addr: *u8, addr_len: i64) -> i64 called by 1: sys_unix_listen |
| 1649 | func sys_listen(fd: i64, backlog: i64) -> i64 called by 1: sys_unix_listen |
| 1656 | func sys_accept(fd: i64) -> i64 |
| 1659 | func sys_accept_with_addr(fd: i64, addr: *u8, addr_len: *i64) -> i64 |
| 1663 | func sys_shutdown(fd: i64, how: i64) -> i64 |
| 1666 | func sys_connect(fd: i64, addr: *u8, addr_len: i64) -> i64 called by 1: sys_unix_connect_fd |
| 1669 | func sys_sendto(fd: i64, buf: *u8, n: i64, flags: i64, |
| 1673 | func sys_recvfrom(fd: i64, buf: *u8, n: i64, flags: i64, |
| 1752 | func scm_zero(base: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { base[i] = 0; i = i + 1 } return 0 } |
| 1753 | func scm_put_i64(base: *u8, off: i64, v: i64) -> i64 |
| 1758 | func scm_get_i64(base: *u8, off: i64) -> i64 called by 1: sys_recv_fd |
| 1765 | func scm_put_u32(base: *u8, off: i64, v: i64) -> i64 called by 1: sys_send_fd |
| 1775 | func scm_get_u32(base: *u8, off: i64) -> i64 called by 1: sys_recv_fd |
| 1787 | func sys_sendmsg(fd: i64, msg: *u8, flags: i64) -> i64 called by 1: sys_send_fd |
| 1790 | func sys_recvmsg(fd: i64, msg: *u8, flags: i64) -> i64 called by 1: sys_recv_fd |
| 1814 | func sys_socketpair(domain: i64, sock_type: i64, protocol: i64, sv: *u8) -> i64 |
| 1825 | func sys_unix_listen(path: *u8, backlog: i64) -> i64 |
| 1853 | func sys_unix_connect_fd(path: *u8) -> i64 |
| 1877 | func sys_send_fd(sock: i64, fd: i64) -> i64 |
| 1911 | func sys_recv_fd(sock: i64, flags: i64) -> i64 |