DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

munmap(S)


munmap -- unmap pages of memory

Syntax

cc . . . -lc
#include <sys/types.h>
#include <sys/mman.h>

int munmap(caddr_t 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 may perform an implicit munmap if MAP_FIXED was specified.

Return values

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

Diagnostics

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 to addr + len] are outside the valid range for the address space of a process.

Files


/lib/libc.a
linking library

See also

mmap(S), sysconf(S)

Standards conformance

munmap is conformant with:

AT&T SVID Issue 3;
IEEE POSIX Std 1003.4 1992 System Application Program Interface (API) Realtime Extension [C Language] (ISO/IEC 9945-1).


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003