OpenBSD manual page server

Manual Page Search Parameters

MIMMUTABLE(2) System Calls Manual MIMMUTABLE(2)

mimmutablecontrol the immutability of pages

#include <sys/mman.h>

int
mimmutable(void *addr, size_t len);

The () system call changes currently mapped pages in the region to be marked immutable, which means their protection or mapping may not be changed in the future. Most requests to madvise(2), minherit(2), mmap(2), mprotect(2), msync(2), and munmap(2) to pages marked immutable will return with error EPERM.

Unmapped pages in the region do not retain immutability, but this behaviour should not be relied upon.

Not all implementations will guarantee that the immutable characteristic can be set on a page basis; the granularity of changes may be as large as an entire region.

Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

The mimmutable() system call will fail if:

[]
The virtual address range specified by the addr and len arguments is not valid.
[]
At least one page has inheritance of MAP_INHERIT_ZERO.

minherit(2), mmap(2), mprotect(2), munmap(2)

The mimmutable() function first appeared in OpenBSD 7.3.

January 21, 2024 OpenBSD-current