获取linux系统页大小

代码如下:

#include<unistd.h>
#include
<stdio.h>

int main()
{
int pageSize = getpagesize();
printf(
"Page size on your system = %i bytes\n", pageSize);
return 0;
}

编译方法如下:

gcc pagesize.c

运行方法:

./a.out

输出结果:

Page size on your system = 4096 bytes

posted @ 2011-02-18 16:08  sunss  阅读(3408)  评论(0编辑  收藏  举报