Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

munmap(2) [ultrix man page]

munmap(2)							System Calls Manual							 munmap(2)

Name
       munmap - unmaps memory of a character device

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

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

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

       len	 Specifies the number of bytes to unmap.

Description
       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.

Restrictions
       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 region.

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.

Diagnostics
       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)

																	 munmap(2)

Check Out this Related Man Page

MUNMAP(2)						      BSD System Calls Manual							 MUNMAP(2)

NAME
munmap -- remove a mapping LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/mman.h> int munmap(void *addr, size_t len); DESCRIPTION
The munmap() system call deletes the mappings for the specified address range, and causes further references to addresses within the range to generate invalid memory references. RETURN VALUES
The munmap() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The munmap() system call will fail if: [EINVAL] The addr argument was not page aligned, the len argument was zero or negative, or some part of the region being unmapped is outside the valid address range for a process. SEE ALSO
madvise(2), mincore(2), mmap(2), mprotect(2), msync(2), getpagesize(3) HISTORY
The munmap() system call first appeared in 4.4BSD. BSD
May 27, 1994 BSD
Man Page

5 More Discussions You Might Find Interesting

1. AIX

AIX 5.3 , gensyms command, translate 32 bit addr to 64 bit addr

I am trying to map the information from the gensyms command, Its gives information about the various symbols info like symbol type, addr offset, and the main libraries addr starting point. My problem is , how do I map this 32 bit addr to a 64 bit addr, I am trying to extract Segment # information... (0 Replies)
Discussion started by: mrmeswani
0 Replies

2. Solaris

BAD TRAP: type=30 rp=2a10001b840 addr=2a000012040 mmu_fsr=0

Hello Gurus, I got a system reboot due to "unix: BAD TRAP: type=30 rp=2a10001b840 addr=2a000012040 mmu_fsr=0" on SUNW,Netra-CP2300. I guess it is caused by HW fault but not very sure, and don't know which part should be relaced incase it is HW reason really. Sincerely appreciate for your... (7 Replies)
Discussion started by: fangfang
7 Replies

3. Shell Programming and Scripting

How to combine lines?

Hi, I have a file like this: "sdfc@abc.com","arovls","some addr ", "more stuff" "ssss@email.com","arovls","some addr", "sss" "edx@email.com","arovls","some addr", "sssdfvv" "ssss@a55.com","arovls","some addr", "lsdsdgf" "ssss@0234.com","aro vls","123 Main", "lSdfv" I want to... (4 Replies)
Discussion started by: erniel
4 Replies

4. Shell Programming and Scripting

mapped reads using samtools flagstat options

Hey guys, Does anyone know how to calculate total number of mapped reads for a certain region of a bam file using samtools flagstat? I know to use flagstat for the whole bam file. but for a specific region of it... is there an option? Tnx ---------- Post updated at 12:27 PM ----------... (1 Reply)
Discussion started by: @man
1 Replies

5. Shell Programming and Scripting

Too many arguments error

Here's my code. 21 if ; then 22 23 ls addr*.tmp | while IFS= read -r entry; do # Starts Reading .cfg files one by one ... 24 echo $entry I get the below error at line number 21 line 21: Can you tell me how can i alter my code to avoid the error ? (3 Replies)
Discussion started by: mohtashims
3 Replies