2026-09-22 03:35 UTC
TIL: Unlike say Windows `CreateFileMapping()` which expands the size of the mapped file to the requested size if it's larger than the file, POSIX `mmap()` doesn't... and any data you write to the mapping past the previous end of file won't be saved anywhere, so you might find that your file is truncated compared to what you expected.
Replies (1)
-
@atax1a@infosec.exchange 2026-09-22 03:35
@rakslice@mastodon.social yeah, you have to, iirc, ftruncate() on posix