nx_madvise_probe.nx
buildroot/runtime/nx_madvise_probe.nx
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
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
structs
| none |
consts
| 14 | const K_MAGIC_1048576: i64 = 1048576 |
| 15 | const K_MAGIC_8192: i64 = 8192 |
| 16 | const K_MAGIC_4096: i64 = 4096 |
| 17 | const K_MAGIC_9999: i64 = 9999 |
functions
| 19 | func mp_wnum(buf: *u8, off: i64, v: i64) -> i64 |
| 31 | func mp_cat(buf: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 38 | func main() -> i64 |