|MUNMAP(2)||System Calls Manual||MUNMAP(2)|
munmap — remove a
system call deletes the mappings for the specified address range, causing
further references to addresses within the range to generate invalid memory
munmap() handles a dirty page, depends
on what type of memory is being unmapped:
If there are still other references to the memory when the munmap is done, then nothing is done to the memory itself and it may be swapped out if need be. The memory will continue to persist until the last reference goes away (except for System V shared memory in which case, see above).
Upon successful completion,
zero. Otherwise, a value of -1 is returned and errno
is set to indicate the error.
munmap() will fail if:
The include file
addr, size_t len);;
The type of addr has changed.
munmap() function first appeared in
|October 16, 2008||macOS 14.1|