OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man2 / signalfd.2
index cb23766..96af41c 100644 (file)
 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 .\" MA  02111-1307  USA
 .\"
-.\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
-.\"         all rights reserved.
-.\" Translated 2008-04-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.79
-.\" Updated 2008-11-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
-.\" Updated 2009-02-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.18
-.\" 
-.TH SIGNALFD 2 2009-01-13 Linux "Linux Programmer's Manual"
-.\"O .SH NAME
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH SIGNALFD 2 2009\-01\-13 Linux "Linux Programmer's Manual"
 .SH 名前
-.\"O signalfd \- create a file descriptor for accepting signals
 signalfd \- シグナル受け付け用のファイルディスクリプタを生成する
-.\"O .SH SYNOPSIS
 .SH 書式
-.B #include <sys/signalfd.h>
+\fB#include <sys/signalfd.h>\fP
 .sp
-.BI "int signalfd(int " fd ", const sigset_t *" mask ", int " flags );
-.\"O .SH DESCRIPTION
+\fBint signalfd(int \fP\fIfd\fP\fB, const sigset_t *\fP\fImask\fP\fB, int \fP\fIflags\fP\fB);\fP
 .SH 説明
-.\"O .BR signalfd ()
-.\"O creates a file descriptor that can be used to accept signals
-.\"O targeted at the caller.
-.\"O This provides an alternative to the use of a signal handler or
-.\"O .BR sigwaitinfo (2),
-.\"O and has the advantage that the file descriptor may be monitored by
-.\"O .BR select (2),
-.\"O .BR poll (2),
-.\"O and
-.\"O .BR epoll (7).
-.BR signalfd ()
-は、呼び出し元宛てのシグナルを受け付けるために使用されるファイル
-ディスクリプタを生成する。
-この方法はシグナルハンドラや
-.BR sigwaitinfo (2)
-を用いる方法の代わりとなるものであり、このファイルディスクリプタを
-.BR select (2),
-.BR poll (2),
-.BR epoll (7)
-で監視できるという利点がある。
+\fBsignalfd\fP()  は、呼び出し元宛てのシグナルを受け付けるために使用されるファイル ディスクリプタを生成する。 この方法はシグナルハンドラや
+\fBsigwaitinfo\fP(2)  を用いる方法の代わりとなるものであり、このファイルディスクリプタを \fBselect\fP(2),
+\fBpoll\fP(2), \fBepoll\fP(7)  で監視できるという利点がある。
 
-.\"O The
-.\"O .I mask
-.\"O argument specifies the set of signals that the caller
-.\"O wishes to accept via the file descriptor.
-.\"O This argument is a signal set whose contents can be initialized
-.\"O using the macros described in
-.\"O .BR sigsetops (3).
-.I mask
-引き数には、呼び出し元がこのファイルディスクリプタ経由で受け付けたい
-シグナル集合を指定する。この引き数で指定するシグナル集合の内容は、
-.BR sigsetops (3)
-で説明されているマクロを使って初期化することができる。
-.\"O Normally, the set of signals to be received via the
-.\"O file descriptor should be blocked using
-.\"O .BR sigprocmask (2),
-.\"O to prevent the signals being handled according to their default
-.\"O dispositions.
-通常、ファイルディスクリプタ経由で受信するシグナル集合は、
-そのシグナルがデフォルトの配送方法に基いて処理されるのを防ぐために、
-.BR sigprocmask (2)
-を使ってブロックしておくべきである。
-.\"O It is not possible to receive
-.\"O .B SIGKILL
-.\"O or
-.\"O .B SIGSTOP
-.\"O signals via a signalfd file descriptor;
-.\"O these signals are silently ignored if specified in
-.\"O .IR mask .
-シグナル
-.B SIGKILL
-と
-.B SIGSTOP
-を signalfd ファイルディスクリプタ経由で受信することはできない。
-これらのシグナルが
-.I mask
-で指定された場合には黙って無視される。
+\fImask\fP 引き数には、呼び出し元がこのファイルディスクリプタ経由で受け付けたい シグナル集合を指定する。この引き数で指定するシグナル集合の内容は、
+\fBsigsetops\fP(3)  で説明されているマクロを使って初期化することができる。 通常、ファイルディスクリプタ経由で受信するシグナル集合は、
+そのシグナルがデフォルトの配送方法に基いて処理されるのを防ぐために、 \fBsigprocmask\fP(2)  を使ってブロックしておくべきである。
+シグナル \fBSIGKILL\fP と \fBSIGSTOP\fP を signalfd ファイルディスクリプタ経由で受信することはできない。 これらのシグナルが
+\fImask\fP で指定された場合には黙って無視される。
 
-.\"O If the
-.\"O .I fd
-.\"O argument is \-1,
-.\"O then the call creates a new file descriptor and associates the
-.\"O signal set specified in
-.\"O .I mask
-.\"O with that descriptor.
-.\"O If
-.\"O .I fd
-.\"O is not \-1,
-.\"O then it must specify a valid existing signalfd file descriptor, and
-.\"O .I mask
-.\"O is used to replace the signal set associated with that descriptor.
-.I fd
-引き数が \-1 の場合、
-.BR signalfd ()
-は新しいファイルディスクリプタを生成し、
-.I mask
-で指定されたシグナル集合をそのファイルディスクリプタに関連付ける。
-.I fd
-引き数が \-1 以外の場合、
-.I fd
-には有効な既存の signalfd ファイルディスクリプタを指定しなければならず、
-そのディスクリプタに関連付けられているシグナル集合は
-.I mask
+\fIfd\fP 引き数が \-1 の場合、 \fBsignalfd\fP()  は新しいファイルディスクリプタを生成し、 \fImask\fP
+で指定されたシグナル集合をそのファイルディスクリプタに関連付ける。 \fIfd\fP 引き数が \-1 以外の場合、 \fIfd\fP には有効な既存の
+signalfd ファイルディスクリプタを指定しなければならず、 そのディスクリプタに関連付けられているシグナル集合は \fImask\fP
 を使って置き換えられる。
 
-.\"O Starting with Linux 2.6.27, the following values may be bitwise ORed in
-.\"O .IR flags
-.\"O to change the behaviour of
-.\"O .BR signalfd ():
-Linux 2.6.27 以降では、
-以下の値のいくつかをビット単位の論理和 (OR) で指定することで、
-.BR signalfd ()
+Linux 2.6.27 以降では、 以下の値のいくつかをビット単位の論理和 (OR) で指定することで、 \fBsignalfd\fP()
 の振舞いを変更することができる。
-.TP 14
-.B SFD_NONBLOCK
-.\"O Set the
-.\"O .BR O_NONBLOCK
-.\"O file status flag on the new open file description.
-.\"O Using this flag saves extra calls to
-.\"O .BR fcntl (2)
-.\"O to achieve the same result.
-新しく生成されるオープンファイル記述 (open file description) の
-.B O_NONBLOCK
-ファイルステータスフラグをセットする。
-このフラグを使うことで、
-.B O_NONBLOCK
-をセットするために
-.BR fcntl (2)
+.TP  14
+\fBSFD_NONBLOCK\fP
+新しく生成されるオープンファイル記述 (open file description) の \fBO_NONBLOCK\fP
+ファイルステータスフラグをセットする。 このフラグを使うことで、 \fBO_NONBLOCK\fP をセットするために \fBfcntl\fP(2)
 を追加で呼び出す必要がなくなる。
-.TP
-.B SFD_CLOEXEC
-.\"O Set the close-on-exec
-.\"O .RB ( FD_CLOEXEC )
-.\"O flag on the new file descriptor.
-.\"O See the description of the
-.\"O .B O_CLOEXEC
-.\"O flag in
-.\"O .BR open (2)
-.\"O for reasons why this may be useful.
-新しいファイルディスクリプタに対して
-close-on-exec
-.RB ( FD_CLOEXEC )
-フラグをセットする。
-このフラグが役に立つ理由については、
-.BR open (2)
-の
-.B O_CLOEXEC
-フラグの説明を参照のこと。
+.TP 
+\fBSFD_CLOEXEC\fP
+新しいファイルディスクリプタに対して close\-on\-exec (\fBFD_CLOEXEC\fP)  フラグをセットする。
+このフラグが役に立つ理由については、 \fBopen\fP(2)  の \fBO_CLOEXEC\fP フラグの説明を参照のこと。
 .PP
-.\"O In Linux up to version 2.6.26, the
-.\"O .I flags
-.\"O argument is unused, and must be specified as zero.
-バージョン 2.6.26 以前の Linux では、
-.I flags
-引き数は未使用であり、0 を指定しなければならない。
+バージョン 2.6.26 以前の Linux では、 \fIflags\fP 引き数は未使用であり、0 を指定しなければならない。
 
-.\"O .BR signalfd ()
-.\"O returns a file descriptor that supports the following operations:
-.BR signalfd ()
-が返すファイルディスクリプタは以下の操作をサポートしている。
-.TP
-.BR read (2)
-.\"O If one or more of the signals specified in
-.\"O .I mask
-.\"O is pending for the process, then the buffer supplied to
-.\"O .BR read (2)
-.\"O is used to return one or more
-.\"O .I signalfd_siginfo
-.\"O structures (see below) that describe the signals.
-.\"O The
-.\"O .BR read (2)
-.\"O returns information for as many signals as are pending and will
-.\"O fit in the supplied buffer.
-.\"O The buffer must be at least
-.\"O .I "sizeof(struct signalfd_siginfo)"
-.\"O bytes.
-.\"O The return value of the
-.\"O .BR read (2)
-.\"O is the total number of bytes read.
-.I mask
-に指定されているシグナルのうち一つ以上がそのプロセスに対して
-処理待ち (pending) であれば、それらのシグナルの情報が
-.BR read (2)
-に渡されたバッファを使って、
-.I signalfd_siginfo
-構造体に格納されて返される。
-.BR read (2)
-は、バッファに格納可能な範囲でできるだけ多くの処理待ちのシグナルに
-ついての情報を返す。
-バッファは最低でも
-.I "sizeof(struct signalfd_siginfo)"
-バイトの大きさがなければならない。
-.BR read (2)
-の返り値は読み出されたトータルのバイト数である。
+\fBsignalfd\fP()  が返すファイルディスクリプタは以下の操作をサポートしている。
+.TP 
+\fBread\fP(2)
+\fImask\fP に指定されているシグナルのうち一つ以上がそのプロセスに対して 処理待ち (pending) であれば、それらのシグナルの情報が
+\fBread\fP(2)  に渡されたバッファを使って、 \fIsignalfd_siginfo\fP 構造体に格納されて返される。 \fBread\fP(2)
+は、バッファに格納可能な範囲でできるだけ多くの処理待ちのシグナルに ついての情報を返す。 バッファは最低でも \fIsizeof(struct
+signalfd_siginfo)\fP バイトの大きさがなければならない。 \fBread\fP(2)  の返り値は読み出されたトータルのバイト数である。
 .IP
-.\"O As a consequence of the
-.\"O .BR read (2),
-.\"O the signals are consumed,
-.\"O so that they are no longer pending for the process
-.\"O (i.e., will not be caught by signal handlers,
-.\"O and cannot be accepted using
-.\"O .BR sigwaitinfo (2)).
-.BR read (2)
-が行われた結果、シグナルは消費され、
-これらのシグナルはそのプロセスに対しては処理待ちではなくなる
-(つまり、シグナルハンドラで捕捉されることもなく、
-.BR sigwaitinfo (2)
-を使って受け取ることもできなくなる)。
+\fBread\fP(2)  が行われた結果、シグナルは消費され、 これらのシグナルはそのプロセスに対しては処理待ちではなくなる
+(つまり、シグナルハンドラで捕捉されることもなく、 \fBsigwaitinfo\fP(2)  を使って受け取ることもできなくなる)。
 .IP
-.\"O If none of the signals in
-.\"O .I mask
-.\"O is pending for the process, then the
-.\"O .BR read (2)
-.\"O either blocks until one of the signals in
-.\"O .I mask
-.\"O is generated for the process,
-.\"O or fails with the error
-.\"O .B EAGAIN
-.\"O if the file descriptor has been made nonblocking.
-.I mask
-に指定されているシグナルがそのプロセスに対して一つも処理待ちでなければ、
-.BR read (2)
-は、
-.I mask
-で指定されたシグナルのうちいずれか一つがそのプロセスに対して発生するまで
-停止 (block) する、もしくはファイルディスクリプタが非停止 (nonblocking)
-に設定されている場合はエラー
-.B EAGAIN
-で失敗する。
-.TP
-.\"O .BR poll "(2), " select "(2) (and similar)"
-.BR poll "(2), " select "(2) (と同様の操作)"
-.\"O The file descriptor is readable
-.\"O (the
-.\"O .BR select (2)
-.\"O .I readfds
-.\"O argument; the
-.\"O .BR poll (2)
-.\"O .B POLLIN
-.\"O flag)
-.\"O if one or more of the signals in
-.\"O .I mask
-.\"O is pending for the process.
-.I mask
-に指定されたシグナルのうち一つ以上がそのプロセスに対して処理待ちであれば、
-ファイルディスクリプタは読み出し可能となる
-.RB ( select (2)
-の
-.I readfds
-引き数や
-.BR poll (2)
-の
-.B POLLIN
-フラグ)。
+\fImask\fP に指定されているシグナルがそのプロセスに対して一つも処理待ちでなければ、 \fBread\fP(2)  は、 \fImask\fP
+で指定されたシグナルのうちいずれか一つがそのプロセスに対して発生するまで 停止 (block) する、もしくはファイルディスクリプタが非停止
+(nonblocking)  に設定されている場合はエラー \fBEAGAIN\fP で失敗する。
+.TP 
+\fBpoll\fP(2), \fBselect\fP(2) (と同様の操作)
+\fImask\fP に指定されたシグナルのうち一つ以上がそのプロセスに対して処理待ちであれば、 ファイルディスクリプタは読み出し可能となる
+(\fBselect\fP(2)  の \fIreadfds\fP 引き数や \fBpoll\fP(2)  の \fBPOLLIN\fP フラグ)。
 .IP
-.\"O The signalfd file descriptor also supports the other file-descriptor
-.\"O multiplexing APIs:
-.\"O .BR pselect (2),
-.\"O .BR ppoll (2),
-.\"O and
-.\"O .BR epoll (7).
-signalfd ファイルディスクリプタは、これ以外のファイルディスクリプタ
-多重 API である
-.BR pselect (2),
-.BR ppoll (2),
-.BR epoll (7)
-もサポートしている。
-.TP
-.BR close (2)
-.\"O When the file descriptor is no longer required it should be closed.
-.\"O When all file descriptors associated with the same signalfd object
-.\"O have been closed, the resources for object are freed by the kernel.
-ファイルディスクリプタがそれ以降は必要なくなった際には、クローズすべきである。
-同じ signalfd オブジェクトに関連付けられたファイルディスクリプタが全て
-クローズされると、そのオブジェクト用の資源がカーネルにより解放される。
-.\"O .SS The signalfd_siginfo structure
-.SS signalfd_siginfo 構造体
-.\"O The format of the
-.\"O .I signalfd_siginfo
-.\"O structure(s) returned by
-.\"O .BR read (2)s
-.\"O from a signalfd file descriptor is as follows:
-signalfd ファイルディスクリプタからの
-.BR read (2)
-で返される
-.I signalfd_siginfo
+signalfd ファイルディスクリプタは、これ以外のファイルディスクリプタ 多重 API である \fBpselect\fP(2),
+\fBppoll\fP(2), \fBepoll\fP(7)  もサポートしている。
+.TP 
+\fBclose\fP(2)
+ファイルディスクリプタがそれ以降は必要なくなった際には、クローズすべきである。 同じ signalfd
+オブジェクトに関連付けられたファイルディスクリプタが全て クローズされると、そのオブジェクト用の資源がカーネルにより解放される。
+.SS "signalfd_siginfo 構造体"
+signalfd ファイルディスクリプタからの \fBread\fP(2)  で返される \fIsignalfd_siginfo\fP
 構造体のフォーマットは以下の通りである。
 .in +4n
 .nf
 
+.\" ssi_trapno is unused on most arches
 struct signalfd_siginfo {
-.\"O     uint32_t ssi_signo;   /* Signal number */
-.\"O     int32_t  ssi_errno;   /* Error number (unused) */
-.\"O     int32_t  ssi_code;    /* Signal code */
-.\"O     uint32_t ssi_pid;     /* PID of sender */
-.\"O     uint32_t ssi_uid;     /* Real UID of sender */
-.\"O     int32_t  ssi_fd;      /* File descriptor (SIGIO) */
-.\"O     uint32_t ssi_tid;     /* Kernel timer ID (POSIX timers)
-.\"O     uint32_t ssi_band;    /* Band event (SIGIO) */
-.\"O     uint32_t ssi_overrun; /* POSIX timer overrun count */
-.\"O     uint32_t ssi_trapno;  /* Trap number that caused signal */
-.\"O .\" ssi_trapno is unused on most arches
-.\"O     int32_t  ssi_status;  /* Exit status or signal (SIGCHLD) */
-.\"O     int32_t  ssi_int;     /* Integer sent by sigqueue(3) */
-.\"O     uint64_t ssi_ptr;     /* Pointer sent by sigqueue(3) */
-.\"O     uint64_t ssi_utime;   /* User CPU time consumed (SIGCHLD) */
-.\"O     uint64_t ssi_stime;   /* System CPU time consumed (SIGCHLD) */
-.\"O     uint64_t ssi_addr;    /* Address that generated signal
-.\"O                              (for hardware-generated signals) */
-.\"O     uint8_t  pad[\fIX\fP];      /* Pad size to 128 bytes (allow for
-.\"O                               additional fields in the future) */
 struct signalfd_siginfo {
     uint32_t ssi_signo;   /* シグナル番号 */
     int32_t  ssi_errno;   /* エラー番号 (未使用) */
@@ -336,7 +102,6 @@ struct signalfd_siginfo {
     uint32_t ssi_band;    /* Band イベント (SIGIO) */
     uint32_t ssi_overrun; /* POSIX タイマのオーバーラン回数 */
     uint32_t ssi_trapno;  /* シグナルの原因となったトラップ番号 */
-.\" ほとんどのアーキテクチャで ssi_trapno は未使用
     int32_t  ssi_status;  /* 終了ステータスかシグナル (SIGCHLD) */
     int32_t  ssi_int;     /* sigqueue(3) から送られた整数 */
     uint64_t ssi_ptr;     /* sigqueue(3) から送られたポインタ */
@@ -350,343 +115,96 @@ struct signalfd_siginfo {
 
 .fi
 .in
-.\"O Each of the fields in this structure
-.\"O is analogous to the similarly named field in the
-.\"O .I siginfo_t
-.\"O structure.
-.\"O The
-.\"O .I siginfo_t
-.\"O structure is described in
-.\"O .BR sigaction (2).
-.I signalfd_siginfo
-構造体の各フィールドは、
-.I siginfo_t
-構造体の同じような名前のフィールドと同様である。
-.I siginfo_t
-構造体については
-.BR sigaction (2)
-に説明がある。
-.\"O Not all fields in the returned
-.\"O .I signalfd_siginfo
-.\"O structure will be valid for a specific signal;
-.\"O the set of valid fields can be determined from the value returned in the
-.\"O .I ssi_code
-.\"O field.
-.\"O This field is the analog of the
-.\"O .I siginfo_t
-.\"O .I si_code
-.\"O field; see
-.\"O .BR sigaction (2)
-.\"O for details.
-返された
-.I signalfd_siginfo
-構造体の全てのフィールドがあるシグナルに対して有効なわけではない。
-どのフィールドが有効かは、
-.I ssi_code
-フィールドで返される値から判定することができる。
-このフィールドは
-.I siginfo_t
-の
-.I si_code
-フィールドと同様である。詳細は
-.BR sigaction (2)
-を参照。
-.\"O .SS fork(2) semantics
-.SS fork(2) での扱い
-.\"O After a
-.\"O .BR fork (2),
-.\"O the child inherits a copy of the signalfd file descriptor.
-.\"O A
-.\"O .BR read (2)
-.\"O from the file descriptor in the child will return information
-.\"O about signals queued to the child.
-.BR fork (2)
-が行われると、子プロセスは signalfd ファイルディスクリプタのコピーを
-継承する。
-子プロセスでこのファイルディスクリプタから
-.BR read (2)
-を行うと、子プロセスに対するキューに入っているシグナルに関する
-情報が返される。
-.\"O .SS execve(2) semantics
-.SS execve(2) での扱い
-.\"O Just like any other file descriptor,
-.\"O a signalfd file descriptor remains open across an
-.\"O .BR execve (2),
-.\"O unless it has been marked for close-on-exec (see
-.\"O .BR fcntl (2)).
-.\"O Any signals that were available for reading before the
-.\"O .BR execve (2)
-.\"O remain available to the newly loaded program.
-.\"O (This is analogous to traditional signal semantics,
-.\"O where a blocked signal that is pending remains pending across an
-.\"O .BR execve (2).)
-他のファイルディスクリプタと全く同様に、
-signalfd ファイルディスクリプタも
-.BR execve (2)
-の前後でオープンされたままとなる。但し、そのファイルディスクリプタに
-close-on-exec のマーク
-.RB ( fcntl (2)
-参照) が付いている場合はクローズされる。
-.BR execve (2)
-の前に読み出し可能となっていた全てのシグナルは新しく起動されたプログラム
-でも引き続き読み出し可能である
-(これは伝統的なシグナルの扱いと同じであり、
-処理待ちのブロックされたシグナルは
-.BR execve (2)
+\fIsignalfd_siginfo\fP 構造体の各フィールドは、 \fIsiginfo_t\fP 構造体の同じような名前のフィールドと同様である。
+\fIsiginfo_t\fP 構造体については \fBsigaction\fP(2)  に説明がある。 返された \fIsignalfd_siginfo\fP
+構造体の全てのフィールドがあるシグナルに対して有効なわけではない。 どのフィールドが有効かは、 \fIssi_code\fP
+フィールドで返される値から判定することができる。 このフィールドは \fIsiginfo_t\fP の \fIsi_code\fP フィールドと同様である。詳細は
+\fBsigaction\fP(2)  を参照。
+.SS "fork(2) での扱い"
+\fBfork\fP(2)  が行われると、子プロセスは signalfd ファイルディスクリプタのコピーを 継承する。
+子プロセスでこのファイルディスクリプタから \fBread\fP(2)  を行うと、子プロセスに対するキューに入っているシグナルに関する 情報が返される。
+.SS "execve(2) での扱い"
+他のファイルディスクリプタと全く同様に、 signalfd ファイルディスクリプタも \fBexecve\fP(2)
+の前後でオープンされたままとなる。但し、そのファイルディスクリプタに close\-on\-exec のマーク (\fBfcntl\fP(2)  参照)
+が付いている場合はクローズされる。 \fBexecve\fP(2)  の前に読み出し可能となっていた全てのシグナルは新しく起動されたプログラム
+でも引き続き読み出し可能である (これは伝統的なシグナルの扱いと同じであり、 処理待ちのブロックされたシグナルは \fBexecve\fP(2)
 の前後で処理待ちのままとなる)。
-.\"O .SS Thread semantics
 .SS スレッドでの扱い
-.\"O The semantics of signalfd file descriptors in a multithreaded program
-.\"O mirror the standard semantics for signals.
-.\"O In other words,
-.\"O when a thread reads from a signalfd file descriptor,
-.\"O it will read the signals that are directed to the thread
-.\"O itself and the signals that are directed to the process
-.\"O (i.e., the entire thread group).
-.\"O (A thread will not be able to read signals that are directed
-.\"O to other threads in the process.)
-マルチスレッドプログラムにおける signalfd ファイルディスクリプタの扱いは
-シグナルの標準的な扱いと全く同じである。
-言い換えると、あるスレッドが signalfd ファイルディスクリプタから
-読み出しを行うと、そのスレッド自身宛てのシグナルとプロセス (すなわち
-スレッドグループ全体) 宛てのシグナルが読み出される。
-(スレッドは同じプロセスの他のスレッド宛てのシグナルを読み出すことはできない。)
-.\"O .SH "RETURN VALUE"
+マルチスレッドプログラムにおける signalfd ファイルディスクリプタの扱いは シグナルの標準的な扱いと全く同じである。
+言い換えると、あるスレッドが signalfd ファイルディスクリプタから 読み出しを行うと、そのスレッド自身宛てのシグナルとプロセス (すなわち
+スレッドグループ全体) 宛てのシグナルが読み出される。 (スレッドは同じプロセスの他のスレッド宛てのシグナルを読み出すことはできない。)
 .SH 返り値
-.\"O On success,
-.\"O .BR signalfd ()
-.\"O returns a signalfd file descriptor;
-.\"O this is either a new file descriptor (if
-.\"O .I fd
-.\"O was \-1), or
-.\"O .I fd
-.\"O if
-.\"O .I fd
-.\"O was a valid signalfd file descriptor.
-.\"O On error, \-1 is returned and
-.\"O .I errno
-.\"O is set to indicate the error.
-成功すると、
-.BR signalfd ()
-は signalfd ファイルディスクリプタを返す。
-返されるファイルディスクリプタは、
-.IR fd
-が \-1 の場合は新規のファイルディスクリプタであり、
-.I fd
-が有効な signalfd ファイルディスクリプタだった場合は
-.I fd
-自身である。
-エラーの場合、\-1 を返し、
-.I errno
-にエラーを示す値を設定する。
-.\"O .SH ERRORS
+成功すると、 \fBsignalfd\fP()  は signalfd ファイルディスクリプタを返す。 返されるファイルディスクリプタは、 \fIfd\fP が
+\-1 の場合は新規のファイルディスクリプタであり、 \fIfd\fP が有効な signalfd ファイルディスクリプタだった場合は \fIfd\fP 自身である。
+エラーの場合、\-1 を返し、 \fIerrno\fP にエラーを示す値を設定する。
 .SH エラー
-.TP
-.B EBADF
-.\"O The
-.\"O .I fd
-.\"O file descriptor is not a valid file descriptor.
-ファイルディスクリプタ
-.I fd
-が有効なファイルディスクリプタでない。
-.TP
-.B EINVAL
-.\"O .I fd
-.\"O is not a valid signalfd file descriptor.
-.I fd
-が有効な signalfd ファイルディスクリプタではない。
+.TP 
+\fBEBADF\fP
+ファイルディスクリプタ \fIfd\fP が有効なファイルディスクリプタでない。
+.TP 
+\fBEINVAL\fP
 .\" or, the
 .\" .I sizemask
 .\" argument is not equal to
 .\" .IR sizeof(sigset_t) ;
-.TP
-.B EINVAL
-.\"O .I flags
-.\"O is invalid;
-.\"O or, in Linux 2.6.26 or earlier,
-.\"O .I flags
-.\"O is nonzero.
-.I flags
-が無効。
-Linux 2.6.26 以前では、
-.I flags
-が 0 以外の値。
-.TP
-.B EMFILE
-.\"O The per-process limit of open file descriptors has been reached.
-オープン済みのファイルディスクリプタの数がプロセスあたりの上限に
-達していた。
-.TP
-.B ENFILE
-.\"O The system-wide limit on the total number of open files has been
-.\"O reached.
+\fIfd\fP が有効な signalfd ファイルディスクリプタではない。
+.TP 
+\fBEINVAL\fP
+\fIflags\fP が無効である。もしくは、Linux 2.6.26 以前の場合には \fIflags\fP が 0 以外である。
+.TP 
+\fBEMFILE\fP
+オープン済みのファイルディスクリプタの数がプロセスあたりの上限に 達していた。
+.TP 
+\fBENFILE\fP
 オープン済みのファイル総数がシステム全体の上限に達していた。
-.TP
-.B ENODEV
-.\"O Could not mount (internal) anonymous inode device.
+.TP 
+\fBENODEV\fP
 (カーネル内の) 無名 inode デバイスをマウントできなかった。
-.TP
-.B ENOMEM
-.\"O There was insufficient memory to create a new signalfd file descriptor.
+.TP 
+\fBENOMEM\fP
 新しい signalfd ファイルディスクリプタを生成するのに十分なメモリがなかった。
-.\"O .SH VERSIONS
 .SH バージョン
-.\"O .BR signalfd ()
-.\"O is available on Linux since kernel 2.6.22.
-.\"O Working support is provided in glibc since version 2.8.
-.BR signalfd ()
-はカーネル 2.6.22 以降の Linux で利用可能である。
-正しく動作する glibc 側のサポートはバージョン 2.8 以降で提供されている。
 .\" signalfd() is in glibc 2.7, but reportedly does not build
-.\"O The
-.\"O .BR signalfd4 ()
-.\"O system call (see NOTES) is available on Linux since kernel 2.6.27.
-.BR signalfd4 ()
-システムコール (「注意」参照) は
-カーネル 2.6.27 以降の Linux で利用可能である。
-.\"O .SH CONFORMING TO
+\fBsignalfd\fP()  はカーネル 2.6.22 以降の Linux で利用可能である。 正しく動作する glibc 側のサポートはバージョン
+2.8 以降で提供されている。 \fBsignalfd4\fP()  システムコール (「注意」参照) は カーネル 2.6.27 以降の Linux
+で利用可能である。
 .SH 準拠
-.\"O .BR signalfd ()
-.\"O and
-.\"O .BR signalfd4 ()
-.\"O are Linux-specific.
-.BR signalfd ()
-と
-.BR signalfd4 ()
-は Linux 固有である。
-.\"O .SH NOTES
+\fBsignalfd\fP()  と \fBsignalfd4\fP()  は Linux 固有である。
 .SH 注意
-.\"O The underlying Linux system call requires an additional argument,
-.\"O .IR "size_t sizemask" ,
-.\"O which specifies the size of the
-.\"O .I mask
-.\"O argument.
-.\"O The glibc
-.\"O .BR signalfd ()
-.\"O wrapper function does not include this argument,
-.\"O since it provides the required value for the underlying system call.
-実際の Linux のシステムコールでは
-.I "size_t sizemask"
-という引き数が追加で必要である。この引き数で
-.I mask
-のサイズを指定する。
-glibc の
-.BR signalfd ()
-ラッパー関数にはこの引き数は含まれず、
+実際の Linux のシステムコールでは \fIsize_t sizemask\fP という引き数が追加で必要である。この引き数で \fImask\fP
+のサイズを指定する。 glibc の \fBsignalfd\fP()  ラッパー関数にはこの引き数は含まれず、
 ラッパー関数が必要な値を計算して内部で呼び出すシステムコールに提供する。
 
-.\"O A process can create multiple signalfd file descriptors.
-.\"O This makes it possible to accept different signals
-.\"O on different file descriptors.
-.\"O (This may be useful if monitoring the file descriptors using
-.\"O .BR select (2),
-.\"O .BR poll (2),
-.\"O or
-.\"O .BR epoll (7):
-.\"O the arrival of different signals will make different descriptors ready.)
-.\"O If a signal appears in the
-.\"O .I mask
-.\"O of more than one of the file descriptors, then occurrences
-.\"O of that signal can be read (once) from any one of the descriptors.
 一つのプロセスは複数の signalfd ファイルディスクリプタを生成することができる。
-これにより、異なるファイルディスクリプタで異なるシグナルを受け取ることが
-できる (この機能は
-.BR select (2),
-.BR poll (2),
-.BR epoll (7)
-を使ってファイルディスクリプタを監視する場合に有用かもしれない。
-異なるシグナルが到着すると、異なるファイルディスクリプタが利用可能に
-なるからだ)。
-一つのシグナルが二つ以上のファイルディスクリプタの
-.I mask
-に含まれている場合、そのシグナルの発生はそのシグナルを
-.I mask
-に含むファイルディスクリプタのうちいずれか一つから読み出すことができる。
-.\"O .SS Underlying Linux system calls
-.SH 下層にある Linux のシステムコール
-.\"O There are two underlying Linux system calls:
-.\"O .BR signalfd ()
-.\"O and the more recent
-.\"O .BR signalfd4 ().
-.\"O The former system call does not implement a
-.\"O .I flags
-.\"O argument.
-.\"O The latter system call implements the
-.\"O .I flags
-.\"O values described above.
-下層にある Linux システムコールは二種類あり、
-.BR signalfd ()
-と、もっと新しい
-.BR signalfd4 ()
-である。
-.BR signalfd ()
-は
-.I flags
-引き数を実装していない。
-.BR signalfd4 ()
-では上記の値の
-.I flags
-が実装されている。
-.\"O Starting with glibc 2.9, the
-.\"O .BR signalfd ()
-.\"O wrapper function will use
-.\"O .BR signalfd4 ()
-.\"O where it is available.
-glibc 2.9 以降では、
-.BR signalfd ()
-のラッパー関数は、
-.BR signalfd4 ()
+これにより、異なるファイルディスクリプタで異なるシグナルを受け取ることが できる (この機能は \fBselect\fP(2), \fBpoll\fP(2),
+\fBepoll\fP(7)  を使ってファイルディスクリプタを監視する場合に有用かもしれない。
+異なるシグナルが到着すると、異なるファイルディスクリプタが利用可能に なるからだ)。 一つのシグナルが二つ以上のファイルディスクリプタの \fImask\fP
+に含まれている場合、そのシグナルの発生はそのシグナルを \fImask\fP に含むファイルディスクリプタのうちいずれか一つから読み出すことができる。
+.SS "下層にある Linux のシステムコール"
+下層にある Linux システムコールは二種類あり、 \fBsignalfd\fP()  と、もっと新しい \fBsignalfd4\fP()  である。
+\fBsignalfd\fP()  は \fIflags\fP 引き数を実装していない。 \fBsignalfd4\fP()  では上記の値の \fIflags\fP
+が実装されている。 glibc 2.9 以降では、 \fBsignalfd\fP()  のラッパー関数は、 \fBsignalfd4\fP()
 が利用可能であれば、これを使用する。
-.\"O .SH BUGS
 .SH バグ
-.\"O In kernels before 2.6.25, the
-.\"O .I ssi_ptr
-.\"O and
-.\"O .I ssi_int
-.\"O fields are not filled in with the data accompanying a signal sent by
-.\"O .BR sigqueue (3).
-カーネル 2.6.25 より前では、
-.BR sigqueue (3)
-により送信されたシグナルと一緒に渡されるデータでは、フィールド
-.I ssi_ptr
-と
-.I ssi_int
-は設定されない。
 .\" The fix also was put into 2.6.24.5
-.\"O .SH EXAMPLE
+カーネル 2.6.25 より前では、 \fBsigqueue\fP(3)  により送信されたシグナルと一緒に渡されるデータでは、フィールド
+\fIssi_ptr\fP と \fIssi_int\fP は設定されない。
 .SH 例
-.\"O The program below accepts the signals
-.\"O .B SIGINT
-.\"O and
-.\"O .B SIGQUIT
-.\"O via a signalfd file descriptor.
-.\"O The program terminates after accepting a
-.\"O .B SIGQUIT
-.\"O signal.
-.\"O The following shell session demonstrates the use of the program:
-下記のプログラムは、シグナル
-.B SIGINT
-と
-.B SIGQUIT
-を signalfd ファイルディスクリプタ経由で受信する。
-シグナル
-.B SIGQUIT
-受信後にプログラムは終了する。
-以下に示すシェルセッションにこのプログラムの使い方を示す。
+下記のプログラムは、シグナル \fBSIGINT\fP と \fBSIGQUIT\fP を signalfd ファイルディスクリプタ経由で受信する。 シグナル
+\fBSIGQUIT\fP 受信後にプログラムは終了する。 以下に示すシェルセッションにこのプログラムの使い方を示す。
 .in +4n
 .nf
 
-.RB "$" " ./signalfd_demo"
-.BR "^C" "                   # Control\-C generates SIGINT"
+$\fB ./signalfd_demo\fP
+\fB^C\fP                   # Control\-C generates SIGINT
 Got SIGINT
-.B ^C
+\fB^C\fP
 Got SIGINT
-\fB^\\\fP                    # Control\-\\ generates SIGQUIT
+\fB^\e\fP                    # Control\-\e generates SIGQUIT
 Got SIGQUIT
 $
 .fi
 .in
-.\"O .SS Program source
 .SS プログラムのソース
 \&
 .nf
@@ -696,7 +214,7 @@ $
 #include <stdlib.h>
 #include <stdio.h>
 
-#define handle_error(msg) \\
+#define handle_error(msg) \e
     do { perror(msg); exit(EXIT_FAILURE); } while (0)
 
 int
@@ -727,27 +245,17 @@ main(int argc, char *argv[])
             handle_error("read");
 
         if (fdsi.ssi_signo == SIGINT) {
-            printf("Got SIGINT\\n");
+            printf("Got SIGINT\en");
         } else if (fdsi.ssi_signo == SIGQUIT) {
-            printf("Got SIGQUIT\\n");
+            printf("Got SIGQUIT\en");
             exit(EXIT_SUCCESS);
         } else {
-            printf("Read unexpected signal\\n");
+            printf("Read unexpected signal\en");
         }
     }
 }
 .fi
-.\"O .SH "SEE ALSO"
 .SH 関連項目
-.BR eventfd (2),
-.BR poll (2),
-.BR read (2),
-.BR select (2),
-.BR sigaction (2),
-.BR sigprocmask (2),
-.BR sigwaitinfo (2),
-.BR timerfd_create (2),
-.BR sigsetops (3),
-.BR sigwait (3),
-.BR epoll (7),
-.BR signal (7)
+\fBeventfd\fP(2), \fBpoll\fP(2), \fBread\fP(2), \fBselect\fP(2), \fBsigaction\fP(2),
+\fBsigprocmask\fP(2), \fBsigwaitinfo\fP(2), \fBtimerfd_create\fP(2), \fBsigsetops\fP(3),
+\fBsigwait\fP(3), \fBepoll\fP(7), \fBsignal\fP(7)