MUNMAP(2) BSD System Calls Manual MUNMAP(2)NAME
munmap -- remove a mapping
SYNOPSIS
#include <sys/types.h>
#include <sys/mman.h>
int
munmap(caddr_t 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
Upon successful completion, munmap returns zero. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Munmap() will fail if:
[EINVAL] The addr parameter was not page aligned, the len parameter was negative, or some part of the region being unmapped is not
part of the currently valid address space.
SEE ALSO getpagesize(3), msync(2), munmap(2), mprotect(2), madvise(2), mincore(2)HISTORY
The munmap() function first appeared in 4.4BSD.
BSD April 15, 1994 BSD
Check Out this Related Man Page
MUNMAP(2) BSD System Calls Manual MUNMAP(2)NAME
munmap -- remove a mapping
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, causing further references to addresses within the range to
generate invalid memory references.
DIRTY PAGE HANDLING
How munmap() handles a dirty page, depends on what type of memory is being unmapped:
[Anonymous] If the memory is anonymous memory and if the last reference is going away, then the contents are discarded by definition
of anonymous memory.
[System V Shared] If the memory mapping was created using System V shared memory, then the contents persist until the System V memory region
is destroyed or the system is rebooted.
[File mapping] If the mapping maps data from a file (MAP_SHARED), then the memory will eventually be written back to disk if it's dirty.
This will happen automatically at some point in the future (implementation dependent). Note: to force the memory to be
written back to the disk, use msync(2).
If there are still other references to the memory when the munmap is done, then nothing is done to the memory itself and it may be swapped
out if need be. The memory will continue to persist until the last reference goes away (except for System V shared memory in which case, see
above).
RETURN VALUES
Upon successful completion, munmap returns zero. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Munmap() will fail if:
[EINVAL] The addr parameter was not page aligned (i.e., a multiple of the page size).
[EINVAL] The len parameter was negative or zero.
[EINVAL] Some part of the region being unmapped is not part of the currently valid address space.
LEGACY SYNOPSIS
#include <sys/types.h>
#include <sys/mman.h>
The include file <sys/types.h> is necessary.
int
munmap(caddr_t addr, size_t len);
The type of addr has changed.
SEE ALSO getpagesize(3), msync(2), munmap(2), mprotect(2), madvise(2), mincore(2), compat(5)HISTORY
The munmap() function first appeared in 4.4BSD.
BSD October 16, 2008 BSD
Hi all,
I would like to use properly an input pipe, like this :
cat myFile.txt | myCommand.shI always find this solution :
while read line; do ...; donebut I have a great lost of performance !
On a big file, with a simple grep, I can spend 2400 times more time ! oO
(from 0,023sec to 1m)... (4 Replies)
Suppose I have a main() function with only one malloc statement allocating say some 1 gb memory. Also say my system has 1 gb of ram.
main()
{
malloc(1gb)
return(0)
}
The program above exits without freeing the memory.
In this case will the 1 gb of heap memory be returned... (9 Replies)
Hi all,
I'm quite new to Solaris and I've been searching around everywhere to try and find the root of my Oracle DB install problem. It quits immediately when it runs isainfo when it gets a return of 3md64. To me this looks like there is a typo where ever isainfo pulls it's info from, but I... (13 Replies)
Hello all,
I have read just about every rpcbind not starting thread and article on the internet it seems, but I have not found a solution to my problem as of yet. I have a solaris 10 server that has been running with no problems for a while. The other day it crashed and would not boot to the gui... (2 Replies)
I keep getting a Illegal instruction error when running my MCP file below is the dump error message followed by truss log, dose anyone have any ideas?
/opt/builds/bin/core: ELF 32-bit MSB core file SPARC Version 1, from 'mcp'
*** Select Close or Exit from the window menu to close this window... (12 Replies)
Hi all, Hope everyone doing good.
Let me come to point, i have setup-ed a LDAP server and client machines
Server works perfect, while make a search from client machine it too get the Query from LDAP server, But while i switch user it says user not exists
# su - babin
su: user babin does... (3 Replies)
There is backup client software on Solaris-10. I wanted to restart that application, but one of PID is not getting killed even with -9. Can I try some more things before restarting server.
root@pdvtil03:/# ps -ealf | grep -i 6177
0 S root 28101 10844 0 50 20 ? 220 ?... (14 Replies)
Hello all
i have simple server running on linux redhat 6.1
it is build with c++
in the server i have huge std vector that holds pointers to cache objects
those cache objects holds allot of data from the DB
any way ...
in some point in time there is simple API that suppose to clean the... (2 Replies)
I am building a wrapper around fgets, and fighting crashes for no reason I can explain.
I have stripped it down as far as I can and it still crashes.
#include <stdio.h>
#include <stdlib.h>
typedef struct {
char buf;
FILE *fp;
int type;
} wrap;
wrap... (12 Replies)
Hi Forum.
I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script.
Any feedback will be greatly appreciated.
... (19 Replies)
Hi
We meet errors while running configuration scripts to prepare compiling source code on AIX 7.2. This error does not happen on AIX5.3 and AIX6.1
With the “/usr/bin/sh” from AIX7.2, sometimes , the script runs sucessfully, sometimes not. It’s unstable, and I don’t know why.
When... (10 Replies)
Hello,
I got into a wired state on one of solaris 10 server. When I noticed that server is having some issue, I found that there were dumpadm.conf entries in /etc/shadow and real entries were wiped of. Probably somebody fat fingers.
I was able to boot into failsafe, break SVM mirror, copied... (25 Replies)