Skip to content

Use anonymous shared memory fds for tmpfiles when available

Val Packett requested to merge github/fork/unrelentingtech/memfd-shm-anon into master

On Linux >= 3.17, memfd is used. On FreeBSD, shm_open with SHM_ANON is used.

This reduces potential filesystem pollution and avoids potential problems such as usage of posix_fallocate on ZFS filesystems (which was disallowed in FreeBSD 12).

I haven't tested that memfd works, only that it compiles — the only Linux box I have right now is a headless VM.

Merge request reports