OSDN Git Service

(split) LDP: Translate several pages
[linuxjm/LDP_man-pages.git] / draft / man2 / wait.2
index aa1ab08..57b8d3b 100644 (file)
@@ -1,8 +1,7 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (c) 1993 by Thomas Koenig <ig25@rz.uni-karlsruhe.de>
 .\" and Copyright (c) 2004 by 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.
@@ -22,7 +21,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
-.\" License.
+.\" %%%LICENSE_END
 .\"
 .\" Modified Sat Jul 24 13:30:06 1993 by Rik Faith <faith@cs.unc.edu>
 .\" Modified Sun Aug 21 17:42:42 1994 by Rik Faith <faith@cs.unc.edu>
 .\" 2005-05-10, mtk, __W* flags can't be used with waitid()
 .\" 2008-07-04, mtk, removed erroneous text about SA_NOCLDSTOP
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya all rights reserved.
 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved.
 .\" Translated 1997-03-04, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
 .\" Updated 2005-03-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
 .\" Updated 2005-12-26, Akihiro MOTOKI
 .\" Updated 2008-07-31, Akihiro MOTOKI, LDP v3.05
+.\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       signal handling         ¥·¥°¥Ê¥ë½èÍý
-.\"WORD:       suspend                 Ää»ß(suspend)
-.\"WORD:       zombie                  ¥¾¥ó¥Ó(zombie)
-.\"WORD:       child process           »Ò¥×¥í¥»¥¹
-.\"WORD:       process group           ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×
-.\"WORD:       process group ID        ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×ID
-.\"WORD:       stop                    Ää»ß(stop)
-.\"WORD:       effective user ID       ¼Â¸ú¥æ¡¼¥¶¡¼ID
-.\"WORD:       block                   ¶Ø»ß(block)
-.\"
-.TH WAIT 2 2010-09-26 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O wait, waitpid, waitid \- wait for process to change state
-wait, waitpid, waitid \- ¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤òÂÔ¤Ä
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
-.B #include <sys/types.h>
+.TH WAIT 2 2013\-09\-04 Linux "Linux Programmer's Manual"
+.SH 名前
+wait, waitpid, waitid \- プロセスの状態変化を待つ
+.SH 書式
+\fB#include <sys/types.h>\fP
 .br
-.B #include <sys/wait.h>
+\fB#include <sys/wait.h>\fP
 .sp
-.BI "pid_t wait(int *" "status" );
+\fBpid_t wait(int *\fP\fIstatus\fP\fB);\fP
 
-.BI "pid_t waitpid(pid_t " pid ", int *" status ", int " options );
+\fBpid_t waitpid(pid_t \fP\fIpid\fP\fB, int *\fP\fIstatus\fP\fB, int \fP\fIoptions\fP\fB);\fP
 
-.BI "int waitid(idtype_t " idtype ", id_t " id \
-", siginfo_t *" infop ", int " options );
+\fBint waitid(idtype_t \fP\fIidtype\fP\fB, id_t \fP\fIid\fP\fB, siginfo_t *\fP\fIinfop\fP\fB, int \fP\fIoptions\fP\fB);\fP
+                /* これは glibc と POSIX のインターフェイスである。
+                   生のシステムコールについての情報は「注意」の節を参照。 */
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
 .ad l
 .PD 0
-.BR waitid ():
+\fBwaitid\fP():
 .RS 4
-_SVID_SOURCE ||
-_XOPEN_SOURCE\ >=\ 500 ||
-_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
 .br
-.\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L
-|| /* glibc 2.12 °Ê¹ß: */ _POSIX_C_SOURCE\ >=\ 200809L
+|| /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L
 .RE
 .PD
 .ad
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O All of these system calls are used to wait for state changes
-.\"O in a child of the calling process, and obtain information
-.\"O about the child whose state has changed.
-.\"O A state change is considered to be: the child terminated;
-.\"O the child was stopped by a signal; or the child was resumed by a signal.
-.\"O In the case of a terminated child, performing a wait allows
-.\"O the system to release the resources associated with the child;
-.\"O if a wait is not performed, then the terminated child remains in
-.\"O a "zombie" state (see NOTES below).
-¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤¤¤º¤ì¤â¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î
-¾õÂÖÊѲ½¤òÂÔ¤Á¡¢¾õÂÖ¤¬ÊѲ½¤·¤¿¤½¤Î»Ò¥×¥í¥»¥¹¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¤Î¤Ë
-»ÈÍѤµ¤ì¤ë¡£
-¾õÂÖÊѲ½¤È¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë:
-»Ò¥×¥í¥»¥¹¤Î½ªÎ»¡¢¥·¥°¥Ê¥ë¤Ë¤è¤ë»Ò¥×¥í¥»¥¹¤ÎÄä»ß¡¢
-¥·¥°¥Ê¥ë¤Ë¤è¤ë»Ò¥×¥í¥»¥¹¤ÎºÆ³«¡£
-»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¾ì¹ç¤Ï¡¢wait ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢
-¥·¥¹¥Æ¥à¤¬¤½¤Î»Ò¥×¥í¥»¥¹¤Ë´ØÏ¢¤¹¤ë¥ê¥½¡¼¥¹¤ò²òÊü¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£
-wait ¤¬¼Â¹Ô¤µ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Ï
-¡Ö¥¾¥ó¥Ó¡×¾õÂ֤ǻĤ곤±¤ë (²¼µ­¤ÎÃí°Õ¤Î¾Ï¤ò»²¾È¤Î¤³¤È)¡£
+.SH 説明
+これらのシステムコールはいずれも、呼び出し元プロセスの子プロセスの 状態変化を待ち、状態が変化したその子プロセスの情報を取得するのに 使用される。
+状態変化とは以下のいずれかである: 子プロセスの終了、シグナルによる子プロセスの停止、 シグナルによる子プロセスの再開。
+子プロセスが終了した場合は、wait を実行することで、 システムがその子プロセスに関連するリソースを解放できるようになる。 wait
+が実行されなかった場合には、終了した子プロセスは 「ゾンビ」状態で残り続ける (下記の注意の章を参照のこと)。
 
-.\"O If a child has already changed state, then these calls return immediately.
-.\"O Otherwise they block until either a child changes state or
-.\"O a signal handler interrupts the call (assuming that system calls
-.\"O are not automatically restarted using the
-.\"O .B SA_RESTART
-.\"O flag of
-.\"O .BR sigaction (2)).
-.\"O In the remainder of this page, a child whose state has changed
-.\"O and which has not yet been waited upon by one of these system
-.\"O calls is termed
-.\"O .IR waitable .
-»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬¤¹¤Ç¤ËȯÀ¸¤·¤Æ¤¤¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î¥³¡¼¥ë¤Ï
-¤¹¤°¤ËÉüµ¢¤¹¤ë¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬µ¯¤³¤ë¤«¡¢
-¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÃæÃǤµ¤ì¤ë¤Þ¤Ç¡¢
-Ää»ß (block) ¤¹¤ë (¸å¼Ô¤Ï¡¢
-.BR sigaction (2)
-¤Î
-.B SA_RESTART
-¥Õ¥é¥°¤Ë¤è¤ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤
-¾ì¹ç¤ÎÆ°ºî¤Ç¤¢¤ë)¡£
-°Ê²¼¤ÎÀâÌÀ¤Ç¤Ï¡¢¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤¿¤¬¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¤¤º¤ì¤«¤Ë
-¤è¤Ã¤ÆÂÔ¤¿¤ì¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤ò
-.I waitable
-(ÂÔ¤Á²Äǽ) ¤È¸Æ¤Ö¡£
-.\"O .SS "wait() and waitpid()"
-.SS "wait() ¤È waitpid()"
-.\"O The
-.\"O .BR wait ()
-.\"O system call suspends execution of the calling process until one of its
-.\"O children terminates.
-.\"O The call
-.\"O .I wait(&status)
-.\"O is equivalent to:
-.\"O .nf
-.\"O
-.\"O     watpid(\-1, &status, 0);
-.\"O .fi
-.BR wait ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤Î¤¤¤º¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤Ç
-¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë¡£
-°Ê²¼¤ÎÆó¤Ä¤Î¸Æ¤Ó½Ð¤·¤ÏÅù²Á¤Ç¤¢¤ë:
+子プロセスの状態変化がすでに発生していた場合、これらのコールは すぐに復帰する。それ以外の場合は、子プロセスの状態変化が起こるか、
+シグナルハンドラによりシステムコールが中断されるまで、 停止 (block) する (後者は、 \fBsigaction\fP(2)  の
+\fBSA_RESTART\fP フラグによりシステムコールが自動的に再スタートするようになっていない 場合の動作である)。
+以下の説明では、状態変化が起こったがこれらのシステムコールのいずれかに よって待たれていない子プロセスを \fIwaitable\fP (待ち可能) と呼ぶ。
+.SS "wait() と waitpid()"
+\fBwait\fP()  システムコールは、子プロセスのいずれかが終了するまで 呼び出し元のプロセスの実行を一時停止する。 呼び出し
+\fIwait(&status)\fP は以下と等価である:
 .nf
 
-    wait(&status);
-
     waitpid(\-1, &status, 0);
 .fi
 
-.\"O The
-.\"O .BR waitpid ()
-.\"O system call suspends execution of the calling process until a
-.\"O child specified by
-.\"O .I pid
-.\"O argument has changed state.
-.\"O By default,
-.\"O .BR waitpid ()
-.\"O waits only for terminated children, but this behavior is modifiable
-.\"O via the
-.\"O .I options
-.\"O argument, as described below.
-.BR waitpid ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢
-.I pid
-°ú¤­¿ô¤Ç»ØÄꤷ¤¿»Ò¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤¬µ¯¤³¤ë¤Þ¤Ç¡¢
-¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
-.BR waitpid ()
-¤Ï»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤À¤±¤òÂԤĤ¬¡¢¤³¤ÎÆ°ºî¤Ï
-.I options
-°ú¤­¿ô¤Ë¤è¤êÊѹ¹²Äǽ¤Ç¤¢¤ë¡£
+\fBwaitpid\fP()  システムコールは、 \fIpid\fP 引き数で指定した子プロセスの状態変化が起こるまで、
+呼び出し元のプロセスの実行を一時停止する。デフォルトでは、 \fBwaitpid\fP()  は子プロセスの終了だけを待つが、この動作は \fIoptions\fP
+引き数により変更可能である。
 
-.\"O The value of
-.\"O .I pid
-.\"O can be:
-.I pid
-¤Ë»ØÄê¤Ç¤­¤ëÃͤϰʲ¼¤ÎÄ̤ê:
+\fIpid\fP に指定できる値は以下の通り:
 .IP "< \-1"
-.\"O meaning wait for any child process whose process group ID is
-.\"O equal to the absolute value of
-.\"O .IR pid .
-¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬
-.I pid
-¤ÎÀäÂÐÃͤËÅù¤·¤¤»Ò¥×¥í¥»¥¹¤Î¤¤¤º¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤Ç¤òÂԤġ£
+プロセスグループID が \fIpid\fP の絶対値に等しい子プロセスのいずれかが終了するまでを待つ。
 .IP \-1
-.\"O meaning wait for any child process.
-»Ò¥×¥í¥»¥¹¤Î¤É¤ì¤«¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£
+子プロセスのどれかが終了するまで待つ。
 .IP 0
-.\"O meaning wait for any child process whose process group ID is
-.\"O equal to that of the calling process.
-¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¤â¤Î¤ÈÅù¤·¤¤
-»Ò¥×¥í¥»¥¹¤òÂԤġ£
+プロセスグループID が呼び出したプロセスのものと等しい 子プロセスを待つ。
 .IP "> 0"
-.\"O meaning wait for the child whose process ID is equal to the
-.\"O value of
-.\"O .IR pid .
-¥×¥í¥»¥¹ID ¤¬
-.I pid
-¤ËÅù¤·¤¤»Ò¥×¥í¥»¥¹¤òÂԤġ£
+プロセスID が \fIpid\fP に等しい子プロセスを待つ。
 .PP
-.\"O The value of
-.\"O .I options
-.\"O is an OR of zero or more of the following constants:
-.I options
-¤ÎÃͤϼ¡¤ÎÄê¿ô¤Î 0 ¸Ä°Ê¾å¤ÎÏÀÍýϤǤ¢¤ë:
-.TP 12
-.B WNOHANG
-.\"O return immediately if no child has exited.
-¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤¿»Ò¥×¥í¥»¥¹¤¬¤Ê¤¤¾ì¹ç¤Ë¤¹¤°¤ËÉüµ¢¤¹¤ë¡£
-.TP
-.B WUNTRACED
-.\"O also return if a child has stopped
-.\"O (but not traced via
-.\"O .BR ptrace (2)).
-.\"O Status for
-.\"O .I traced
-.\"O children which have stopped is provided
-.\"O even if this option is not specified.
-»Ò¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿¾ì¹ç¤Ë¤âÉüµ¢¤¹¤ë (»Ò¥×¥í¥»¥¹¤¬
-.BR ptrace (2)
-¤Ç¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï½ü¤¯)¡£
-¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢Ää»ß¤·¤¿¥×¥í¥»¥¹¤¬
-¡Ö¥È¥ì¡¼¥¹ (traced)¡×¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢»Ò¥×¥í¥»¥¹¤Î¾õÂÖ¤¬Êó¹ð¤µ¤ì¤ë¡£
-.TP
-.\"O .BR WCONTINUED " (Since Linux 2.6.10)"
-.BR WCONTINUED " (Linux 2.6.10 °Ê¹ß)"
-.\"O also return if a stopped child has been resumed by delivery of
-.\"O .BR SIGCONT .
-Ää»ß¤·¤¿»Ò¥×¥í¥»¥¹¤¬
-.B SIGCONT
-¤ÎÇÛÁ÷¤Ë¤è¤êºÆ³«¤·¤¿¾ì¹ç¤Ë¤âÉüµ¢¤¹¤ë¡£
+\fIoptions\fP の値は次の定数の 0 個以上の論理和である:
+.TP  12
+\fBWNOHANG\fP
+状態変化が起こった子プロセスがない場合にすぐに復帰する。
+.TP 
+\fBWUNTRACED\fP
+子プロセスが停止した場合にも復帰する (子プロセスが \fBptrace\fP(2)  でトレースされている場合は除く)。
+このオプションが指定されていない場合でも、停止したプロセスが 「トレース (traced)」されていれば、子プロセスの状態が報告される。
+.TP 
+\fBWCONTINUED\fP (Linux 2.6.10 以降)
+停止した子プロセスが \fBSIGCONT\fP の配送により再開した場合にも復帰する。
 .PP
-.\"O (For Linux-only options, see below.)
-(Linux ÀìÍÑ¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë)
+(Linux 専用オプションについては後述する)
 .PP
-.\"O If
-.\"O .I status
-.\"O is not NULL,
-.\"O .BR wait ()
-.\"O and
-.\"O .BR waitpid ()
-.\"O store status information in the \fIint\fP to which it points.
-.I status
-¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢
-.BR wait ()
-¤ä
-.BR waitpid ()
-¤Ï
-.I status
-¤Ç»Ø¤¹ \fIint\fP ¤Ë¾õÂÖ¾ðÊó¤ò³ÊǼ¤¹¤ë¡£
-.\"O This integer can be inspected with the following macros (which
-.\"O take the integer itself as an argument, not a pointer to it,
-.\"O as is done in
-.\"O .BR wait ()
-.\"O and
-.\"O .BR waitpid ()!):
-¤³¤ÎÀ°¿ô¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤Ã¤Æ¸¡ºº¤Ç¤­¤ë¡£
-(¤³¤ì¤é¤Î¥Þ¥¯¥í¤Î°ú¤­¿ô¤Ë¤Ï¡¢
-.BR wait ()
-¤ä
-.BR waitpid ()
-¤¬½ñ¤­¹þ¤ó¤ÀÀ°¿ô¤½¤Î¤â¤Î¤ò»ØÄꤹ¤ë¡£¥Ý¥¤¥ó¥¿¤Ç¤Ï¤Ê¤¤!)
-.TP
-.BI WIFEXITED( status )
-.\"O returns true if the child terminated normally, that is,
-.\"O by calling
-.\"O .BR exit (3)
-.\"O or
-.\"O .BR _exit (2),
-.\"O or by returning from main().
-»Ò¥×¥í¥»¥¹¤¬Àµ¾ï¤Ë½ªÎ»¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£
-¡ÖÀµ¾ï¤Ë¡×¤È¤Ï¡¢
-.BR exit (3)
-¤«
-.BR _exit (2)
-¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢¤â¤·¤¯¤Ï
-main() ¤«¤éÉüµ¢¤·¤¿¾ì¹ç¤Ç¤¢¤ë¡£
-.TP
-.BI WEXITSTATUS( status )
-.\"O returns the exit status of the child.
-.\"O This consists of the least significant 8 bits of the
-.\"O .I status
-.\"O argument that the child specified in a call to
-.\"O .BR exit (3)
-.\"O or
-.\"O .BR _exit (2)
-.\"O or as the argument for a return statement in main().
-.\"O This macro should only be employed if
-.\"O .B WIFEXITED
-.\"O returned true.
-»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹¡£
-½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï
-.I status
-°ú¤­¿ô¤Î²¼°Ì 8¥Ó¥Ã¥È¤Ç¹½À®¤µ¤ì¤Æ¤ª¤ê¡¢
-.BR exit (3)
-¤ä
-.BR _exit (2)
-¤Î¸Æ¤Ó½Ð¤·»þ¤ËÅϤµ¤ì¤¿ÃÍ¡¢¤â¤·¤¯¤Ï main() ¤Î return Ê¸¤Î
-°ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤¿ÃͤǤ¢¤ë¡£
-¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï
-.B WIFEXITED
-¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-.TP
-.BI WIFSIGNALED( status )
-.\"O returns true if the child process was terminated by a signal.
-»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤Ë¤è¤ê½ªÎ»¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£
-.TP
-.BI WTERMSIG( status )
-.\"O returns the number of the signal that caused the child process to
-.\"O terminate.
-.\"O This macro should only be employed if
-.\"O .B WIFSIGNALED
-.\"O returned true.
-»Ò¥×¥í¥»¥¹½ªÎ»¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤òÊÖ¤¹¡£
-¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï
-.B WIFSIGNALED
-¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-.TP
-.BI WCOREDUMP( status )
-.\"O returns true if the child produced a core dump.
-.\"O This macro should only be employed if
-.\"O .B WIFSIGNALED
-.\"O returned true.
-.\"O This macro is not specified in POSIX.1-2001 and is not available on
-.\"O some UNIX implementations (e.g., AIX, SunOS).
-.\"O Only use this enclosed in #ifdef WCOREDUMP ... #endif.
-»Ò¥×¥í¥»¥¹¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£
-¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï
-.B WIFSIGNALED
-¤¬¿¿¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-¤³¤Î¥Þ¥¯¥í¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢
-(AIX, SunOS ¤Ê¤É¤Î) ¤¤¤¯¤Ä¤«¤Î UNIX ¤Î¼ÂÁõ¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£
-ɬ¤º #ifdef WCOREDUMP ... #endif ¤Ç³ç¤Ã¤Æ»ÈÍѤ¹¤ë¤³¤È¡£
-.TP
-.BI WIFSTOPPED( status )
-.\"O returns true if the child process was stopped by delivery of a signal;
-.\"O this is only possible if the call was done using
-.\"O .B WUNTRACED
-.\"O or when the child is being traced (see
-.\"O .BR ptrace (2)).
-»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤êÄä»ß¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£
-¤³¤ì¤¬¿¿¤Ë¤Ê¤ë¤Î¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬
-.B WUNTRACED
-¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢»Ò¥×¥í¥»¥¹¤¬¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç
-.RB ( ptrace (2)
-»²¾È) ¤À¤±¤Ç¤¢¤ë¡£
-.TP
-.BI WSTOPSIG( status )
-.\"O returns the number of the signal which caused the child to stop.
-.\"O This macro should only be employed if
-.\"O .B WIFSTOPPED
-.\"O returned true.
-»Ò¥×¥í¥»¥¹¤òÄä»ß¤µ¤»¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ¤òÊÖ¤¹¡£
-¤³¤Î¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤Î¤Ï
-.B WIFSTOPPED
-¤¬ 0 °Ê³°¤òÊÖ¤·¤¿¾ì¹ç¤À¤±¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-.TP
-.BI WIFCONTINUED( status )
-.\"O (since Linux 2.6.10)
-(Linux 2.6.10 °Ê¹ß)
-.\"O returns true if the child process was resumed by delivery of
-.\"O .BR SIGCONT .
-»Ò¥×¥í¥»¥¹¤¬
-.B SIGCONT
-¤ÎÇÛÁ÷¤Ë¤è¤êºÆ³«¤·¤¿¾ì¹ç¤Ë¿¿¤òÊÖ¤¹¡£
-.SS "waitid()"
-.\"O The
-.\"O .BR waitid ()
-.\"O system call (available since Linux 2.6.9) provides more precise
-.\"O control over which child state changes to wait for.
-.BR waitid ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë (Linux 2.6.9 °Ê¹ß¤ÇÍøÍѲÄǽ) ¤ò»È¤¦¤È¡¢
-»Ò¥×¥í¥»¥¹¤Î¤É¤Î¾õÂÖÊѲ½¤òÂԤĤ«¤Ë¤Ä¤¤¤Æ¤è¤êºÙ¤«¤ÊÀ©¸æ¤¬¤Ç¤­¤ë¡£
+\fIstatus\fP が NULL でなければ、 \fBwait\fP()  や \fBwaitpid\fP()  は \fIstatus\fP で指す \fIint\fP
+に状態情報を格納する。 この整数は以下のマクロを使って検査できる。 (これらのマクロの引き数には、 \fBwait\fP()  や \fBwaitpid\fP()
+が書き込んだ整数そのものを指定する。ポインタではない!)
+.TP 
+\fBWIFEXITED(\fP\fIstatus\fP\fB)\fP
+子プロセスが正常に終了した場合に真を返す。 「正常に」とは、 \fBexit\fP(3)  か \fB_exit\fP(2)  が呼び出された場合、もしくは
+main() から復帰した場合である。
+.TP 
+\fBWEXITSTATUS(\fP\fIstatus\fP\fB)\fP
+子プロセスの終了ステータスを返す。 終了ステータスは \fIstatus\fP 引き数の下位 8ビットで構成されており、 \fBexit\fP(3)  や
+\fB_exit\fP(2)  の呼び出し時に渡された値、もしくは main() の return 文の 引き数として指定された値である。
+このマクロを使用するのは \fBWIFEXITED\fP が真を返した場合だけにすべきである。
+.TP 
+\fBWIFSIGNALED(\fP\fIstatus\fP\fB)\fP
+子プロセスがシグナルにより終了した場合に真を返す。
+.TP 
+\fBWTERMSIG(\fP\fIstatus\fP\fB)\fP
+子プロセス終了の原因となったシグナルの番号を返す。 このマクロを使用するのは \fBWIFSIGNALED\fP が真を返した場合だけにすべきである。
+.TP 
+\fBWCOREDUMP(\fP\fIstatus\fP\fB)\fP
+子プロセスがコアダンプを生成した場合に真を返す。 このマクロを使用するのは \fBWIFSIGNALED\fP が真を返した場合だけにすべきである。
+このマクロは POSIX.1\-2001 では規定されておらず、 (AIX, SunOS などの) いくつかの UNIX の実装では利用できない。 必ず
+#ifdef WCOREDUMP ... #endif で括って使用すること。
+.TP 
+\fBWIFSTOPPED(\fP\fIstatus\fP\fB)\fP
+子プロセスがシグナルの配送により停止した場合に真を返す。 これが真になるのは、システムコールが \fBWUNTRACED\fP
+を指定して呼び出された場合か、子プロセスがトレースされている場合 (\fBptrace\fP(2)  参照) だけである。
+.TP 
+\fBWSTOPSIG(\fP\fIstatus\fP\fB)\fP
+子プロセスを停止させたシグナルの番号を返す。 このマクロを使用するのは \fBWIFSTOPPED\fP が 0 以外を返した場合だけにすべきである。
+.TP 
+\fBWIFCONTINUED(\fP\fIstatus\fP\fB)\fP
+(Linux 2.6.10 以降)  子プロセスが \fBSIGCONT\fP の配送により再開した場合に真を返す。
+.SS waitid()
+\fBwaitid\fP()  システムコール (Linux 2.6.9 以降で利用可能) を使うと、
+子プロセスのどの状態変化を待つかについてより細かな制御ができる。
 
-.\"O The
-.\"O .I idtype
-.\"O and
-.\"O .I id
-.\"O arguments select the child(ren) to wait for, as follows:
-°ú¤­¿ô
-.I idtype
-¤È
-.I id
-¤Ç¤É¤Î»Ò¥×¥í¥»¥¹¤òÂԤĤ«¤òÁªÂò¤¹¤ë:
+引き数 \fIidtype\fP と \fIid\fP でどの子プロセスを待つかを選択する:
 .IP "\fIidtype\fP == \fBP_PID\fP"
-.\"O Wait for the child whose process ID matches
-.\"O .IR id .
-¥×¥í¥»¥¹ID ¤¬
-.I id
-¤È°ìÃפ¹¤ë»Ò¥×¥í¥»¥¹¤òÂԤġ£
+プロセスID が \fIid\fP と一致する子プロセスを待つ。
 .IP "\fIidtype\fP == \fBP_PGID\fP"
-.\"O Wait for any child whose process group ID matches
-.\"O .IR id .
-¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤¬
-.I id
-¤È°ìÃפ¹¤ë»Ò¥×¥í¥»¥¹¤òÂԤġ£
+プロセスグループID が \fIid\fP と一致する子プロセスを待つ。
 .IP "\fIidtype\fP == \fBP_ALL\fP"
-.\"O Wait for any child;
-.\"O .I id
-.\"O is ignored.
-»Ò¥×¥í¥»¥¹Á´Éô¤òÂоݤËÂԤġ£
-.I id
-¤Ï̵»ë¤µ¤ì¤ë¡£
+子プロセス全部を対象に待つ。 \fIid\fP は無視される。
 .PP
-.\"O The child state changes to wait for are specified by ORing
-.\"O one or more of the following flags in
-.\"O .IR options :
-»Ò¥×¥í¥»¥¹¤Î¤É¤Î¾õÂÖÊѲ½¤òÂԤĤ«¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Ç»ØÄꤹ¤ë
-.RI ( options
-¤Ë¤Ï 1¸Ä°Ê¾å¤Î¥Õ¥é¥°¤ÎÏÀÍýϤò¤È¤Ã¤Æ»ØÄꤹ¤ë):
-.TP 12
-.B WEXITED
-.\"O Wait for children that have terminated.
-»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤òÂԤġ£
-.TP
-.B WSTOPPED
-.\"O Wait for children that have been stopped by delivery of a signal.
-»Ò¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤Ë¤è¤êÄä»ß¤¹¤ë¤Î¤òÂԤġ£
-.TP
-.B WCONTINUED
-.\"O Wait for (previously stopped) children that have been
-.\"O resumed by delivery of
-.\"O .BR SIGCONT .
-(Ää»ß¤·¤Æ¤¤¤¿) »Ò¥×¥í¥»¥¹¤¬
-.B SIGCONT
-¤¬ÇÛÁ÷¤µ¤ì¤ÆºÆ³«¤¹¤ë¤Î¤òÂԤġ£
+子プロセスのどの状態変化を待つかは以下のフラグで指定する (\fIoptions\fP には 1個以上のフラグの論理和をとって指定する):
+.TP  12
+\fBWEXITED\fP
+子プロセスの終了を待つ。
+.TP 
+\fBWSTOPPED\fP
+子プロセスがシグナルの配送により停止するのを待つ。
+.TP 
+\fBWCONTINUED\fP
+(停止していた) 子プロセスが \fBSIGCONT\fP が配送されて再開するのを待つ。
 .PP
-.\"O The following flags may additionally be ORed in
-.\"O .IR options :
-¤µ¤é¤Ë°Ê²¼¤Î¥Õ¥é¥°¤òÏÀÍýϤηÁ¤Ç
-.I options
-¤Ë»ØÄê¤Ç¤­¤ë:
-.TP 12
-.B WNOHANG
-.\"O As for
-.\"O .BR waitpid ().
-.BR waitpid ()
-¤ÈƱÍÍ¡£
-.TP
-.B WNOWAIT
-.\"O Leave the child in a waitable state; a later wait call
-.\"O can be used to again retrieve the child status information.
-waitable ¾õÂÖ¤Î¥×¥í¥»¥¹¤ò¤½¤Î¤Þ¤Þ¤Ë¤¹¤ë¡£¤³¤Î¸å¤Ç wait ¥³¡¼¥ë¤ò
-»È¤Ã¤Æ¡¢Æ±¤¸»Ò¥×¥í¥»¥¹¤Î¾õÂÖ¾ðÊó¤ò¤â¤¦°ìÅÙ¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+さらに以下のフラグを論理和の形で \fIoptions\fP に指定できる:
+.TP  12
+\fBWNOHANG\fP
+\fBwaitpid\fP()  と同様。
+.TP 
+\fBWNOWAIT\fP
+waitable 状態のプロセスをそのままにする。この後で wait コールを 使って、同じ子プロセスの状態情報をもう一度取得することができる。
 .PP
-.\"O Upon successful return,
-.\"O .BR waitid ()
-.\"O fills in the following fields of the
-.\"O .I siginfo_t
-.\"O structure pointed to by
-.\"O .IR infop :
-À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¡¢
-.BR waitid ()
-¤Ï
-.I infop
-¤¬»Ø¤¹
-.I siginfo_t
-¹½Â¤ÂΤΰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤òÀßÄꤹ¤ë:
-.TP 12
+成功した場合には、 \fBwaitid\fP()  は \fIinfop\fP が指す \fIsiginfo_t\fP 構造体の以下のフィールドを設定する:
+.TP  12
 \fIsi_pid\fP
-.\"O The process ID of the child.
-»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID¡£
-.TP
+子プロセスのプロセスID。
+.TP 
 \fIsi_uid\fP
-.\"O The real user ID of the child.
-.\"O (This field is not set on most other implementations.)
-»Ò¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ID
-(¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¾¤Î¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤ÏÀßÄꤵ¤ì¤Ê¤¤)¡£
-.TP
+子プロセスの実ユーザID (このフィールドは他のほとんどの実装では設定されない)。
+.TP 
 \fIsi_signo\fP
-.\"O Always set to
-.\"O .BR SIGCHLD .
-¾ï¤Ë
-.B SIGCHLD
-¤¬ÀßÄꤵ¤ì¤ë¡£
-.TP
+常に \fBSIGCHLD\fP が設定される。
+.TP 
 \fIsi_status\fP
-.\"O Either the exit status of the child, as given to
-.\"O .BR _exit (2)
-.\"O (or
-.\"O .BR exit (3)),
-.\"O or the signal that caused the child to terminate, stop, or continue.
-.\"O The
-.\"O .I si_code
-.\"O field can be used to determine how to interpret this field.
-.BR _exit (2)
-(¤«
-.BR exit (3))
-¤Ë»ØÄꤵ¤ì¤¿»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¡¢¤â¤·¤¯¤Ï
-»Ò¥×¥í¥»¥¹¤Î½ªÎ»¡¢Ää»ß¡¢ºÆ³«¤Î¸¶°ø¤È¤Ê¤Ã¤¿¥·¥°¥Ê¥ë¤¬ÀßÄꤵ¤ì¤ë¡£
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤ò¤É¤¦²ò¼á¤¹¤ë¤«¤Ï¡¢
-.I si_code
-¥Õ¥£¡¼¥ë¥É¤ò»²¾È¤·¤Æ·è¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-.TP
+\fB_exit\fP(2)  (か \fBexit\fP(3))  に指定された子プロセスの終了ステータス、もしくは
+子プロセスの終了、停止、再開の原因となったシグナルが設定される。 このフィールドをどう解釈するかは、 \fIsi_code\fP
+フィールドを参照して決めることができる。
+.TP 
 \fIsi_code\fP
-.\"O Set to one of:
-.\"O .B CLD_EXITED
-.\"O (child called
-.\"O .BR _exit (2));
-.\"O .B CLD_KILLED
-.\"O (child killed by signal);
-.\"O .B CLD_DUMPED
-.\"O (child killed by signal, and dumped core);
-.\"O .B CLD_STOPPED
-.\"O (child stopped by signal);
-.\"O .B CLD_TRAPPED
-.\"O (traced child has trapped); or
-.\"O .B CLD_CONTINUED
-.\"O (child continued by
-.\"O .BR SIGCONT ).
-°Ê²¼¤Î¤¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë:
-.B CLD_EXITED
-(»Ò¥×¥í¥»¥¹¤¬
-.BR _exit (2)
-¤ò¸Æ¤Ó½Ð¤·¤¿);
-.B CLD_KILLED
-(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ kill ¤µ¤ì¤¿);
-.B CLD_DUMPED
-(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ kill ¤µ¤ì¡¢¥³¥¢¡¦¥À¥ó¥×¤¬¹Ô¤ï¤ì¤¿);
-.B CLD_STOPPED
-(¥·¥°¥Ê¥ë¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬Ää»ß¤·¤¿);
-.BR CLD_TRAPPED
-(¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤¿»Ò¥×¥í¥»¥¹¤¬¥È¥é¥Ã¥×¤ò¼õ¿®¤·¤¿);
-.B CLD_CONTINUED
-.RB ( SIGCONT
-¤Ë¤è¤ê»Ò¥×¥í¥»¥¹¤¬ºÆ³«¤µ¤ì¤¿)¡£
+以下のいずれかが設定される: \fBCLD_EXITED\fP (子プロセスが \fB_exit\fP(2)  を呼び出した); \fBCLD_KILLED\fP
+(シグナルにより子プロセスが kill された); \fBCLD_DUMPED\fP (シグナルにより子プロセスが kill され、コア・ダンプが行われた);
+\fBCLD_STOPPED\fP (シグナルにより子プロセスが停止した); \fBCLD_TRAPPED\fP
+(トレースされていた子プロセスがトラップを受信した); \fBCLD_CONTINUED\fP (\fBSIGCONT\fP により子プロセスが再開された)。
 .PP
-.\"O If
-.\"O .B WNOHANG
-.\"O was specified in
-.\"O .I options
-.\"O and there were no children in a waitable state, then
-.\"O .BR waitid ()
-.\"O returns 0 immediately and
-.\"O the state of the
-.\"O .I siginfo_t
-.\"O structure pointed to by
-.\"O .I infop
-.\"O is unspecified.
-.B WNOHANG
-¤¬
-.I options
-¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢
-waitable ¾õÂÖ¤Î»Ò¥×¥í¥»¥¹¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
-.BR waitid ()
-¤Ï¤¹¤°¤Ë 0 ¤òÊÖ¤¹¡£¤³¤Î¤È¤­¡¢
-.I infop
-¤¬»Ø¤¹
-.I siginfo_t
-¹½Â¤ÂΤÎÆâÍƤÏÉÔÄê¤Ç¤¢¤ë¡£
-.\"O .\" POSIX.1-2001 leaves this possibility unspecified; most
-.\"O .\" implementations (including Linux) zero out the structure
-.\"O .\" in this case, but at at least one implementation (AIX 5.1)
-.\"O .\" does not -- MTK Nov 04
-.\" POSIX.1-2001 ¤Ç¤Ï¡¢ÉÔÄê¤Î²ÄǽÀ­¤ò»Ä¤·¤Æ¤¤¤ë¡£
-.\" (Linux ¤ò´Þ¤à) ¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î¾ì¹ç¤Ë¹½Â¤ÂΤò 0 ¤ÇËä¤á¤ë¤¬¡¢
-.\" ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¼ÂÁõ (AIX 5.1) ¤Ç¤Ï¤½¤¦¤Ê¤é¤Ê¤¤¡£ -- MTK Nov 04
-.\"O To distinguish this case from that where a child was in a
-.\"O waitable state, zero out the
-.\"O .I si_pid
-.\"O field before the call and check for a nonzero value in this field
-.\"O after the call returns.
-¤³¤Î¾ì¹ç¤ò waitable ¾õÂÖ¤Î»Ò¥×¥í¥»¥¹¤¬¤¢¤Ã¤¿¾ì¹ç¤È¶èÊ̤¹¤ë¤Ë¤Ï¡¢
-.BR waitid ()
-¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë
-.I si_pid
-¤ò 0 ¤Ë¤·¤Æ¤ª¤­¡¢¥³¡¼¥ë¤¬Éüµ¢¤·¤¿¸å¤Ç¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ 0 °Ê³°¤ÎÃͤ«¤É¤¦¤«
-¤ò¥Á¥§¥Ã¥¯¤¹¤ì¤Ð¤è¤¤¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.BR wait ():
-.\"O on success, returns the process ID of the terminated child;
-.\"O on error, \-1 is returned.
-À®¸ù¤¹¤ë¤È¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID ¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£
+.\" POSIX.1-2001 leaves this possibility unspecified; most
+.\" implementations (including Linux) zero out the structure
+.\" in this case, but at least one implementation (AIX 5.1)
+.\" does not -- MTK Nov 04
+\fBWNOHANG\fP が \fIoptions\fP に指定されていて、 waitable 状態の子プロセスがなかった場合には、 \fBwaitid\fP()
+はすぐに 0 を返す。このとき、 \fIinfop\fP が指す \fIsiginfo_t\fP 構造体の内容は不定である。 この場合を waitable
+状態の子プロセスがあった場合と区別するには、 \fBwaitid\fP()  を呼び出す前に \fIsi_pid\fP を 0
+にしておき、コールが復帰した後でこのフィールドが 0 以外の値かどうか をチェックすればよい。
+.SH 返り値
+\fBwait\fP(): 成功すると、終了した子プロセスのプロセスID を返す。 エラーの場合 \-1 を返す。
 
-.BR waitpid ():
-.\"O on success, returns the process ID of the child whose state has changed;
-.\"O if
-.\"O .B WNOHANG
-.\"O was specified and one or more child(ren) specified by
-.\"O.I pid
-.\"O exist, but have not yet changed state, then 0 is returned.
-.\"O On error, \-1 is returned.
-À®¸ù¤¹¤ë¤È¡¢¾õÂÖ¤¬ÊѲ½¤·¤¿»Ò¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID ¤òÊÖ¤¹¡£
-.B WNOHANG
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢
-.I pid
-¤Ç»Ø¼¨¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤¬°ì¤Ä°Ê¾å¸ºß¤¹¤ë¤¬¡¢¤É¤Î»Ò¥×¥í¥»¥¹¤Ç¤â
-¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ 0 ¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£
+\fBwaitpid\fP(): 成功すると、状態が変化した子プロセスのプロセスID を返す。 \fBWNOHANG\fP が指定されていて、 \fIpid\fP
+で指示された子プロセスが一つ以上存在するが、どの子プロセスでも 状態変化が起こっていなかった場合は、 0 を返す。 エラーの場合 \-1 を返す。
 
-.BR waitid ():
-.\"O returns 0 on success or
-.\"O if
-.\"O .B WNOHANG
-.\"O was specified and no child(ren) specified by
-.\"O .I id
-.\"O has yet changed state;
-.\"O on error, \-1 is returned.
-À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
-.B WNOHANG
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢
-.I pid
-¤Ç»Ø¼¨¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ç¾õÂÖÊѲ½¤¬µ¯¤³¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤â
-0 ¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£
 .\" FIXME: As reported by Vegard Nossum, if infop is NULL, then waitid()
 .\" returns the PID of the child.  Either this is a bug, or it is intended
 .\" behavior that needs to be documented.  See my Jan 2009 LKML mail
 .\" "waitid() return value strangeness when infop is NULL".
-.\"O Each of these calls sets
-.\"O .I errno
-.\"O to an appropriate value in the case of an error.
-¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¤¤¤º¤ì¤â
-.I errno
-¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.\"O .B ECHILD
-.\"O (for
-.\"O .BR wait ())
-.B ECHILD
-.RB ( wait ()
-¤Î¾ì¹ç)
-.\"O The calling process does not have any unwaited-for children.
-¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¡¢wait ¤ò¹Ô¤Ã¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤Ï¤Ê¤¤¡£
-.TP
-.\"O .B ECHILD
-.\"O (for
-.\"O .BR waitpid ()
-.\"O or
-.\"O .BR waitid ())
-.B ECHILD
-.RB ( waitpid ()
-¤«
-.BR waitid ()
-¤Î¾ì¹ç)
-.\"O The process specified by
-.\"O .I pid
-.\"O .RB ( waitpid ())
-.\"O or
-.\"O .I idtype
-.\"O and
-.\"O .I id
-.\"O .RB ( waitid ())
-.\"O does not exist or is not a child of the calling process.
-.\"O (This can happen for one's own child if the action for
-.\"O .B SIGCHLD
-.\"O is set to
-.\"O .BR SIG_IGN .
-.\"O See also the \fILinux Notes\fP section about threads.)
-.I pid
-.RB ( waitpid ())
-¤«
-.I idtype
-¤È
-.I id
-.RB ( waitid ())
-¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Ç¤Ê¤¤
-.RB ( SIGCHLD
-¤ÎÆ°ºî¤Ë
-.B SIG_IGN
-¤òÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¼«Ê¬¼«¿È¤Î»Ò¥×¥í¥»¥¹¤Ç¤âµ¯¤³¤ê¤¦¤ë¡£
-¥¹¥ì¥Ã¥É¤Ë´Ø¤·¤Æ¤Ï¡ÖLinux ¤Ç¤ÎÃí°Õ¡×¤ÎÀá¤â»²¾È¤¹¤ë¤³¤È)¡£
-.TP
-.B EINTR
-.\"O .B WNOHANG
-.\"O was not set and an unblocked signal or a
-.\"O .B SIGCHLD
-.\"O was caught; see.
-.\"O .BR signal (7).
-.B WNOHANG
-¤¬ÀßÄꤵ¤ì¤Æ¤ª¤é¤º¡¢¶Ø»ß (block) ¤µ¤ì¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤ä
-.B SIGCHLD
-¤ò¼õ¿®¤·¤¿¡£
-.BR signal (7)
-»²¾È¡£
-.TP
-.B EINVAL
-.\"O The
-.\"O .I options
-.\"O argument was invalid.
-.I options
-°ú¤­¿ô¤¬ÉÔÀµ¤Ç¤¢¤ë¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-SVr4, 4.3BSD, POSIX.1-2001.
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O A child that terminates, but has not been waited for becomes a "zombie".
-.\"O The kernel maintains a minimal set of information about the zombie
-.\"O process (PID, termination status, resource usage information)
-.\"O in order to allow the parent to later perform a wait to obtain
-.\"O information about the child.
-.\"O As long as a zombie is not removed from the system via a wait,
-.\"O it will consume a slot in the kernel process table, and if
-.\"O this table fills, it will not be possible to create further processes.
-.\"O If a parent process terminates, then its "zombie" children (if any)
-.\"O are adopted by
-.\"O .BR init (8),
-.\"O which automatically performs a wait to remove the zombies.
-½ªÎ»¤·¤¿¤¬¡¢wait ¤µ¤ì¤Æ¤¤¤Ê¤¤»Ò¥×¥í¥»¥¹¤Ï¡Ö¥¾¥ó¥Ó¡×¤Ë¤Ê¤ë¡£
-¸å¤Ç¿Æ¥×¥í¥»¥¹¤¬ wait ¤ò¼Â¹Ô¤·¤Æ»Ò¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë¡¢
-¥«¡¼¥Í¥ë¤Ï¥¾¥ó¥Ó¥×¥í¥»¥¹¤Ë¤Ä¤¤¤ÆºÇ¾®¸Â¤Î¾ðÊó (PID¡¢½ªÎ»¥¹¥Æ¡¼¥¿¥¹¡¢
-¥ê¥½¡¼¥¹»ÈÍѾõ¶·) ¤òÊÝ»ý¤¹¤ë¡£
-¥¾¥ó¥Ó¥×¥í¥»¥¹¤Ï¡¢ wait ¤Ë¤è¤Ã¤Æ¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤Ê¤¤¸Â¤ê¡¢
-¥«¡¼¥Í¥ë¤Î¥×¥í¥»¥¹¥Æ¡¼¥Ö¥ë¤Î 1 ¥¨¥ó¥È¥ê¤ò¾ÃÈñ¤¹¤ë¡£¤³¤Î¥×¥í¥»¥¹¥Æ¡¼¥Ö¥ë¤¬
-°ìÇդˤʤë¤È¡¢¿·¤¿¤Ë¥×¥í¥»¥¹¤òºî¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¯¤Ê¤ë¡£
-¿Æ¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤È¡¢¤½¤Î¿Æ¥×¥í¥»¥¹¤Î¡Ö¥¾¥ó¥Ó¡×¤Î
-»Ò¥×¥í¥»¥¹¤Ï (¤â¤·¤¢¤ì¤Ð)
-.BR init (8)
-¤ÎÍܻҤȤʤ롣
-.BR init (8)
-¤Ï wait ¤ò¼«Æ°Åª¤Ë¼Â¹Ô¤·¡¢¥¾¥ó¥Ó¤òºï½ü¤¹¤ë¡£
+\fBwaitid\fP(): 成功すると 0 を返す。 \fBWNOHANG\fP が指定されていて、 \fIpid\fP
+で指示された子プロセスで状態変化が起こっていなかった場合にも 0 を返す。 エラーの場合 \-1 を返す。 エラーの場合、これらのシステムコールはいずれも
+\fIerrno\fP に適切な値を設定する。
+.SH エラー
+.TP 
+\fBECHILD\fP
+(\fBwait\fP()  の場合)  呼び出し元プロセスには、wait を行っていない子プロセスはない。
+.TP 
+\fBECHILD\fP
+(\fBwaitpid\fP()  か \fBwaitid\fP()  の場合)  \fIpid\fP (\fBwaitpid\fP())  か \fIidtype\fP と
+\fIid\fP (\fBwaitid\fP())  で指定したプロセスが存在しないか、呼び出し元プロセスの子プロセスでない (\fBSIGCHLD\fP の動作に
+\fBSIG_IGN\fP を設定した場合には、自分自身の子プロセスでも起こりうる。 スレッドに関しては「Linux での注意」の節も参照すること)。
+.TP 
+\fBEINTR\fP
+\fBWNOHANG\fP が設定されておらず、禁止 (block) されていないシグナルや \fBSIGCHLD\fP を受信した。 \fBsignal\fP(7)
+参照。
+.TP 
+\fBEINVAL\fP
+\fIoptions\fP 引き数が不正である。
+.SH 準拠
+SVr4, 4.3BSD, POSIX.1\-2001.
+.SH 注意
+終了したが、wait されていない子プロセスは「ゾンビ」になる。 後で親プロセスが wait を実行して子プロセスについての情報を取得できるように、
+カーネルはゾンビプロセスについて最小限の情報 (PID、終了ステータス、 リソース使用状況) を保持する。 ゾンビプロセスは、 wait
+によってシステムから削除されない限り、 カーネルのプロセステーブルの 1 エントリを消費する。このプロセステーブルが
+一杯になると、新たにプロセスを作ることができなくなる。 親プロセスが終了すると、その親プロセスの「ゾンビ」の 子プロセスは (もしあれば)
+\fBinit\fP(8)  の養子となる。 \fBinit\fP(8)  は wait を自動的に実行し、ゾンビを削除する。
 
-.\"O POSIX.1-2001 specifies that if the disposition of
-.\"O .B SIGCHLD
-.\"O is set to
-.\"O .B SIG_IGN
-.\"O or the
-.\"O .B SA_NOCLDWAIT
-.\"O flag is set for
-.\"O .B SIGCHLD
-.\"O (see
-.\"O .BR sigaction (2)),
-.\"O then children that terminate do not become zombies and a call to
-.\"O .BR wait ()
-.\"O or
-.\"O .BR waitpid ()
-.\"O will block until all children have terminated, and then fail with
-.\"O .I errno
-.\"O set to
-.\"O .BR ECHILD .
-POSIX.1-2001 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
-.B SIGCHLD
-¤ÎÆ°ºî¤¬
-.B SIG_IGN
-¤ËÀßÄꤵ¤ì¤¿¤«¡¢
-.B SIGCHLD
-¤ËÂФ·¤Æ
-.B SA_NOCLDWAIT
-¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç
-.RB ( sigaction (2)
-»²¾È)¡¢½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Ï¥¾¥ó¥Ó¤Ë¤Ï¤Ê¤é¤º¡¢
-.BR wait ()
-¤ä
-.BR waitpid ()
-¤Î¸Æ¤Ó½Ð¤·¤ÏÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÄä»ß¤·¡¢
-»Ò¥×¥í¥»¥¹¤¬Á´Éô½ªÎ»¤·¤¿¸å
-.I errno
-¤Ë
-.B ECHILD
-¤òÀßÄꤷ¤Æ¼ºÇÔ¤¹¤ë¡£
-.\"O (The original POSIX standard left the behavior of setting
-.\"O .B SIGCHLD
-.\"O to
-.\"O .B SIG_IGN
-.\"O unspecified.
-.\"O Note that even though the default disposition of
-.\"O .B SIGCHLD
-.\"O is "ignore", explicitly setting the disposition to
-.\"O .B SIG_IGN
-.\"O results in different treatment of zombie process children.)
-(¤â¤È¤â¤È¤Î POSIX É¸½à¤Ï
-.B SIGCHLD
-¤Ë
-.B SIG_IGN
-¤òÀßÄꤷ¤¿¾ì¹ç¤Î¿¶¤ëÉñ¤¤¤ò̤µ¬Äê¤Î¤Þ¤Þ¤Ë¤·¤Æ¤¤¤ë¡£
-.B SIGCHLD
-¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤¬¡Ö̵»ë¡×¤Ç¤¢¤ë¤Ë¤â¤«¤«¤ï¤é¤º¡¢
-.B SIGCHLD
-¤ÎÆ°ºî¤È¤·¤Æ
-.B SIG_IGN
-¤òÌÀ¼¨Åª¤ËÀßÄꤷ¤¿¾ì¹ç¤Ë¤Ï¥¾¥ó¥Ó¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤Î°·¤¤¤¬
-°Û¤Ê¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£)
-.\"O Linux 2.6 conforms to this specification.
-.\"O However, Linux 2.4 (and earlier) does not:
-Linux 2.6 ¤Ï¤³¤Î»ÅÍͤ˽àµò¤·¤Æ¤¤¤ë¡£
-¤·¤«¤·¡¢Linux 2.4 (¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó) ¤Ï¤½¤¦¤Ç¤Ï¤Ê¤¤:
-.\"O if a
-.\"O .BR wait ()
-.\"O or
-.\"O .BR waitpid ()
-.\"O call is made while
-.\"O .B SIGCHLD
-.\"O is being ignored, the call behaves just as though
-.\"O .B SIGCHLD
-.\"O were not being ignored, that is, the call blocks until the next child
-.\"O terminates and then returns the process ID and status of that child.
-.B SIGCHLD
-¤¬Ìµ»ë¤µ¤ì¤ë¾õÂÖ¤Ç
-.BR wait ()
-¤Þ¤¿¤Ï
-.BR waitpid ()
-¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¡¢
-.B SIGCHLD
-¤¬Ìµ»ë¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¦¡£
-¤Ä¤Þ¤ê¡¢¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¼¡¤Î»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤Þ¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¡¢
-½ªÎ»¤·¤¿»Ò¥×¥í¥»¥¹¤Î PID ¤È¾õÂÖ¤¬ÊÖ¤µ¤ì¤ë¡£
-.\"O .SS Linux Notes
-.SS Linux ¤Ç¤ÎÃí°Õ
-.\"O In the Linux kernel, a kernel-scheduled thread is not a distinct
-.\"O construct from a process.
-.\"O Instead, a thread is simply a process
-.\"O that is created using the Linux-unique
-.\"O .BR clone (2)
-.\"O system call; other routines such as the portable
-.\"O .BR pthread_create (3)
-.\"O call are implemented using
-.\"O .BR clone (2);
-.\"O they cannot be used with
-.\"O .BR waitid ():
-Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¥¹¥±¥¸¥å¡¼¥ë¤µ¤ì¤ë¥¹¥ì¥Ã¥É¤Ï
-¥×¥í¥»¥¹¤ÈÌÀ³Î¤Ë¶èÊ̤Ǥ­¤ë¹½À®Í×ÁǤǤϤʤ¤¡£¥¹¥ì¥Ã¥É¤Ï Linux ¸ÇÍ­¤Î
-.BR clone (2)
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»ÈÍѤ·¤ÆÀ¸À®¤µ¤ì¤ë¥×¥í¥»¥¹¤Ë²á¤®¤Ê¤¤¡£
-°Ü¿¢À­¤Î¤¢¤ë
-.BR pthread_create (3)
-¥³¡¼¥ë¤Î¤è¤¦¤Ê¾¤Î¥ë¡¼¥Á¥ó¤Ï
-.BR clone (2)
-¤ò»ÈÍѤ·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë;
-¤³¤ì¤é¤Ç¤Ï
-.BR waitid ()
-¤ò»È¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
-.\"O Before Linux 2.4, a thread was just a special case of a process,
-.\"O and as a consequence one thread could not wait on the children
-.\"O of another thread, even when the latter belongs to the same thread group.
-Linux 2.4 ¤è¤êÁ°¤Ç¤Ï¡¢¥¹¥ì¥Ã¥É¤Ïñ¤ËÆüì¤Ê¥×¥í¥»¥¹¤Ç¤¢¤Ã¤¿¤Î¤Ç¡¢
-Î㤨Ʊ¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Ç¤¢¤Ã¤Æ¤â¡¢
-¤¢¤ë¥¹¥ì¥Ã¥É¤¬Ê̤Υ¹¥ì¥Ã¥É¤Î»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂԤĤ³¤È¤Ï½ÐÍè¤Ê¤«¤Ã¤¿¡£
-.\"O However, POSIX prescribes such functionality, and since Linux 2.4
-.\"O a thread can, and by default will, wait on children of other threads
-.\"O in the same thread group.
-¤·¤«¤·¡¢POSIX ¤Ç¤Ï¤³¤Î¤è¤¦¤Êµ¡Ç½¤òµ¬Äꤷ¤Æ¤ª¤ê¡¢
-Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤¬Æ±¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î¾¤Î¥¹¥ì¥Ã¥É¤Î
-»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂԤĤ³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-¤½¤·¤Æ¾­Íè¤Ï¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ë¤Ê¤ë¤Ç¤¢¤í¤¦¡£
+POSIX.1\-2001 では以下のように規定されている。 \fBSIGCHLD\fP の動作が \fBSIG_IGN\fP に設定されたか、 \fBSIGCHLD\fP
+に対して \fBSA_NOCLDWAIT\fP フラグが設定された場合 (\fBsigaction\fP(2)  参照)、終了した子プロセスはゾンビにはならず、
+\fBwait\fP()  や \fBwaitpid\fP()  の呼び出しは全ての子プロセスが終了するまで停止し、 子プロセスが全部終了した後 \fIerrno\fP
+に \fBECHILD\fP を設定して失敗する。 (もともとの POSIX 標準は \fBSIGCHLD\fP に \fBSIG_IGN\fP
+を設定した場合の振る舞いを未規定のままにしている。 \fBSIGCHLD\fP のデフォルトの動作が「無視」であるにもかかわらず、 \fBSIGCHLD\fP
+の動作として \fBSIG_IGN\fP を明示的に設定した場合にはゾンビプロセスの子プロセスの扱いが 異なる点に注意すること。)  Linux 2.6
+はこの仕様に準拠している。 しかし、Linux 2.4 (とそれ以前のバージョン) はそうではない: \fBSIGCHLD\fP が無視される状態で
+\fBwait\fP()  または \fBwaitpid\fP()  が呼び出された場合、 \fBSIGCHLD\fP が無視されていないかのように振る舞う。
+つまり、呼び出しによって次の子プロセスの終了までブロックされ、 終了した子プロセスの PID と状態が返される。
+.SS "Linux での注意"
+Linux カーネルでは、カーネルによってスケジュールされるスレッドは プロセスと明確に区別できる構成要素ではない。スレッドは Linux 固有の
+\fBclone\fP(2)  システムコールを使用して生成されるプロセスに過ぎない。 移植性のある \fBpthread_create\fP(3)
+コールのような他のルーチンは \fBclone\fP(2)  を使用して実装されている; これらでは \fBwaitid\fP()  を使うことはできない。
+Linux 2.4 より前では、スレッドは単に特殊なプロセスであったので、 例え同じスレッドグループであっても、
+あるスレッドが別のスレッドの子プロセスが終了するのを待つことは出来なかった。 しかし、POSIX ではこのような機能を規定しており、 Linux 2.4
+以降では、あるスレッドが同じスレッドグループの他のスレッドの 子プロセスが終了するのを待つことができるようになった。
+そして将来はこれがデフォルトの動作になるであろう。
 .LP
-.\"O The following Linux-specific
-.\"O .I options
-.\"O are for use with children created using
-.\"O .BR clone (2).
-.BR clone (2)
-¤òÍѤ¤¤Æºî¤é¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï¡¢°Ê²¼¤Î Linux ¸ÇÍ­¤Î
-.I options
-¤¬»ÈÍѤǤ­¤ë¡£
-.TP
-.B __WCLONE
+\fBclone\fP(2)  を用いて作られた子プロセスには、以下の Linux 固有の \fIoptions\fP が使用できる。
+.TP 
+\fB__WCLONE\fP
 .\" since 0.99pl10
-.\"O Wait for "clone" children only.
-.\"O If omitted then wait
-.\"O for "non-clone" children only.
-.\"O (A "clone" child is one
-.\"O which delivers no signal, or a signal other than
-.\"O .B SIGCHLD
-.\"O to its parent upon termination.)
-"clone" ¤Ê»Ò¥×¥í¥»¥¹¤À¤±¤òÂԤġ£
-»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏÈó "clone" ¤Ê»Ò¥×¥í¥»¥¹¤À¤±¤òÂÔ¤Ä
-("clone" ¤Ê»Ò¥×¥í¥»¥¹¤Ï¡¢½ªÎ»»þ¤Ë¿Æ¥×¥í¥»¥¹¤ØÁ´¤¯¥·¥°¥Ê¥ë¤òÁ÷¤é¤Ê¤¤¤«¡¢
-.B SIGCHLD
-°Ê³°¤Î¥·¥°¥Ê¥ë¤òÁ÷¤ë)¡£
-.\"O This option is ignored if
-.\"O .B __WALL
-.\"O is also specified.
-¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
-.B __WALL
-¤â»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï̵»ë¤µ¤ì¤ë¡£
-.TP
-.\"O .BR __WALL " (since Linux 2.4)"
-.BR __WALL " (Linux 2.4 °Ê¹ß)"
+"clone" な子プロセスだけを待つ。 指定されなかった場合は非 "clone" な子プロセスだけを待つ ("clone"
+な子プロセスは、終了時に親プロセスへ全くシグナルを送らないか、 \fBSIGCHLD\fP 以外のシグナルを送る)。 このオプションは \fB__WALL\fP
+も指定された場合は無視される。
+.TP 
+\fB__WALL\fP (Linux 2.4 以降)
 .\" since patch-2.3.48
-.\"O Wait for all children, regardless of
-.\"O type ("clone" or "non-clone").
-"clone" ¤Ç¤¢¤ë¤«¤Ê¤¤¤«¤Ë´Ø¤ï¤é¤º¡¢
-Á´¤Æ¤Î»Ò¥×¥í¥»¥¹¤òÂԤġ£
-.TP
-.\"O .BR __WNOTHREAD " (since Linux 2.4)"
-.BR __WNOTHREAD " (Linux 2.4 °Ê¹ß)"
+"clone" であるかないかに関わらず、 全ての子プロセスを待つ。
+.TP 
+\fB__WNOTHREAD\fP (Linux 2.4 以降)
 .\" since patch-2.4.0-test8
-.\"O Do not wait for children of other threads in
-.\"O the same thread group.
-.\"O This was the default before Linux 2.4.
-Ʊ¤¸¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î¾¤Î¥¹¥ì¥Ã¥É¤Î»Ò¥×¥í¥»¥¹¤ÏÂÔ¤¿¤Ê¤¤¡£
-Linux 2.4 ¤è¤êÁ°¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤¢¤Ã¤¿¡£
-.\"O .SH EXAMPLE
-.SH Îã
-.\"O .\" fork.2 refers to this example program.
-.\" fork.2 ¤â¤³¤Î¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò»²¾È¤·¤Æ¤¤¤ë¡£
-.\"O The following program demonstrates the use of
-.\"O .BR fork (2)
-.\"O and
-.\"O .BR waitpid ().
-.\"O The program creates a child process.
-.\"O If no command-line argument is supplied to the program,
-.\"O then the child suspends its execution using
-.\"O .BR pause (2),
-.\"O to allow the user to send signals to the child.
-.\"O Otherwise, if a command-line argument is supplied,
-.\"O then the child exits immediately,
-.\"O using the integer supplied on the command line as the exit status.
-.\"O The parent process executes a loop that monitors the child using
-.\"O .BR waitpid (),
-.\"O and uses the W*() macros described above to analyze the wait status value.
-°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¡¢
-.BR fork (2)
-¤È
-.BR waitpid ()
-¤Î»ÈÍÑÊýË¡¤ÎÎã¤ò¼¨¤·¤Æ¤¤¤ë¡£
-¤³¤Î¥×¥í¥°¥é¥à¤Ç¤Ï»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£
-¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¤È¤­¤Ï¡¢
-»Ò¥×¥í¥»¥¹¤Ï
-.BR pause (2)
-¤ò»È¤Ã¤Æ¤½¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤·¡¢¥æ¡¼¥¶¤¬¤½¤Î»Ò¥×¥í¥»¥¹¤Ë
-¥·¥°¥Ê¥ë¤òÁ÷¿®¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£
-¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢
-»Ò¥×¥í¥»¥¹¤Ïľ¤Á¤Ë½ªÎ»¤·¡¢
-¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤵ¤ì¤¿À°¿ô¤ò½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤È¤·¤Æ»ÈÍѤ¹¤ë¡£
-¿Æ¥×¥í¥»¥¹¤Ï¡¢
-.BR waitpid ()
-¤ò»È¤Ã¤Æ»Ò¥×¥í¥»¥¹¤ò´Æ»ë¤·¡¢
-wait ¤Î¥¹¥Æ¡¼¥¿¥¹Ãͤò¾åµ­¤Î W*() ¥Þ¥¯¥í¤ò»È¤Ã¤Æ²òÀϤ¹¤ë¤È¤¤¤¦
-¥ë¡¼¥×¤ò¼Â¹Ô¤¹¤ë¡£
+同じスレッドグループの他のスレッドの子プロセスは待たない。 Linux 2.4 より前ではデフォルトであった。
+.PP
+生の \fBwaitid\fP() システムコールは \fIstruct rusage\ *\fP 型の第 5 引数を取る。 この引数が NULL 以外の場合、
+この引数が子プロセスのリソース使用状況を返すのに使用される。 これは \fBwait4\fP(2) と同じ方法である。 詳細は \fBgetrusage\fP(2)
+を参照。
+.SH バグ
+POSIX.1\-2008 によると、 \fBwaitid\fP() を呼び出すアプリケーションは、 \fIinfop\fP が \fIsiginfo_t\fP
+構造体を指していること (つまり \fIinfop\fP が NULL でないポインタであること) を保証しなければならない。 Linux では、
+\fIinfop\fP が NULL の場合、 \fBwaitid\fP() は成功し、wait している子プロセスのプロセス ID を返す。
+アプリケーションは、この食い違った、非標準で、不必要な機能に依存しないようにすべきである。
+.SH 例
+.\" fork.2 refers to this example program.
+以下のプログラムは、 \fBfork\fP(2)  と \fBwaitpid\fP()  の使用方法の例を示している。 このプログラムでは子プロセスを生成する。
+コマンドライン引き数が指定されなかったときは、 子プロセスは \fBpause\fP(2)  を使ってその実行を一時停止し、ユーザがその子プロセスに
+シグナルを送信できるようにする。 コマンドライン引き数が指定された場合は、 子プロセスは直ちに終了し、
+コマンドラインで指定された整数を終了ステータスとして使用する。 親プロセスは、 \fBwaitpid\fP()  を使って子プロセスを監視し、 wait
+のステータス値を上記の W*() マクロを使って解析するという ループを実行する。
 
-.\"O The following shell session demonstrates the use of the program:
-²¼µ­¤Î¤Î¥·¥§¥ë¡¦¥»¥Ã¥·¥ç¥ó¤Ï¥×¥í¥°¥é¥à¤Î¼Â¹ÔÎã¤Ç¤¢¤ë:
+以下のシェルのセッションはこのプログラムの使用例を示したものである。
 .in +4n
 .nf
 
-.RB "$" " ./a.out &"
+$\fB ./a.out &\fP
 Child PID is 32360
 [1] 32359
-.RB "$" " kill \-STOP 32360"
+$\fB kill \-STOP 32360\fP
 stopped by signal 19
-.RB "$" " kill \-CONT 32360"
+$\fB kill \-CONT 32360\fP
 continued
-.RB "$" " kill \-TERM 32360"
+$\fB kill \-TERM 32360\fP
 killed by signal 15
 [1]+  Done                    ./a.out
 $
 .fi
 .in
-.\"O .SS Program source
-.SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹
+.SS プログラムのソース
 \&
 .nf
 #include <sys/wait.h>
@@ -995,7 +363,7 @@ main(int argc, char *argv[])
     }
 
     if (cpid == 0) {            /* Code executed by child */
-        printf("Child PID is %ld\\n", (long) getpid());
+        printf("Child PID is %ld\en", (long) getpid());
         if (argc == 1)
             pause();                    /* Wait for signals */
         _exit(atoi(argv[1]));
@@ -1009,29 +377,24 @@ main(int argc, char *argv[])
             }
 
             if (WIFEXITED(status)) {
-                printf("exited, status=%d\\n", WEXITSTATUS(status));
+                printf("exited, status=%d\en", WEXITSTATUS(status));
             } else if (WIFSIGNALED(status)) {
-                printf("killed by signal %d\\n", WTERMSIG(status));
+                printf("killed by signal %d\en", WTERMSIG(status));
             } else if (WIFSTOPPED(status)) {
-                printf("stopped by signal %d\\n", WSTOPSIG(status));
+                printf("stopped by signal %d\en", WSTOPSIG(status));
             } else if (WIFCONTINUED(status)) {
-                printf("continued\\n");
+                printf("continued\en");
             }
         } while (!WIFEXITED(status) && !WIFSIGNALED(status));
         exit(EXIT_SUCCESS);
     }
 }
 .fi
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR _exit (2),
-.BR clone (2),
-.BR fork (2),
-.BR kill (2),
-.BR ptrace (2),
-.BR sigaction (2),
-.BR signal (2),
-.BR wait4 (2),
-.BR pthread_create (3),
-.BR credentials (7),
-.BR signal (7)
+.SH 関連項目
+\fB_exit\fP(2), \fBclone\fP(2), \fBfork\fP(2), \fBkill\fP(2), \fBptrace\fP(2),
+\fBsigaction\fP(2), \fBsignal\fP(2), \fBwait4\fP(2), \fBpthread_create\fP(3),
+\fBcredentials\fP(7), \fBsignal\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。