Wrap sys/mman.h: mmap, munmap, mprotect, msync, madvise #12

Open
opened 2026-08-02 18:53:25 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md §4.1 (at 669b2b3)

  • mmap, munmap, mprotect, msync, madvise

mmap returning MAP_FAILED rather than NULL is the trap worth wrapping: it is
(void *)-1, so a caller checking for NULL gets a pointer that looks valid.

Files: src/, include/akstdlib.h


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md §4.1 (at 669b2b3) - [ ] `mmap`, `munmap`, `mprotect`, `msync`, `madvise` `mmap` returning `MAP_FAILED` rather than NULL is the trap worth wrapping: it is `(void *)-1`, so a caller checking for NULL gets a pointer that looks valid. **Files:** `src/`, `include/akstdlib.h` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.3.0 milestone 2026-08-02 18:53:25 -04:00
tachikoma added the api-gapblast-radius:lowstatus::grooming labels 2026-08-02 18:53:25 -04:00
Sign in to join this conversation.