getpagesize
Section: System Calls (2)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
getpagesize - メモリーのページサイズを取得する
ライブラリ
標準 C ライブラリ (libc,~-lc)
書式
#include <unistd.h>
int getpagesize(void);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
getpagesize():
glibc 2.20 以降:
_DEFAULT_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
glibc 2.12 から 2.19:
_BSD_SOURCE || ! (_POSIX_C_SOURCE >= 200112L)
glibc 2.12 より前:
_BSD_SOURCE || _XOPEN_SOURCE >= 500
説明
getpagesize() 関数はメモリーページの大きさをバイト数で返す。
ここでいう「ページ」は固定長のブロックであり、
mmap(2) で実行されるメモリー割り当てとファイルマッピングの単位である。
バージョン
A user program should not hard-code a page size, neither as a literal nor
using the PAGE_SIZE macro, because some architectures support multiple
page sizes.
This manual page is in section 2 because Alpha, SPARC, and SPARC64 all have
a Linux system call getpagesize() though other architectures do not, and
use the ELF auxiliary vector instead.
標準規格
なし。
歴史
4.2BSD, SVr4, SUSv1. In SUSv2 the getpagesize() call was labeled
LEGACY, and it was removed in POSIX.1-2001.
glibc 2.0 returned a constant even on architectures with multiple page
sizes.
関連項目
mmap(2), sysconf(3)
Index
- 名前
-
- ライブラリ
-
- 書式
-
- 説明
-
- バージョン
-
- 標準規格
-
- 歴史
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.