IS_KSEG_VA(9r)IS_KSEG_VA(9r)NAME
IS_KSEG_VA, IS_SEG0_VA, IS_SEG1_VA - General: Determine if the specified address is located in the kernel-unmapped address space, the user-
mapped address space, and the kernel-mapped address space.
SYNOPSIS
void IS_KSEG_VA(
unsigned long addr ); void IS_SEG0_VA(
unsigned long addr ); void IS_SEG1_VA(
unsigned long addr );
ARGUMENTS
Specifies the virtual address.
DESCRIPTION
The IS_KSEG_VA routine determines if the specified address is located in the kernel-unmapped address space. The IS_SEG0_VA routine deter-
mines if the specified address is located in the user-mapped address space. The IS_SEG1_VA routine determines if the specified address is
located in the kernel-mapped address space.
RETURN VALUES
None
EXAMPLE
The following code fragment shows a call to IS_KSEG_VA:
. . .
caddr_t virt_addr; [1] unsigned phys_addr; [2]
. . .
if(IS_KSEG_VA(virt_addr)) { [3]
phys_addr = KSEG_TO_PHYS(virt_addr); [4]
. . .
Declares a variable to store the user buffer's virtual address. Declares a variable to store the physical address returned by
KSEG_TO_PHYS. Before calling KSEG_TO_PHYS, calls IS_KSEG_VA to determine if the virtual address is from the kernel-unmapped address space.
If the virtual address is from the kernel-unmapped address space, then calls KSEG_TO_PHYS to convert the address to a corresponding physi-
cal address.
SEE ALSO
Routines: KSEG_TO_PHYS(9r), PHYS_TO_KSEG(9r)IS_KSEG_VA(9r)
Check Out this Related 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 Alsogetpagesize(2), getsysinfo(2), mmap(2)munmap(2)
as kernel keeps track of user activities on a file by its INODE number and I node table .
what is the structure of Inode table. and where does this Inode table mapped into?user space or kernel space?
is the Inode Number is fixed for a file till its deletion?
thanks (1 Reply)
how can i find my own ip address from unix. command like who -x .this would provide all the ip address but i need to list only current user ip address. who am i command does not display the ip. (1 Reply)
how can i find my own ip address from unix. command like who -x .this would provide all the ip address but i need to list only current user ip address. who am i command does not display the ip. (1 Reply)
Hi,
I am looking to work on unix systems which include (hp-ux, ibm aix, solaris and linux). I want to get the total virtual address space of a process, the used virtual memory i am able to get without any problem. I have tried using getrlimit and getrlimit64, but that gives only ... (4 Replies)
Hi All,
From C++, I just want to find the address space size that a process is allowed to use. For ex, in 32 bit OS the allowed address space is 4GB and in 64 bit OS I guess this is 16GB or more.
I jsut want to find it in my C++ project. Is there any API calls that gives me such information.... (2 Replies)
Hi guys,
I got one problem which I definetily no idea.
What would the physical address be for virtual address?
1) 2ABC
2) 3F4B
Here is the page table:see attached
Thank you sos sososososso much!! (0 Replies)
Suppose I have 3 gb of ram and 250 gb hard disk in my pc.
Now I wrote a simple C program having only one statement malloc() to allocate 4 gb of memory as 32 bit os can address 4gb address space then will the malloc succeed?
If yes then how it will get extra 1 gb of memory?
Does the process gets... (3 Replies)