MINHERIT(2) | System Calls Manual | MINHERIT(2) |
minherit
—
#include <sys/mman.h>
int
minherit
(void
*addr, size_t len,
int inherit);
minherit
() system call changes the specified range
of virtual addresses to have the inheritance characteristic
inherit, which determines how
fork(2) will map the region in the
child process. The supported inheritance characteristics are:
Normally, the parent's virtual address space is copied for the
child as if with MAP_INHERIT_COPY
, for which the
alias MAP_INHERIT_DEFAULT
is provided. Regions in
the parent mapped using mmap(2)
with the MAP_SHARED
flag are by default shared with
the child as if with MAP_INHERIT_SHARED
.
Not all implementations will guarantee that the inheritance characteristic can be set on a page basis; the granularity of changes may be as large as an entire region.
minherit
() function returns the value 0 if
successful; otherwise the value -1 is returned and the global variable
errno is set to indicate the error.
minherit
() will fail if:
EINVAL
]minherit
() function first appeared in
OpenBSD.
minherit
().
August 5, 2014 | NetBSD 9.0 |