Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
munmap(2)							     munmap(2)

       munmap -	unmaps memory of a character device

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

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

       addr	 Specifies  the	 address space of the calling process at which
		 the unmapping begins.

       len	 Specifies the number of bytes to unmap.

       The system call unmaps a	specified number of bytes (len)	starting at  a
       specified address (addr)	from the address space of the calling process.
       You mapped this device in a previous call to Subsequent access  to  the
       unmapped	region results in a signal.  You cannot	unmap data, stack, and
       text segments using

       The system call rounds len to the nearest  multiple  of	page  size  as
       returned	by

       The  range  [addr,  addr	+ len] may contain more	than one mapped	region
       created by In this case,	unmaps all of the mapped regions.

       All of the mapped regions must be wholly	contained in the range	[addr,
       addr + len].  That is, addr must	be the beginning of some mapped	region
       and addr	+ len must be the end  of  some	 (possibly  different)	mapped

Return Value
       If  successful, returns 0.  Otherwise, it returns -1 and	sets the errno
       argument	to one of the errors listed in the Diagnostics section.

       The call	to fails if one	or more	of the following is true:

       [EINVAL]	 The address you specified in addr is not a  multiple  of  the
		 page size as returned by

       [EINVAL]	 The  addresses	 in the	range [addr, addr + len] are not valid
		 in the	process	address	space.

       [EINVAL]	 All of	the segments being unmapped are	not entirely contained
		 in the	range [addr, addr + len].

See Also
       getpagesize(2), getsysinfo(2), mmap(2)


Name | Syntax | Arguments | Description | Restrictions | Return Value | Diagnostics | See Also

Want to link to this manual page? Use this URL:

home | help