OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / draft / man2 / timerfd_create.2
index 8853705..71a81c9 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\" %%%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
 .\"
-.\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
-.\"         all rights reserved.
-.\" Translated 2008-11-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
-.\" Updated 2009-04-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP 3.20
-.\" 
-.TH TIMERFD_CREATE 2 2009-03-10 Linux "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O timerfd_create, timerfd_settime, timerfd_gettime \-
-.\"O timers that notify via file descriptors
-timerfd_create, timerfd_settime, timerfd_gettime \-
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿·Ðͳ¤ÇÄÌÃΤ¹¤ë¥¿¥¤¥Þ¡¼
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.\" FIXME: Linux 3.0: timerfd_settime() adds a TFD_TIMER_CANCEL_ON_SET flag.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH TIMERFD_CREATE 2 2011\-09\-14 Linux "Linux Programmer's Manual"
+.SH 名前
+timerfd_create, timerfd_settime, timerfd_gettime \- ファイルディスクリプタ経由で通知するタイマー
+.SH 書式
 .nf
-.B #include <sys/timerfd.h>
+\fB#include <sys/timerfd.h>\fP
 .sp
-.BI "int timerfd_create(int " clockid ", int " flags );
+\fBint timerfd_create(int \fP\fIclockid\fP\fB, int \fP\fIflags\fP\fB);\fP
 .sp
-.BI "int timerfd_settime(int " fd ", int " flags ,
-.BI "                    const struct itimerspec *" new_value ,
-.BI "                    struct itimerspec *" old_value );
+\fBint timerfd_settime(int \fP\fIfd\fP\fB, int \fP\fIflags\fP\fB,\fP
+\fB                    const struct itimerspec *\fP\fInew_value\fP\fB,\fP
+\fB                    struct itimerspec *\fP\fIold_value\fP\fB);\fP
 .sp
-.BI "int timerfd_gettime(int " fd ", struct itimerspec *" curr_value );
+\fBint timerfd_gettime(int \fP\fIfd\fP\fB, struct itimerspec *\fP\fIcurr_value\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O These system calls create and operate on a timer
-.\"O that delivers timer expiration notifications via a file descriptor.
-.\"O They provide an alternative to the use of
-.\"O .BR setitimer (2)
-.\"O or
-.\"O .BR timer_create (2),
-.\"O with 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 setitimer (2)
-¤ä
-.BR timer_create (2)
-¤òÍѤ¤¤ëÊýË¡¤ÎÂå¤ï¤ê¤È¤Ê¤ë¤â¤Î¤Ç¤¢¤ê¡¢¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò
-.BR select (2),
-.BR poll (2),
-.BR epoll (7)
-¤Ç´Æ»ë¤Ç¤­¤ë¤È¤¤¤¦ÍøÅÀ¤¬¤¢¤ë¡£
+.SH 説明
+これらのシステムコールは、満了通知をファイルディスクリプタ経由で配送する タイマーの生成と操作を行う。 これらは、 \fBsetitimer\fP(2)  や
+\fBtimer_create\fP(2)  を用いる方法の代わりとなるものであり、このファイルディスクリプタを \fBselect\fP(2),
+\fBpoll\fP(2), \fBepoll\fP(7)  で監視できるという利点がある。
 
-.\"O The use of these three system calls is analogous to the use of
-.\"O .BR timer_create (2),
-.\"O .BR timer_settime (2),
-.\"O and
-.\"O .BR timer_gettime (2).
-.\"O (There is no analog of
-.\"O .BR timer_getoverrun (2),
-.\"O since that functionality is provided by
-.\"O .BR read (2),
-.\"O as described below.)
-¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Î¤Ï¡¢¤½¤ì¤¾¤ì
-.BR timer_create (2),
-.BR timer_settime (2),
-.BR timer_gettime (2)
-¤ò»È¤¦¤Î¤ÈƱÍͤǤ¢¤ë
-.RB ( timer_getoverrun (2)
-¤ËÂбþ¤¹¤ë¤â¤Î¤Ï¤Ê¤¯¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¤è¤¦¤Ë
-¤³¤Îµ¡Ç½¤Ï
-.BR read (2)
-¤Ë¤è¤êÄ󶡤µ¤ì¤ë)¡£
 .\"
+これらのシステムコールを使うのは、それぞれ \fBtimer_create\fP(2), \fBtimer_settime\fP(2),
+\fBtimer_gettime\fP(2)  を使うのと同様である (\fBtimer_getoverrun\fP(2)
+に対応するものはなく、以下で説明するように この機能は \fBread\fP(2)  により提供される)。
 .SS timerfd_create()
-.\"O .BR timerfd_create ()
-.\"O creates a new timer object,
-.\"O and returns a file descriptor that refers to that timer.
-.BR timerfd_create ()
-¤Ï¿·µ¬¤Î¥¿¥¤¥Þ¡¼¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤·¡¢¤½¤Î¥¿¥¤¥Þ¡¼¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë
-¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£
-.\"O The
-.\"O .I clockid
-.\"O argument specifies the clock that is used to mark the progress
-.\"O of the timer, and must be either
-.\"O .B CLOCK_REALTIME
-.\"O or
-.\"O .BR CLOCK_MONOTONIC .
-.\"O .B CLOCK_REALTIME
-.\"O is a settable system-wide clock.
-.\"O .B CLOCK_MONOTONIC
-.\"O is a nonsettable clock that is not affected
-.\"O by discontinuous changes in the system clock
-.\"O (e.g., manual changes to system time).
-.\"O The current value of each of these clocks can be retrieved using
-.\"O .BR clock_gettime (2).
-.I clockid
-°ú¤­¿ô¤Ï¡¢¥¿¥¤¥Þ¡¼¤Î¿ÊĽ¤ò´ÉÍý¤¹¤ë¤¿¤á¤Î¥¯¥í¥Ã¥¯¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¡¢
-.B CLOCK_REALTIME
-¤«
-.B CLOCK_MONOTONIC
-¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.B CLOCK_REALTIME
-¤Ï¥·¥¹¥Æ¥àÁ´ÂΤǻÈÍѤµ¤ì¤ë¥¯¥í¥Ã¥¯¤Ç¡¢¤³¤Î¥¯¥í¥Ã¥¯¤ÏÊѹ¹²Äǽ¤Ç¤¢¤ë¡£
-.B CLOCK_MONOTONIC
-¤ÏÊѹ¹¤µ¤ì¤ë¤³¤È¤Î¤Ê¤¤¥¯¥í¥Ã¥¯¤Ç¡¢(¥·¥¹¥Æ¥à»þ¹ï¤Î¼êÆ°¤Ç¤ÎÊѹ¹¤Ê¤É¤Î)
-¥·¥¹¥Æ¥à¥¯¥í¥Ã¥¯¤ÎÉÔϢ³¤ÊÊѲ½¤Î±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£
-¤³¤ì¤é¤Î¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͤÏ
-.BR clock_gettime (2)
-¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£
+\fBtimerfd_create\fP()  は新規のタイマーオブジェクトを生成し、そのタイマーを参照するファイル ディスクリプタを返す。
+\fIclockid\fP 引き数は、タイマーの進捗を管理するためのクロックを指定するもので、 \fBCLOCK_REALTIME\fP か
+\fBCLOCK_MONOTONIC\fP のいずれかでなければならない。 \fBCLOCK_REALTIME\fP
+はシステム全体で使用されるクロックで、このクロックは変更可能である。 \fBCLOCK_MONOTONIC\fP
+は変更されることのないクロックで、(システム時刻の手動での変更などの)  システムクロックの不連続な変化の影響を受けない。 これらのクロックの現在の値は
+\fBclock_gettime\fP(2)  を使って取得できる。
 
-.\"O Starting with Linux 2.6.27, the following values may be bitwise ORed in
-.\"O .IR flags
-.\"O to change the behavior of
-.\"O .BR timerfd_create ():
-Linux 2.6.27 °Ê¹ß¤Ç¤Ï¡¢
-°Ê²¼¤ÎÃͤΤ¤¤¯¤Ä¤«¤ò¥Ó¥Ã¥Èñ°Ì¤ÎÏÀÍýÏ (OR) ¤Ç»ØÄꤹ¤ë¤³¤È¤Ç¡¢
-.BR timerfd_create ()
-¤Î¿¶Éñ¤¤¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-.TP 14
-.B TFD_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
-.B TFD_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
-¥Õ¥é¥°¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£
+Linux 2.6.27 以降では、 以下の値のいくつかをビット単位の論理和 (OR) で指定することで、 \fBtimerfd_create\fP()
+の振舞いを変更することができる。
+.TP  14
+\fBTFD_NONBLOCK\fP
+新しく生成されるオープンファイル記述 (open file description) の \fBO_NONBLOCK\fP
+ファイルステータスフラグをセットする。 このフラグを使うことで、 \fBO_NONBLOCK\fP をセットするために \fBfcntl\fP(2)
+を追加で呼び出す必要がなくなる。
+.TP 
+\fBTFD_CLOEXEC\fP
+新しいファイルディスクリプタに対して close\-on\-exec (\fBFD_CLOEXEC\fP)  フラグをセットする。
+このフラグが役に立つ理由については、 \fBopen\fP(2)  の \fBO_CLOEXEC\fP フラグの説明を参照のこと。
 .PP
-.\"O In Linux versions up to and including 2.6.26,
-.\"O .I flags
-.\"O must be specified as zero.
-¥Ð¡¼¥¸¥ç¥ó 2.6.26 °ÊÁ°¤Î Linux ¤Ç¤Ï¡¢
-.I flags
-°ú¤­¿ô¤Ï̤»ÈÍѤǤ¢¤ê¡¢0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+バージョン 2.6.26 以前の Linux では、 \fIflags\fP 引き数は未使用であり、0 を指定しなければならない。
 .SS timerfd_settime()
-.\"O .BR timerfd_settime ()
-.\"O arms (starts) or disarms (stops)
-.\"O the timer referred to by the file descriptor
-.\"O .IR fd .
-.BR timerfd_settime ()
-¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
-.I fd
-¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥¿¥¤¥Þ¡¼¤ò³«»Ï¤·¤¿¤êÄä»ß¤·¤¿¤ê¤¹¤ë¡£
+\fBtimerfd_settime\fP()  は、ファイルディスクリプタ \fIfd\fP により参照されるタイマーを開始したり停止したりする。
 
-.\"O The
-.\"O .I new_value
-.\"O argument specifies the initial expiration and interval for the timer.
-.\"O The
-.\"O .I itimer
-.\"O structure used for this argument contains two fields,
-.\"O each of which is in turn a structure of type
-.\"O .IR timespec :
-.I new_value
-°ú¤­¿ô¤Ï¡¢¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö (expiration) ¤Î½é´üÃͤȴֳ֠(interval) ¤ò
-»ØÄꤹ¤ë¡£¤³¤Î°ú¤­¿ô¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë
-.\"Omotoki: itimer structure ¤Ï itimerspec structure ¤Î´Ö°ã¤¤¤À¤í¤¦¡£
-.I itimerspec
-¹½Â¤ÂΤˤϠ2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ê¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Ï
-.I timespec
-·¿¤Î¹½Â¤ÂΤǤ¢¤ë¡£
+\fInew_value\fP 引き数は、タイマーの満了時間 (expiration) の初期値と間隔 (interval) を
+指定する。この引き数で使用されている \fIitimerspec\fP 構造体には 2 つのフィールドがあり、各フィールドは \fItimespec\fP
+型の構造体である。
 .in +4n
 .nf
 
@@ -214,460 +89,151 @@ struct itimerspec {
 .fi
 .in
 .PP
-.\"O .I new_value.it_value
-.\"O specifies the initial expiration of the timer,
-.\"O in seconds and nanoseconds.
-.\"O Setting either field of
-.\"O .I new_value.it_value
-.\"O to a nonzero value arms the timer.
-.\"O Setting both fields of
-.\"O .I new_value.it_value
-.\"O to zero disarms the timer.
-.I new_value.it_value
-¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö¤Î½é´üÃͤò¡¢ÉäȥʥÎÉäǻØÄꤹ¤ë¡£
-.I new_value.it_value
-¤Î¥Õ¥£¡¼¥ë¥É¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â°ìÊý¤Ë 0 °Ê³°¤ÎÃͤòÀßÄꤹ¤ë¤È¡¢
-¥¿¥¤¥Þ¡¼¤¬³«»Ï¤µ¤ì¤ë¡£
-ξÊý¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤òÀßÄꤹ¤ë¤È¡¢¥¿¥¤¥Þ¡¼¤¬Ää»ß¤¹¤ë¡£
+\fInew_value.it_value\fP はタイマーの満了時間の初期値を、秒とナノ秒で指定する。 \fInew_value.it_value\fP
+のフィールドのうち少なくとも一方に 0 以外の値を設定すると、 タイマーが開始される。 両方のフィールドに 0 を設定すると、タイマーが停止する。
 
-.\"O Setting one or both fields of
-.\"O .I new_value.it_interval
-.\"O to nonzero values specifies the period, in seconds and nanoseconds,
-.\"O for repeated timer expirations after the initial expiration.
-.\"O If both fields of
-.\"O .I new_value.it_interval
-.\"O are zero, the timer expires just once, at the time specified by
-.\"O .IR new_value.it_value .
-.I new_value.it_interval
-¤Ï¥¿¥¤¥Þ¡¼¤Î°ì²óÌܤÎËþλ¸å¤Ë·«¤êÊÖ¤·¥¿¥¤¥Þ¡¼¤ÎËþλ´Ö³Ö¤ò¡¢ÉäȥʥÎÉäǻØÄꤹ¤ë¡£
-.I new_value.it_interval
-¤Î¥Õ¥£¡¼¥ë¥É¤Î¤¦¤Á¾¯¤Ê¤¯¤È¤â°ìÊý¤Ë 0 °Ê³°¤ÎÃͤòÀßÄꤹ¤ë¤È¡¢
-·«¤êÊÖ¤·¥¿¥¤¥Þ¡¼¤¬Í­¸ú¤Ë¤Ê¤ë¡£
-ξÊý¤Î¥Õ¥£¡¼¥ë¥É¤Ë 0 ¤òÀßÄꤷ¤¿¾ì¹ç¡¢¥¿¥¤¥Þ¡¼¤Ï
-.I new_value.it_value
-¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¸å¤Ë¡¢°ì²ó¤À¤±Ëþλ¤·¤ÆÄä»ß¤¹¤ë¡£
+\fInew_value.it_interval\fP はタイマーの一回目の満了後に繰り返しタイマーの満了間隔を、秒とナノ秒で指定する。
+\fInew_value.it_interval\fP のフィールドのうち少なくとも一方に 0 以外の値を設定すると、 繰り返しタイマーが有効になる。
+両方のフィールドに 0 を設定した場合、タイマーは \fInew_value.it_value\fP で指定された時間後に、一回だけ満了して停止する。
 
-.\"O The
-.\"O .I flags
-.\"O argument is either 0, to start a relative timer
-.\"O .RI ( new_value.it_interval
-.\"O specifies a time relative to the current value of the clock specified by
-.\"O .IR clockid ),
-.\"O or
-.\"O .BR TFD_TIMER_ABSTIME ,
-.\"O to start an absolute timer
-.\"O .RI ( new_value.it_value
-.\"O specifies an absolute time for the clock specified by
-.\"O .IR clockid ;
-.\"O that is, the timer will expire when the value of that
-.\"O clock reaches the value specified in
-.\"O .IR new_value.it_value ).
-.I flags
-°ú¤­¿ô¤Ë¤Ï 0 ¤«
-.B TFD_TIMER_ABSTIME
-¤ò»ØÄꤹ¤ë¡£
-0 ¤ÏÁêÂлþ¹ï¥¿¥¤¥Þ¡¼¤ò°ÕÌ£¤·¡¢
-.I new_value.it_interval
-¤Ç¤Ï
-.I clockid
-¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͤ«¤é¤ÎÁêÂÐŪ¤Ê»þ¹ï¤ò»ØÄꤹ¤ë¡£
-.B TFD_TIMER_ABSTIME
-¤ÏÀäÂлþ¹ï¥¿¥¤¥Þ¡¼¤ò°ÕÌ£¤·¡¢
-.I new_value.it_interval
-¤Ç¤Ï
-.I clockid
-¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤ÎÀäÂлþ¹ï¤ò»ØÄꤹ¤ë¡£¤Ä¤Þ¤ê¡¢
-¥¯¥í¥Ã¥¯¤ÎÃͤ¬
-.I new_value.it_interval
-¤Ç»ØÄꤵ¤ì¤¿»þ¹ï¤Ë㤷¤¿¤é¡¢¥¿¥¤¥Þ¡¼¤¬Ëþλ¤¹¤ë¡£
+\fIflags\fP 引き数には 0 か \fBTFD_TIMER_ABSTIME\fP を指定する。 0 は相対時刻
+タイマーを意味し、 \fInew_value.it_value\fP では \fIclockid\fP で指定された
+クロックの現在の値からの相対的な時刻を指定する。 \fBTFD_TIMER_ABSTIME\fP
+は絶対時刻タイマーを意味し、 \fInew_value.it_interval\fP では \fIclockid\fP
+で指定されたクロックの絶対時刻を指定する。
+つまり、クロックの値が \fInew_value.it_interval\fP で指定された時刻に
+達したら、タイマーが満了する。
 
-.\"O The
-.\"O .I old_value
-.\"O argument returns a structure containing the setting of the timer that
-.\"O was current at the time of the call; see the description of
-.\"O .BR timerfd_gettime ()
-.\"O following.
-.I old_value
-°ú¤­¿ô¤òÄ̤¸¤Æ¡¢
-.BR timerfd_settime ()
-¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤Ç¤Î¥¿¥¤¥Þ¡¼¤ÎÀßÄê¤òÊÝ»ý¤·¤¿¹½Â¤ÂΤ¬ÊÖ¤µ¤ì¤ë¡£
-²¼µ­¤Î
-.BR timerfd_gettime ()
-¤ÎÀâÌÀ¤ò»²¾È¡£
 .\"
+\fIold_value\fP 引き数が NULL でない場合、 \fIold_value\fP 引き数が指す
+\fIitimerspec\fP 構造体は、 \fBtimerfd_settime\fP() を呼び出した時点での
+タイマーの設定を返すのに使用される。
+下記の \fBtimerfd_gettime\fP() の説明を参照。
 .SS timerfd_gettime()
-.\"O .BR timerfd_gettime ()
-.\"O returns, in
-.\"O .IR curr_value ,
-.\"O an
-.\"O .IR itimerspec
-.\"O structure that contains the current setting of the timer
-.\"O referred to by the file descriptor
-.\"O .IR fd .
-.BR timerfd_gettime ()
-¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
-.I fd
-¤Ç»²¾È¤µ¤ì¤ë¥¿¥¤¥Þ¡¼¤Î¸½ºß¤ÎÀßÄ꤬Æþ¤Ã¤¿
-.I itimerspec
-¹½Â¤ÂΤò¡¢
-.I curr_value
-¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£
+\fBtimerfd_gettime\fP()  は、ファイルディスクリプタ \fIfd\fP で参照されるタイマーの現在の設定が入った \fIitimerspec\fP
+構造体を、 \fIcurr_value\fP に格納して返す。
 
-.\"O The
-.\"O .I it_value
-.\"O field returns the amount of time
-.\"O until the timer will next expire.
-.\"O If both fields of this structure are zero,
-.\"O then the timer is currently disarmed.
-.\"O This field always contains a relative value, regardless of whether the
-.\"O .BR TFD_TIMER_ABSTIME
-.\"O flag was specified when setting the timer.
-.I it_value
-¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¿¥¤¥Þ¡¼¤¬¼¡¤ËËþλ¤¹¤ë¤Þ¤Ç¤Î»Ä¤ê»þ´Ö¤òÊÖ¤¹¡£
-¤³¤Î¹½Â¤ÂΤÎξÊý¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 ¤Ç¤¢¤ì¤Ð¡¢¥¿¥¤¥Þ¡¼¤Ï¸½ºßÄä»ß¤·¤Æ¤¤¤ë¡£
-¥¿¥¤¥Þ¡¼ÀßÄê»þ¤Ë
-.B TFD_TIMER_ABSTIME
-¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¾ï¤ËÁêÂÐÃͤ¬³ÊǼ¤µ¤ì¤ë¡£
+\fIit_value\fP フィールドは、タイマーが次に満了するまでの残り時間を返す。 この構造体の両方のフィールドが 0
+であれば、タイマーは現在停止している。 タイマー設定時に \fBTFD_TIMER_ABSTIME\fP
+フラグが指定されたかに関わらず、このフィールドは常に相対値が格納される。
 
-.\"O The
-.\"O .I it_interval
-.\"O field returns the interval of the timer.
-.\"O If both fields of this structure are zero,
-.\"O then the timer is set to expire just once, at the time specified by
-.\"O .IR curr_value.it_value .
-.I it_interval
-¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥¿¥¤¥Þ¡¼¤Î´Ö³Ö¤òÊÖ¤¹¡£
-¤³¤Î¹½Â¤ÂΤÎξÊý¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 ¤Ç¤¢¤ì¤Ð¡¢¥¿¥¤¥Þ¡¼¤Ï
-.I new_value.it_value
-¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¸å¤Ë°ì²ó¤À¤±Ëþλ¤·¤ÆÄä»ß¤¹¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¡£
-.\"O .SS Operating on a timer file descriptor
-.SS ¥¿¥¤¥Þ¡¼¡¦¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÁàºî
-.\"O The file descriptor returned by
-.\"O .BR timerfd_create ()
-.\"O supports the following operations:
-.BR timerfd_create ()
-¤¬ÊÖ¤¹¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï°Ê²¼¤ÎÁàºî¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
-.TP
-.BR read (2)
-.\"O If the timer has already expired one or more times since
-.\"O its settings were last modified using
-.\"O .BR timerfd_settime (),
-.\"O or since the last successful
-.\"O .BR read (2),
-.\"O then the buffer given to
-.\"O .BR read (2)
-.\"O returns an unsigned 8-byte integer
-.\"O .RI ( uint64_t )
-.\"O containing the number of expirations that have occurred.
-.\"O (The returned value is in host byte order,
-.\"O i.e., the native byte order for integers on the host machine.)
-.BR timerfd_settime ()
-¤ò»È¤Ã¤Æ¥¿¥¤¥Þ¡¼¤ÎÀßÄ꤬ºÇ¸åÊѹ¹¤µ¤ì¤Æ°Ê¹ß¡¢¤Þ¤¿¤Ï
-.BR read (2)
-¤Î¸Æ¤Ó½Ð¤·¤ËºÇ¸å¤ËÀ®¸ù¤·¤Æ°Ê¹ß¤Ë¡¢¥¿¥¤¥Þ¡¼¤ÎËþ뤬°ì²ó°Ê¾åȯÀ¸¤·¤Æ¤¤¤ì¤Ð¡¢
-.BR read (2)
-¤ËÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë¡¢¥¿¥¤¥Þ¡¼Ëþλ²ó¿ô¤ò¼¨¤¹ 8 ¥Ð¥¤¥È¤Î unsigned ·¿¤ÎÀ°¿ô
-.RI ( uint64_t )
-¤¬ÊÖ¤µ¤ì¤ë
-(ÊÖ¤µ¤ì¤ëÃͤϥۥ¹¥È¥Ð¥¤¥È¥ª¡¼¥À¡¢¤Ä¤Þ¤ê¤½¤Î¥Û¥¹¥È¥Þ¥·¥ó¤Ë¤ª¤±¤ë
-À°¿ô¤ÎÄ̾ï¤Î¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤¢¤ë)¡£
+\fIit_interval\fP フィールドは、タイマーの間隔を返す。 この構造体の両方のフィールドが 0 であれば、タイマーは
+\fInew_value.it_value\fP で指定された時間後に一回だけ満了して停止するように設定されている。
+.SS タイマー・ファイルディスクリプタに対する操作
+\fBtimerfd_create\fP()  が返すファイルディスクリプタは以下の操作をサポートしている。
+.TP 
+\fBread\fP(2)
+\fBtimerfd_settime\fP()  を使ってタイマーの設定が最後変更されて以降、または \fBread\fP(2)
+の呼び出しに最後に成功して以降に、タイマーの満了が一回以上発生していれば、 \fBread\fP(2)  に渡されたバッファに、タイマー満了回数を示す 8
+バイトの unsigned 型の整数 (\fIuint64_t\fP)  が返される (返される値はホストバイトオーダ、つまりそのホストマシンにおける
+整数の通常のバイトオーダである)。
 .IP
-.\"O If no timer expirations have occurred at the time of the
-.\"O .BR read (2),
-.\"O then the call either blocks until the next timer expiration,
-.\"O or fails with the error
-.\"O .B EAGAIN
-.\"O if the file descriptor has been made nonblocking
-.\"O (via the use of the
-.\"O .BR fcntl (2)
-.\"O .B F_SETFL
-.\"O operation to set the
-.\"O .B O_NONBLOCK
-.\"O flag).
-.BR read (2)
-¤ò¹Ô¤Ã¤¿»þÅÀ¤Ç¥¿¥¤¥Þ¡¼¤ÎËþλ¤¬È¯À¸¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
-.BR read (2)
-¤ÏÄä»ß (block) ¤¹¤ë¡¢¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬
-ÈóÄä»ß (nonblocking) ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼
-.B EAGAIN
-¤Ç¼ºÇÔ¤¹¤ë (ÈóÄä»ß¥â¡¼¥É¤Ë¤¹¤ë¤Ë¤Ï¡¢
-.BR fcntl (2)
-¤Î
-.B F_SETFL
-Ì¿Îá¤Ç
-.B O_NONBLOCK
-¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë)¡£
+\fBread\fP(2)  を行った時点でタイマーの満了が発生していなければ、 \fBread\fP(2)  は停止 (block)
+する、もしくはファイルディスクリプタが 非停止 (nonblocking) に設定されている場合はエラー \fBEAGAIN\fP で失敗する
+(非停止モードにするには、 \fBfcntl\fP(2)  の \fBF_SETFL\fP 命令で \fBO_NONBLOCK\fP フラグをセットする)。
 .IP
-.\"O A
-.\"O .BR read (2)
-.\"O will fail with the error
-.\"O .B EINVAL
-.\"O if the size of the supplied buffer is less than 8 bytes.
-ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤¬ 8 ¥Ð¥¤¥È̤Ëþ¤Î¾ì¹ç¡¢
-.BR read (2)
-¤Ï¥¨¥é¡¼
-.B EINVAL
-¤Ç¼ºÇÔ¤¹¤ë¡£
-.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 timer expirations have occurred.
-°ì¤Ä°Ê¾å¤Î¥¿¥¤¥Þ¡¼Ëþλ¤¬È¯À¸¤·¤Æ¤¤¤ì¤Ð¡¢
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÆɤ߽Ф·²Äǽ¤È¤Ê¤ë
-.RB ( select (2)
-¤Î
-.I readfds
-°ú¤­¿ô¤ä
-.BR poll (2)
-¤Î
-.B POLLIN
-¥Õ¥é¥°)¡£
+渡されたバッファの大きさが 8 バイト未満の場合、 \fBread\fP(2)  はエラー \fBEINVAL\fP で失敗する。
+.TP 
+\fBpoll\fP(2), \fBselect\fP(2) (と同様の操作)
+一つ以上のタイマー満了が発生していれば、 ファイルディスクリプタは読み出し可能となる (\fBselect\fP(2)  の \fIreadfds\fP 引き数や
+\fBpoll\fP(2)  の \fBPOLLIN\fP フラグ)。
 .IP
-.\"O The 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).
-¤³¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢Â¾¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿Â¿½Å 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 timer object
-.\"O have been closed,
-.\"O the timer is disarmed and its resources are freed by the kernel.
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬¤½¤ì°Ê¹ß¤ÏɬÍפʤ¯¤Ê¤Ã¤¿ºÝ¤Ë¤Ï¡¢¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-Ʊ¤¸ timer ¥ª¥Ö¥¸¥§¥¯¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Á´¤Æ
-¥¯¥í¡¼¥º¤µ¤ì¤ë¤È¡¢¤½¤Î¥¿¥¤¥Þ¡¼¤Ï²ò½ü¤µ¤ì¡¢
-¤½¤Î¥ª¥Ö¥¸¥§¥¯¥ÈÍѤλñ¸»¤¬¥«¡¼¥Í¥ë¤Ë¤è¤ê²òÊü¤µ¤ì¤ë¡£
+このファイルディスクリプタは、他のファイルディスクリプタ多重 API である \fBpselect\fP(2), \fBppoll\fP(2),
+\fBepoll\fP(7)  もサポートしている。
+.TP 
+\fBclose\fP(2)
 .\"
-.\"O .SS fork(2) semantics
-.SS fork(2) ¤Ç¤Î°·¤¤
-.\"O After a
-.\"O .BR fork (2),
-.\"O the child inherits a copy of the file descriptor created by
-.\"O .BR timerfd_create ().
-.\"O The file descriptor refers to the same underlying
-.\"O timer object as the corresponding file descriptor in the parent,
-.\"O and
-.\"O .BR read (2)s
-.\"O in the child will return information about
-.\"O expirations of the timer.
-.BR fork (2)
-¤¬¹Ô¤ï¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï
-.BR timerfd_create ()
-¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò
-·Ñ¾µ¤¹¤ë¡£¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¿Æ¥×¥í¥»¥¹¤ÎÂбþ¤¹¤ë
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÈƱ¤¸¥¿¥¤¥Þ¡¼¥ª¥Ö¥¸¥§¥¯¥È¤ò»²¾È¤·¤Æ¤ª¤ê¡¢
-»Ò¥×¥í¥»¥¹¤Î
-.BR read (2)
-¤Ç¤âƱ¤¸¥¿¥¤¥Þ¡¼¤ÎËþλ¤Ë´Ø¤¹¤ë¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¡£
+ファイルディスクリプタがそれ以降は必要なくなった際には、クローズすべきである。 同じ timer
+オブジェクトに関連付けられたファイルディスクリプタが全て クローズされると、そのタイマーは解除され、
+そのオブジェクト用の資源がカーネルにより解放される。
+.SS "fork(2) での扱い"
 .\"
-.\"O .SS execve(2) semantics
-.SS execve(2) ¤Ç¤Î°·¤¤
-.\"O A file descriptor created by
-.\"O .BR timerfd_create ()
-.\"O is preserved across
-.\"O .BR execve (2),
-.\"O and continues to generate timer expirations if the timer was armed.
-.BR execve (2)
-¤ÎÁ°¸å¤Ç
-.BR timerfd_create ()
-¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÏÊÝ»ý¤µ¤ì¡¢
-¥¿¥¤¥Þ¡¼¤¬³«»Ï¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ¤¬È¯À¸¤·Â³¤±¤ë¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O On success,
-.\"O .BR timerfd_create ()
-.\"O returns a new file descriptor.
-.\"O On error, \-1 is returned and
-.\"O .I errno
-.\"O is set to indicate the error.
-À®¸ù¤¹¤ë¤È¡¢
-.BR timerfd_create ()
-¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
-.I errno
-¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
+\fBfork\fP(2)  が行われると、子プロセスは \fBtimerfd_create\fP()  により生成されたファイルディスクリプタのコピーを
+継承する。そのファイルディスクリプタは、親プロセスの対応する ファイルディスクリプタと同じタイマーオブジェクトを参照しており、 子プロセスの
+\fBread\fP(2)  でも同じタイマーの満了に関する情報が返される。
+.SS "execve(2) での扱い"
+\fBexecve\fP(2)  の前後で \fBtimerfd_create\fP()  により生成されたファイルディスクリプタは保持され、
+タイマーが開始されていた場合にはタイマーの満了が発生し続ける。
+.SH 返り値
+成功すると、 \fBtimerfd_create\fP()  は新しいファイルディスクリプタを返す。 エラーの場合、\-1 を返し、 \fIerrno\fP
+にエラーを示す値を設定する。
 
-.\"O .BR timerfd_settime ()
-.\"O and
-.\"O .BR timerfd_gettime ()
-.\"O return 0 on success;
-.\"O on error they return \-1, and set
-.\"O .I errno
-.\"O to indicate the error.
-.BR timerfd_settime ()
-¤È
-.BR timerfd_gettime ()
-¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
-.I errno
-¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.\"O .BR timerfd_create ()
-.\"O can fail with the following errors:
-.BR timerfd_create ()
-¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
-.TP
-.B EINVAL
-.\"O The
-.\"O .I clockid
-.\"O argument is neither
-.\"O .B CLOCK_MONOTONIC
-.\"O nor
-.\"O .BR CLOCK_REALTIME ;
-.I clockid
-°ú¤­¿ô¤¬
-.B CLOCK_MONOTONIC
-¤Ç¤â
-.B CLOCK_REALTIME
-¤Ç¤â¤Ê¤¤¡£
-.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.
-¥ª¡¼¥×¥óºÑ¤ß¤Î¥Õ¥¡¥¤¥ëÁí¿ô¤¬¥·¥¹¥Æ¥àÁ´ÂΤξå¸Â¤Ë㤷¤Æ¤¤¤¿¡£
-.TP
-.B ENODEV
-.\"O Could not mount (internal) anonymous inode device.
-(¥«¡¼¥Í¥ëÆâ¤Î) ÌµÌ¾ inode ¥Ç¥Ð¥¤¥¹¤ò¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤«¤Ã¤¿¡£
-.TP
-.B ENOMEM
-.\"O There was insufficient kernel memory to create the timer.
-¥¿¥¤¥Þ¡¼¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¡£
+\fBtimerfd_settime\fP()  と \fBtimerfd_gettime\fP()  は成功すると 0 を返す。 エラーの場合、\-1 を返し、
+\fIerrno\fP にエラーを示す値を設定する。
+.SH エラー
+\fBtimerfd_create\fP()  は以下のエラーで失敗する可能性がある。
+.TP 
+\fBEINVAL\fP
+\fIclockid\fP 引き数が \fBCLOCK_MONOTONIC\fP でも \fBCLOCK_REALTIME\fP でもない。
+.TP 
+\fBEINVAL\fP
+\fIflags\fP が無効である。もしくは、Linux 2.6.26 以前の場合には \fIflags\fP が 0 以外である。
+.TP 
+\fBEMFILE\fP
+オープン済みのファイルディスクリプタの数がプロセスあたりの上限に 達していた。
+.TP 
+\fBENFILE\fP
+オープン済みのファイル総数がシステム全体の上限に達していた。
+.TP 
+\fBENODEV\fP
+(カーネル内の) 無名 inode デバイスをマウントできなかった。
+.TP 
+\fBENOMEM\fP
+タイマーを作成するのに十分なカーネルメモリがなかった。
 .PP
-.\"O .BR timerfd_settime ()
-.\"O and
-.\"O .BR timerfd_gettime ()
-.\"O can fail with the following errors:
-.BR timerfd_settime ()
-¤È
-.BR timerfd_gettime ()
-¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
-.TP
-.B EBADF
-.\"O .I fd
-.\"O is not a valid file descriptor.
-.I fd
-¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
-.TP
-.B EFAULT
-.\"O .IR new_value ,
-.\"O .IR old_value ,
-.\"O or
-.\"O .I curr_value
-.\"O is not valid a pointer.
-.IR new_value ,
-.IR old_value ,
-.I curr_value
-¤¬Í­¸ú¤Ê¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¤¡£
-.TP
-.B EINVAL
-.\"O .I fd
-.\"O is not a valid timerfd file descriptor.
-.I fd
-¤¬Í­¸ú¤Ê timerfd ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
+\fBtimerfd_settime\fP()  と \fBtimerfd_gettime\fP()  は以下のエラーで失敗する可能性がある。
+.TP 
+\fBEBADF\fP
+\fIfd\fP が有効なファイルディスクリプタでない。
+.TP 
+\fBEFAULT\fP
+\fInew_value\fP, \fIold_value\fP, \fIcurr_value\fP が有効なポインタではない。
+.TP 
+\fBEINVAL\fP
+\fIfd\fP が有効な timerfd ファイルディスクリプタでない。
 .PP
-.\"O .BR timerfd_settime ()
-.\"O can also fail with the following errors:
-.BR timerfd_settime ()
-¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤³¤È¤â¤¢¤ë¡£
-.TP
-.B EINVAL
-.\"O .I new_value
-.\"O is not properly initialized (one of the
-.\"O .I tv_nsec
-.\"O falls outside the range zero to 999,999,999).
-.I new_value
-¤¬Å¬Àڤ˽é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤
-.RI ( tv_nsec
-¤Î°ì¤Ä¤¬ 0 ¤«¤é 999,999,999 ¤Þ¤Ç¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤)¡£
-.TP
-.B EINVAL
+\fBtimerfd_settime\fP()  は以下のエラーで失敗することもある。
+.TP 
+\fBEINVAL\fP
+\fInew_value\fP が適切に初期化されていない (\fItv_nsec\fP の一つが 0 から 999,999,999 までの範囲に入っていない)。
+.TP 
+\fBEINVAL\fP
 .\" This case only checked since 2.6.29, and 2.2.2[78].some-stable-version.
 .\" In older kernel versions, no check was made for invalid flags.
-.\"O .I flags
-.\"O is invalid.
-.I flags
-¤¬Ìµ¸ú¤Ç¤¢¤ë¡£
-.\"O .SH VERSIONS
-.SH ¥Ð¡¼¥¸¥ç¥ó
-.\"O These system calls are available on Linux since kernel 2.6.25.
-.\"O Library support is provided by glibc since version 2.8.
-¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.25 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
-¥é¥¤¥Ö¥é¥ê¦¤Î¥µ¥Ý¡¼¥È¤Ï¥Ð¡¼¥¸¥ç¥ó 2.8 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
-.\"O .SH CONFORMING TO
-.SH ½àµò
-.\"O These system calls are Linux-specific.
-¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£
-.\"O .SH EXAMPLE
-.SH Îã
-.\"O The following program creates a timer and then monitors its progress.
-.\"O The program accepts up to three command-line arguments.
-.\"O The first argument specifies the number of seconds for
-.\"O the initial expiration of the timer.
-.\"O The second argument specifies the interval for the timer, in seconds.
-.\"O The third argument specifies the number of times the program should
-.\"O allow the timer to expire before terminating.
-.\"O The second and third command-line arguments are optional.
-°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢¥¿¥¤¥Þ¡¼¤òºîÀ®¤·¡¢¤½¤Î¿ÊĽ¤ò¥â¥Ë¥¿¡¼¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
-¤³¤Î¥×¥í¥°¥é¥à¤ÏºÇÂç¤Ç 3 ¸Ä¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò¼è¤ê¡¢
-Âè°ì°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤ÎËþλ»þ´Ö¤Î½é´üÃÍ (Éÿôñ°Ì) ¤ò¡¢
-ÂèÆó°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤Î´Ö³Ö (Éÿôñ°Ì) ¤ò¡¢
-Âè»°°ú¤­¿ô¤Ç¤Ï¥¿¥¤¥Þ¡¼¤¬²¿²óËþλ¤·¤¿¤é¥×¥í¥°¥é¥à¤¬½ªÎ»¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£
-ÂèÆó°ú¤­¿ô¤ÈÂè»°°ú¤­¿ô¤Ï¾Êά²Äǽ¤Ç¤¢¤ë¡£
+\fIflags\fP が無効である。
+.SH バージョン
+これらのシステムコールはカーネル 2.6.25 以降の Linux で利用可能である。 ライブラリ側のサポートはバージョン 2.8 以降の glibc
+で提供されている。
+.SH 準拠
+これらのシステムコールは Linux 固有である。
+.SH バグ
+.\" 2.6.29
+現在のところ、 \fBtimerfd_create\fP()  が対応している clockid の種類は \fBtimer_create\fP(2)
+よりも少ない。
+.SH 例
+以下のプログラムは、タイマーを作成し、その進捗をモニターするものである。 このプログラムは最大で 3 個のコマンドライン引き数を取り、
+第一引き数ではタイマーの満了時間の初期値 (秒数単位) を、 第二引き数ではタイマーの間隔 (秒数単位) を、
+第三引き数ではタイマーが何回満了したらプログラムが終了するかを指定する。 第二引き数と第三引き数は省略可能である。
 
-.\"O The following shell session demonstrates the use of the program:
-°Ê²¼¤Î¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î»ÈÍÑÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£
+以下のシェルのセッションはこのプログラムの使用例を示したものである。
 .in +4n
 .nf
 
-.RB "$" " a.out 3 1 100"
+$\fB a.out 3 1 100\fP
 0.000: timer started
 3.000: read: 1; total=1
 4.000: read: 1; total=2
-.BR "^Z " "                 # type control-Z to suspend the program"
+\fB^Z \fP                 # type control\-Z to suspend the program
 [1]+  Stopped                 ./timerfd3_demo 3 1 100
-.RB "$ " "fg" "                # Resume execution after a few seconds"
+$ \fBfg\fP                # Resume execution after a few seconds
 a.out 3 1 100
 9.660: read: 5; total=7
 10.000: read: 1; total=8
 11.000: read: 1; total=9
-.BR "^C " "                 # type control-C to suspend the program"
+\fB^C \fP                 # type control\-C to suspend the program
 .fi
 .in
-.\"O .SS Program source
-.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹
+.SS プログラムのソース
 \&
 .nf
 .\" The commented out code here is what we currently need until
@@ -715,7 +281,7 @@ a.out 3 1 100
 #include <stdio.h>
 #include <stdint.h>        /* Definition of uint64_t */
 
-#define handle_error(msg) \\
+#define handle_error(msg) \e
         do { perror(msg); exit(EXIT_FAILURE); } while (0)
 
 static void
@@ -754,7 +320,7 @@ main(int argc, char *argv[])
     ssize_t s;
 
     if ((argc != 2) && (argc != 4)) {
-        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\\n",
+        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\en",
                 argv[0]);
         exit(EXIT_FAILURE);
     }
@@ -784,7 +350,7 @@ main(int argc, char *argv[])
         handle_error("timerfd_settime");
 
     print_elapsed_time();
-    printf("timer started\\n");
+    printf("timer started\en");
 
     for (tot_exp = 0; tot_exp < max_exp;) {
         s = read(fd, &exp, sizeof(uint64_t));
@@ -793,7 +359,7 @@ main(int argc, char *argv[])
 
         tot_exp += exp;
         print_elapsed_time();
-        printf("read: %llu; total=%llu\\n",
+        printf("read: %llu; total=%llu\en",
                 (unsigned long long) exp,
                 (unsigned long long) tot_exp);
     }
@@ -801,29 +367,11 @@ main(int argc, char *argv[])
     exit(EXIT_SUCCESS);
 }
 .fi
-.\"O .SH BUGS
-.SH ¥Ð¥°
-.\"O Currently,
-.\"O .\" 2.6.29
-.\"O .BR timerfd_create ()
-.\"O supports fewer types of clock IDs than
-.\"O .BR timer_create (2).
-¸½ºß¤Î¤È¤³¤í¡¢
-.\" 2.6.29
-.BR timerfd_create ()
-¤¬Âбþ¤·¤Æ¤¤¤ë clockid ¤Î¼ïÎà¤Ï
-.BR timer_create (2)
-¤è¤ê¤â¾¯¤Ê¤¤¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR eventfd (2),
-.BR poll (2),
-.BR read (2),
-.BR select (2),
-.BR setitimer (2),
-.BR signalfd (2),
-.BR timer_create (2),
-.BR timer_gettime (2),
-.BR timer_settime (2),
-.BR epoll (7),
-.BR time (7)
+.SH 関連項目
+\fBeventfd\fP(2), \fBpoll\fP(2), \fBread\fP(2), \fBselect\fP(2), \fBsetitimer\fP(2),
+\fBsignalfd\fP(2), \fBtimer_create\fP(2), \fBtimer_gettime\fP(2),
+\fBtimer_settime\fP(2), \fBepoll\fP(7), \fBtime\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。