munmap() - remove mappings for files in memory
#include <sys/mman.h>
int munmap (void *addr, size_t len)
The munmap(2) function removes a mapping for a file from the range [addr addr + len).
Addr should be a multiple of the page size as given by sysconf(2). The len argument is rounded up to the next multiple of the page size.
Mapped files are automatically unmapped when the process terminates.
On success, munmap(2) returns 0. On failure, it returns -1 and sets errno to indicate the error.
The munmap(2) function can fail if:
Addresses in the range [addr addr + len) are not in the valid range for a process' address space.
Len is 0.
exec(2)
fcntl(2)
fork(2)
mmap(2)
shmat(2)
sysconf(2)