MUNMAP(2)

NAME
munmap - unmap pages of memory.

SYNOPSIS
#include <sys/mman.h>

int munmap(addr, len)
caddr_t addr;
int len;

DESCRIPTION

munmap() removes the mappings for pages in the range [addr, addr + len). Further references to these pages will result in the delivery of a SIGSEGV signal to the process, unless these pages are considered part of the “data” or “stack” segments.

brk() and mmap() often perform implicit munmap's.

RETURN VALUES

munmap() returns:

0   on success.

-1  on failure and sets errno to indicate the error.

ERRORS

EINVAL
    addr is not a multiple of the page size as returned by getpagesize(2).

    Addresses in the range [addr, addr + len) are outside the valid range for the address space of a process.

SEE ALSO
brk(2), getpagesize(2), mmap(2)