DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

munmap(S)


munmap -- unmap pages of memory

Synopsis

   #include <sys/types.h>
   #include <sys/mman.h>
   

int munmap(void *addr, size_t len);

Description

The function 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.

The function mmap often performs an implicit munmap.

Return values

On success, munmap returns 0. On failure, munmap returns -1 and sets errno to identify the error.

Errors

In the following conditions, munmap fails and sets errno to:

EINVAL
addr is not a multiple of the page size as returned by sysconf.

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

EINVAL
The argument len has a value less than or equal to 0.

References

mmap(S), sysconf(S)

Notices

Considerations for threads programming

Sibling threads share (by definition) the same address space; modifications to the address space by one can be perceived by the others.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005