OSDN Git Service

Translation snapshot for LDP v3.76
[linuxjm/LDP_man-pages.git] / draft / man2 / poll.2
index fffd3db..3e3bff9 100644 (file)
@@ -1,8 +1,7 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
 .\" and Copyright (C) 2006, Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\" %%%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
 .\"
 .\" Additions from Richard Gooch <rgooch@atnf.CSIRO.AU> and aeb, 971207
 .\" 2006-03-13, mtk, Added ppoll() + various other rewordings
 .\" 2006-07-01, mtk, Added POLLRDHUP + various other wording and
 .\"    formatting changes.
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
 .\"         all rights reserved.
 .\" Translated 1997-12-11, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
 .\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16
 .\" Updated 2006-04-16, Akihiro MOTOKI, Catch up to LDP man-pages 2.28
 .\" Updated 2006-07-23, Akihiro MOTOKI, Catch up to LDP man-pages 2.36
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2012-05-29, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-03-26, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       descriptor              ¥Ç¥£¥¹¥¯¥ê¥×¥¿
-.\"
-.TH POLL 2 2009-09-15 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O poll, ppoll \- wait for some event on a file descriptor
-poll, ppoll \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤ª¤±¤ë¥¤¥Ù¥ó¥È¤òÂÔ¤Ä
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.TH POLL 2 2014\-09\-06 Linux "Linux Programmer's Manual"
+.SH 名前
+poll, ppoll \- ファイルディスクリプタにおけるイベントを待つ
+.SH 書式
 .nf
-.B #include <poll.h>
+\fB#include <poll.h>\fP
 .sp
-.BI "int poll(struct pollfd *" fds ", nfds_t " nfds ", int " timeout );
+\fBint poll(struct pollfd *\fP\fIfds\fP\fB, nfds_t \fP\fInfds\fP\fB, int \fP\fItimeout\fP\fB);\fP
 .sp
-.B #define _GNU_SOURCE
-.B #include <poll.h>
+\fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
+\fB#include <signal.h>\fP
+\fB#include <poll.h>\fP
 .sp
-.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ", "
-.BI "        const struct timespec *" timeout ", const sigset_t *" sigmask );
+\fBint ppoll(struct pollfd *\fP\fIfds\fP\fB, nfds_t \fP\fInfds\fP\fB, \fP
+\fB        const struct timespec *\fP\fItimeout_ts\fP\fB, const sigset_t *\fP\fIsigmask\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR poll ()
-.\"O performs a similar task to
-.\"O .BR select (2):
-.\"O it waits for one of a set of file descriptors to become ready
-.\"O to perform I/O.
-.BR poll ()
-¤Ï
-.BR select (2)
-¤ÈƱÍͤλŻö¤ò¹Ô¤¦¡¢¤Ä¤Þ¤ê¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Î¤¤¤º¤ì¤«°ì¤Ä¤¬
-I/O ¤ò¼Â¹Ô²Äǽ¤Ê¾õÂ֤ˤʤë¤Î¤òÂԤġ£
+.SH 説明
+\fBpoll\fP()  は \fBselect\fP(2)  と同様の仕事を行う、つまり、ファイルディスクリプタ集合のいずれか一つが I/O
+を実行可能な状態になるのを待つ。
 
-.\"O The set of file descriptors to be monitored is specified in the
-.\"O .I fds
-.\"O argument, which is an array of structures of the following form:
-´Æ»ë¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿½¸¹ç¤Ï¡¢
-.I fds
-°ú¤­¿ô¤Ç»ØÄꤹ¤ë¡£
-.I fds
-¤Ï¡¢°Ê²¼¤Î·¿¤Î¹½Â¤ÂΤÎÇÛÎó¤Ç¤¢¤ë¡£
+監視するファイルディスクリプタ集合は、 \fIfds\fP 引き数で指定する。 \fIfds\fP は、以下の型の構造体の配列である。
 .in +4n
 .nf
 
@@ -90,285 +79,116 @@ struct pollfd {
 .in
 .fi
 .PP
-.\"O The caller should specify the number of items in the
-.\"O .I fds
-.\"O array in
-.\"O .IR nfds .
-.I nfds
-¤Ë¤Ï¡¢
-.I fds
-ÇÛÎó¤ÎÍ×ÁÇ¿ô¤ò»ØÄꤹ¤ë¡£
-
-.\"O The field
-.\"O .I fd
-.\"O contains a file descriptor for an open file.
-¹½Â¤ÂΤÎ
-.I fd
-¤Ë¤Ï¥ª¡¼¥×¥ó¤·¤¿¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÆþ¤ì¤ë¡£
-
-.\"O The field
-.\"O .I events
-.\"O is an input parameter, a bit mask specifying the events the application
-.\"O is interested in.
-¹½Â¤ÂΤÎ
-.I events
-Í×ÁǤÏÆþÎϥѥé¥á¡¼¥¿¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¶½Ì£¤ò»ý¤Ã¤Æ¤¤¤ë¥¤¥Ù¥ó¥È¤Î
-¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò»ØÄꤹ¤ë¡£
-
-.\"O The field
-.\"O .I revents
-.\"O is an output parameter, filled by the kernel with the events that
-.\"O actually occurred.
-.\"O The bits returned in
-.\"O .I revents
-.\"O can include any of those specified in
-.\"O .IR events ,
-.\"O or one of the values
-.\"O .BR POLLERR ,
-.\"O .BR POLLHUP ,
-.\"O or
-.\"O .BR POLLNVAL .
-.\"O (These three bits are meaningless in the
-.\"O .I events
-.\"O field, and will be set in the
-.\"O .I revents
-.\"O field whenever the corresponding condition is true.)
-.I revents
-Í×ÁǤϽÐÎϥѥé¥á¡¼¥¿¤Ç¡¢¼ÂºÝ¤Ëµ¯¤³¤Ã¤¿¥¤¥Ù¥ó¥È¤¬¥«¡¼¥Í¥ë¤Ë¤è¤êÀßÄꤵ¤ì¤ë¡£
-.I revents
-¤ÇÊÖ¤µ¤ì¤ë¥Ó¥Ã¥ÈÎó¤Ë¤Ï¡¢
-.I events
-¤Ç»ØÄꤷ¤¿¤â¤Î¤Î¤É¤ì¤«¡¢¤â¤·¤¯¤Ï
-.BR POLLERR ,
-.BR POLLHUP ,
-.B POLLNVAL
-¤Î¤¦¤Á¤Î°ì¤Ä¤¬´Þ¤Þ¤ì¤ë
-.RB ( POLLERR ,
-.BR POLLHUP ,
-.B POLLNVAL
-¤Î 3¤Ä¤Î¥Ó¥Ã¥È¤Ï
-.I events
-¤Ë»ØÄꤷ¤Æ¤â°ÕÌ£¤¬¤Ê¤¯¡¢Âбþ¤·¤¿¾õÂÖ¤¬¿¿¤Î¾ì¹ç¤Ë
-.I revents
-¤ËÀßÄꤵ¤ì¤ë)¡£
-
-.\"O If none of the events requested (and no error) has occurred for any
-.\"O of the file descriptors, then
-.\"O .BR poll ()
-.\"O blocks until one of the events occurs.
-¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤âÍ׵ᤷ¤¿¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤Æ¤ª¤é¤º¡¢
-¥¨¥é¡¼¤âµ¯¤³¤é¤Ê¤¤¾ì¹ç¡¢
-.BR poll ()
-¤Ï¥¤¥Ù¥ó¥È¤Î¤¦¤Á¤¤¤º¤ì¤«°ì¤Ä¤¬È¯À¸¤¹¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£
-
-.\"O The
-.\"O .I timeout
-.\"O argument specifies an upper limit on the time for which
-.\"O .BR poll ()
-.\"O will block, in milliseconds.
-.\"O Specifying a negative value in
-.\"O .I timeout
-.\"O means an infinite timeout.
-.I timeout
-°ú¤­¿ô¤Ï
-.BR poll ()
-¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤òÀßÄꤹ¤ë¤â¤Î¤Ç¡¢¥ß¥êÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£
-.I timeout
-¤ËÉé¤ÎÃͤò»ØÄꤹ¤ë¤È¡¢¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤¬Ìµ¸Â¤È¤Ê¤ë¡£
+\fInfds\fP には、 \fIfds\fP 配列の要素数を指定する。
+
+\fIfd\fP フィールドには、オープンされたファイルのファイルディスクリプタが入る。 このフィールドが負の場合、対応する \fIevents\fP
+フィールドは無視され、 \fIrevents\fP には 0 が返される。(この機能により、一つの \fBpoll\fP()
+の呼び出しで簡単にあるファイルディスクリプタを無視することができる。 単に \fIfd\fP フィールドの符号を反転するだけでよい。
+ただし、この方法はファイルディスクリプタ 0 を無視するのには使用できない点に注意すること。)
+
+構造体の \fIevents\fP 要素は入力パラメータで、 ファイルディスクリプタ \fIfd\fP に関して、
+アプリケーションが興味を持っているイベントのビットマスクを指定する。 このフィールドには 0 を指定することもでき、 その場合 \fIrevents\fP
+で返されるイベントは \fBPOLLHUP\fP, \fBPOLLERR\fP, \fBPOLLNVAL\fP だけである (下記参照)。
+
+\fIrevents\fP 要素は出力パラメータで、実際に起こったイベントがカーネルにより設定される。 \fIrevents\fP で返されるビット列には、
+\fIevents\fP で指定したもののどれか、もしくは \fBPOLLERR\fP, \fBPOLLHUP\fP, \fBPOLLNVAL\fP のうちの一つが含まれる
+(\fBPOLLERR\fP, \fBPOLLHUP\fP, \fBPOLLNVAL\fP の 3つのビットは \fIevents\fP
+に指定しても意味がなく、対応した状態が真の場合に \fIrevents\fP に設定される)。
+
+どのファイルディスクリプタにも要求したイベントが発生しておらず、 エラーも起こらない場合、 \fBpoll\fP()
+はイベントのうちいずれか一つが発生するまで停止 (block) する。
+
+\fItimeout\fP 引き数は、 ファイルディスクリプタが利用可能になるまで \fBpoll\fP() が停止する時間をミリ秒で指定する。 \fBpoll\fP()
+の呼び出しは以下のいずれかになるまで停止する。
+.IP * 3
+ファイルディスクリプタが利用可能になる
+.IP *
+呼び出しがシグナルハンドラーにより割り込まれた
+.IP *
+タイムアウトが満了する
+.PP
+\fItimeout\fP 時間はシステムクロックの粒度に切り上げられ、 カーネルのスケジューリング遅延により少しだけ長くなる可能性がある点に注意すること。
+\fItimeout\fP に負の値を指定した場合、タイムアウト時間が無限大を意味する。 \fItimeout\fP を 0 に指定した場合、I/O
+可能なファイルディスクリプタがない場合であっても、 \fBpoll\fP() はすぐに返る。
 
-.\"O The bits that may be set/returned in
-.\"O .I events
-.\"O and
-.\"O .I revents
-.\"O are defined in \fI<poll.h>\fP:
-.I events
-¤Ë»ØÄꤷ¤¿¤ê¡¢
-.I revents
-¤ÇÊÖ¤µ¤ì¤ë¥Ó¥Ã¥È¤Ï \fI<poll.h>\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
+\fIevents\fP に指定したり、 \fIrevents\fP で返されるビットは \fI<poll.h>\fP で定義されている:
 .RS
-.TP
-.B POLLIN
-.\"O There is data to read.
-Æɤ߽Ф·²Äǽ¤Ê¥Ç¡¼¥¿¤¬¤¢¤ë¡£
-.TP
-.B POLLPRI
-.\"O There is urgent data to read (e.g., out-of-band data on TCP socket;
-.\"O pseudo-terminal master in packet mode has seen state change in slave).
-Æɤ߽Ф·²Äǽ¤Ê¶ÛµÞ¥Ç¡¼¥¿ (urgent data) ¤¬¤¢¤ë
-(Î㤨¤Ð¡¢TCP ¥½¥±¥Ã¥È¤ÎÂÓ°è³° (out-of-band data) ¥Ç¡¼¥¿¤ò¼õ¿®¤·¤¿¾ì¹ç¤ä¡¢
-¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Îµ¼»÷üËö¤Î¥Þ¥¹¥¿¤¬¥¹¥ì¡¼¥Ö¦¤ÎÊѲ½¤ò¸«¤Ä¤±¤¿¤È¤­)¡£
-.TP
-.B POLLOUT
-.\"O Writing now will not block.
-½ñ¤­¹þ¤ß¤¬Ää»ß (block) ¤·¤Ê¤¤¾õÂ֤Ǥ¢¤ë¡£
-.TP
-.\"O .BR POLLRDHUP " (since Linux 2.6.17)"
-.BR POLLRDHUP " (Linux 2.6.17 °Ê¹ß)"
-.\"O Stream socket peer closed connection,
-.\"O or shut down writing half of connection.
-.\"O The
-.\"O .B _GNU_SOURCE
-.\"O feature test macro must be defined in order to obtain this definition.
-¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¤Î¾ü¤¬¡¢¥³¥Í¥¯¥·¥ç¥ó¤ò close ¤·¤¿¤«¡¢
-¥³¥Í¥¯¥·¥ç¥ó¤Î½ñ¤­¹þ¤ß¦¤ò shutdown ¤·¤¿¡£
-¤³¤ÎÄêµÁ¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢
-.B _GNU_SOURCE
-µ¡Ç½¸¡ºº¥Þ¥¯¥í¤òÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.TP
-.B POLLERR
-.\"O Error condition (output only).
-¥¨¥é¡¼¾õÂÖ (½ÐÎϤξì¹ç¤Î¤ß)¡£
-.TP
-.B POLLHUP
-.\"O Hang up (output only).
-¥Ï¥ó¥°¥¢¥Ã¥×¤·¤¿ (½ÐÎϤξì¹ç¤Î¤ß)¡£
-.TP
-.B POLLNVAL
-.\"O Invalid request:
-.\"O .I fd
-.\"O not open (output only).
-ÉÔÀµ¤ÊÍ×µá:
-.I fd
-¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤ (½ÐÎϤξì¹ç¤Î¤ß)¡£
+.TP 
+\fBPOLLIN\fP
+読み出し可能なデータがある。
+.TP 
+\fBPOLLPRI\fP
+読み出し可能な緊急データ (urgent data) がある (例えば、TCP ソケットの帯域外 (out\-of\-band data)
+データを受信した場合や、 パケットモードの擬似端末のマスタがスレーブ側の変化を見つけたとき)。
+.TP 
+\fBPOLLOUT\fP
+書き込みが可能になった。ただし、ソケットやパイプで利用可能な空間よりも大きなデータを書き込んだ場合には (\fBO_NONBLOCK\fP
+がセットされている場合以外は) やはり停止することになる。
+.TP 
+\fBPOLLRDHUP\fP (Linux 2.6.17 以降)
+ストリームソケットの他端が、コネクションを close したか、 コネクションの書き込み側を shutdown した。 この定義を有効にするには、
+(「どの」ヘッダファイルをインクルードするよりも前に)  \fB_GNU_SOURCE\fP 機能検査マクロを定義しなければならない。
+.TP 
+\fBPOLLERR\fP
+エラー状態 (出力の場合のみ)。
+.TP 
+\fBPOLLHUP\fP
+ハングアップした (出力の場合のみ)。
+.TP 
+\fBPOLLNVAL\fP
+不正な要求: \fIfd\fP がオープンされていない (出力の場合のみ)。
 .RE
 .PP
-.\"O When compiling with
-.\"O .B _XOPEN_SOURCE
-.\"O defined, one also has the following,
-.\"O which convey no further information beyond the bits listed above:
-.B _XOPEN_SOURCE
-¤òÄêµÁ¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ë¤Ï¡¢°Ê²¼¤ÎÄêµÁ¤â¹Ô¤ï¤ì¤ë¡£
-¤¿¤À¤·¡¢¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ë¥Ó¥Ã¥È°Ê¾å¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤ëÌõ¤Ç¤Ï¤Ê¤¤¡£
+\fB_XOPEN_SOURCE\fP を定義してコンパイルした場合には、以下の定義も行われる。
+ただし、上記のリストにあるビット以上の情報が得られる訳ではない。
 .RS
-.TP
-.B POLLRDNORM
-.\"O Equivalent to
-.\"O .BR POLLIN .
-.B POLLIN
-¤ÈƱ¤¸¡£
-.TP
-.B POLLRDBAND
-.\"O Priority band data can be read (generally unused on Linux).
-Í¥ÀèÂÓ°è¥Ç¡¼¥¿ (priority band data) ¤¬Æɤ߽Ф·²Äǽ¤Ç¤¢¤ë
-(ÉáÄ̤ϠLinux ¤Ç¤Ï»ÈÍѤµ¤ì¤Ê¤¤)¡£
+.TP 
+\fBPOLLRDNORM\fP
+\fBPOLLIN\fP と同じ。
+.TP 
+\fBPOLLRDBAND\fP
 .\" POLLRDBAND is used in the DECnet protocol.
-.TP
-.B POLLWRNORM
-.\"O Equivalent to
-.\"O .BR POLLOUT .
-.B POLLOUT
-¤ÈƱ¤¸¡£
-.TP
-.B POLLWRBAND
-.\"O Priority data may be written.
-Í¥ÀèÂÓ°è¥Ç¡¼¥¿ (priority data) ¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤¢¤ë¡£
+優先帯域データ (priority band data) が読み出し可能である (普通は Linux では使用されない)。
+.TP 
+\fBPOLLWRNORM\fP
+\fBPOLLOUT\fP と同じ。
+.TP 
+\fBPOLLWRBAND\fP
+優先帯域データ (priority data) が書き込み可能である。
 .RE
 .PP
-.\"O Linux also knows about, but does not use
-.\"O .BR POLLMSG .
-Linux ¤Ç¤Ï
-.B POLLMSG
-¤âÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¡£
+Linux では \fBPOLLMSG\fP も定義されているが、使用されていない。
 .SS ppoll()
-.\"O The relationship between
-.\"O .BR poll ()
-.\"O and
-.\"O .BR ppoll ()
-.\"O is analogous to the relationship between
-.\"O .BR select (2)
-.\"O and
-.\"O .BR pselect (2):
-.\"O like
-.\"O .BR pselect (2),
-.\"O .BR ppoll ()
-.\"O allows an application to safely wait until either a file descriptor
-.\"O becomes ready or until a signal is caught.
-.BR poll ()
-¤È
-.BR ppoll ()
-¤Î´Ø·¸¤Ï
-.BR select (2)
-¤È
-.BR pselect (2)
-¤Î´Ø·¸¤ÈƱ¤¸¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë:
-.BR pselect (2)
-¤ÈƱÍͤˡ¢
-.BR ppoll ()
-¤ò»È¤¦¤È¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¾õÂÖÊѲ½
-¤â¤·¤¯¤Ï¥·¥°¥Ê¥ë¤ÎÊ᪤ò°ÂÁ´¤ËÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£
+\fBpoll\fP()  と \fBppoll\fP()  の関係は \fBselect\fP(2)  と \fBpselect\fP(2)  の関係と同じようなものである:
+\fBpselect\fP(2)  と同様に、 \fBppoll\fP()  を使うと、アプリケーションはファイルディスクリプタの状態変化
+もしくはシグナルの捕捉を安全に待つことができる。
 .PP
-.\"O Other than the difference in the
-.\"O .I timeout
-.\"O argument, the following
-.\"O .BR ppoll ()
-.\"O call:
-.I timeout
-°ú¤­¿ô¤Î°ã¤¤¤ò½ü¤¯¤È¡¢°Ê²¼¤Î
-.BR ppoll ()
-¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢
+\fItimeout\fP 引き数の精度の違いを除くと、以下の \fBppoll\fP()  の呼び出しは、
 .nf
 
-    ready = ppoll(&fds, nfds, timeout, &sigmask);
+    ready = ppoll(&fds, nfds, timeout_ts, &sigmask);
 
 .fi
-.\"O is equivalent to
-.\"O .I atomically
-.\"O executing the following calls:
-¼¡¤Î¥³¡¼¥ë¤ò
-.I atomic
-¤Ë¼Â¹Ô¤¹¤ë¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£
+次の呼び出しを \fIatomic\fP に実行するのと等価である。
 .nf
 
     sigset_t origmask;
+    int timeout;
 
+    timeout = (timeout_ts == NULL) ? \-1 :
+              (timeout_ts.tv_sec * 1000 + timeout_ts.tv_nsec / 1000000);
     sigprocmask(SIG_SETMASK, &sigmask, &origmask);
     ready = poll(&fds, nfds, timeout);
     sigprocmask(SIG_SETMASK, &origmask, NULL);
 .fi
 .PP
-.\"O See the description of
-.\"O .BR pselect (2)
-.\"O for an explanation of why
-.\"O .BR ppoll ()
-.\"O is necessary.
-¤Ê¤¼
-.BR ppoll ()
-¤¬É¬ÍפʤΤ«¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¤Ï
-.BR pselect (2)
-¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£
+なぜ \fBppoll\fP()  が必要なのかについての説明は \fBpselect\fP(2)  の説明を参照のこと。
 
-.\"O If the
-.\"O .I sigmask
-.\"O argument is specified as NULL, then
-.\"O no signal mask manipulation is performed
-.\"O (and thus
-.\"O .BR ppoll ()
-.\"O differs from
-.\"O .BR poll ()
-.\"O only in the precision of the
-.\"O .I timeout
-.\"O argument).
-.I sigmask
-°ú¤­¿ô¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ÎÁàºî¤Ï¹Ô¤ï¤ì¤Ê¤¤
-(¤·¤¿¤¬¤Ã¤Æ¡¢
-.BR ppoll ()
-¤Î
-.BR poll ()
-¤È¤Î°ã¤¤¤Ï
-.I timeout
-°ú¤­¿ô¤ÎÀºÅÙ¤À¤±¤È¤Ê¤ë)¡£
+\fIsigmask\fP 引き数に NULL が指定された場合、シグナルマスクの操作は行われない (したがって、 \fBppoll\fP()  の
+\fBpoll\fP()  との違いは \fItimeout\fP 引き数の精度だけとなる)。
 
-.\"O The
-.\"O .I timeout
-.\"O argument specifies an upper limit on the amount of time that
-.\"O .BR ppoll ()
-.\"O will block.
-.\"O This argument is a pointer to a structure of the following form:
-.I timeout
-°ú¤­¿ô¤Ï
-.BR ppoll ()
-¤¬Ää»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£
-¤³¤Î°ú¤­¿ô¤Ë¤Ï°Ê²¼¤Î·¿¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò»ØÄꤹ¤ë¡£
+\fItimeout\fP 引き数は \fBppoll\fP()  が停止する時間の上限を指定するものである。
+この引き数には以下の型の構造体へのポインタを指定する。
 .in +4n
 .nf
 
@@ -379,160 +199,56 @@ struct timespec {
 .fi
 .in
 
-.\"O If
-.\"O .I timeout
-.\"O is specified as NULL, then
-.\"O .BR ppoll ()
-.\"O can block indefinitely.
-.I timeout
-¤Ë NULL ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
-.B ppoll
-¤Ï̵¸Â¤ËÄä»ß¤¹¤ë¤³¤È¤¬¤¢¤êÆÀ¤ë¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O On success, a positive number is returned; this is
-.\"O the number of structures which have nonzero
-.\"O .I revents
-.\"O fields (in other words, those descriptors with events or errors reported).
-.\"O A value of 0 indicates that the call timed out and no file
-.\"O descriptors were ready.
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-À®¸ù¤·¤¿¾ì¹ç¤ÏÀµ¤Î¿ô¤òÊÖ¤¹¡£¤³¤Î¿ô¤Ï 0 °Ê³°¤Î
-.I revents
-Í×ÁǤò»ý¤Ä¹½Â¤ÂΤοô¤Ç¤¢¤ë (Ê̤θÀ¤¤Êý¤ò¤¹¤ë¤È¡¢¤³¤ì¤é¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿
-¤Ë¤Ï¥¤¥Ù¥ó¥È¤«¥¨¥é¡¼Êó¹ð¤¬¤¢¤ë)¡£
-ÃÍ 0 ¤Ï¡¢¥¿¥¤¥à¥¢¥¦¥È¤È¤Ê¤ê¡¢¤É¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤â¥¤¥Ù¥ó¥È¤¬
-ȯÀ¸¤·¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
-.I errno
-¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B EFAULT
-.\"O The array given as argument was not contained in the calling program's
-.\"O address space.
-°ú¤­¿ô¤È¤·¤Æ»ØÄꤷ¤¿ÇÛÎ󤬡¢¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë
-´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£
-.TP
-.B EINTR
-.\"O A signal occurred before any requested event; see
-.\"O .BR signal (7).
-Í׵ᤵ¤ì¤¿¥¤¥Ù¥ó¥È¤Î¤É¤ì¤«¤¬µ¯¤³¤ëÁ°¤Ë¥·¥°¥Ê¥ë¤¬È¯À¸¤·¤¿¡£
-.BR signal (7)
-»²¾È¡£
-.TP
-.B EINVAL
-.\"O The
-.\"O .I nfds
-.\"O value exceeds the
-.\"O .B RLIMIT_NOFILE
-.\"O value.
-.I nfds
-¤ÎÃͤ¬
-.B RLIMIT_NOFILE
-¤òĶ¤¨¤¿¡£
-.TP
-.B ENOMEM
-.\"O There was no space to allocate file descriptor tables.
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë¤ò³ÎÊݤ¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬¤Ê¤¤¡£
-.\"O .SH VERSIONS
-.SH ¥Ð¡¼¥¸¥ç¥ó
-.\"O The
-.\"O .BR poll ()
-.\"O system call was introduced in Linux 2.1.23.
-.\"O The
-.\"O .BR poll ()
-.\"O library call was introduced in libc 5.4.28
-.\"O (and provides emulation using select(2) if your kernel does not
-.\"O have a
-.\"O .BR poll ()
-.\"O system call).
-.BR poll ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.1.23 ¤ÇƳÆþ¤µ¤ì¤¿¡£
-.BR poll ()
-¥é¥¤¥Ö¥é¥ê¡¦¥³¡¼¥ë¤Ï libc 5.4.28 ¤«¤éƳÆþ¤µ¤ì¤¿
-(¤³¤ì¤Ï¥«¡¼¥Í¥ë¤¬
-.BR poll ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë
-.BR select (2)
-¤ò»ÈÍѤ·¤Æ¥¨¥ß¥å¥ì¡¼¥È¤ò¹Ô¤¦)¡£
-
-.\"O The
-.\"O .BR ppoll ()
-.\"O system call was added to Linux in kernel 2.6.16.
-.\"O The
-.\"O .BR ppoll ()
-.\"O library call was added in glibc 2.4.
-.BR ppoll ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï ¥«¡¼¥Í¥ë 2.6.16 ¤Ç Linux ¤ËÄɲ䵤줿¡£
-.BR ppoll ()
-¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤Ï glibc 2.4 ¤ËÄɲ䵤줿¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O .BR poll ()
-.\"O conforms to POSIX.1-2001.
-.\"O .BR ppoll ()
-.\"O is Linux-specific.
-.\"O .\" NetBSD 3.0 has a pollts() which is like Linux ppoll().
-.BR poll ()
-¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
-.BR ppoll ()
-¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£
-.\" NetBSD 3.0 ¤Ë¤Ï pollts() ¤¬¤¢¤ë¡£
-.\" pollts() ¤Ï Linux ppoll () ¤ÈƱ¤¸¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O Some implementations define the nonstandard constant
-.\"O .B INFTIM
-.\"O with the value \-1 for use as a
-.\"O .IR timeout .
-.\"O This constant is not provided in glibc.
-¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤Ï¡¢ÃÍ \-1 ¤ò»ý¤Ã¤¿Èóɸ½à¤ÎÄê¿ô
-.B INFTIM
-¤¬ÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢
-.I timeout
-¤Î»ØÄê¤Ë»ÈÍѤǤ­¤ë¡£
-¤³¤ÎÄê¿ô¤Ï glibc ¤Ç¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
-.\"O .SS "LINUX NOTES"
-.SS "Linux ¤Ç¤ÎÃí°Õ"
-.\"O The Linux
-.\"O .BR ppoll ()
-.\"O system call modifies its
-.\"O .I timeout
-.\"O argument.
-.\"O However, the glibc wrapper function hides this behavior
-.\"O by using a local variable for the timeout argument that
-.\"O is passed to the system call.
-.\"O Thus, the glibc
-.\"O .BR ppoll ()
-.\"O function does not modify its
-.\"O .I timeout
-.\"O argument.
-Linux ¤Î
-.BR ppoll ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
-.I timeout
-°ú¤­¿ô¤òÊѹ¹¤¹¤ë¡£
-¤·¤«¤·¡¢glibc ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ timeout °ú¤­¿ô
-¤È¤·¤Æ¥í¡¼¥«¥ëÊÑ¿ô¤ò»È¤¦¤³¤È¤Ç¤³¤ÎÆ°ºî¤ò±£Ê䷤Ƥ¤¤ë¡£
-¤³¤Î¤¿¤á¡¢glibc ¤Î
-.BR ppoll ()
-´Ø¿ô¤Ï
-.I timeout
-°ú¤­¿ô¤òÊѹ¹¤·¤Ê¤¤¡£
-.\"O .SH BUGS
-.SH ¥Ð¥°
-.\"O See the discussion of spurious readiness notifications under the
-.\"O BUGS section of
-.\"O .BR select (2).
-.BR select (2)
-¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡¢¸í¤Ã¤¿½àÈ÷´°Î»ÄÌÃΠ(spurious readiness
-notifications) ¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤ò»²¾È¤Î¤³¤È¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR select (2),
-.BR select_tut (2),
-.BR feature_test_macros (7),
-.BR time (7)
+\fItimeout_ts\fP に NULL が指定された場合、 \fBppoll\fP は無限に停止することがあり得る。
+.SH 返り値
+成功した場合は正の数を返す。この数は 0 以外の \fIrevents\fP 要素を持つ構造体の数である (別の言い方をすると、これらのディスクリプタ
+にはイベントかエラー報告がある)。 値 0 は、タイムアウトとなり、どのファイルディスクリプタでもイベントが 発生しなかったことを示す。エラーの場合は
+\-1 が返され、 \fIerrno\fP が適切に設定される。
+.SH エラー
+.TP 
+\fBEFAULT\fP
+引き数として指定した配列が、呼び出したプロセスのアドレス空間に 含まれていない。
+.TP 
+\fBEINTR\fP
+要求されたイベントのどれかが起こる前にシグナルが発生した。 \fBsignal\fP(7)  参照。
+.TP 
+\fBEINVAL\fP
+\fInfds\fP の値が \fBRLIMIT_NOFILE\fP を超えた。
+.TP 
+\fBENOMEM\fP
+ファイルディスクリプタ・テーブルを確保するためのメモリがない。
+.SH バージョン
+.\" library call was introduced in libc 5.4.28
+\fBpoll\fP() システムコールは Linux 2.1.23 で導入された。
+このシステムコールが存在しない古いカーネルでは、
+glibc (や古い Linux libc) は \fBselect\fP(2) を使用して \fBpoll\fP()
+ラッパー関数のエミュレーションを行う。
+
+\fBppoll\fP()  システムコールは カーネル 2.6.16 で Linux に追加された。 \fBppoll\fP()  ライブラリコールは glibc
+2.4 に追加された。
+.SH 準拠
+.\" NetBSD 3.0 has a pollts() which is like Linux ppoll().
+\fBpoll\fP()  は POSIX.1\-2001 に準拠している。 \fBppoll\fP()  は Linux 固有である。
+.SH 注意
+いくつかの実装では、値 \-1 を持った非標準の定数 \fBINFTIM\fP が定義されており、 \fBpoll\fP()  の \fItimeout\fP
+の指定に使用できる。 この定数は glibc では定義されていない。
+
+\fBpoll\fP() で監視中のファイルディスクリプタが別のスレッドによってクローズされた場合に何が起こるかの議論については、 \fBselect\fP(2)
+を参照してほしい。
+.SS "C ライブラリとカーネル ABI の違い"
+Linux の \fBppoll\fP()  システムコールは \fItimeout_ts\fP 引き数を変更する。 しかし、glibc
+のラッパー関数は、システムコールに渡す timeout 引き数 としてローカル変数を使うことでこの動作を隠蔽している。 このため、glibc の
+\fBppoll\fP()  関数では \fItimeout_ts\fP 引き数は変更されない。
+
+素の \fBppoll\fP() システムコールは 5 番目の引き数 \fIsize_t sigsetsize\fP をとる。 この引き数は \fIsigmask\fP
+引き数のバイト単位のサイズを指定する。 glibc の \fBppoll\fP() ラッパー関数は、この引き数に固定値
+(\fIsizeof(sigset_t)\fP と同じ) を指定する。
+.SH バグ
+\fBselect\fP(2)  の「バグ」の節に書かれている、誤った準備完了通知 (spurious readiness notifications)
+についての議論を参照のこと。
+.SH 関連項目
+\fBrestart_syscall\fP(2), \fBselect\fP(2), \fBselect_tut\fP(2), \fBtime\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.76 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。