.\" Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
.\" starting from a version by Davide Libenzi <davidel@xmailserver.org>
.\"
+.\" %%%LICENSE_START(GPLv2+_SW_3_PARA)
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
-.\" You should have received a copy of the GNU General Public License
-.\" along with this program; if not, write to the Free Software
-.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-.\" MA 02111-1307 USA
+.\" You should have received a copy of the GNU General Public
+.\" License along with this manual; if not, see
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
.\"
.\" 2008-10-10, mtk: describe eventfd2(), and EFD_NONBLOCK and EFD_CLOEXEC
.\"
.sp
\fBint eventfd(unsigned int \fP\fIinitval\fP\fB, int \fP\fIflags\fP\fB);\fP
.SH 説明
-\fBeventfd\fP() は "eventfd オブジェクト" を生成する。 eventfd
-オブジェクトはユーザ空間アプリケーションがイベント待ち受け/通知用の 仕組みとして使うことができる。また、カーネルがユーザ空間アプリケーションに
-イベントを通知するためにも使うことができる。 このオブジェクトには、unsigned の 64 ビット整数 (\fIuint64_t\fP)
-型のカウンタが含まれており、このカウンタはカーネルにより管理される。 このカウンタは \fIinitval\fP 引き数で指定された値で初期化される。
+\fBeventfd\fP() creates an "eventfd object" that can be used as an event
+wait/notify mechanism by user\-space applications, and by the kernel to
+notify user\-space applications of events. The object contains an unsigned
+64\-bit integer (\fIuint64_t\fP) counter that is maintained by the kernel.
+This counter is initialized with the value specified in the argument
+\fIinitval\fP.
以下の値のいくつかをビット単位の論理和 (OR) で指定することで、
\fBeventfd\fP() の振舞いを変更することができる。
を追加で呼び出す必要がなくなる。
.TP
\fBEFD_SEMAPHORE\fP (Linux 2.6.30 以降)
-Provide semaphore\-like semantics for reads from the new file descriptor.
-See below.
+新しいファイルディスクリプタからの読み出しにおいて、セマフォ風の動作を行う。
+下記参照。
.PP
バージョン 2.6.26 以前の Linux では、 \fIflags\fP 引き数は未使用であり、0 を指定しなければならない。
渡されたバッファの大きさが 8 バイト未満の場合、
\fBread\fP(2) はエラー \fBEINVAL\fP で失敗する。
.IP
-The value returned by \fBread\fP(2) is in host byte order, i.e., the native
-byte order for integers on the host machine.
+\fBread\fP(2) が返す値は、ホストバイトオーダ、つまり
+そのホストマシンにおける整数の通常のバイトオーダである。
.IP
-The semantics of \fBread\fP(2) depend on whether the eventfd counter currently
-has a nonzero value and whether the \fBEFD_SEMAPHORE\fP flag was specified when
-creating the eventfd file descriptor:
+\fBread\fP(2) の動作は、 eventfd カウンタの現在の値が 0 以外であるかと、
+eventfd ファイルディスクリプタを作成する際に \fBEFD_SEMAPHORE\fP フラグが
+指定されたか、により変化する。
.RS
.IP * 3
\fBEFD_SEMAPHORE\fP が指定されておらず、eventfd カウンタが 0 以外の値
\fBread\fP(2) は \fIuint64_t\fP の最大値 (すなわち 0xffffffffffffffff) を返す。
.RE
.IP
-eventfd ファイルディスクリプタは、これ以外のファイルディスクリプタ 多重 API である \fBpselect\fP(2), \fBppoll\fP(2),
-\fBepoll\fP(7) もサポートしている。
+The eventfd file descriptor also supports the other file\-descriptor
+multiplexing APIs: \fBpselect\fP(2) and \fBppoll\fP(2).
.TP
\fBclose\fP(2)
ファイルディスクリプタがそれ以降は必要なくなった際には、クローズすべきである。 同じ eventfd
.SH エラー
.TP
\fBEINVAL\fP
-An unsupported value was specified in \fIflags\fP.
+\fIflags\fP にサポートされていない値が指定された。
.TP
\fBEMFILE\fP
オープン済みのファイルディスクリプタの数がプロセスあたりの上限に 達していた。
カーネルでのオーバヘッドは比べるとずっと小さく、ファイルディスクリプタも 一つしか必要としない (パイプの場合は二つ必要である)。
.\" or eventually syslets/threadlets
-カーネル内で使用すると、eventfd ファイルディスクリプタは カーネル空間とユーザ空間のブリッジ機能を提供することができ、 例えば KAIO
-(kernel AIO) のような機能が、あるファイルディスクリプタに何らかの操作が完了したことを 通知することができる。
+When used in the kernel, an eventfd file descriptor can provide a bridge
+from kernel to user space, allowing, for example, functionalities like KAIO
+(kernel AIO) to signal to a file descriptor that some operation is
+complete.
eventfd ファイルディスクリプタの重要な点は、 eventfd ファイルディスクリプタが \fBselect\fP(2), \fBpoll\fP(2),
\fBepoll\fP(7) を使って他のファイルディスクリプタと全く同様に監視できる点である。 このことは、アプリケーションは「従来の
\fBsignalfd\fP(2), \fBtimerfd_create\fP(2), \fBwrite\fP(2), \fBepoll\fP(7),
\fBsem_overview\fP(7)
.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。