如何得到当前linux系统的页大小

操作系统的页是虚拟存储的关键技术.

[code lang="cpp"]
#include <unistd.h>
#include <stdio.h>
int main()
{
int pageSize = getpagesize();
printf("Page size on your system = %i bytes\n", pageSize);
return 0;
}
[/code]

在我电脑里的运行结果:
[code light="true"]
$./a.out
Page size on your system = 4096 bytes
[/code]

相关文章:

This entry was posted in Linux系统 and tagged , . Bookmark the permalink.

One Response to 如何得到当前linux系统的页大小

  1. Pingback: Linux内存管理中的分页 | 编译点滴

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>