code wiki / (root) / nx_madvise_probe.nx

nx_madvise_probe.nx

buildroot/runtime/nx_madvise_probe.nx

2847 B65 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind probe
docsdependenciesstructsconstsfunctions

about

nx_madvise_probe.nx -- SYSCALL-IDENTITY PROBE: does raw __syscall(28) reach x86_64 madvise(2)? WHY RAW 28: the portable rv64/asm-generic number is 233 and x86ctx_rv64_to_x86_64_syscall carries no 233 row yet, so a portable const would fall through `return num` to x86_64 233 = epoll_ctl -- the wrong-syscall-not-an-error class (setpgid/flock precedent). Raw 28 is the sys_exit_group pattern (raw x86 231) and is conflict-checked: nothing in the tree calls __syscall(28,...) today. PROOF SHAPE (print the numbers, never just a verdict): T1 positive: MADV_WILLNEED(3) on a live 1MB anonymous mapping -> expect 0 T2 negative-control: MADV_WILLNEED on the unmapped page at 4096 -> expect -12 (ENOMEM) T3 identity-control: advice=9999 on the live mapping -> expect -22 (EINVAL) The TRIPLE (0,-12,-22) is a madvise signature; any other syscall answers differently (epoll_ctl would say EBADF/EINVAL on T1). exit 0 = MADVISE-LIVE, 1 = WRONG-SYSCALL with the numbers printed. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_madvise_probe.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ mp_cat mp_wnum sys_mmap ↻ sys_write ↻

structs

none

consts

14const K_MAGIC_1048576: i64 = 1048576
15const K_MAGIC_8192: i64 = 8192
16const K_MAGIC_4096: i64 = 4096
17const K_MAGIC_9999: i64 = 9999

functions

19func mp_wnum(buf: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
31func mp_cat(buf: *u8, off: i64, s: *u8) -> i64
called by 1: main
38func main() -> i64