OSDN Git Service

Translation snapshot for LDP v3.76
[linuxjm/LDP_man-pages.git] / draft / man2 / epoll_ctl.2
index 35542ac..f37e0a7 100644 (file)
@@ -114,15 +114,12 @@ distribution architectures) についての詳細な情報は、 \fBepoll\fP(7)
 .TP 
 \fBEPOLLWAKEUP\fP (Linux 3.5 以降)
 .\" commit 4d7e30d98939a0340022ccd49325a3d70f7e0238
-If \fBEPOLLONESHOT\fP and \fBEPOLLET\fP are clear and the process has the
-\fBCAP_BLOCK_SUSPEND\fP capability, ensure that the system does not enter
-"suspend" or "hibernate" while this event is pending or being processed.
-The event is considered as being "processed" from the time when it is
-returned by a call to \fBepoll_wait\fP(2)  until the next call to
-\fBepoll_wait\fP(2)  on the same \fBepoll\fP(7)  file descriptor, the closure of
-that file descriptor, the removal of the event file descriptor with
-\fBEPOLL_CTL_DEL\fP, or the clearing of \fBEPOLLWAKEUP\fP for the event file
-descriptor with \fBEPOLL_CTL_MOD\fP.  See also BUGS.
+\fBEPOLLONESHOT\fP と \fBEPOLLET\fP がクリアされており、 プロセスが \fBCAP_BLOCK_SUSPEND\fP
+ケーパビリティを持っている場合、 イベントが処理待ちか処理中かにかかわらず、必ずシステムが "suspend" や "hibernate"
+に入らないようにすること。 \fBepoll_wait\fP(2) の呼び出しが返った時点から、 同じ \fBepoll\fP(7) ファイルディスクリプタに対して
+\fBepoll_wait\fP(2) が次に呼び出されるか、 そのファイルディスクリプタが閉じられるか、 イベントファイルディスクリプタが
+\fBEPOLL_CTL_DEL\fP で削除されるか、 \fBEPOLL_CTL_MOD\fP でイベントファイルディスクリプタの \fBEPOLLWAKEUP\fP
+がクリアされるか、 のいずれかになるまで、イベントは「処理中」であるとみなされる。 「バグ」の節も参照のこと。
 .SH 返り値
 成功した場合、 \fBepoll_ctl\fP()  は 0 を返す。 エラーが起こった場合、 \fBepoll_ctl\fP()  は \-1 を返し、
 \fIerrno\fP を適切に設定する。
@@ -151,8 +148,8 @@ epoll インスタンスに新しいファイルディスクリプタを登録 (
 \fI/proc/sys/fs/epoll/max_user_watches\fP で決まる上限に達した。 詳細は \fBepoll\fP(7)  を参照。
 .TP 
 \fBEPERM\fP
-The target file \fIfd\fP does not support \fBepoll\fP.  This error can occur if
-\fIfd\fP refers to, for example, a regular file or a directory.
+対象ファイル \fIfd\fP が \fBepoll\fP に対応していない。 このエラーは \fIfd\fP
+が例えば通常ファイルやディレクトリを参照している場合にも起こり得る。
 .SH バージョン
 .\" To be precise: kernel 2.5.44.
 .\" The interface should be finalized by Linux kernel 2.5.66.
@@ -170,16 +167,13 @@ NULL を指定できるようになっている。 2.6.9 より前のカーネ
 
 .\" commit a8159414d7e3af7233e7a5a82d1c5d85379bd75c (behavior change)
 .\" https://lwn.net/Articles/520198/
-If \fBEPOLLWAKEUP\fP is specified in \fIflags\fP, but the caller does not have the
-\fBCAP_BLOCK_SUSPEND\fP capability, then the \fBEPOLLWAKEUP\fP flag is \fIsilently
-ignored\fP.  This unfortunate behavior is necessary because no validity checks
-were performed on the \fIflags\fP argument in the original implementation, and
-the addition of the \fBEPOLLWAKEUP\fP with a check that caused the call to fail
-if the caller did not have the \fBCAP_BLOCK_SUSPEND\fP capability caused a
-breakage in at least one existing user\-space application that happened to
-randomly (and uselessly) specify this bit.  A robust application should
-therefore double check that it has the \fBCAP_BLOCK_SUSPEND\fP capability if
-attempting to use the \fBEPOLLWAKEUP\fP flag.
+\fIflags\fP に \fBEPOLLWAKEUP\fP が指定されたが、呼び出し元が \fBCAP_BLOCK_SUSPEND\fP
+ケーパビリティを持っていない場合、 \fBEPOLLWAKEUP\fP フラグは \fI黙って無視される\fP。 元の実装では \fIflags\fP
+引き数に対する正当性チェックが実行されていないため、 この残念な動作は必要である。 また、 呼び出し元が \fBCAP_BLOCK_SUSPEND\fP
+ケーパビリティを持っていなかった場合に呼び出しを失敗させるようにチェックを \fBEPOLLWAKEUP\fP に追加すると、
+少なくともひとつは動かなくなる既存のユーザー空間アプリケーションがあった。 そのアプリケーションはたまたま (しかも意味もなく)
+このビットを指定していた。 したがって、信頼性が求められるアプリケーションでは、 \fBEPOLLWAKEUP\fP フラグを使おうする場合には
+\fBCAP_BLOCK_SUSPEND\fP ケーパビリティを持っているかも確認するようにすべきである。
 .SH 関連項目
 \fBepoll_create\fP(2), \fBepoll_wait\fP(2), \fBpoll\fP(2), \fBepoll\fP(7)
 .SH この文書について