*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> munmap (2)              
Title
Content
Arch
Section
 

munmap(2)

Contents


NAME    [Toc]    [Back]

       munmap - Unmap a mapped region

SYNOPSIS    [Toc]    [Back]

       #include <sys/mman.h>

       int munmap(
               void *addr,
               size_t len );

       [Tru64  UNIX]  The  following  definition  of the munmap()
       function does not conform to current standards and is supported
  only for backward compatibility. See standards(5).
       #include <sys/mman.h>

       int munmap(
               caddr_t addr,
               size_t len );

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       munmap(): XSH4.2, XSH5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Specifies the address of the region to be unmapped.  Specifies
 the length in bytes of the region to be unmapped.

DESCRIPTION    [Toc]    [Back]

       The  munmap() function unmaps a mapped file or shared memory
 region.

       The addr and len parameters specify the address and length
       in  bytes, respectively, of the region to be unmapped. The
       len parameter must be a  multiple  of  the  page  size  as
       returned by sysconf(_SC_PAGE_SIZE). If len is not a multiple
    of    the    page    size    as     returned     by
       sysconf(_SC_PAGE_SIZE),  the  length of the region will be
       rounded up to the next multiple of the page size.

       The result of using an address which lies in  an  unmapped
       region  and not in any subsequently mapped region is undefined.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, the munmap() function  returns
       0 (zero). Otherwise, munmap() returns -1 and sets errno to
       indicate the error.

ERRORS    [Toc]    [Back]

       If the munmap() function fails, errno is set as follows:

       One of the following conditions applies: The addr  parameter
  is  not  a  multiple  of the page size as returned by
       sysconf(_SC_PAGE_SIZE).  The len parameter  is  0  (zero).
       Addresses  in the range [addr, addr + len) are outside the
       valid range for the address space of a process.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: mmap(2), sysconf(3)

       Standards: standards(5)



                                                        munmap(2)
[ Back ]
 Similar pages
Name OS Title
msync NetBSD synchronize a mapped region
msync FreeBSD synchronize a mapped region
msync OpenBSD synchronize a mapped region
msem_remove HP-UX remove a semaphore in mapped file or anonymous region
msem_init HP-UX initialize a semaphore in a mapped file or anonymous memory region
msem_init Tru64 Initialize a semaphore in a mapped file or shared memory region
mapwindow IRIX map or unmap a window
shmat NetBSD map/unmap shared memory
shmdt OpenBSD map/unmap shared memory
munmap HP-UX unmap pages of memory
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service