OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / getpagesize.2
index e2db542..67b58ce 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
 .\"
 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
 .\"         all rights reserved.
 .\" Translated 2002-04-14, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
 .\" Updated 2003-07-03, Akihiro Motoki <amotoki@dd.iij4u.or.jp>
 .\" Updated 2007-01-07, Akihiro MOTOKI, catch up to LDP v2.43
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       page                    ¥Ú¡¼¥¸
-.\"WORD:       legacy                  ²áµî¤Î°äʪ
-.\"
-.TH GETPAGESIZE 2 2007-07-26 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O getpagesize \- get memory page size
-getpagesize \- ¥á¥â¥ê¤Î¥Ú¡¼¥¸¡¦¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë
-.SH ½ñ¼°
-.B #include <unistd.h>
+.TH GETPAGESIZE 2 2010\-11\-16 Linux "Linux Programmer's Manual"
+.SH 名前
+getpagesize \- メモリのページ・サイズを取得する
+.SH 書式
+\fB#include <unistd.h>\fP
 .sp
-.B int getpagesize(void);
+\fBint getpagesize(void);\fP
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
-.BR getpagesize ():
-_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O The function
-.\"O .BR getpagesize ()
-.\"O returns the number of bytes in a page, where a "page" is the thing
-.\"O used where it says in the description of
-.\"O .BR mmap (2)
-.\"O that files are mapped in page-sized units.
-.BR getpagesize ()
-´Ø¿ô¤Ï¥Ú¡¼¥¸¤ÎÂ礭¤µ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£¤³¤³¤Ç¤Î¡Ö¥Ú¡¼¥¸¡×¤Ï
-.BR mmap (2)
-¤ÎÀâÌÀ¤ÎÃæ¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¡¢
-.BR mmap ()
-¤Ï¤³¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Îñ°Ì¤Ç¥Õ¥¡¥¤¥ë¤ò¥Þ¥Ã¥×¤¹¤ë¡£
-
-.\"O The size of the kind of pages that
-.\"O .BR mmap (2)
-.\"O uses, is found using
-.BR mmap (2)
-¤¬»ÈÍѤ¹¤ë¥Ú¡¼¥¸¥µ¥¤¥º¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£
-
+\fBgetpagesize\fP():
+.ad l
+.RS 4
+.PD 0
+.TP  4
+glibc 2.12 以降:
+.nf
+_BSD_SOURCE ||
+    !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
+.TP  4
+.fi
+glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+.PD
+.RE
+.ad b
+.SH 説明
+.\" .SH HISTORY
+.\" This call first appeared in 4.2BSD.
+\fBgetpagesize\fP() 関数はメモリページの大きさをバイト数で返す。
+ここでいう「ページ」は固定長のブロックであり、
+\fBmmap\fP(2) で実行されるメモリ割り当てとファイルマッピングの単位である。
+.SH 準拠
+SVr4, 4.4BSD, SUSv2.
+SUSv2 では \fBgetpagesize\fP() システムコールは「過去の遺物 (LEGACY)」とされており、
+POSIX.1\-2001 からは外されている。 HP\-UX にはこのシステムコールは存在しない。
+.SH 注意
+移植性が必要なアプリケーションでは、
+\fBgetpagesize\fP() ではなく \fIsysconf(_SC_PAGESIZE)\fP を利用すべきである。
+.PP
 .in +4n
 .nf
 #include <unistd.h>
@@ -77,87 +83,19 @@ long sz = sysconf(_SC_PAGESIZE);
 .fi
 .in
 
-.\"O (most systems allow the synonym
-.\"O .B _SC_PAGE_SIZE
-.\"O for
-.\"O .BR _SC_PAGESIZE ),
-.\"O or
-(¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ç¤Ï
-.B _SC_PAGESIZE
-¤ÎƱµÁ¸ì¤È¤·¤Æ
-.B _SC_PAGE_SIZE
-¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë)¡¢¤â¤·¤¯¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë:
+(ほとんどのシステムでは \fB_SC_PAGESIZE\fP の同義語として
+\fB_SC_PAGE_SIZE\fP を使用することができる。)
 
-.in +4n
-.nf
-#include <unistd.h>
-int sz = getpagesize();
-.fi
-.in
-.\"O .\" .SH HISTORY
-.\" .SH Îò»Ë
-.\"O .\" This call first appeared in 4.2BSD.
-.\" ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï 4.2BSD ¤Ç½é¤á¤ÆÅо줷¤¿¡£
-.\"O .SH CONFORMING TO
-.SH ½àµò
-SVr4, 4.4BSD, SUSv2.
-.\"O In SUSv2 the
-.\"O .BR getpagesize ()
-.\"O call is labeled LEGACY, and in POSIX.1-2001
-.\"O it has been dropped;
-.\"O HP-UX does not have this call.
-.\"O Portable applications should employ
-.\"O .I sysconf(_SC_PAGESIZE)
-.\"O instead of this call.
-SUSv2 ¤Ç¤Ï
-.BR getpagesize ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡Ö²áµî¤Î°äʪ (LEGACY)¡×¤È¤µ¤ì¤Æ¤ª¤ê¡¢
-POSIX.1-2001 ¤«¤é¤Ï³°¤µ¤ì¤Æ¤¤¤ë¡£
-HP-UX ¤Ë¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¸ºß¤·¤Ê¤¤¡£
-°Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÂå¤ï¤ê¤Ë
-.I sysconf(_SC_PAGESIZE)
-¤òÍøÍѤ¹¤Ù¤­¤Ç¤¢¤ë¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O Whether
-.\"O .BR getpagesize ()
-.\"O is present as a Linux system call depends on the architecture.
-.BR getpagesize ()
-¤¬ Linux ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ¸ºß¤¹¤ë¤«¤É¤¦¤«¤Ï¡¢¤½¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë
-°Í¸¤·¤Æ¤¤¤ë¡£
-.\"O If it is, it returns the kernel symbol
-.\"O .BR PAGE_SIZE ,
-.\"O whose value depends on the architecture and machine model.
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¥«¡¼¥Í¥ë¥·¥ó¥Ü¥ë¤Î
-.B PAGE_SIZE
-¤òÊÖ¤¹¡£
-.B PAGE_SIZE
-¤ÎÃͤϡ¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤È¥Þ¥·¥ó¥â¥Ç¥ë¤Ë°Í¸¤¹¤ë¡£
-.\"O Generally, one uses binaries that are dependent on the architecture but not
-.\"O on the machine model, in order to have a single binary
-.\"O distribution per architecture.
-.\"O This means that a user program
-.\"O should not find
-.\"O .B PAGE_SIZE
-.\"O at compile time from a header file,
-.\"O but use an actual system call, at least for those architectures
-.\"O (like sun4) where this dependency exists.
-°ìÈ̤ˡ¢¥Ð¥¤¥Ê¥ê¤Ï¡¢¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤´¤È¤Ë1¤Ä¤Î¥Ð¥¤¥Ê¥êÇÛÉۤǺѤޤ»¤ë¤¿¤á¤Ë¡¢
-¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤Ï°Í¸¤·¤Æ¤¤¤ë¤¬¥Þ¥·¥ó¥â¥Ç¥ë¤Ë¤Ï°Í¸¤·¤Æ¤¤¤Ê¤¤¡£
-¤Ä¤Þ¤ê¡¢¥æ¡¼¥¶¥×¥í¥°¥é¥à¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤«¤é
-.B PAGE_SIZE
-¤ò¸«¤Ä¤±¤Æ»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
-¾¯¤Ê¤¯¤È¤â¡¢¥Þ¥·¥ó¥â¥Ç¥ë¤Ë¤Ä¤¤¤Æ¤â°Í¸À­¤¬Â¸ºß¤¹¤ë (sun4 ¤Î¤è¤¦¤Ê)
-¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤ª¤¤¤Æ¤ÏËÜʪ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ¹¤ëɬÍפ¬¤¢¤ë¡£
-.\"O Here libc4, libc5, glibc 2.0 fail because their
-.\"O .BR getpagesize ()
-.\"O returns a statically derived value, and does not use a system call.
-.\"O Things are OK in glibc 2.1.
-¾°¡¢ libc4, libc5, glibc 2.0 ¤Ç¤Ï¡¢
-.BR getpagesize ()
-¤¬¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò»ÈÍѤ»¤º¡¢¸ÇÄê¤ÎÃͤòÊÖ¤¹¤¿¤á¤Ë¡¢¤³¤ÎÊýË¡¤Ï
-¼ºÇÔ¤¹¤ë¡£glibc 2.1 ¤Ç¤ÏÂç¾æÉפǤ¢¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR mmap (2),
-.BR sysconf (3)
+\fBgetpagesize\fP()  が Linux のシステムコールとして存在するかどうかは、そのアーキテクチャに 依存している。
+システムコールとして存在する場合には、カーネルシンボルの \fBPAGE_SIZE\fP を返す。 \fBPAGE_SIZE\fP
+の値は、アーキテクチャとマシンモデルに依存する。 一般に、バイナリは、アーキテクチャごとに1つのバイナリ配布で済ませるために、
+アーキテクチャには依存しているがマシンモデルには依存していない。 つまり、ユーザプログラムはコンパイル時にヘッダーファイルから \fBPAGE_SIZE\fP
+を見つけて使用すべきではない。 少なくとも、マシンモデルについても依存性が存在する (sun4 のような)
+アーキテクチャにおいては本物のシステムコールを使用する必要がある。 尚、 libc4, libc5, glibc 2.0 では、
+\fBgetpagesize\fP()  がシステム・コールを使用せず、固定の値を返すために、この方法は 失敗する。glibc 2.1 では大丈夫である。
+.SH 関連項目
+\fBmmap\fP(2), \fBsysconf\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。