OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / draft / man2 / vfork.2
index 6c39d05..37a5b8c 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl), 1 Nov 1999
 .\"
+.\" %%%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.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" 1999-11-10: Merged text taken from the page contributed by
 .\" Reed H. Petty (rhp@draper.net)
 .\"
-.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
-.\"         all rights reserved.
-.\" Translated 1999-12-04, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Updated 2007-01-09, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.43
-.\" Updated 2008-11-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
+.\"*******************************************************************
 .\"
-.TH VFORK 2 2010-09-20 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O vfork \- create a child process and block parent
-vfork \- »Ò¥×¥í¥»¥¹¤òÀ¸À®¤·¿Æ¥×¥í¥»¥¹¤òÄä»ß¤µ¤»¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
-.B #include <sys/types.h>
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH VFORK 2 2012\-08\-05 Linux "Linux Programmer's Manual"
+.SH 名前
+vfork \- 子プロセスを生成し親プロセスを停止させる
+.SH 書式
+\fB#include <sys/types.h>\fP
 .br
-.B #include <unistd.h>
+\fB#include <unistd.h>\fP
 .sp
-.B pid_t vfork(void);
+\fBpid_t vfork(void);\fP
 .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
-.BR vfork ():
+\fBvfork\fP():
 .ad l
 .RS 4
 .PD 0
-.TP 4
-.\"O Since glibc 2.12:
-glibc 2.12 °Ê¹ß:
+.TP  4
+glibc 2.12 以降:
 .nf
 _BSD_SOURCE ||
     (_XOPEN_SOURCE\ >=\ 500 ||
         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
     !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
+.TP  4
 .fi
-.TP 4
-.\"O Before glibc 2.12:
-glibc 2.12 ¤è¤êÁ°:
-_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
-_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
 .PD
 .RE
 .ad b
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .SS "Standard Description"
-.SS µ¬³Ê¤ÎÀâÌÀ
-.\"O (From POSIX.1)
-(POSIX.1 ¤è¤ê°úÍÑ)
-.\"O The
-.\"O .BR vfork ()
-.\"O function has the same effect as
-.\"O .BR fork (2),
-.\"O except that the behavior is undefined if the process created by
-.\"O .BR vfork ()
-.\"O either modifies any data other than a variable of type
-.\"O .I pid_t
-.\"O used to store the return value from
-.\"O .BR vfork (),
-.\"O or returns from the function in which
-.\"O .BR vfork ()
-.\"O was called, or calls any other function before successfully calling
-.\"O .BR _exit (2)
-.\"O or one of the
-.\"O .BR exec (3)
-.\"O family of functions.
-.BR vfork ()
-´Ø¿ô¤Ï
-.BR fork (2)
-¤ÈƱ¤¸Æ¯¤­¤ò¤¹¤ë¤¬¡¢
-.BR vfork ()
-¤ÇºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹¤¬
-.BR vfork ()
-¤«¤é¤ÎÊÖ¤êÃͤò³ÊǼ¤·¤Æ¤¤¤ë
-.I pid_t
-·¿¤ÎÊÑ¿ô°Ê³°¤òÊѹ¹¤·¤¿¤ê¡¢
-.BR vfork ()
-¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë´Ø¿ô¤«¤é return ¤·¤¿¤ê¡¢
-.BR _exit (2)
-¤ä
-.BR exec (3)
-²¤Î´Ø¿ô¤ò¥³¡¼¥ë¤¹¤ëÁ°¤Ë¾¤Î´Ø¿ô¤ò¥³¡¼¥ë¤·¤¿¾ì¹ç¤ÎÆ°ºî¤¬
-̤ÄêµÁ¤Ç¤¢¤ë¤È¤¤¤¦ÅÀ¤¬°Û¤Ê¤ë¡£
-.\"O .SS "Linux Description"
-.SS "LINUX ¤Ç¤ÎÀâÌÀ"
-.\"O .BR vfork (),
-.\"O just like
-.\"O .BR fork (2),
-.\"O creates a child process of the calling process.
-.\"O For details and return value and errors, see
-.\"O .BR fork (2).
-.BR vfork ()
-¤Ï
-.BR fork (2)
-¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤Ë¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î»Ò¥×¥í¥»¥¹¤òÀ¸À®¤¹¤ë¡£
-¾Ü¤·¤¤ÀâÌÀ¤ÈÊÖ¤êÃÍ¡¢¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Ï
-.BR fork (2)
-¤ò»²¾È¤¹¤ë¤³¤È¡£
-.PP
-.\"O .BR vfork ()
-.\"O is a special case of
-.\"O .BR clone (2).
-.\"O It is used to create new processes without copying the page tables of
-.\"O the parent process.
-.\"O It may be useful in performance-sensitive applications
-.\"O where a child is created which then immediately issues an
-.\"O .BR execve (2).
-.BR vfork ()
-¤Ï
-.BR clone (2)
-¤ÎÆüì¤Ê¾ì¹ç¤Ç¤¢¤ë¡£
-¿Æ¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¥Æ¡¼¥Ö¥ë¤Î¥³¥Ô¡¼¤ò¹Ô¤ï¤º¤Ë¿·¤·¤¤¥×¥í¥»¥¹¤ò
-ºîÀ®¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¡£¤³¤ì¤ÏÀ­Ç½¤ËÉÒ´¶¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤ª¤¤¤Æ
-»Ò¥×¥í¥»¥¹¤òÀ¸À®¤·¤Æ¤¹¤°¤Ë
-.BR execve (2)
-¤¹¤ë¾ì¹ç¤ËÍ­ÍѤ«¤â¤·¤ì¤Ê¤¤¡£
+.SH 説明
+.SS 規格の説明
+(POSIX.1 より引用)  \fBvfork\fP()  関数は \fBfork\fP(2)  と同じ働きをするが、 \fBvfork\fP()
+で作成されたプロセスが \fBvfork\fP()  からの返り値を格納している \fIpid_t\fP 型の変数以外を変更したり、 \fBvfork\fP()
+を呼び出している関数から return したり、 \fB_exit\fP(2)  や \fBexec\fP(3)
+族の関数をコールする前に他の関数をコールした場合の動作が 未定義であるという点が異なる。
+.SS "LINUX での説明"
+\fBvfork\fP()  は \fBfork\fP(2)  と全く同じように呼び出したプロセスの子プロセスを生成する。 詳しい説明と返り値、エラーについては
+\fBfork\fP(2)  を参照すること。
 .PP
-.\"O .BR vfork ()
-.\"O differs from
-.\"O .BR fork (2)
-.\"O in that the parent is suspended until the child terminates
-.\"O (either normally,
-.\"O by calling
-.\"O .BR _exit (2),
-.\"O or abnormally, after delivery of a fatal signal),
-.\"O or it makes a call to
-.\"O .BR execve (2).
-.BR vfork ()
-¤Ï
-.BR fork (2)
-¤È°ã¤¤¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤«¡¢
-.BR execve (2)
-¤ò¥³¡¼¥ë¤¹¤ë¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤òÄä»ß (suspend) ¤µ¤»¤ë¡£
-»Ò¥×¥í¥»¥¹¤Î½ªÎ»¤Ï¡¢
-.BR _exit (2)
-¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ëÄ̾ェλ¡¢
-Ã×̿Ū¤Ê¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¸å¤Î°Û¾ï½ªÎ»¤ÎÆó¤Ä¤Î¥±¡¼¥¹¤¬¤¢¤ë¡£
-.\"O Until that point, the child shares all memory with its parent,
-.\"O including the stack.
-.\"O The child must not return from the current function or call
-.\"O .BR exit (3),
-.\"O but may call
-.\"O .BR _exit (2).
-¤³¤Î»þÅÀ¤Þ¤Ç¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ï¥¹¥¿¥Ã¥¯¤ò´Þ¤àÁ´¤Æ¤Î¥á¥â¥ê¤ò
-¿Æ¥×¥í¥»¥¹¤È¶¦Í­¤¹¤ë¡£
-»Ò¥×¥í¥»¥¹¤Ï¸½ºß¤Î´Ø¿ô¤«¤é return ¤·¤Æ¤Ï¤Ê¤é¤º¡¢
-.BR exit (3)
-¤â¥³¡¼¥ë¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¤¬¡¢
-.BR _exit (2)
-¤Ê¤é¤Ð¥³¡¼¥ë¤·¤Æ¤â¤è¤¤¡£
+\fBvfork\fP()  は \fBclone\fP(2)  の特殊な場合である。 親プロセスのページテーブルのコピーを行わずに新しいプロセスを
+作成するために使用する。これは性能に敏感なアプリケーションにおいて 子プロセスを生成してすぐに \fBexecve\fP(2)  する場合に有用かもしれない。
 .PP
-.\"O Signal handlers are inherited, but not shared.
-.\"O Signals to the parent
-.\"O arrive after the child releases the parent's memory
-.\"O (i.e., after the child terminates
-.\"O or calls
-.\"O .BR execve (2)).
-¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ï·Ñ¾µ¤µ¤ì¤ë¤¬¡¢¶¦Í­¤Ï¤µ¤ì¤Ê¤¤¡£
-¿Æ¥×¥í¥»¥¹¤Ø¤Î¥·¥°¥Ê¥ë¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¤ò
-²òÊü¤·¤¿¸å (¤¹¤Ê¤ï¤Á¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤«
-.BR execve (2)
-¤ò¸Æ¤ó¤À¸å) ¤ËÅþÃ夹¤ë¡£
-.\"O .SS "Historic Description"
-.SS Îò»ËŪ¤ÊÀâÌÀ
-.\"O Under Linux,
-.\"O .BR fork (2)
-.\"O is implemented using copy-on-write pages, so the only penalty incurred by
-.\"O .BR fork (2)
-.\"O is the time and memory required to duplicate the parent's page tables,
-.\"O and to create a unique task structure for the child.
-Linux ¤Ë¤ª¤¤¤Æ
-.BR fork (2)
-¤Ï½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy-on-write) ¥Ú¡¼¥¸¤ò»ÈÍѤ·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
-¤½¤Î¤¿¤á
-.BR fork (2)
-¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤ÆÈï¤ë»³²¤Ï¿Æ¥×¥í¥»¥¹¤Î¥Ú¡¼¥¸¡¦¥Æ¡¼¥Ö¥ë¤ò
-Ê£À½¤¹¤ë¤¿¤á¤ËɬÍפʻþ´Ö¤È¥á¥â¥ê¤À¤±¤Ç¤¢¤ë¡£
-.\"O However, in the bad old days a
-.\"O .BR fork (2)
-.\"O would require making a complete copy of the caller's data space,
-.\"O often needlessly, since usually immediately afterward an
-.\"O .BR exec (3)
-.\"O is done.
-.\"O Thus, for greater efficiency, BSD introduced the
-.\"O .BR vfork ()
-.\"O system call, which did not fully copy the address space of
-.\"O the parent process, but borrowed the parent's memory and thread
-.\"O of control until a call to
-.\"O .BR execve (2)
-.\"O or an exit occurred.
-.\"O The parent process was suspended while the
-.\"O child was using its resources.
-.\"O The use of
-.\"O .BR vfork ()
-.\"O was tricky: for example, not modifying data
-.\"O in the parent process depended on knowing which variables were
-.\"O held in a register.
-¤·¤«¤·¤Ê¤¬¤é¡¢´÷¤·¤­ÀΤˤÏ
-.BR fork (2)
-¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿¶õ´Ö¤ÎÁ´¤Æ¤Î¥³¥Ô¡¼¤·¤Æ¤¤¤¿¤¬¡¢
-¤³¤ì¤Ï¤·¤Ð¤·¤ÐÉÔɬÍפǤ¢¤Ã¤¿¡£¤Ê¤¼¤Ê¤é¡¢¤¿¤¤¤Æ¤¤¤Ï¤¹¤°¸å¤Ë
-.BR exec (3)
-¤ò¼Â¹Ô¤·¤Æ¤¤¤¿¤«¤é¤Ç¤¢¤ë¡£
-¤³¤Î¾ì¹ç¤Î¸úΨ¤ò¾å¤²¤ë¤¿¤á¤Ë BSD ¤Ï
-.BR vfork ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤òƳÆþ¤·¤Æ¿Æ¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ò´°Á´¤Ë¥³¥Ô¡¼
-¤¹¤ë¤«¤ï¤ê¤Ë¡¢
-.BR execve (2)
-¤ò¥³¡¼¥ë¤¹¤ë¤« exit ¤¬µ¯¤­¤ë¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¤ÈÀ©¸æ¥¹¥ì¥Ã¥É
-¤ò¼Ú¤ê¤ë¤è¤¦¤Ë¤·¤¿¡£
-¿Æ¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤¬¤½¤Î»ñ¸»¤ò»ÈÍѤ·¤Æ¤¤¤ë´Ö¤ÏÄä»ß¤µ¤ì¤¿¡£
-.BR vfork ()
-¤Ï»È¤¤¤Ë¤¯¤¤¤â¤Î¤Ç¤¢¤Ã¤¿: Î㤨¤Ð¡¢¿Æ¥×¥í¥»¥¹¤ÎÊÑ¿ô¤òÊѹ¹¤·¤Ê
-¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¤É¤ÎÊÑ¿ô¤¬¥ì¥¸¥¹¥¿¤ËÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤«¤òÃΤé¤Ê
-¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-4.3BSD, POSIX.1-2001.
-.\"O POSIX.1-2008 removes the specification of
-.\"O .BR vfork ().
-POSIX.1-2008 ¤Ç¤Ï¡¢
-.BR vfork ()
-¤Îµ¬Ä꤬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
-.\"O The requirements put on
-.\"O .BR vfork ()
-.\"O by the standards are weaker than those put on
-.\"O .BR fork (2),
-.\"O so an implementation where the two are synonymous is compliant.
-.\"O In particular, the programmer cannot rely on the parent
-.\"O remaining blocked until the child either terminates or calls
-.\"O .BR execve (2),
-.\"O and cannot rely on any specific behavior with respect to shared memory.
-.BR vfork ()
-¥³¡¼¥ë¤Ï¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à¤ÎƱ̾¤Î¥³¡¼¥ë¤È
-¤Á¤ç¤Ã¤È»÷¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£µ¬³Ê¤¬
-.BR vfork ()
-¤ËÍ׵ᤷ¤Æ¤¤¤ë¤³¤È¤Ï¡¢
-.BR fork (2)
-¤ËÍ׵ᤷ¤Æ¤¤¤ë¤³¤È¤è¤ê¤Ï¼å¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢
-ξ¼Ô¤òƱ¤¸¤â¤Î¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤â¡¢µ¬³Ê¤Ë½àµò¤·¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ë¡£
-ÆÃ¤Ë¥×¥í¥°¥é¥Þ¡¼¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤«
-.BR execve (2)
-¤ò¸Æ¤Ó½Ð¤¹¤Þ¤Ç¿Æ¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë¤³¤È¤ä¡¢¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³
-¤È¤Ë¤è¤ëÆüì¤ÊÆ°ºî¤ò¤¢¤Æ¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
+\fBvfork\fP() は \fBfork\fP(2) と違い、子プロセスが終了するか、
+\fBexecve\fP(2) をコールするまで呼び出し元のスレッドを停止 (suspend) させる。
+子プロセスの終了は、\fB_exit\fP(2) の呼び出しによる通常終了、致命的なシグナルの
+配送後の異常終了の二つのケースがある。
+この時点までは、子プロセスはスタックを含む全てのメモリを親プロセスと共有する。
+子プロセスは現在の関数から return してはならず、
+\fBexit\fP(3) もコールしてはならないが、\fB_exit\fP(2) ならばコールしてもよい。
+
+\fBfork\fP(2) と同様に、 \fBvfork\fP() で作成された子プロセスは、
+(ファイルディスクリプタ、シグナル配送定義、カレントワーキングディレクトリなどの)
+呼び出し元のプロセスの各種の属性を継承する。
+\fBvfork\fP() では、上で説明した仮想アドレス空間の扱いだけが異なる。
+
+親プロセスへ送られたシグナルは、子プロセスが親プロセスのメモリを解放した後
+(すなわち、子プロセスが終了するか \fBexecve\fP(2) を呼んだ後) に到着する。
+.SS 歴史的な説明
+Linux において \fBfork\fP(2)  は書き込み時コピー (copy\-on\-write) ページを使用して実装されている。 そのため
+\fBfork\fP(2)  を使用することによって被る損害は親プロセスのページ・テーブルを 複製するために必要な時間とメモリだけである。
+しかしながら、忌しき昔には \fBfork\fP(2)  は呼び出したプロセスのデータ空間の全てのコピーしていたが、
+これはしばしば不必要であった。なぜなら、たいていはすぐ後に \fBexec\fP(3)  を実行していたからである。 この場合の効率を上げるために BSD は
+\fBvfork\fP()  システムコールを導入して親プロセスのアドレス空間を完全にコピー するかわりに、 \fBexecve\fP(2)  をコールするか
+exit が起きるまで親プロセスのメモリと制御スレッド を借りるようにした。 親プロセスは子プロセスがその資源を使用している間は停止された。
+\fBvfork\fP()  は使いにくいものであった: 例えば、親プロセスの変数を変更しな いようにするためにはどの変数がレジスタに保持されているかを知らな
+ければならなかった。
+.SH 準拠
+4.3BSD; POSIX.1\-2001 (廃止予定とされている)。
+POSIX.1\-2008 では \fBvfork\fP() の規定が削除されている。
+
 .\" In AIXv3.1 vfork is equivalent to fork.
-.\"O .SH NOTES
-.\"O .SS Linux Notes
-.SH Ãí°Õ
-.SS Linux ¤Ç¤ÎÃí°Õ
-.\"O Fork handlers established using
-.\"O .BR pthread_atfork (3)
-.\"O are not called when a multithreaded program employing
-.\"O the NPTL threading library calls
-.\"O .BR vfork ().
-.\"O Fork handlers are called in this case in a program using the
-.\"O LinuxThreads threading library.
-.\"O (See
-.\"O .BR pthreads (7)
-.\"O for a description of Linux threading libraries.)
-.BR pthread_atfork (3)
-¤ò»È¤Ã¤ÆÀßÄꤵ¤ì¤¿ fork ¥Ï¥ó¥É¥é¤Ï
-NPTL ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë¤òºÎÍѤ·¤¿¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥à¤Ç¤Ï
-¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£°ìÊý¡¢LinuxThreads ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤¿
-¥×¥í¥°¥é¥à¤Ç¤Ï¡¢fork ¥Ï¥ó¥É¥é¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¡£
-(Linux ¤Î¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ÎÀâÌÀ¤Ï
-.BR pthreads (7)
-¤ò»²¾È¡£)
-.\"O .SS History
-.SS Îò»Ë
-.\"O The
-.\"O .BR vfork ()
-.\"O system call appeared in 3.0BSD.
-.BR vfork ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï 3.0BSD ¤Ë¸½¤ï¤ì¤¿¡£
+\fBvfork\fP() コールは他のオペレーティング・システムの同名のコールと ちょっと似
+ているかもしれない。規格が \fBvfork\fP() に要求していることは、 \fBfork\fP(2) に要
+求していることよりは弱い。したがって、 両者を同じものとして実装しても、規格に
+準拠していることになる。 特にプログラマーは、子プロセスが終了するか
+\fBexecve\fP(2) を呼び出すまで親プロセスが停止していることや、メモリを共有するこ
+とによる特殊な動作をあてにすべきではない。
+.SH 注意
+.PP
+\fBvfork\fP() の動作は構造的な欠陥と考える人もいるだろうし、
+BSD のマニュアルには、「このシステムコールは妥当なシステム共有機構が実装さ
+れた場合には削除される。ユーザは \fBvfork\fP() のメモリ共有機能に依存するべき
+ではない。何故ならば、このシステムコール が削除された場合には、それは
+\fBfork\fP(2) の同義語とされるからである。」と書かれている。しかしながら、
+最近のメモリ管理ハードウェアにより \fBfork\fP(2) と \fBvfork\fP() の間の性能差が
+減ったとはいえ、 Linux や他のシステムで \fBvfork\fP() が残されているのには
+いくつか理由がある:
+.IP * 3
+性能に厳しいアプリケーションでは、 \fBvfork\fP() により得られる
+小さな性能上のメリットが必要な場合がある。
+.IP *
+.\" http://stackoverflow.com/questions/4259629/what-is-the-difference-between-fork-and-vfork
+.\" http://developers.sun.com/solaris/articles/subprocess/subprocess.html
+.\" http://mailman.uclinux.org/pipermail/uclinux-dev/2009-April/000684.html
+\fBvfork\fP() はメモリ管理ユニット (MMU) を持たないシステムでも実装すること
+ができるが、そのようなシステムで \fBfork\fP(2) を実装することはできない。
+(POSIX.1\-2008 では \fBvfork\fP() が標準から削除された。
+\fBposix_spawn\fP(3) 関数の POSIX の原理 (rationale) には、
+\fBfork\fP(2)+\fBexec\fP(3) と等価な機能を提供する \fBposix_spawn\fP(3) は、
+MMU を持たないシステムでも実装できるように設計されたとの注記がある。)
+.SS "Linux での注意"
+\fBpthread_atfork\fP(3)  を使って設定された fork ハンドラは NPTL
+スレッドライブラリコールを採用したマルチスレッドプログラムでは 呼び出されない。一方、LinuxThreads スレッドライブラリを使った
+プログラムでは、fork ハンドラは呼び出される。 (Linux のスレッドライブラリの説明は \fBpthreads\fP(7)  を参照。)
+
+\fBvfork\fP() の呼び出しは、以下の \fIflags\fP を指定して \fBclone\fP(2) を呼び出す
+のと等価である。
+
+     CLONE_VM | CLONE_VFORK | SIGCHLD
+.SS 歴史
 .\" In the release notes for 4.2BSD Sam Leffler wrote: `vfork: Is still
 .\" present, but definitely on its way out'.
-.\"O In 4.4BSD it was made synonymous to
-.\"O .BR fork (2)
-.\"O but NetBSD introduced it again,
-.\"O cf. http://www.netbsd.org/Documentation/kernel/vfork.html .
-4.4BSD ¤Ë¤ª¤¤¤Æ
-.BR fork (2)
-¤ÎƱµÁ¸ì¤È¤Ê¤Ã¤¿¤¬¡¢NetBSD ¤Ç¤ÏºÆ¤ÓƳÆþ¤µ¤ì¤¿¡£
-http://www.netbsd.org/Documentation/kernel/vfork.html ¤ò»²¾È¡£
-.\"O In Linux, it has been equivalent to
-.\"O .BR fork (2)
-.\"O until 2.2.0-pre6 or so.
-.\"O Since 2.2.0-pre9 (on i386, somewhat later on
-.\"O other architectures) it is an independent system call.
-.\"O Support was added in glibc 2.0.112.
-Linux ¤Ç¤Ï 2.2.0-pre6 ¤¢¤¿¤ê¤Þ¤Ç¤Ï
-.BR fork (2)
-¤ÈÅù²Á¤Ç¤¢¤Ã¤¿¡£(i386 ¤Ç¤Ï) 2.2.0-pre9 ¤«¤é (¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï
-¾¯¤·ÃÙ¤ì¤Æ) ÆÈΩ¤·¤¿¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤Ê¤Ã¤¿¡£
-glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc-2.0.112 ¤ÇÄɲ䵤줿¡£
-.\"O .SH BUGS
-.SH ¥Ð¥°
-.\"O It is rather unfortunate that Linux revived this specter from the past.
-.\"O The BSD man page states:
-.\"O "This system call will be eliminated when proper system sharing mechanisms
-.\"O are implemented.
-.\"O Users should not depend on the memory sharing semantics of
-.\"O .BR vfork ()
-.\"O as it will, in that case, be made synonymous to
-.\"O .BR fork (2).\c
-.\"O "
-Linux ¤¬¤³¤Î²áµî¤ÎË´Îî¤òÉü³è¤µ¤»¤¿¤³¤È¤Ï¡¢¤à¤·¤íÉÔ¹¬¤È¸À¤¦¤Ù¤­¤Ç¤¢¤ë¡£
-BSD ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï¡¢
-¡Ö¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÂÅÅö¤Ê¥·¥¹¥Æ¥à¶¦Í­µ¡¹½¤¬¼ÂÁõ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï
-ºï½ü¤µ¤ì¤ë¡£¥æ¡¼¥¶¤Ï
-.BR vfork ()
-¤Î¥á¥â¥ê¶¦Í­µ¡Ç½¤Ë°Í¸¤¹¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£²¿¸Î¤Ê¤é¤Ð¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë
-¤¬ºï½ü¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤Ï
-.BR fork (2)
-¤ÎƱµÁ¸ì¤È¤µ¤ì¤ë¤«¤é¤Ç¤¢¤ë¡£¡×¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£
-
-.\"O Details of the signal handling are obscure and differ between systems.
-.\"O The BSD man page states:
-.\"O "To avoid a possible deadlock situation, processes that are children
-.\"O in the middle of a
-.\"O .BR vfork ()
-.\"O are never sent
-.\"O .B SIGTTOU
-.\"O or
-.\"O .B SIGTTIN
-.\"O signals; rather, output or
-.\"O .IR ioctl s
-.\"O are allowed and input attempts result in an end-of-file indication."
-¥·¥°¥Ê¥ë¤Î°·¤¤¤Î¾ÜºÙ¤ÏÉÔÌÀÎƤǥ·¥¹¥Æ¥à¤´¤È¤Ë°Û¤Ã¤Æ¤¤¤ë¡£
-BSD ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï¡¢
-¡Ö¥Ç¥Ã¥É¥í¥Ã¥¯¾õÂ֤ˤʤë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç
-.BR vfork ()
-¤ÎÅÓÃæ¤Î»Ò¥×¥í¥»¥¹¤Ë
-.B SIGTTOU
-¤ä
-.B SIGTTIN
-¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤;
-¤µ¤é¤Ë½ÐÎϤä
-.I ioctl
-¤Ïµö¤µ¤ì¤ë¤¬¡¢ÆþÎϤò»î¤ß¤¿¾ì¹ç¤Ë¤Ï·ë²Ì¤Ï¥Õ¥¡¥¤¥ë½ªÃ¼ (EOF) ¤Ë¤Ê¤ë¡£¡×
-¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£
+\fBvfork\fP()  システムコールは 3.0BSD に現われた。 4.4BSD において \fBfork\fP(2)  の同義語となったが、NetBSD
+では再び導入された。
+.UR http://www.netbsd.org\:/Documentation\:/kernel\:/vfork.html
+.UE
+を参照。
+Linux では 2.2.0\-pre6 あたりまでは \fBfork\fP(2)  と等価であった。(i386 では) 2.2.0\-pre9 から
+(他のアーキテクチャでは 少し遅れて) 独立したシステムコールとなった。 glibc でのサポートは glibc\-2.0.112 で追加された。
+.SH バグ
+.PP
 .\"
 .\" As far as I can tell, the following is not true in 2.6.19:
-.\"O .\" Currently (Linux 2.3.25),
-.\"O .\" .BR strace (1)
-.\"O .\" cannot follow
-.\"O .\" .BR vfork ()
-.\"O .\" and requires a kernel patch.
-.\" ¸½ºß¤Î¤È¤³¤í (Linux 2.3.25)¡¢
+.\" Currently (Linux 2.3.25),
 .\" .BR strace (1)
-.\" ¤Ï
+.\" cannot follow
 .\" .BR vfork ()
-.\" ¤òÄÉÀפ¹¤ë¤³¤È¤¬¤Ç¤­¤º¡¢¥«¡¼¥Í¥ë¥Ñ¥Ã¥Á¤¬É¬ÍפǤ¢¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR clone (2),
-.BR execve (2),
-.BR fork (2),
-.BR unshare (2),
-.BR wait (2)
+.\" and requires a kernel patch.
+シグナルの扱いの詳細は不明瞭でシステムごとに異っている。 BSD のマニュアルには、 「デッドロック状態になる可能性があるので \fBvfork\fP()
+の途中の子プロセスに \fBSIGTTOU\fP や \fBSIGTTIN\fP シグナルを送信してはならない; さらに出力や \fIioctl\fP
+は許されるが、入力を試みた場合には結果はファイル終端 (EOF) になる。」 と書かれている。
+.SH 関連項目
+\fBclone\fP(2), \fBexecve\fP(2), \fBfork\fP(2), \fBunshare\fP(2), \fBwait\fP(2)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。