getpagesize(2) System Calls Manual getpagesize(2)Name
getpagesize - get system page size
Syntax
pagesize = getpagesize()
int pagesize;
Description
The system call returns the number of bytes in a page. Page granularity is the granularity of many of the memory management calls.
The page size is a system page size and may not be the same as the underlying hardware page size.
See Alsopagesize(1), sbrk(2)getpagesize(2)
Check Out this Related Man Page
getpagesize(3C) Standard C Library Functions getpagesize(3C)NAME
getpagesize - get system page size
SYNOPSIS
#include <unistd.h>
int getpagesize(void);
DESCRIPTION
The getpagesize() function returns the number of bytes in a page. Page granularity is the granularity of many of the memory management
calls.
The page size is a system page size and need not be the same as the underlying hardware page size.
The getpagesize() function is equivalent to sysconf(_SC_PAGE_SIZE) and sysconf(_SC_PAGESIZE). See sysconf(3C).
RETURN VALUES
The getpagesize() function returns the current page size.
ERRORS
No errors are defined.
USAGE
The value returned by getpagesize() need not be the minimum value that malloc(3C) can allocate. Moreover, the application cannot assume
that an object of this size can be allocated with malloc().
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO pagesize(1), brk(2), getrlimit(2), mmap(2), mprotect(2), munmap(2), malloc(3C), msync(3C), sysconf(3C), attributes(5)SunOS 5.10 27 Jun 2000 getpagesize(3C)
Hi.,
I want to know amount of memory used by a process inside the same process. For example, I am writing a program and I want to know the memory used by it from the program. So, I could do some actions (flush some unwanted data structures/ log the memory usage) in my program based on this... (2 Replies)
I am trying to write .pgm images using the O_DIRECT flag in open().
I have a char* buffer which has the image data.
I know that I have to align the buffers and have done that using posix_memalign() yet only a part of the image gets written.
Has someone used O_DIRECT for writing files... (3 Replies)
OFFSET=100;
PAGESIZE=4096;
int dummy_last;
TOPSTACK = (caddr_t)(&dummy_last - OFFSET);
TOPSTACK = (caddr_t)((unsigned long)TOPSTACK -
((unsigned long)TOPSTACK % PAGESIZE));
this i a code to find the top of the stack, but not able to figure it out. can... (2 Replies)
I am trying to add support for hugepages into an existing application. I have done a lot of online research, but I still have a few questions that I haven't been able get answers to. Hopefully someone here can help!
(1) My application requires that all mapped memory segments be shared. The... (2 Replies)
I'll try to keep this short, but basically I need to figure out a way to load data in shared memory (this file will be called load.c) I will later access the data with a print.c program.
The "data" is in the form of a student database that looks like this
John Blakeman
111223333
560... (7 Replies)
Hi
I want to lock or prevent a portion of memory which I allocated. So I tried MLOCK, MPROTECT and some like this. But all these functions works only on page border. Can I know why that so.
Is that possible to protect a portion of memory which is in middle of the page.
Example.
int A;
... (1 Reply)
I can't find a guide or tutorial that explains it at all. Its there a better search term than Memory Mapping? What's the magic inbetween having the hard drive behave like the memory? (4 Replies)
Hi guys,
I use AIX version 5 on IBM Power 5+ machine. I am currently trying to experiment with sort of self-modifying code, like this:
ucontext_t ut;
getcontext(&ut);
int iar = ut.uc_mcontext.jmp_context.iar;
int pageSize = getpagesize();
int rest = iar % pageSize;
void *ptr = iar -... (6 Replies)
Hi,
I have following doubts regarding page sharing in Linux (please also correct me if any of my assumptions are wrong),
1. In recent kernel KSM does the page sharing for user process' anonymous pages.
2. What about pages where the program text is stored ? are they shared between two... (4 Replies)
i have to shared a variable between two different c programs with shared memory and i do these:
int main() {
int a=5,b=7;
int buffer;
int *point;
int shmid;
shmid=shmget(IPC_PRIVATE , sizeof(buffer),0666);
point=(int *)shmat(shmid,NULL,0);
point=a;
... (21 Replies)
Hello, I am trying to concatenate two strings by merging the overlapped region. E.g.
Seq1=ACGTGCCC
Seq2=CCCCCGTGTGTGT
Seq_merged=ACGTGCCCCCGTGTGTGTFunction strcat(char *dest, char *src) appends the src string to the dest string, ignoring the overlapped parts (prefix of src and suffix of dest).... (30 Replies)