OSDN Git Service

Update drafts for LDP 3.67
[linuxjm/LDP_man-pages.git] / draft / man2 / clone.2
index 4a64b6a..6b855b2 100644 (file)
@@ -1,8 +1,10 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (c) 1992 Drew Eckhardt <drew@cs.colorado.edu>, March 28, 1992
-.\" and Copyright (c) Michael Kerrisk, 2001, 2002, 2005
+.\" and Copyright (c) Michael Kerrisk, 2001, 2002, 2005, 2013
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
 .\" May be distributed under the GNU General Public License.
+.\" %%%LICENSE_END
+.\"
 .\" Modified by Michael Haardt <michael@moria.de>
 .\" Modified 24 Jul 1993 by Rik Faith <faith@cs.unc.edu>
 .\" Modified 21 Aug 1994 by Michael Chastain <mec@shell.portal.com>:
@@ -31,7 +33,7 @@
 .\"    wrapper under BUGS.
 .\" 2005-05-10, mtk, added CLONE_SYSVSEM, CLONE_UNTRACED, CLONE_STOPPED.
 .\" 2005-05-17, mtk, Substantially enhanced discussion of CLONE_THREAD.
-.\" 2008-11-18, mtk, order CLONE_* flags  alphabetically
+.\" 2008-11-18, mtk, order CLONE_* flags alphabetically
 .\" 2008-11-18, mtk, document CLONE_NEWPID
 .\" 2008-11-19, mtk, document CLONE_NEWUTS
 .\" 2008-11-19, mtk, document CLONE_NEWIPC
 .\"
 .\" FIXME Document CLONE_NEWUSER, which is new in 2.6.23
 .\"       (also supported for unshare()?)
-.\" FIXME . 2.6.25 marks the unused CLONE_STOPPED as obsolete, and it will
-.\"       probably be removed in the future.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
 .\"
 .\" Japanese Version Copyright (c) 2001 HANATAKA Shinya
 .\"     and Copyright(c) 2002, 2005-2008 Akihiro MOTOKI
 .\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.10
 .\" Updated 2009-03-02, Akihiro MOTOKI, LDP v3.19
 .\" Updated 2010-04-11, Akihiro MOTOKI, LDP v3.24
+.\" Updated 2012-05-08, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       capability      ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£
-.\"WORD:       pending signals ½èÍýÂÔ¤Á¥·¥°¥Ê¥ë
-.\"WORD:       namespace       Ì¾Á°¶õ´Ö
-.\"
-.TH CLONE 2 2009-07-18 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.\"O clone, __clone2 \- create a child process
-.SH Ì¾Á°
-clone, __clone2 \- »Ò¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.TH CLONE 2 2014\-02\-27 Linux "Linux Programmer's Manual"
+.SH 名前
+clone, __clone2 \- 子プロセスを作成する
+.SH 書式
 .nf
-.B #define _GNU_SOURCE
-.\" Actually _BSD_SOURCE || _SVID_SOURCE
-.\" See http://sources.redhat.com/bugzilla/show_bug.cgi?id=4749
-.B #include <sched.h>
+/* glibc ラッパー関数のプロトタイプ */
+
+\fB#include <sched.h>\fP
+
+\fBint clone(int (*\fP\fIfn\fP\fB)(void *), void *\fP\fIchild_stack\fP\fB,\fP
+\fB          int \fP\fIflags\fP\fB, void *\fP\fIarg\fP\fB, ... \fP
+\fB          /* pid_t *\fP\fIptid\fP\fB, struct user_desc *\fP\fItls\fP\fB, pid_t *\fP\fIctid\fP\fB */ );\fP
 
-.BI "int clone(int (*" "fn" ")(void *), void *" child_stack ,
-.BI "          int " flags ", void *" "arg" ", ... "
-.BI "          /* pid_t *" ptid ", struct user_desc *" tls \
-", pid_t *" ctid " */ );"
+/* 素のシステムコールのプロトタイプ */
+
+\fBlong clone(unsigned long \fP\fIflags\fP\fB, void *\fP\fIchild_stack\fP\fB,\fP
+\fB          void *\fP\fIptid\fP\fB, void *\fP\fIctid\fP\fB,\fP
+\fB          struct pt_regs *\fP\fIregs\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR clone ()
-.\"O creates a new process, in a manner similar to
-.\"O .BR fork (2).
-.\"O It is actually a library function layered on top of the underlying
-.\"O .BR clone ()
-.\"O system call, hereinafter referred to as
-.\"O .BR sys_clone .
-.\"O A description of
-.\"O .B sys_clone
-.\"O is given towards the end of this page.
-.BR clone ()
-¤Ï
-.BR fork (2)
-¤ÈƱ¤¸¤è¤¦¤ÊÊýË¡¤Ç¿·¤·¤¤¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£
-.BR clone ()
-¤Ë¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤½¤Î²¼Áؤˤ¢¤¿¤ë
-.BR clone ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¡£°Ê²¼¤ÎÀâÌÀ¤Ç¤Ï¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÊý¤ò
-.B sys_clone
-¤Èɽ¤¹¤³¤È¤È¤¹¤ë¡£
-.B sys_clone
-¤Ë´Ø¤¹¤ëÀâÌÀ¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÎºÇ¸å¤ÎÊý¤Ë¤¢¤ë¡£
-
-.\"O Unlike
-.\"O .BR fork (2),
-.\"O these calls
-.\"O allow the child process to share parts of its execution context with
-.\"O the calling process, such as the memory space, the table of file
-.\"O descriptors, and the table of signal handlers.
-.\"O (Note that on this manual
-.\"O page, "calling process" normally corresponds to "parent process".
-.\"O But see the description of
-.\"O .B CLONE_PARENT
-.\"O below.)
-.BR fork (2)
-¤È¤Ï°Û¤Ê¤ê¡¢¤³¤ì¤é¤Î¥³¡¼¥ë¤Ç¤Ï¡¢»Ò¥×¥í¥»¥¹ (child process)
-¤È¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È¤¬¡¢¥á¥â¥ê¶õ´Ö¡¢
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥Æ¡¼¥Ö¥ë¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤Î¥Æ¡¼¥Ö¥ë¤Ê¤É¤Î
-¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î°ìÉô¤ò¶¦Í­¤Ç¤­¤ë¡£
-(¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤ª¤±¤ë¡Ö¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¡×¤Ï¡¢Ä̾ï¤Ï
-¡Ö¿Æ¥×¥í¥»¥¹¡×¤È°ìÃפ¹¤ë¡£Ã¢¤·¡¢¸å½Ò¤Î
-.B CLONE_PARENT
-¤Î¹à¤â»²¾È¤Î¤³¤È)
-
-.\"O The main use of
-.\"O .BR clone ()
-.\"O is to implement threads: multiple threads of control in a program that
-.\"O run concurrently in a shared memory space.
-.BR clone ()
-¤Î¼çÍפʻÈÍÑË¡¤Ï¥¹¥ì¥Ã¥É (threads) ¤ò¼ÂÁõ¤¹¤ë¤³¤È¤Ç¤¢¤ë:
-°ì¤Ä¤Î¥×¥í¥°¥é¥à¤ÎÃæ¤ÎÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤Ï¶¦Í­¤µ¤ì¤¿¥á¥â¥ê¶õ´Ö¤Ç
-Ʊ»þ¤Ë¼Â¹Ô¤µ¤ì¤ë¡£
-
-.\"O When the child process is created with
-.\"O .BR clone (),
-.\"O it executes the function
-.\"O application
-.\"O .IR fn ( arg ).
-.\"O (This differs from
-.\"O .BR fork (2),
-.\"O where execution continues in the child from the point
-.\"O of the
-.\"O .BR fork (2)
-.\"O call.)
-.\"O The
-.\"O .I fn
-.\"O argument is a pointer to a function that is called by the child
-.\"O process at the beginning of its execution.
-.\"O The
-.\"O .I arg
-.\"O argument is passed to the
-.\"O .I fn
-.\"O function.
-.BR clone ()
-¤Ç»Ò¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¤¿»þ¤Ë¡¢ºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï´Ø¿ô
-.IR fn ( arg )
-¤ò¼Â¹Ô¤¹¤ë¡£
-(¤³¤ÎÅÀ¤¬
-.BR fork (2)
-¤È¤Ï°Û¤Ê¤ë¡£
-.BR fork (2)
-¤Î¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï
-.BR fork (2)
-¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì½ê¤«¤é¼Â¹Ô¤ò³¤±¤ë¡£)
-.I fn
-°ú¤­¿ô¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬¼Â¹Ô¤ò»Ï¤á¤ë»þ¤Ë»Ò¥×¥í¥»¥¹¤¬¸Æ¤Ó½Ð¤¹
-´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
-.I arg
-°ú¤­¿ô¤Ï¤½¤Î¤Þ¤Þ
-.I fn
-´Ø¿ô¤Ø¤ÈÅϤµ¤ì¤ë¡£
-
-.\"O When the
-.\"O .IR fn ( arg )
-.\"O function application returns, the child process terminates.
-.\"O The integer returned by
-.\"O .I fn
-.\"O is the exit code for the child process.
-.\"O The child process may also terminate explicitly by calling
-.\"O .BR exit (2)
-.\"O or after receiving a fatal signal.
-.IR fn ( arg )
-´Ø¿ô¤¬½ªÎ»¤¹¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï½ªÎ»¤¹¤ë¡£
-.I fn
-¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿À°¿ô¤¬»Ò¥×¥í¥»¥¹¤Î½ªÎ»¥³¡¼¥É¤È¤Ê¤ë¡£
-»Ò¥×¥í¥»¥¹¤Ï¡¢
-.BR exit (2)
-¤ò¸Æ¤ó¤ÇÌÀ¼¨Åª¤Ë½ªÎ»¤¹¤ë¤³¤È¤â¤¢¤ë¤·¡¢Ã×̿Ū¤Ê¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿
-¾ì¹ç¤Ë½ªÎ»¤¹¤ë¤³¤È¤â¤¢¤ë¡£
-
-.\"O The
-.\"O .I child_stack
-.\"O argument specifies the location of the stack used by the child process.
-.\"O Since the child and calling process may share memory,
-.\"O it is not possible for the child process to execute in the
-.\"O same stack as the calling process.
-.\"O The calling process must therefore
-.\"O set up memory space for the child stack and pass a pointer to this
-.\"O space to
-.\"O .BR clone ().
-.I child_stack
-°ú¤­¿ô¤Ï¡¢»Ò¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¥¹¥¿¥Ã¥¯¤Î°ÌÃÖ¤ò»ØÄꤹ¤ë¡£
-»Ò¥×¥í¥»¥¹¤È¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï¥á¥â¥ê¤ò¶¦Í­¤¹¤ë¤³¤È¤¬¤¢¤ë¤¿¤á¡¢
-»Ò¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥¹¥¿¥Ã¥¯¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£
-¤³¤Î¤¿¤á¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ï»Ò¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¤Î¤¿¤á¤Î¥á¥â¥ê¶õ´Ö¤ò
-ÍÑ°Õ¤·¤Æ¡¢¤³¤Î¶õ´Ö¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò
-.BR clone ()
-¤ØÅϤµ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.\"O Stacks grow downwards on all processors that run Linux
-.\"O (except the HP PA processors), so
-.\"O .I child_stack
-.\"O usually points to the topmost address of the memory space set up for
-.\"O the child stack.
-(HP PA ¥×¥í¥»¥Ã¥µ°Ê³°¤Î) Linux ¤¬Æ°ºî¤¹¤ëÁ´¤Æ¤Î¥×¥í¥»¥Ã¥µ¤Ç¤Ï¡¢
-¥¹¥¿¥Ã¥¯¤Ï²¼Êý (¥¢¥É¥ì¥¹¤¬¾®¤µ¤¤Êý¸þ) ¤Ø¤È¿­¤Ó¤ë¡£¤³¤Î¤¿¤á¡¢ÉáÄ̤Ï
-.I child_stack
-¤Ï»Ò¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¤Î¤¿¤á¤ËÍÑ°Õ¤·¤¿¥á¥â¥ê¶õ´Ö¤Î°ìÈÖÂ礭¤¤
-¥¢¥É¥ì¥¹¤ò»Ø¤¹¤è¤¦¤Ë¤¹¤ë¡£
-
-.\"O The low byte of
-.\"O .I flags
-.\"O contains the number of the
-.\"O .I "termination signal"
-.\"O sent to the parent when the child dies.
-.\"O If this signal is specified as anything other than
-.\"O .BR SIGCHLD ,
-.\"O then the parent process must specify the
-.\"O .B __WALL
-.\"O or
-.\"O .B __WCLONE
-.\"O options when waiting for the child with
-.\"O .BR wait (2).
-.\"O If no signal is specified, then the parent process is not signaled
-.\"O when the child terminates.
-.I flags
-¤Î²¼°Ì 1 ¥Ð¥¤¥È¤Ï»Ò¥×¥í¥»¥¹¤¬»à¤ó¤À¾ì¹ç¤Ë¿Æ¥×¥í¥»¥¹¤Ø¤ÈÁ÷¤é¤ì¤ë
-.I "½ªÎ»¥·¥°¥Ê¥ë (termination signal)"
-¤ÎÈÖ¹æ¤ò»ØÄꤹ¤ë¡£¤³¤Î¥·¥°¥Ê¥ë¤È¤·¤Æ
-.B SIGCHLD
-°Ê³°¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¿Æ¥×¥í¥»¥¹¤Ï¡¢
-.BR wait (2)
-¤Ç»Ò¥×¥í¥»¥¹¤òÂԤĺݤˡ¢¥ª¥×¥·¥ç¥ó¤È¤·¤Æ
-.B __WALL
-¤Þ¤¿¤Ï
-.B __WCLONE
-¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-¤É¤Î¥·¥°¥Ê¥ë¤â»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿»þ¤Ë¿Æ¥×¥í¥»¥¹
-¤Ë¥·¥°¥Ê¥ë¤ÏÁ÷¤é¤ì¤Ê¤¤¡£
-
-.\"O .I flags
-.\"O may also be bitwise-or'ed with zero or more of the following constants,
-.\"O in order to specify what is shared between the calling process
-.\"O and the child process:
-.I flags
-¤Ë¤Ï¡¢°Ê²¼¤ÎÄê¿ô¤Î¤¦¤Á 0¸Ä°Ê¾å¤ò¥Ó¥Ã¥ÈËè¤ÎÏÀÍýÏ (bitwise-or)
-¤ò¤È¤Ã¤¿¤â¤Î¤ò»ØÄê¤Ç¤­¤ë¡£¤³¤ì¤é¤ÎÄê¿ô¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È
-»Ò¥×¥í¥»¥¹¤Î´Ö¤Ç²¿¤ò¶¦Í­¤¹¤ë¤«¤ò»ØÄꤹ¤ë:
-.TP
-.\"O .BR CLONE_CHILD_CLEARTID " (since Linux 2.5.49)"
-.BR CLONE_CHILD_CLEARTID " (Linux 2.5.49 °Ê¹ß)"
-.\"O Erase child thread ID at location
-.\"O .I ctid
-.\"O in child memory when the child exits, and do a wakeup on the futex
-.\"O at that address.
-.\"O The address involved may be changed by the
-.\"O .BR set_tid_address (2)
-.\"O system call.
-.\"O This is used by threading libraries.
-»Ò¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¤È¤­¤Ë»Ò¥×¥í¥»¥¹¤Î¥á¥â¥êÆâ¤Î
-.I ctid
-¤¬»Ø¤¹¾ì½ê¤Ë¤¢¤ë»Ò¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É ID ¤ò¾Ãµî¤·¡¢
-¤½¤Î¥¢¥É¥ì¥¹¤Ç futex ¤ò wake (µ¯¾²) ¤µ¤»¤ë¡£
-¤³¤Î¥¢¥É¥ì¥¹¤Ï
-.BR set_tid_address (2)
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-¤³¤Îµ¡Ç½¤Ï¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤Ç»ÈÍѤµ¤ì¤ë¡£
-.TP
-.\"O .BR CLONE_CHILD_SETTID " (since Linux 2.5.49)"
-.BR CLONE_CHILD_SETTID " (Linux 2.5.49 °Ê¹ß)"
-.\"O Store child thread ID at location
-.\"O .I ctid
-.\"O in child memory.
-»Ò¥×¥í¥»¥¹¤Î¥á¥â¥êÆâ¤Î
-.I ctid
-¤¬»Ø¤¹¾ì½ê¤Ë»Ò¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É ID ¤ò³ÊǼ¤¹¤ë¡£
-.TP
-.B CLONE_FILES
-.\"O If
-.\"O .B CLONE_FILES
-.\"O is set, the calling process and the child process share the same file
-.\"O descriptor table.
-.\"O Any file descriptor created by the calling process or by the child
-.\"O process is also valid in the other process.
-.\"O Similarly, if one of the processes closes a file descriptor,
-.\"O or changes its associated flags (using the
-.\"O .BR fcntl (2)
-.\"O .B F_SETFD
-.\"O operation), the other process is also affected.
-.B CLONE_FILES
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î
-¥Æ¡¼¥Ö¥ë¤ò¶¦Í­¤¹¤ë¡£
-¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤È¤½¤Î»Ò¥×¥í¥»¥¹¤Î°ìÊý¤¬ºîÀ®¤·¤¿
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢¤â¤¦°ìÊý¤Ë¤ª¤¤¤Æ¤âÍ­¸ú¤Ç¤¢¤ë¡£
-Ʊ¤¸¤è¤¦¤Ë¡¢°ìÊý¤Î¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊĤ¸¤¿¤ê¡¢
-.RB ( fcntl (2)
-.B F_SETFD
-Áàºî¤ò»È¤Ã¤Æ) ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë´ØÏ¢¤¹¤ë¥Õ¥é¥°¤òÊѹ¹¤·¤¿¤ê¤¹¤ë¤È¡¢
-¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤â±Æ¶Á¤¹¤ë¡£
-
-.\"O If
-.\"O .B CLONE_FILES
-.\"O is not set, the child process inherits a copy of all file descriptors
-.\"O opened in the calling process at the time of
-.\"O .BR clone ().
-.\"O (The duplicated file descriptors in the child refer to the
-.\"O same open file descriptions (see
-.\"O .BR open (2))
-.\"O as the corresponding file descriptors in the calling process.)
-.\"O Subsequent operations that open or close file descriptors,
-.\"O or change file descriptor flags,
-.\"O performed by either the calling
-.\"O process or the child process do not affect the other process.
-.B CLONE_FILES
-¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¡¢
-.BR clone ()
-¤¬¼Â¹Ô¤µ¤ì¤¿»þÅÀ¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ëÁ´¤Æ¤Î
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë
-(»Ò¥×¥í¥»¥¹¤ÎÊ£À½¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï¡¢
-Âбþ¤¹¤ë¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È
-Ʊ¤¸¥Õ¥¡¥¤¥ëµ­½Ò
-.RB ( open (2)
-»²¾È) ¤ò»²¾È¤¹¤ë)¡£
-¤³¤ì°Ê¹ß¤Ë¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î°ìÊý¤¬
-¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÁàºî (¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î
-¥ª¡¼¥×¥ó¡¦¥¯¥í¡¼¥º¤ä¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Õ¥é¥°¤ÎÊѹ¹)
-¤ò¹Ô¤Ã¤Æ¤â¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£
-.TP
-.B CLONE_FS
-.\"O If
-.\"O .B CLONE_FS
-.\"O is set, the caller and the child process share the same file system
-.\"O information.
-.\"O This includes the root of the file system, the current
-.\"O working directory, and the umask.
-.\"O Any call to
-.\"O .BR chroot (2),
-.\"O .BR chdir (2),
-.\"O or
-.\"O .BR umask (2)
-.\"O performed by the calling process or the child process also affects the
-.\"O other process.
-.B CLONE_FS
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤¬Æ±¤¸¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à
-¾ðÊó¤ò¶¦Í­¤¹¤ë¡£¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¾ðÊó¤Ï¡¢¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥ë¡¼¥È (root)¡¢
-¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê (current working directory)
-¤ä umask ¤Ê¤É¤Ç¤¢¤ë¡£
-¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ä»Ò¥×¥í¥»¥¹¤Î¤É¤Á¤é¤«°ìÊý¤Ë¤è¤Ã¤Æ
-.BR chroot (2),
-.BR chdir (2),
-.BR umask (2)
-¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤È¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤â±Æ¶Á¤¬µÚ¤Ö¡£
-
-.\"O If
-.\"O .B CLONE_FS
-.\"O is not set, the child process works on a copy of the file system
-.\"O information of the calling process at the time of the
-.\"O .BR clone ()
-.\"O call.
-.\"O Calls to
-.\"O .BR chroot (2),
-.\"O .BR chdir (2),
-.\"O .BR umask (2)
-.\"O performed later by one of the processes do not affect the other process.
-.B CLONE_FS
-¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¡¢
-.BR clone ()
-¤¬¼Â¹Ô¤µ¤ì¤¿»þÅÀ¤Ç¤Î¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¾ðÊó¤Î¥³¥Ô¡¼¤ò
-»ÈÍѤ¹¤ë¡£
-¤³¤ì°Ê¹ß¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î°ìÊý¤¬
-.BR chroot (2),
-.BR chdir (2),
-.BR umask (2)
-¤ò¸Æ¤Ó½Ð¤·¤Æ¤â¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£
-.TP
-.\"O .BR CLONE_IO " (since Linux 2.6.25)"
-.BR CLONE_IO " (Linux 2.6.25 °Ê¹ß)"
-.\"O If
-.\"O .B CLONE_IO
-.\"O is set, then the new process shares an I/O context with
-.\"O the calling process.
-.\"O If this flag is not set, then (as with
-.\"O .BR fork (2))
-.\"O the new process has its own I/O context.
-.B CLONE_IO
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È
-I/O ¥³¥ó¥Æ¥­¥¹¥È¤ò¶¦Í­¤¹¤ë¡£
-¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢
-.RB ( fork (2)
-¤Î¾ì¹ç¤ÈƱÍÍ) ¿·¤·¤¤¥×¥í¥»¥¹¤Ï¼«Ê¬ÀìÍѤΠI/O ¥³¥ó¥Æ¥­¥¹¥È¤ò»ý¤Ä¡£
+.sp
+.in -4n
+glibc ラッパー関数の機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
+.in
+.sp
+\fBclone\fP():
+.ad l
+.RS 4
+.PD 0
+.TP  4
+glibc 2.14 以降:
+_GNU_SOURCE
+.TP  4
+.\" See http://sources.redhat.com/bugzilla/show_bug.cgi?id=4749
+glibc 2.14 より前:
+_BSD_SOURCE || _SVID_SOURCE
+    /* _GNU_SOURCE も定義される */
+.PD
+.RE
+.ad b
+.SH 説明
+\fBclone\fP() は、 \fBfork\fP(2) と似た方法で新しいプロセスを作成する。
+
+このページでは、 glibc の \fBclone\fP() ラッパー関数とその裏で呼ばれるシステムコールの両方について説明している。
+メインの説明はラッパー関数に関するものである。 素のシステムコールにおける差分はこのページの最後の方で説明する。
+
+\fBfork\fP(2) とは異なり、\fBclone\fP() では、子プロセス (child process)
+と呼び出し元のプロセスとが、メモリ空間、ファイルディスクリプタのテーブル、シグナルハンドラのテーブルなどの 実行コンテキストの一部を共有できる。
+(このマニュアルにおける「呼び出し元のプロセス」は、通常は 「親プロセス」と一致する。但し、後述の \fBCLONE_PARENT\fP の項も参照のこと)
+
+\fBclone\fP()  の主要な使用法はスレッド (threads) を実装することである:
+一つのプログラムの中の複数のスレッドは共有されたメモリ空間で 同時に実行される。
+
+\fBclone\fP()  で子プロセスが作成された時に、作成された子プロセスは関数 \fIfn\fP(\fIarg\fP)  を実行する。 (この点が
+\fBfork\fP(2)  とは異なる。 \fBfork\fP(2)  の場合、子プロセスは \fBfork\fP(2)  が呼び出された場所から実行を続ける。)
+\fIfn\fP 引き数は、子プロセスが実行を始める時に子プロセスが呼び出す 関数へのポインタである。 \fIarg\fP 引き数はそのまま \fIfn\fP
+関数へと渡される。
+
+\fIfn\fP(\fIarg\fP)  関数が終了すると、子プロセスは終了する。 \fIfn\fP によって返された整数が子プロセスの終了コードとなる。 子プロセスは、
+\fBexit\fP(2)  を呼んで明示的に終了することもあるし、致命的なシグナルを受信した 場合に終了することもある。
+
+\fIchild_stack\fP 引き数は、子プロセスによって使用されるスタックの位置を指定する。
+子プロセスと呼び出し元のプロセスはメモリを共有することがあるため、 子プロセスは呼び出し元のプロセスと同じスタックで実行することができない。
+このため、呼び出し元のプロセスは子プロセスのスタックのためのメモリ空間を 用意して、この空間へのポインタを \fBclone\fP()
+へ渡さなければならない。 (HP PA プロセッサ以外の) Linux が動作する全てのプロセッサでは、 スタックは下方 (アドレスが小さい方向)
+へと伸びる。このため、普通は \fIchild_stack\fP は子プロセスのスタックのために用意したメモリ空間の一番大きい アドレスを指すようにする。
+
+\fIflags\fP の下位 1 バイトは子プロセスが死んだ場合に親プロセスへと送られる \fI終了シグナル (termination signal)\fP
+の番号を指定する。このシグナルとして \fBSIGCHLD\fP 以外が指定された場合、親プロセスは、 \fBwait\fP(2)
+で子プロセスを待つ際に、オプションとして \fB__WALL\fP または \fB__WCLONE\fP を指定しなければならない。
+どのシグナルも指定されなかった場合、子プロセスが終了した時に親プロセス にシグナルは送られない。
+
+\fIflags\fP には、以下の定数のうち 0個以上をビット毎の論理和 (bitwise\-or)
+をとったものを指定できる。これらの定数は呼び出し元のプロセスと 子プロセスの間で何を共有するかを指定する:
+.TP 
+\fBCLONE_CHILD_CLEARTID\fP (Linux 2.5.49 以降)
+子プロセスが終了したときに子プロセスのメモリ内の \fIctid\fP が指す場所にある子プロセスのスレッド ID を消去し、 そのアドレスで futex を
+wake (起床) させる。 このアドレスは \fBset_tid_address\fP(2)  システムコールで変更することができる。
+この機能はスレッドライブラリで使用される。
+.TP 
+\fBCLONE_CHILD_SETTID\fP (Linux 2.5.49 以降)
+子プロセスのメモリ内の \fIctid\fP が指す場所に子プロセスのスレッド ID を格納する。
+.TP 
+\fBCLONE_FILES\fP (Linux 2.0 以降)
+\fBCLONE_FILES\fP が設定された場合、呼び出し元のプロセスと子プロセスはファイルディスクリプタの テーブルを共有する。
+呼び出し元プロセスとその子プロセスの一方が作成した ファイルディスクリプタは、もう一方においても有効である。
+同じように、一方のプロセスがファイルディスクリプタを閉じたり、 (\fBfcntl\fP(2)  \fBF_SETFD\fP 操作を使って)
+ディスクリプタに関連するフラグを変更したりすると、 もう一方のプロセスにも影響する。
+
+\fBCLONE_FILES\fP が設定されていない場合、子プロセスは、 \fBclone\fP()
+が実行された時点で、呼び出し元のプロセスがオープンしている全ての ファイルディスクリプタのコピーを継承する
+(子プロセスの複製されたファイルディスクリプタは、 対応する呼び出し元のプロセスのファイルディスクリプタと 同じファイル記述 (\fBopen\fP(2)
+参照) を参照する)。 これ以降に、呼び出し元のプロセスと子プロセスの一方が ファイルディスクリプタの操作 (ファイルディスクリプタの
+オープン・クローズや、ファイルディスクリプタ・フラグの変更)  を行っても、もう一方のプロセスには影響を与えない。
+.TP 
+\fBCLONE_FS\fP (Linux 2.0 以降)
+\fBCLONE_FS\fP が設定された場合、呼び出し元のプロセスと子プロセスが同じファイルシステム
+情報を共有する。ファイルシステム情報は、ファイルシステムのルート (root)、 カレントワーキングディレクトリ (current working
+directory)  や umask などである。 呼び出し元のプロセスや子プロセスのどちらか一方によって \fBchroot\fP(2),
+\fBchdir\fP(2), \fBumask\fP(2)  が呼び出されると、もう一方のプロセスにも影響が及ぶ。
+
+\fBCLONE_FS\fP が設定されていない場合、子プロセスは、 \fBclone\fP()
+が実行された時点での、呼び出し元のプロセスのファイルシステム情報のコピーを 使用する。 これ以降は、呼び出し元のプロセスと子プロセスの一方が
+\fBchroot\fP(2), \fBchdir\fP(2), \fBumask\fP(2)  を呼び出しても、もう一方のプロセスには影響を与えない。
+.TP 
+\fBCLONE_IO\fP (Linux 2.6.25 以降)
+\fBCLONE_IO\fP が設定された場合、新しいプロセスは呼び出し元のプロセスと I/O コンテキストを共有する。
+このフラグが設定されていない場合には、 (\fBfork\fP(2)  の場合と同様) 新しいプロセスは自分専用の I/O コンテキストを持つ。
 
 .\" The following based on text from Jens Axboe
-.\"O The I/O context is the I/O scope of the disk scheduler (i.e,
-.\"O what the I/O scheduler uses to model scheduling of a process's I/O).
-.\"O If processes share the same I/O context,
-.\"O they are treated as one by the I/O scheduler.
-.\"O As a consequence, they get to share disk time.
-I/O ¥³¥ó¥Æ¥­¥¹¥È¤Ï¡¢¥Ç¥£¥¹¥¯¥¹¥±¥¸¥å¡¼¥ë¤Î I/O ¥¹¥³¡¼¥×¤Ç¤¢¤ë
-(¸À¤¤´¹¤¨¤ë¤È¡¢I/O ¥³¥ó¥Æ¥­¥¹¥È¤Ï I/O ¥¹¥±¥¸¥å¡¼¥é¤¬¥×¥í¥»¥¹ I/O ¤Î
-¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ò¥â¥Ç¥ë²½¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë)¡£
-Ê£¿ô¤Î¥×¥í¥»¥¹¤¬Æ±¤¸ I/O ¥³¥ó¥Æ¥­¥¹¥È¤ò¶¦Í­¤¹¤ë¾ì¹ç¡¢
-¤³¤ì¤é¤Î¥×¥í¥»¥¹¤Ï I/O ¥¹¥±¥¸¥å¡¼¥é¤«¤é¤Ï°ì¤Ä¤È¤·¤Æ°·¤ï¤ì¤ë¡£
-·ë²Ì¤È¤·¤Æ¡¢¤³¤ì¤é¤Î¥×¥í¥»¥¹¤Ï¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤Î»þ´Ö¤ò¶¦Í­¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£
-.\"O For some I/O schedulers,
-.\"O .\" the anticipatory and CFQ scheduler
-.\"O if two processes share an I/O context,
-.\"O they will be allowed to interleave their disk access.
-.\"O If several threads are doing I/O on behalf of the same process
-.\"O .RB ( aio_read (3),
-.\"O for instance), they should employ
-.\"O .BR CLONE_IO
-.\"O to get better I/O performance.
-.\"O .\" with CFQ and AS.
-¤¤¤¯¤Ä¤«¤Î I/O ¥¹¥±¥¸¥å¡¼¥é¤Ç¤Ï¡¢
-.\" Í½Â¬¥¹¥±¥¸¥å¡¼¥é¤È CFQ ¥¹¥±¥¸¥å¡¼¥é
-Æó¤Ä¤Î¥×¥í¥»¥¹¤¬ I/O ¥³¥ó¥Æ¥­¥¹¥È¤ò¶¦Í­¤·¤Æ¤¤¤ë¾ì¹ç¡¢
-¤³¤ì¤é¤Î¥×¥í¥»¥¹¤Ï¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤ò¸ò¸ß¤Ë¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¡£
-Ʊ¤¸¥×¥í¥»¥¹¤ÎÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤¬ I/O ¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç
-(Î㤨¤Ð
-.BR aio_read (3))¡¢
-.B CLONE_IO
-¤òÍøÍѤ¹¤ë¤³¤È¤Ç I/O À­Ç½¤òÎɤ¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-.\" CFQ ¤È AS ¤Î¾ì¹ç
-
-.\"O If the kernel is not configured with the
-.\"O .B CONFIG_BLOCK
-.\"O option, this flag is a no-op.
-¥«¡¼¥Í¥ë¤ÎÀßÄ꤬
-.B CONFIG_BLOCK
-¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç¤Ê¤¤¾ì¹ç¡¢
-¤³¤Î¥Õ¥é¥°¤Ï²¿¤Î°ÕÌ£¤â»ý¤¿¤Ê¤¤¡£
-.TP
-.\"O .BR CLONE_NEWIPC " (since Linux 2.6.19)"
-.BR CLONE_NEWIPC " (Linux 2.6.19 °Ê¹ß)"
-.\"O If
-.\"O .B CLONE_NEWIPC
-.\"O is set, then create the process in a new IPC namespace.
-.\"O If this flag is not set, then (as with
-.\"O .BR fork (2)),
-.\"O the process is created in the same IPC namespace as
-.\"O the calling process.
-.\"O This flag is intended for the implementation of containers.
-.B CLONE_NEWIPC
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤ IPC Ì¾Á°¶õ´Ö (namespace) ¤Ç¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£
-¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-.RB ( fork (2)
-¤Î¾ì¹ç¤ÈƱÍÍ) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸ IPC Ì¾Á°¶õ´Ö¤Ç¥×¥í¥»¥¹¤¬
-ºîÀ®¤µ¤ì¤ë¡£
-¤³¤Î¥Õ¥é¥°¤Ï¡¢¥³¥ó¥Æ¥Ê¤Î¼ÂÁõ¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤ÆÍÑ°Õ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£
-
-.\"O An IPC namespace consists of the set of identifiers for
-.\"O System V IPC objects.
-.\"O (These objects are created using
-.\"O .BR msgctl (2),
-.\"O .BR semctl (2),
-.\"O and
-.\"O .BR shmctl (2)).
-.\"O Objects created in an IPC namespace are visible to all other processes
-.\"O that are members of that namespace,
-.\"O but are not visible to processes in other IPC namespaces.
-IPC Ì¾Á°¶õ´Ö¤Ï¡¢System V IPC ¥ª¥Ö¥¸¥§¥¯¥ÈÍѤμ±Ê̻Ҡ(identifiers) ¤Î
-½¸¹ç¤Ç¹½À®¤µ¤ì¤ë
-(System V IPC ¥ª¥Ö¥¸¥§¥¯¥È¤Ï
-.BR msgctl (2),
-.BR semctl (2),
-.BR shmctl (2)
-¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤ë)¡£
-¤¢¤ë IPC Ì¾Á°¶õ´Ö¤ËºîÀ®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢
-¤½¤Î̾Á°¶õ´Ö¤Î¥á¥ó¥Ð¡¼¤Ç¤¢¤ë¾¤Î¤¹¤Ù¤Æ¤Î¥×¥í¥»¥¹¤«¤é¤â¸«¤¨¤ë¤¬¡¢
-°ã¤¦ IPC Ì¾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£
-
-.\"O When an IPC namespace is destroyed
-.\"O (i.e, when the last process that is a member of the namespace terminates),
-.\"O all IPC objects in the namespace are automatically destroyed.
-IPC Ì¾Á°¶õ´Ö¤¬ÇË´þ¤µ¤ì¤ë»þ
-(¤¹¤Ê¤ï¤Á¡¢¤½¤Î̾Á°¶õ´Ö¤Î¥á¥ó¥Ð¡¼¤ÎºÇ¸å¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë»þ)¡¢
-¤½¤Î̾Á°¶õ´Ö¤ÎÁ´¤Æ¤Î IPC ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¼«Æ°Åª¤ËÇË´þ¤µ¤ì¤ë¡£
-
-.\"O Use of this flag requires: a kernel configured with the
-.\"O .B CONFIG_SYSVIPC
-.\"O and
-.\"O .B CONFIG_IPC_NS
-.\"O options and that the process be privileged
-.\"O .RB ( CAP_SYS_ADMIN ).
-.\"O This flag can't be specified in conjunction with
-.\"O .BR CLONE_SYSVSEM .
-¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢
-¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó
-.B CONFIG_SYSVIPC
-¤È
-.B CONFIG_IPC_NS
-¤òÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¡¢
-¥×¥í¥»¥¹¤¬Æø¢
-.RB ( CAP_SYS_ADMIN )
-¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£
-¤³¤Î¥Õ¥é¥°¤Ï
-.B CLONE_SYSVSEM
-¤ÈÁȤ߹ç¤ï¤»¤Æ»È¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
-.TP
-.\"O .BR CLONE_NEWNET " (since Linux 2.6.24)"
-.BR CLONE_NEWNET " (Linux 2.6.24 °Ê¹ß)"
-.\"O (The implementation of this flag is not yet complete,
-.\"O but probably will be mostly complete by about Linux 2.6.28.)
-(¤³¤Î¥Õ¥é¥°¤Î¼ÂÁõ¤Ï¤Þ¤À´°Î»¤·¤Æ¤¤¤Ê¤¤¤¬¡¢
-¤ª¤½¤é¤¯ Linux 2.6.28 ¤¢¤¿¤ê¤Þ¤Ç¤Ë¤Ï¤Û¤Ü´°À®¤¹¤ë¤³¤È¤À¤í¤¦¡£)
-
-.\"O If
-.\"O .B CLONE_NEWNET
-.\"O is set, then create the process in a new network namespace.
-.\"O If this flag is not set, then (as with
-.\"O .BR fork (2)),
-.\"O the process is created in the same network namespace as
-.\"O the calling process.
-.\"O This flag is intended for the implementation of containers.
-.B CLONE_NEWNET
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö (network namaspace)
-¤Ç¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£
-¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-.RB ( fork (2)
-¤Î¾ì¹ç¤ÈƱÍÍ) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤Ç¥×¥í¥»¥¹¤¬
-ºîÀ®¤µ¤ì¤ë¡£
-¤³¤Î¥Õ¥é¥°¤Ï¡¢¥³¥ó¥Æ¥Ê¤Î¼ÂÁõ¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤ÆÍÑ°Õ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£
-
-.\"O A network namespace provides an isolated view of the networking stack
-.\"O (network device interfaces, IPv4 and IPv6 protocol stacks,
-.\"O IP routing tables, firewall rules, the
-.\"O .I /proc/net
-.\"O and
-.\"O .I /sys/class/net
-.\"O directory trees, sockets, etc.).
-.\"O A physical network device can live in exactly one
-.\"O network namespace.
-.\"O A virtual network device ("veth") pair provides a pipe-like abstraction
-.\"O that can be used to create tunnels between network namespaces,
-.\"O and can be used to create a bridge to a physical network device
-.\"O in another namespace.
-¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤Ï¡¢Ê¬Î¥¤µ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¹¥¿¥Ã¥¯¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë
-(¥Í¥Ã¥È¥ï¡¼¥¯¥¹¥¿¥Ã¥¯¤È¤Ï¡¢
-¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¥¤¥ó¥¿¥Õ¥§¡¼¥¹¡¢IPv4 ¤ä IPv6 ¥×¥í¥È¥³¥ë¥¹¥¿¥Ã¥¯¡¢
-.IR /proc/net ¡¢
-.I /sys/class/net
-¥Ç¥£¥ì¥¯¥È¥ê¥Ä¥ê¡¼¡¢¥½¥±¥Ã¥È¤Ê¤É¤Ç¤¢¤ë)¡£
-ʪÍý¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤¬½ê°¤Ç¤­¤ë¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤Ï°ì¤Ä¤À¤±¤Ç¤¢¤ë¡£
-²¾Áۥͥåȥ¥¯¥Ç¥Ð¥¤¥¹ ("veth") ¤Î¥Ú¥¢¤Ë¤è¤ê
-¥Ñ¥¤¥×É÷¤ÎÃê¾Ý²½ (abstraction) ¤¬¼Â¸½¤µ¤ì¤Æ¤ª¤ê¡¢
-¤³¤ì¤ò»È¤¦¤³¤È¤Ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö´Ö¤Î¥È¥ó¥Í¥ë¤òºîÀ®¤·¤¿¤ê¡¢
-Ê̤Î̾Á°¶õ´Ö¤ÎʪÍý¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ø¤Î¥Ö¥ê¥Ã¥¸¤òºîÀ®¤·¤¿¤ê
-¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-
-.\"O When a network namespace is freed
-.\"O (i.e., when the last process in the namespace terminates),
-.\"O its physical network devices are moved back to the
-.\"O initial network namespace (not to the parent of the process).
-¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤¬²òÊü¤µ¤ì¤ë»þ
-(¤¹¤Ê¤ï¤Á¡¢¤½¤Î̾Á°¶õ´Ö¤ÎºÇ¸å¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë»þ)¡¢
-ʪÍý¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¥Ð¥¤¥¹¤Ï½é´ü¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö
-(initial network namespace) ¤ËÌᤵ¤ì¤ë
-(¿Æ¥×¥í¥»¥¹¤Î¥Í¥Ã¥È¥ï¡¼¥¯Ì¾Á°¶õ´Ö¤ËÌᤵ¤ì¤ëÌõ¤Ç¤Ï¤Ê¤¤)¡£
-
-.\"O Use of this flag requires: a kernel configured with the
-.\"O .B CONFIG_NET_NS
-.\"O option and that the process be privileged
-.\"O .RB ( CAP_SYS_ADMIN ).
-¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢
-¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó
-.B CONFIG_NET_NS
-¤òÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¡¢
-¥×¥í¥»¥¹¤¬Æø¢
-.RB ( CAP_SYS_ADMIN )
-¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£
-.TP
-.\"O .BR CLONE_NEWNS " (since Linux 2.4.19)"
-.BR CLONE_NEWNS " (Linux 2.4.19 °Ê¹ß)"
-.\"O Start the child in a new mount namespace.
-»Ò¥×¥í¥»¥¹¤ò¿·¤·¤¤¥Þ¥¦¥ó¥È̾Á°¶õ´Ö (mount namespace) ¤Ç³«»Ï¤¹¤ë¡£
-
-.\"O Every process lives in a mount namespace.
-.\"O The
-.\"O .I namespace
-.\"O of a process is the data (the set of mounts) describing the file hierarchy
-.\"O as seen by that process.
-.\"O After a
-.\"O .BR fork (2)
-.\"O or
-.\"O .BR clone ()
-.\"O where the
-.\"O .B CLONE_NEWNS
-.\"O flag is not set, the child lives in the same mount
-.\"O namespace as the parent.
-³Æ¥×¥í¥»¥¹¤Ï¤¢¤ë°ì¤Ä¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´ÖÃæ¤Ë¸ºß¤¹¤ë¡£¥×¥í¥»¥¹¤Î
-.I "̾Á°¶õ´Ö (namespace)"
-¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤«¤é¸«¤¨¤ë¥Õ¥¡¥¤¥ë³¬Áؤòɽ¤¹¥Ç¡¼¥¿ (mount ¤Î½¸¹ç) ¤Ç¤¢¤ë¡£
-.B CLONE_NEWNS
-¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤º¤Ë
-.BR fork (2)
-¤«
-.BR clone ()
-¤¬¸Æ¤Ð¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤ÈƱ¤¸¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤ËºîÀ®¤µ¤ì¤ë¡£
-.\"O The system calls
-.\"O .BR mount (2)
-.\"O and
-.\"O .BR umount (2)
-.\"O change the mount namespace of the calling process, and hence affect
-.\"O all processes that live in the same namespace, but do not affect
-.\"O processes in a different mount namespace.
-¥·¥¹¥Æ¥à¥³¡¼¥ë
-.BR mount (2)¡¢
-.BR umount (2)
-¤¬¸Æ¤Ð¤ì¤ë¤È¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤¬Êѹ¹¤µ¤ì¡¢¤³¤Î·ë²Ì
-¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸Ì¾Á°¶õ´Ö¤Ë¤¤¤ë¥×¥í¥»¥¹¤Ï¤¹¤Ù¤Æ±Æ¶Á¤ò¼õ¤±¤ë¤¬¡¢
-°Û¤Ê¤ë¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤Ë¤¤¤ë¥×¥í¥»¥¹¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡£
-
-.\"O After a
-.\"O .BR clone ()
-.\"O where the
-.\"O .B CLONE_NEWNS
-.\"O flag is set, the cloned child is started in a new mount namespace,
-.\"O initialized with a copy of the namespace of the parent.
-.B CLONE_NEWNS
-¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ
-.BR clone ()
-¤¬¸Æ¤Ð¤ì¤ë¤È¡¢clone ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¿·¤·¤¤¥Þ¥¦¥ó¥È̾Á°¶õ´Ö¤Ç
-³«»Ï¤µ¤ì¤ë¡£¿·¤·¤¤Ì¾Á°¶õ´Ö¤Ï¿Æ¥×¥í¥»¥¹¤Î̾Á°¶õ´Ö¤Î¥³¥Ô¡¼¤Ç½é´ü²½¤µ¤ì¤ë¡£
-
-.\"O Only a privileged process (one having the \fBCAP_SYS_ADMIN\fP capability)
-.\"O may specify the
-.\"O .B CLONE_NEWNS
-.\"O flag.
-.\"O It is not permitted to specify both
-.\"O .B CLONE_NEWNS
-.\"O and
-.\"O .B CLONE_FS
-.\"O in the same
-.\"O .BR clone ()
-.\"O call.
-Æø¢¥×¥í¥»¥¹ (\fBCAP_SYS_ADMIN\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬
-.B CLONE_NEWNS
-¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-°ì¤Ä¤Î
-.BR clone ()
-¸Æ¤Ó½Ð¤·¤Ç¡¢
-.B CLONE_NEWNS
-¤È
-.B CLONE_FS
-¤ÎξÊý¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
-.TP
-.\"O .BR CLONE_NEWPID " (since Linux 2.6.24)"
-.BR CLONE_NEWPID " (Linux 2.6.24 °Ê¹ß)"
+.\" the anticipatory and CFQ scheduler
+.\" with CFQ and AS.
+I/O コンテキストは、ディスクスケジュールの I/O スコープである (言い換えると、I/O コンテキストは I/O スケジューラがプロセス I/O
+の スケジューリングをモデル化するのに使用される)。 複数のプロセスが同じ I/O コンテキストを共有する場合、 これらのプロセスは I/O
+スケジューラからは一つとして扱われる。 結果として、これらのプロセスはディスクアクセスの時間を共有するようになる。 いくつかの I/O
+スケジューラでは、 二つのプロセスが I/O コンテキストを共有している場合、 これらのプロセスはディスクアクセスを交互に行うことができる。
+同じプロセスの複数のスレッドが I/O を実行している場合 (例えば \fBaio_read\fP(3))、 \fBCLONE_IO\fP を利用することで I/O
+性能を良くすることができる。
+
+カーネルの設定が \fBCONFIG_BLOCK\fP オプション付きでない場合、 このフラグは何の意味も持たない。
+.TP 
+\fBCLONE_NEWIPC\fP (Linux 2.6.19 以降)
+\fBCLONE_NEWIPC\fP が設定された場合、新しい IPC 名前空間 (namespace) でプロセスを作成する。
+このフラグが設定されていない場合、 (\fBfork\fP(2)  の場合と同様) 呼び出し元のプロセスと同じ IPC 名前空間でプロセスが 作成される。
+このフラグは、コンテナの実装での使用を意図して用意されたものである。
+
+.\" commit 7eafd7c74c3f2e67c27621b987b28397110d643f
+.\" https://lwn.net/Articles/312232/
+IPC 名前空間は、独立の System\ V IPC オブジェクト空間 (\fBsvipc\fP(7) 参照) を提供する 。 (Linux 2.6.30
+以降では) 独立した POSIX メッセージキュー空間 (\fBmq_overview\fP(7) 参照) も提供される。 これらの IPC
+機構に共通の特徴として、 IPC オブジェクトはファイルシステムのパス名とは違った仕組みで識別されるという点がある。
+
+ある IPC 名前空間に作成されたオブジェクトは、 その名前空間のメンバーである他のすべてのプロセスからも見えるが、 違う IPC
+名前空間のプロセスからは見えない。
+
+IPC 名前空間が破棄される時 (すなわち、その名前空間のメンバーの最後のプロセスが終了する時)、 その名前空間の全ての IPC
+オブジェクトは自動的に破棄される。
+
+このフラグを使用するためには、 カーネルでオプション \fBCONFIG_SYSVIPC\fP と \fBCONFIG_IPC_NS\fP を有効になっていること、
+プロセスが特権 (\fBCAP_SYS_ADMIN\fP)  を持っていることが必要である。 このフラグは \fBCLONE_SYSVSEM\fP
+と組み合わせて使うことはできない。
+.TP 
+\fBCLONE_NEWNET\fP (Linux 2.6.24 以降)
+.\" FIXME Check when the implementation was completed
+(このフラグの実装は、Linux 2.6.29 あたりまでには完成した。)
+
+\fBCLONE_NEWNET\fP が設定された場合、新しいネットワーク名前空間 (network namaspace)  でプロセスを作成する。
+このフラグが設定されていない場合、 (\fBfork\fP(2)  の場合と同様) 呼び出し元のプロセスと同じネットワーク名前空間でプロセスが 作成される。
+このフラグは、コンテナの実装での使用を意図して用意されたものである。
+
+.\" FIXME Add pointer to veth(4) page when it is eventually completed
+ネットワーク名前空間は、分離されたネットワークスタックを提供するものである (ネットワークスタックとは、 ネットワークデバイスインタフェース、IPv4
+や IPv6 プロトコルスタック、 \fI/proc/net\fP、 \fI/sys/class/net\fP ディレクトリツリー、ソケットなどである)。
+物理ネットワークデバイスが所属できるネットワーク名前空間は一つだけである。 仮想ネットワークデバイス ("veth") のペアにより パイプ風の抽象化
+(abstraction) が実現されており、 これを使うことで、ネットワーク名前空間間のトンネルを作成したり、
+別の名前空間の物理ネットワークデバイスへのブリッジを作成したり することができる。
+
+ネットワーク名前空間が解放される時 (すなわち、その名前空間の最後のプロセスが終了する時)、 物理ネットワークデバイスは初期ネットワーク名前空間
+(initial network namespace) に戻される (親プロセスのネットワーク名前空間に戻される訳ではない)。
+
+このフラグを使用するためには、 カーネルでオプション \fBCONFIG_NET_NS\fP を有効になっていること、 プロセスが特権
+(\fBCAP_SYS_ADMIN\fP)  を持っていることが必要である。
+.TP 
+\fBCLONE_NEWNS\fP (Linux 2.4.19 以降)
+子プロセスを新しいマウント名前空間 (mount namespace) で開始する。
+
+各プロセスはある一つのマウント名前空間中に存在する。プロセスの \fI名前空間 (namespace)\fP
+は、そのプロセスから見えるファイル階層を表すデータ (mount の集合) である。 \fBCLONE_NEWNS\fP フラグがセットされずに
+\fBfork\fP(2)  か \fBclone\fP()  が呼ばれると、子プロセスは親プロセスと同じマウント名前空間に作成される。 システムコール
+\fBmount\fP(2)、 \fBumount\fP(2)  が呼ばれると呼び出し元のプロセスのマウント名前空間が変更され、この結果
+呼び出し元のプロセスと同じ名前空間にいるプロセスはすべて影響を受けるが、 異なるマウント名前空間にいるプロセスは影響を受けない。
+
+\fBCLONE_NEWNS\fP フラグがセットされて \fBclone\fP()  が呼ばれると、clone で作成された子プロセスは新しいマウント名前空間で
+開始される。新しい名前空間は親プロセスの名前空間のコピーで初期化される。
+
+特権プロセス (\fBCAP_SYS_ADMIN\fP ケーパビリティを持つプロセス) のみが \fBCLONE_NEWNS\fP フラグを指定することができる。
+一つの \fBclone\fP()  呼び出しで、 \fBCLONE_NEWNS\fP と \fBCLONE_FS\fP の両方を指定することはできない。
+.TP 
+\fBCLONE_NEWPID\fP (Linux 2.6.24 以降)
 .\" This explanation draws a lot of details from
 .\" http://lwn.net/Articles/259217/
 .\" Authors: Pavel Emelyanov <xemul@openvz.org>
@@ -666,1145 +251,296 @@ IPC ̾
 .\"
 .\" The primary kernel commit is 30e49c263e36341b60b735cbef5ca37912549264
 .\" Author: Pavel Emelyanov <xemul@openvz.org>
-.\"O If
-.\"O .B CLONE_NEWPID
-.\"O is set, then create the process in a new PID namespace.
-.\"O If this flag is not set, then (as with
-.\"O .BR fork (2)),
-.\"O the process is created in the same PID namespace as
-.\"O the calling process.
-.\"O This flag is intended for the implementation of containers.
-.B CLONE_NEWPID
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤ PID Ì¾Á°¶õ´Ö¤Ç¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£
-¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-.RB ( fork (2)
-¤Î¾ì¹ç¤ÈƱÍÍ) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸ PID Ì¾Á°¶õ´Ö¤Ç
-¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£
-¤³¤Î¥Õ¥é¥°¤Ï¡¢¥³¥ó¥Æ¥Ê¤Î¼ÂÁõ¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤ÆÍÑ°Õ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£
-
-.\"O A PID namespace provides an isolated environment for PIDs:
-.\"O PIDs in a new namespace start at 1,
-.\"O somewhat like a standalone system, and calls to
-.\"O .BR fork (2),
-.\"O .BR vfork (2),
-.\"O or
-.\"O .BR clone (2)
-.\"O will produce processes with PIDs that are unique within the namespace.
-PID Ì¾Á°¶õ´Ö¤Ï¡¢PID ¤Ë´Ø¤·¤ÆʬΥ¤µ¤ì¤¿´Ä¶­¤òÄ󶡤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
-¿·¤·¤¤Ì¾Á°¶õ´Ö¤Ë¤ª¤±¤ë PID ¤Ï 1 ¤«¤é»Ï¤Þ¤ê
-(¤³¤ì¤Ï¥¹¥¿¥ó¥É¥¢¥í¥ó¤Î¥·¥¹¥Æ¥à¤È»÷¤¿¤è¤¦¤Ê´¶¤¸)¡¢
-.BR fork (2),
-.BR vfork (2),
-.BR clone (2)
-¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤Î̾Á°¶õ´Ö¤Ç°ì°Õ¤Ê PID ¤ò»ý¤Ã¤¿¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£
-
-.\"O The first process created in a new namespace
-.\"O (i.e., the process created using the
-.\"O .BR CLONE_NEWPID
-.\"O flag) has the PID 1, and is the "init" process for the namespace.
-.\"O Children that are orphaned within the namespace will be reparented
-.\"O to this process rather than
-.\"O .BR init (8).
-.\"O Unlike the traditional
-.\"O .B init
-.\"O process, the "init" process of a PID namespace can terminate,
-.\"O and if it does, all of the processes in the namespace are terminated.
-¿·¤·¤¤Ì¾Á°¶õ´Ö¤ÇºîÀ®¤µ¤ì¤ëºÇ½é¤Î¥×¥í¥»¥¹
-(¤Ä¤Þ¤ê¡¢
-.B CLONE_NEWPID
-¥Õ¥é¥°¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥×¥í¥»¥¹) ¤Î PID ¤Ï 1 ¤Ç¤¢¤ê¡¢
-¤³¤Î¥×¥í¥»¥¹¤Ï¤½¤Î̾Á°¶õ´Ö¤Ë¤ª¤±¤ë "init" ¥×¥í¥»¥¹¤È¤Ê¤ë¡£
-¤³¤Î̾Á°¶õ´Ö¤Ë¤ª¤¤¤Æ¸É»ù (orphaned) ¤È¤Ê¤Ã¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ¤Ï¡¢
-.BR init (8)
-¤Ç¤Ï¤Ê¤¯¤³¤Î¥×¥í¥»¥¹¤¬¿Æ¥×¥í¥»¥¹¤È¤Ê¤ë¡£
-ÀΤʤ¬¤é¤Î
-.B init
-¥×¥í¥»¥¹¤È¤Ï°ã¤¤¡¢PID Ì¾Á°¶õ´Ö¤Î "init" ¥×¥í¥»¥¹¤Ï½ªÎ» (terminated) ¤¹¤ë
-¤³¤È¤¬¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤Î̾Á°¶õ´Ö¤ÎÁ´¤Æ¤Î¥×¥í¥»¥¹¤¬½ªÎ»¤µ¤ì¤ë¡£
-
-.\"O PID namespaces form a hierarchy.
-PID Ì¾Á°¶õ´Ö´Ö¤Ë¤Ï³¬Áع½Â¤¤¬·ÁÀ®¤µ¤ì¤ë¡£
-.\"O When a new PID namespace is created,
-.\"O the processes in that namespace are visible
-.\"O in the PID namespace of the process that created the new namespace;
-.\"O analogously, if the parent PID namespace is itself
-.\"O the child of another PID namespace,
-.\"O then processes in the child and parent PID namespaces will both be
-.\"O visible in the grandparent PID namespace.
-¿·¤·¤¤ PID Ì¾Á°¶õ´Ö¤¬ºîÀ®¤µ¤ì¤ë¤È¡¢¤½¤Î̾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ï¡¢
-¿·¤·¤¤Ì¾Á°¶õ´Ö¤òºîÀ®¤·¤¿¥×¥í¥»¥¹¤Î PID Ì¾Á°¶õ´Ö¤Ç¸«¤¨¤ë¡£
-ƱÍͤˡ¢¿Æ¤Î PID Ì¾Á°¶õ´Ö¼«ÂΤ¬Ê̤ΠPID Ì¾Á°¶õ´Ö¤Î»Ò¶¡¤Î¾ì¹ç¤Ë¤Ï¡¢
-»Ò¶¡¤Î PID Ì¾Á°¶õ´Ö¤È¿Æ¤Î PID Ì¾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ï¤É¤ì¤â
-¿Æ¤Î¿Æ¤Î PID Ì¾Á°¶õ´Ö¤Ç¤â¸«¤¨¤ë¤³¤È¤Ë¤Ê¤ë¡£
-.\"O Conversely, the processes in the "child" PID namespace do not see
-.\"O the processes in the parent namespace.
-.\"O The existence of a namespace hierarchy means that each process
-.\"O may now have multiple PIDs:
-.\"O one for each namespace in which it is visible;
-.\"O each of these PIDs is unique within the corresponding namespace.
-.\"O (A call to
-.\"O .BR getpid (2)
-.\"O always returns the PID associated with the namespace in which
-.\"O the process lives.)
-È¿ÂФˡ¢¡Ö»Ò¶¡¡×¤Î PID Ì¾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢
-¿Æ¤Î̾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ï¸«¤¨¤Ê¤¤¡£
-̾Á°¶õ´Ö¤Ë³¬Áع½Â¤¤¬Â¸ºß¤¹¤ë¤È¤¤¤¦¤³¤È¤Ï¡¢¸Ä¡¹¤Î¥×¥í¥»¥¹¤Ï
-Ê£¿ô¤Î PID ¤ò»ý¤Ä¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¡£
-¤½¤Î¥×¥í¥»¥¹¤¬¸«¤¨¤ë̾Á°¶õ´Ö°ì¤Ä¤Ë¤Ä¤­ PID ¤¬°ì¤Ä¤¢¤ê¡¢
-¤½¤ì¤¾¤ì¤Î PID ¤ÏÂбþ¤¹¤ë̾Á°¶õ´Ö¤Ë¤ª¤¤¤Æ°ì°Õ¤Ç¤¢¤ë¡£
-.RB ( getpid (2)
-¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¾ï¤Ë¤½¤Î¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Æ¤¤¤ë̾Á°¶õ´Ö¤Ë¤ª¤±¤ë
-PID ¤¬ÊÖ¤µ¤ì¤ë¡£)
-
-.\"O After creating the new namespace,
-.\"O it is useful for the child to change its root directory
-.\"O and mount a new procfs instance at
-.\"O .I /proc
-.\"O so that tools such as
-.\"O .BR ps (1)
-.\"O work correctly.
-¿·¤·¤¤Ì¾Á°¶õ´Ö¤ÎºîÀ®¸å¤Ë¤Ï¡¢
-»Ò¥×¥í¥»¥¹¤Ë¤ª¤¤¤Æ¡¢
-.BR ps (1)
-¤È¤¤¤Ã¤¿¥Ä¡¼¥ë¤¬Àµ¤·¤¯Æ°ºî¤¹¤ë¤è¤¦¤Ë¡¢
-¼«¿È¤Î root ¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤·¡¢
-.I /proc
-¤Ë¿·¤·¤¤ procfs ¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥Þ¥¦¥ó¥È¤¹¤ë¤Î¤¬¤è¤¤¤À¤í¤¦¡£
+\fBCLONE_NEWPID\fP が設定された場合、新しい PID 名前空間でプロセスを作成する。 このフラグが設定されていない場合、
+(\fBfork\fP(2)  の場合と同様) 呼び出し元のプロセスと同じ PID 名前空間で プロセスが作成される。
+このフラグは、コンテナの実装での使用を意図して用意されたものである。
+
+PID 名前空間は、PID に関して分離された環境を提供するものである。 新しい名前空間における PID は 1 から始まり
+(これはスタンドアロンのシステムと似たような感じ)、 \fBfork\fP(2), \fBvfork\fP(2), \fBclone\fP()
+を呼び出すと、その名前空間で一意な PID を持ったプロセスが作成される。
+
+新しい名前空間で作成される最初のプロセス (つまり、 \fBCLONE_NEWPID\fP フラグを使って作成されたプロセス) の PID は 1 であり、
+このプロセスはその名前空間における "init" プロセスとなる。 この名前空間において孤児 (orphaned) となった子プロセスについては、
+\fBinit\fP(8)  ではなくこのプロセスが親プロセスとなる。 昔ながらの \fBinit\fP プロセスとは違い、PID 名前空間の "init"
+プロセスは終了 (terminated) する ことができ、その場合には、この名前空間の全てのプロセスが終了される。
+
+PID 名前空間間には階層構造が形成される。 新しい PID 名前空間が作成されると、その名前空間のプロセスは、 新しい名前空間を作成したプロセスの
+PID 名前空間で見える。 同様に、親の PID 名前空間自体が別の PID 名前空間の子供の場合には、 子供の PID 名前空間と親の PID
+名前空間のプロセスはどれも 親の親の PID 名前空間でも見えることになる。 反対に、「子供」の PID 名前空間のプロセスには、
+親の名前空間のプロセスは見えない。 名前空間に階層構造が存在するということは、個々のプロセスは 複数の PID を持つということを意味している。
+そのプロセスが見える名前空間一つにつき PID が一つあり、 それぞれの PID は対応する名前空間において一意である。 (\fBgetpid\fP(2)
+を呼び出すと、常にそのプロセスが存在している名前空間における PID が返される。)
+
 .\" mount -t proc proc /proc
-.\"O (If
-.\"O .BR CLONE_NEWNS
-.\"O is also included in
-.\"O .IR flags ,
-.\"O then it isn't necessary to change the root directory:
-.\"O a new procfs instance can be mounted directly over
-.\"O .IR /proc .)
-.RB ( flags
-¤Ë
-.B CLONE_NEWNS
-¤â»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢root ¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ëɬÍפϤʤ¯¡¢
-¤¤¤­¤Ê¤ê¿·¤·¤¤ procfs ¥¤¥ó¥¹¥¿¥ó¥¹¤ò
-.I /proc
-¤Ë¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£)
-
-.\"O Use of this flag requires: a kernel configured with the
-.\"O .B CONFIG_PID_NS
-.\"O option and that the process be privileged
-.\"O .RB ( CAP_SYS_ADMIN ).
-.\"O This flag can't be specified in conjunction with
-.\"O .BR CLONE_THREAD .
-¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢
-¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó
-.B CONFIG_PID_NS
-¤òÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¡¢
-¥×¥í¥»¥¹¤¬Æø¢
-.RB ( CAP_SYS_ADMIN )
-¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£
-¤³¤Î¥Õ¥é¥°¤Ï
-.B CLONE_THREAD
-¤ÈÁȤ߹ç¤ï¤»¤Æ»È¤¦¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
-.TP
-.\"O .BR CLONE_NEWUTS " (since Linux 2.6.19)"
-.BR CLONE_NEWUTS " (Linux 2.6.19 °Ê¹ß)"
-.\"O If
-.\"O .B CLONE_NEWUTS
-.\"O is set, then create the process in a new UTS namespace,
-.\"O whose identifiers are initialized by duplicating the identifiers
-.\"O from the UTS namespace of the calling process.
-.\"O If this flag is not set, then (as with
-.\"O .BR fork (2)),
-.\"O the process is created in the same UTS namespace as
-.\"O the calling process.
-.\"O This flag is intended for the implementation of containers.
-.B CLONE_NEWUTS
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤ UTS Ì¾Á°¶õ´Ö¤Ç¥×¥í¥»¥¹¤òºîÀ®¤¹¤ë¡£
-¿·¤·¤¤ UTS Ì¾Á°¶õ´Ö¤Î¼±Ê̻Ҥνé´üÃͤϡ¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î
-UTS Ì¾Á°¶õ´Ö¤Î¼±Ê̻ҤòÊ£À½¤·¤¿¤â¤Î¤È¤Ê¤ë¡£
-¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-.RB ( fork (2)
-¤Î¾ì¹ç¤ÈƱÍÍ) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸ UTS Ì¾Á°¶õ´Ö¤Ç
-¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£
-¤³¤Î¥Õ¥é¥°¤Ï¡¢¥³¥ó¥Æ¥Ê¤Î¼ÂÁõ¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤ÆÍÑ°Õ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£
-
-.\"O A UTS namespace is the set of identifiers returned by
-.\"O .BR uname (2);
-.\"O among these, the domain name and the host name can be modified by
-.\"O .BR setdomainname (2)
-.\"O and
-.\"O .BR
-.\"O .BR sethostname (2),
-.\"O respectively.
-.\"O Changes made to the identifiers in a UTS namespace
-.\"O are visible to all other processes in the same namespace,
-.\"O but are not visible to processes in other UTS namespaces.
-UTS Ì¾Á°¶õ´Ö¤Ï¡¢
-.BR uname (2)
-¤¬ÊÖ¤¹¼±Ê̻Ҥν¸¹ç¤Ç¤¢¤ë¡£
-¼±Ê̻ҤȤ·¤Æ¤Ï¥É¥á¥¤¥ó̾¤È¥Û¥¹¥È̾¤¬¤¢¤ê¡¢
-¤½¤ì¤¾¤ì
-.BR setdomainname (2),
-.BR sethostname (2)
-¤Ç½¤Àµ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-¤¢¤ë UTS Ì¾Á°¶õ´Ö¤Ë¤ª¤±¤ë¼±Ê̻ҤÎÊѹ¹¤ÏƱ¤¸Ì¾Á°¶õ´Ö¤Î¾¤Î¤¹¤Ù¤Æ¤Î
-¥×¥í¥»¥¹¤Ë¸«¤¨¤ë¤¬¡¢Ê̤ΠUTS Ì¾Á°¶õ´Ö¤Î¥×¥í¥»¥¹¤Ë¤Ï¸«¤¨¤Ê¤¤¡£
-
-.\"O Use of this flag requires: a kernel configured with the
-.\"O .B CONFIG_UTS_NS
-.\"O option and that the process be privileged
-.\"O .RB ( CAP_SYS_ADMIN ).
-¤³¤Î¥Õ¥é¥°¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢
-¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó
-.B CONFIG_UTS_NS
-¤òÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¡¢
-¥×¥í¥»¥¹¤¬Æø¢
-.RB ( CAP_SYS_ADMIN )
-¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë¡£
-.TP
-.\"O .BR CLONE_PARENT " (since Linux 2.3.12)"
-.BR CLONE_PARENT " (Linux 2.3.12 °Ê¹ß)"
-.\"O If
-.\"O .B CLONE_PARENT
-.\"O is set, then the parent of the new child (as returned by
-.\"O .BR getppid (2))
-.\"O will be the same as that of the calling process.
-.B CLONE_PARENT
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¿·¤·¤¤»Ò¶¡¤Î
-.RB ( getppid (2)
-¤ÇÊÖ¤µ¤ì¤ë) ¿Æ¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤ÈƱ¤¸¤Ë¤Ê¤ë¡£
-
-.\"O If
-.\"O .B CLONE_PARENT
-.\"O is not set, then (as with
-.\"O .BR fork (2))
-.\"O the child's parent is the calling process.
-.B CLONE_PARENT
-¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-.RB ( fork (2)
-¤ÈƱÍͤË) ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬¤½¤Î»Ò¶¡¤Î¿Æ¤Ë¤Ê¤ë¡£
-
-.\"O Note that it is the parent process, as returned by
-.\"O .BR getppid (2),
-.\"O which is signaled when the child terminates, so that
-.\"O if
-.\"O .B CLONE_PARENT
-.\"O is set, then the parent of the calling process, rather than the
-.\"O calling process itself, will be signaled.
-»Ò¶¡¤¬½ªÎ»¤·¤¿»þ¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¤Î¤Ï
-.BR getppid (2)
-¤¬ÊÖ¤¹¿Æ¥×¥í¥»¥¹¤Ç¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£¤³¤Î¤¿¤á
-.B CLONE_PARENT
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ç¤Ï¤Ê¤¯¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î
-¿Æ¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£
-.TP
-.\"O .BR CLONE_PARENT_SETTID " (since Linux 2.5.49)"
-.BR CLONE_PARENT_SETTID " (Linux 2.5.49 °Ê¹ß)"
-.\"O Store child thread ID at location
-.\"O .I ptid
-.\"O in parent and child memory.
-.\"O (In Linux 2.5.32-2.5.48 there was a flag
-.\"O .B CLONE_SETTID
-.\"O that did this.)
-¿Æ¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î¥á¥â¥êÆâ¤Î
-.I ptid
-¤¬»Ø¤¹Îΰè¤Ë»Ò¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É ID ¤ò³ÊǼ¤¹¤ë¡£
-(Linux 2.5.32-2.5.48 ¤Ç¤Ï¡¢
-Ʊ¤¸¤³¤È¤ò¤¹¤ë
-.B CLONE_SETTID
-¤È¤¤¤¦¥Õ¥é¥°¤¬Â¸ºß¤·¤¿¡£)
-.TP
-.\"O .BR CLONE_PID " (obsolete)"
-.BR CLONE_PID " (ÇÑ»ßͽÄê)"
-.\"O If
-.\"O .B CLONE_PID
-.\"O is set, the child process is created with the same process ID as
-.\"O the calling process.
-.\"O This is good for hacking the system, but otherwise
-.\"O of not much use.
-.\"O Since 2.3.21 this flag can be
-.\"O specified only by the system boot process (PID 0).
-.\"O It disappeared in Linux 2.5.16.
-.B CLONE_PID
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥×¥í¥»¥¹ ID
-¤ÇºîÀ®¤µ¤ì¤ë¡£¤³¤ì¤Ï¥·¥¹¥Æ¥à¤ò¥Ï¥Ã¥­¥ó¥°¤¹¤ë¤Î¤Ë¤ÏÊØÍø¤À¤¬¡¢
-¤½¤ì°Ê³°¤Ë¤Ï¤¢¤Þ¤ê»È¤ï¤ì¤Ê¤¤¡£ Linux 2.3.21 °Ê¹ß¤Ç¤Ï¡¢
-¥·¥¹¥Æ¥à¤Î¥Ö¡¼¥È¥×¥í¥»¥¹ (PID 0) ¤À¤±¤¬¤³¤Î¥Õ¥é¥°¤ò»ØÄê¤Ç¤­¤ë¡£
-Linux 2.5.16 ¤Çºï½ü¤µ¤ì¤¿¡£
-.TP
-.B CLONE_PTRACE
-.\"O If
-.\"O .B CLONE_PTRACE
-.\"O is specified, and the calling process is being traced,
-.\"O then trace the child also (see
-.\"O .BR ptrace (2)).
-.B CLONE_PTRACE
-¤¬»ØÄꤵ¤ì¡¢¤«¤Ä¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬ÄÉÀ× (trace) ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤â
-ƱÍͤËÄÉÀפµ¤ì¤ë¡£
-.RB ( ptrace (2)
-¤ò»²¾È¤Î¤³¤È)
-.TP
-.\"O .BR CLONE_SETTLS " (since Linux 2.5.32)"
-.BR CLONE_SETTLS " (Linux 2.5.32 °Ê¹ß)"
-.\"O The
-.\"O .I newtls
-.\"O argument is the new TLS (Thread Local Storage) descriptor.
-.\"O (See
-.\"O .BR set_thread_area (2).)
-.I newtls
-°ú¤­¿ô¤Ï¡¢¿·¤·¤¤ TLS (Thread Local Storage) ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£
-.RB ( set_thread_area (2)
-¤ò»²¾È¤Î¤³¤È)
-.TP
-.B CLONE_SIGHAND
-.\"O If
-.\"O .B CLONE_SIGHAND
-.\"O is set, the calling process and the child process share the same table of
-.\"O signal handlers.
-.\"O If the calling process or child process calls
-.\"O .BR sigaction (2)
-.\"O to change the behavior associated with a signal, the behavior is
-.\"O changed in the other process as well.
-.\"O However, the calling process and child
-.\"O processes still have distinct signal masks and sets of pending
-.\"O signals.
-.\"O So, one of them may block or unblock some signals using
-.\"O .BR sigprocmask (2)
-.\"O without affecting the other process.
-.B CLONE_SIGHAND
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤ÏƱ¤¸¥·¥°¥Ê¥ë¡¦¥Ï¥ó
-¥É¥é¤Î¥Æ¡¼¥Ö¥ë¤ò¶¦Í­¤¹¤ë¡£¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Þ¤¿¤Ï»Ò¥×¥í¥»¥¹¤Î¤É¤Á¤é¤«¤¬
-.BR sigaction (2)
-¤ò¸Æ¤Ó½Ð¤·¤Æ¥·¥°¥Ê¥ë¤ËÂбþ¤¹¤ëÆ°ºî¤òÊѹ¹¤·¤¿¾ì¹ç¡¢
-¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ëÆ°ºî¤âÊѹ¹¤µ¤ì¤ë¡£
-⤷¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Ï¡¢
-¥×¥í¥»¥¹Ëè¤Ë¡¢¥·¥°¥Ê¥ë¡¦¥Þ¥¹¥¯ (signal mask) ¤È½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤Î½¸¹ç
-¤ò»ý¤Ã¤Æ¤¤¤ë¡£¤³¤Î¤¿¤á¡¢¤¢¤ë¥×¥í¥»¥¹¤Ï¡¢
-.BR sigprocmask (2)
-¤ò»ÈÍѤ·¤Æ¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë±Æ¶Á¤òÍ¿¤¨¤º¤Ë
-¥·¥°¥Ê¥ë¤ò¶Ø»ß (block) ¤·¤¿¤êµö²Ä (unblock) ¤·¤¿¤ê¤Ç¤­¤ë¡£
-
-.\"O If
-.\"O .B CLONE_SIGHAND
-.\"O is not set, the child process inherits a copy of the signal handlers
-.\"O of the calling process at the time
-.\"O .BR clone ()
-.\"O is called.
-.\"O Calls to
-.\"O .BR sigaction (2)
-.\"O performed later by one of the processes have no effect on the other
-.\"O process.
-.B CLONE_SIGHAND
-¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï
-.BR clone ()
-¤¬¼Â¹Ô¤µ¤ì¤¿»þÅÀ¤Ç¤Î¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤Î
-¥³¥Ô¡¼¤ò·Ñ¾µ¤¹¤ë¡£¤³¤ì°Ê¹ß¤Ï¡¢°ìÊý¤Î¥×¥í¥»¥¹¤¬
-.BR sigaction (2)
-¤ò¸Æ¤Ó½Ð¤·¤Æ¤â¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡£
-
-.\"O Since Linux 2.6.0-test6,
-.\"O .I flags
-.\"O must also include
-.\"O .B CLONE_VM
-.\"O if
-.\"O .B CLONE_SIGHAND
-.\"O is specified
-Linux 2.6.0-test6 °Ê¹ß¤Ç¤Ï¡¢
-.B CLONE_SIGHAND
-¤ò»ØÄꤹ¤ë¾ì¹ç¡¢
-.B CLONE_VM
-¤â
-.I flags
-¤Ë´Þ¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.TP
-.\"O .BR CLONE_STOPPED " (since Linux 2.6.0-test2)"
-.BR CLONE_STOPPED " (Linux 2.6.0-test2 °Ê¹ß)"
-.\"O If
-.\"O .B CLONE_STOPPED
-.\"O is set, then the child is initially stopped (as though it was sent a
-.\"O .B SIGSTOP
-.\"O signal), and must be resumed by sending it a
-.\"O .B SIGCONT
-.\"O signal.
-.B CLONE_STOPPED
-¤¬ÀßÄꤵ¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤ÏºÇ½é
-.RB ( SIGSTOP
-¥·¥°¥Ê¥ë¤òÁ÷¤é¤ì¤¿¤«¤Î¤è¤¦¤Ë) Ää»ß¤·¤¿¾õÂ֤Ȥʤ롣
-»Ò¥×¥í¥»¥¹¤òºÆ³«¤µ¤»¤ë¤Ë¤Ï
-.B SIGCONT
-¥·¥°¥Ê¥ë¤òÁ÷¿®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-
-.\"O .I "From Linux 2.6.25 this flag is deprecated."
-.\"O You probably never wanted to use it,
-.\"O you certainly shouldn't be using it, and soon it will go away.
-.I "Linux 2.6.25 °Ê¹ß¡¢¤³¤Î¥Õ¥é¥°¤ÏÈó¿ä¾©¤Ç¤¢¤ë¡£"
-¤³¤Î¥Õ¥é¥°¤ò»È¤¤¤¿¤¤¤È»×¤¦¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¤À¤í¤¦¤·¡¢
-³Î¼Â¤Ë»È¤ï¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-¤³¤Î¥Õ¥é¥°¤Ï¶á¤¤¤¦¤Á¤Ë¤Ê¤¯¤Ê¤ë¤³¤È¤À¤í¤¦¡£
+新しい名前空間の作成後には、 子プロセスにおいて、 \fBps\fP(1)  といったツールが正しく動作するように、 自身の root ディレクトリを変更し、
+\fI/proc\fP に新しい procfs インスタンスをマウントするのがよいだろう。 (\fBflags\fP に \fBCLONE_NEWNS\fP
+も指定されていた場合には、root ディレクトリを変更する必要はなく、 いきなり新しい procfs インスタンスを \fI/proc\fP
+にマウントすることができる。)
+
+このフラグを使用するためには、 カーネルでオプション \fBCONFIG_PID_NS\fP を有効になっていること、 プロセスが特権
+(\fBCAP_SYS_ADMIN\fP)  を持っていることが必要である。 このフラグは \fBCLONE_THREAD\fP と組み合わせて使うことはできない。
+.TP 
+\fBCLONE_NEWUTS\fP (Linux 2.6.19 以降)
+\fBCLONE_NEWUTS\fP が設定された場合、新しい UTS 名前空間でプロセスを作成する。 新しい UTS
+名前空間の識別子の初期値は、呼び出し元のプロセスの UTS 名前空間の識別子を複製したものとなる。 このフラグが設定されていない場合、
+(\fBfork\fP(2)  の場合と同様) 呼び出し元のプロセスと同じ UTS 名前空間で プロセスが作成される。
+このフラグは、コンテナの実装での使用を意図して用意されたものである。
+
+UTS 名前空間は、 \fBuname\fP(2)  が返す識別子の集合である。 識別子としてはドメイン名とホスト名があり、 それぞれ
+\fBsetdomainname\fP(2), \fBsethostname\fP(2)  で修正することができる。 ある UTS
+名前空間における識別子の変更は同じ名前空間の他のすべての プロセスに見えるが、別の UTS 名前空間のプロセスには見えない。
+
+このフラグを使用するためには、 カーネルでオプション \fBCONFIG_UTS_NS\fP を有効になっていること、 プロセスが特権
+(\fBCAP_SYS_ADMIN\fP)  を持っていることが必要である。
+.TP 
+\fBCLONE_PARENT\fP (Linux 2.3.12 以降)
+\fBCLONE_PARENT\fP が設定された場合、新しい子供の (\fBgetppid\fP(2)  で返される)
+親プロセスは呼び出し元のプロセスの親プロセスと同じになる。
+
+\fBCLONE_PARENT\fP が設定されていない場合、 (\fBfork\fP(2)  と同様に) 呼び出し元のプロセスがその子供の親になる。
+
+子供が終了した時にシグナルが送られるのは \fBgetppid\fP(2)  が返す親プロセスである点に注意すること。このため \fBCLONE_PARENT\fP
+が設定された場合、呼び出し元のプロセスではなく呼び出し元のプロセスの 親プロセスにシグナルが送られる。
+.TP 
+\fBCLONE_PARENT_SETTID\fP (Linux 2.5.49 以降)
+親プロセスと子プロセスのメモリ内の \fIptid\fP が指す領域に子プロセスのスレッド ID を格納する。 (Linux 2.5.32\-2.5.48
+では、 同じことをする \fBCLONE_SETTID\fP というフラグが存在した。)
+.TP 
+\fBCLONE_PID\fP (廃止予定)
+\fBCLONE_PID\fP が設定された場合、子プロセスは呼び出し元のプロセスと同じプロセス ID
+で作成される。これはシステムをハッキングするのには便利だが、 それ以外にはあまり使われない。 Linux 2.3.21 以降では、
+システムのブートプロセス (PID 0) だけがこのフラグを指定できる。 Linux 2.5.16 で削除された。
+.TP 
+\fBCLONE_PTRACE\fP (Linux 2.2 以降)
+\fBCLONE_PTRACE\fP が指定され、かつ呼び出し元のプロセスが追跡 (trace) されていた場合、子プロセスも 同様に追跡される。
+(\fBptrace\fP(2)  を参照のこと)
+.TP 
+\fBCLONE_SETTLS\fP (Linux 2.5.32 以降)
+\fInewtls\fP 引き数は、新しい TLS (Thread Local Storage) ディスクリプタである。
+(\fBset_thread_area\fP(2)  を参照のこと)
+.TP 
+\fBCLONE_SIGHAND\fP (Linux 2.0 以降)
+\fBCLONE_SIGHAND\fP が設定された場合、呼び出し元のプロセスと子プロセスは同じシグナルハン
+ドラのテーブルを共有する。呼び出し元のプロセスまたは子プロセスのどちらかが \fBsigaction\fP(2)
+を呼び出してシグナルに対応する動作を変更した場合、 もう一方のプロセスのシグナル動作も変更される。 但し、呼び出し元のプロセスと子プロセスは、
+プロセス毎に、シグナルマスク (signal mask) と処理待ちシグナルの集合 を持っている。このため、あるプロセスは、
+\fBsigprocmask\fP(2)  を使用して、もう一方のプロセスに影響を与えずに シグナルを禁止 (block) したり許可 (unblock)
+したりできる。
+
+\fBCLONE_SIGHAND\fP が設定されていない場合、子プロセスは \fBclone\fP()
+が実行された時点での、呼び出し元のプロセスのシグナルハンドラの コピーを継承する。これ以降は、一方のプロセスが \fBsigaction\fP(2)
+を呼び出しても、もう一方のプロセスには影響を与えない。
+
+Linux 2.6.0\-test6 以降では、 \fBCLONE_SIGHAND\fP を指定する場合、 \fBCLONE_VM\fP も \fIflags\fP
+に含めなければならない。
+.TP 
+\fBCLONE_STOPPED\fP (Linux 2.6.0\-test2 以降)
+\fBCLONE_STOPPED\fP が設定されると、子プロセスは最初 (\fBSIGSTOP\fP シグナルを送られたかのように) 停止した状態となる。
+子プロセスを再開させるには \fBSIGCONT\fP シグナルを送信しなければならない。
+
 .\" glibc 2.8 removed this defn from bits/sched.h
-.TP
-.\"O .BR CLONE_SYSVSEM " (since Linux 2.5.10)"
-.BR CLONE_SYSVSEM " (Linux 2.5.10 °Ê¹ß)"
-.\"O If
-.\"O .B CLONE_SYSVSEM
-.\"O is set, then the child and the calling process share
-.\"O a single list of System V semaphore undo values (see
-.\"O .BR semop (2)).
-.\"O If this flag is not set, then the child has a separate undo list,
-.\"O which is initially empty.
-.B CLONE_SYSVSEM
-¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢»Ò¥×¥í¥»¥¹¤È¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï°ì¤Ä¤Î
-System V ¥»¥Þ¥Õ¥©¤Î¥¢¥ó¥É¥¥Ãͥꥹ¥È
-.RB ( semop (2)
-»²¾È) ¤ò¶¦Í­¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
-»Ò¥×¥í¥»¥¹¤ÏÆȼ«¤Î¥¢¥ó¥É¥¥¥ê¥¹¥È¤ò»ý¤Ä (¥ê¥¹¥È¤Î½é´üÃͤ϶õ¤Ç¤¢¤ë)¡£
-.TP
-.\"O .BR CLONE_THREAD " (since Linux 2.4.0-test8)"
-.BR CLONE_THREAD " (Linux 2.4.0-test8°Ê¹ß)"
-.\"O If
-.\"O .B CLONE_THREAD
-.\"O is set, the child is placed in the same thread group as the calling process.
-.\"O To make the remainder of the discussion of
-.\"O .B CLONE_THREAD
-.\"O more readable, the term "thread" is used to refer to the
-.\"O processes within a thread group.
-.B CLONE_THREAD
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÈƱ¤¸¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë
-ÃÖ¤«¤ì¤ë¡£
-.B CLONE_THREAD
-¤Ë¤Ä¤¤¤Æ¤Î°Ê¹ß¤ÎµÄÏÀ¤òÆɤߤ䤹¤¯¤¹¤ë¤¿¤á¡¢
-¡Ö¥¹¥ì¥Ã¥É¡×¤È¤¤¤¦ÍѸì¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÃæ¤Î¥×¥í¥»¥¹¤ò
-»²¾È¤¹¤ë¤Î¤Ë»È¤¦¤³¤È¤È¤¹¤ë¡£
-
-.\"O Thread groups were a feature added in Linux 2.4 to support the
-.\"O POSIX threads notion of a set of threads that share a single PID.
-.\"O Internally, this shared PID is the so-called
-.\"O thread group identifier (TGID) for the thread group.
-.\"O Since Linux 2.4, calls to
-.\"O .BR getpid (2)
-.\"O return the TGID of the caller.
-¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ï¡¢ ¥¹¥ì¥Ã¥É½¸¹ç¤Ç°ì¤Ä¤Î PID ¤ò¶¦Í­¤¹¤ë¤È¤¤¤¦ POSIX
-¥¹¥ì¥Ã¥É¤Î³µÇ°¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤¿¤á¤Ë Linux 2.4 ¤Ë²Ã¤¨¤é¤ì¤¿µ¡Ç½¤Ç¤¢¤Ã¤¿¡£
-ÆâÉôŪ¤Ë¤Ï¡¢¤³¤Î¶¦Í­ PID ¤Ï¤¤¤ï¤æ¤ë¤½¤Î¥¹¥ì¥Ã¥É¥°¥ë¡¼¥×¤Î
-¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¼±Ê̻Ҡ(TGID) ¤Ç¤¢¤ë¡£
-Linux 2.4 °Ê¹ß¤Ç¤Ï¡¢
-.BR getpid (2)
-¤Î¸Æ¤Ó½Ð¤·¤Ç¤Ï¤½¤Î¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥× ID ¤òÊÖ¤¹¡£
-
-.\"O The threads within a group can be distinguished by their (system-wide)
-.\"O unique thread IDs (TID).
-.\"O A new thread's TID is available as the function result
-.\"O returned to the caller of
-.\"O .BR clone (),
-.\"O and a thread can obtain
-.\"O its own TID using
-.\"O .BR gettid (2).
-¤¢¤ë¥°¥ë¡¼¥×¤Ë°¤¹¤ë¥¹¥ì¥Ã¥É¤Ï (¥·¥¹¥Æ¥àÁ´ÂΤÇ) °ì°Õ¤Ê¥¹¥ì¥Ã¥É ID (TID)
-¤Ç¶èÊ̤Ǥ­¤ë¡£¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î TID ¤Ï
-.BR clone ()
-¤Î¸Æ¤Ó½Ð¤·¸µ¤Ø´Ø¿ô¤Î·ë²Ì¤È¤·¤ÆÊÖ¤µ¤ì¡¢
-¥¹¥ì¥Ã¥É¤Ï¼«Ê¬¼«¿È¤Î TID ¤ò
-.BR gettid (2)
-¤Ç¼èÆÀ¤Ç¤­¤ë¡£
-
-.\"O When a call is made to
-.\"O .BR clone ()
-.\"O without specifying
-.\"O .BR CLONE_THREAD ,
-.\"O then the resulting thread is placed in a new thread group
-.\"O whose TGID is the same as the thread's TID.
-.\"O This thread is the
-.\"O .I leader
-.\"O of the new thread group.
-.B CLONE_THREAD
-¤ò»ØÄꤻ¤º¤Ë
-.BR clone ()
-¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ë¤È¡¢
-À¸À®¤µ¤ì¤¿¥¹¥ì¥Ã¥É¤Ï¤½¤Î¥¹¥ì¥Ã¥É¤Î TID ¤ÈƱ¤¸ÃͤΠTGID ¤ò»ý¤Ä
-¿·¤·¤¤¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ËÃÖ¤«¤ì¤ë¡£¤³¤Î¥¹¥ì¥Ã¥É¤Ï
-¿·¤·¤¤¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î¡Ö¥ê¡¼¥À¡¼¡×¤Ç¤¢¤ë¡£
-
-.\"O A new thread created with
-.\"O .B CLONE_THREAD
-.\"O has the same parent process as the caller of
-.\"O .BR clone ()
-.\"O (i.e., like
-.\"O .BR CLONE_PARENT ),
-.\"O so that calls to
-.\"O .BR getppid (2)
-.\"O return the same value for all of the threads in a thread group.
-.B CLONE_THREAD
-¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤¿¿·¤·¤¤¥¹¥ì¥Ã¥É¤Ï¡¢
-.RB ( CLONE_PARENT
-¤Î¾ì¹ç¤ÈƱÍͤË)
-.BR clone ()
-¤ò¸Æ¤Ó½Ð¤·¸µ¤ÈƱ¤¸¿Æ¥×¥í¥»¥¹¤ò»ý¤Ä¡£
-¤½¤Î¤¿¤á¡¢
-.BR getppid (2)
-¤ò¸Æ¤Ö¤È¡¢°ì¤Ä¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹¥¹¥ì¥Ã¥É¤ÏÁ´¤ÆƱ¤¸ÃͤòÊÖ¤¹¡£
-.\"O When a
-.\"O .B CLONE_THREAD
-.\"O thread terminates, the thread that created it using
-.\"O .BR clone ()
-.\"O is not sent a
-.\"O .B SIGCHLD
-.\"O (or other termination) signal;
-.\"O nor can the status of such a thread be obtained
-.\"O using
-.\"O .BR wait (2).
-.\"O (The thread is said to be
-.\"O .IR detached .)
-.B CLONE_THREAD
-¤Çºî¤é¤ì¤¿¥¹¥ì¥Ã¥É¤¬½ªÎ»¤·¤¿ºÝ¤Ë¡¢
-¤½¤Î¥¹¥ì¥Ã¥É¤ò
-.BR clone (2)
-¤ò»È¤Ã¤ÆÀ¸À®¤·¤¿¥¹¥ì¥Ã¥É¤Ë¤Ï
-.B SIGCHLD
-(¤â¤·¤¯¤Ï¾¤Î½ªÎ»¥·¥°¥Ê¥ë) ¤ÏÁ÷¿®¤µ¤ì¤Ê¤¤¡£
-¤Þ¤¿¡¢
-.BR wait (2)
-¤ò»È¤Ã¤Æ½ªÎ»¤·¤¿¥¹¥ì¥Ã¥É¤Î¾õÂÖ¤ò¼èÆÀ¤¹¤ë¤³¤È¤â¤Ç¤­¤Ê¤¤
-(¤½¤Î¤è¤¦¤Ê¥¹¥ì¥Ã¥É¤Ï
-.I detached
-(ʬΥ¤µ¤ì¤¿) ¤È¤¤¤ï¤ì¤ë)¡£
-
-.\"O After all of the threads in a thread group terminate
-.\"O the parent process of the thread group is sent a
-.\"O .B SIGCHLD
-.\"O (or other termination) signal.
-¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤¬½ªÎ»¤·¤¿¸å¡¢
-¤½¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î¿Æ¥×¥í¥»¥¹¤Ë
-.B SIGCHLD
-(¤â¤·¤¯¤Ï¾¤Î½ªÎ»¥·¥°¥Ê¥ë) ¤¬Á÷¤é¤ì¤ë¡£
-
-.\"O If any of the threads in a thread group performs an
-.\"O .BR execve (2),
-.\"O then all threads other than the thread group leader are terminated,
-.\"O and the new program is executed in the thread group leader.
-¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤¤¤º¤ì¤«¤Î¥¹¥ì¥Ã¥É¤¬
-.BR execve (2)
-¤ò¼Â¹Ô¤¹¤ë¤È¡¢¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼°Ê³°¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ï
-½ªÎ»¤µ¤ì¡¢¿·¤·¤¤¥×¥í¥»¥¹¤¬¤½¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¡¦¥ê¡¼¥À¡¼¤Î²¼¤Ç
-¼Â¹Ô¤µ¤ì¤ë¡£
-
-.\"O If one of the threads in a thread group creates a child using
-.\"O .BR fork (2),
-.\"O then any thread in the group can
-.\"O .BR wait (2)
-.\"O for that child.
-¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹¥¹¥ì¥Ã¥É¤Î°ì¤Ä¤¬
-.BR fork (2)
-¤ò»È¤Ã¤Æ»Ò¥×¥í¥»¥¹¤òºîÀ®¤·¤¿¾ì¹ç¡¢
-¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î¤É¤Î¥¹¥ì¥Ã¥É¤Ç¤¢¤Ã¤Æ¤â
-¤½¤Î»Ò¶¡¤ò
-.BR wait (2)
-¤Ç¤­¤ë¡£
-
-.\"O Since Linux 2.5.35,
-.\"O .I flags
-.\"O must also include
-.\"O .B CLONE_SIGHAND
-.\"O if
-.\"O .B CLONE_THREAD
-.\"O is specified.
-Linux 2.5.35 °Ê¹ß¤Ç¤Ï¡¢
-.B CLONE_THREAD
-¤ò»ØÄꤹ¤ë¾ì¹ç¡¢
-.I flags
-¤Ë
-.B CLONE_SIGHAND
-¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-
-.\"O Signals may be sent to a thread group as a whole (i.e., a TGID) using
-.\"O .BR kill (2),
-.\"O or to a specific thread (i.e., TID) using
-.\"O .BR tgkill (2).
-.BR kill (2)
-¤ò»È¤Ã¤Æ¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×Á´ÂΠ(¤Ä¤Þ¤ê TGID) ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤â¤Ç¤­¤ì¤Ð¡¢
-.BR tgkill (2)
-¤ò»È¤Ã¤ÆÆÃÄê¤Î¥¹¥ì¥Ã¥É (¤Ä¤Þ¤ê TID) ¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤â¤Ç¤­¤ë¡£
-
-.\"O Signal dispositions and actions are process-wide:
-.\"O if an unhandled signal is delivered to a thread, then
-.\"O it will affect (terminate, stop, continue, be ignored in)
-.\"O all members of the thread group.
-¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤È½èÍý¤Ï¥×¥í¥»¥¹Á´ÂΤ˱ƶÁ¤¹¤ë:
-¥Ï¥ó¥É¥é¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¥·¥°¥Ê¥ë¤¬¤¢¤ë¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤ë¤È¡¢
-¤½¤Î¥·¥°¥Ê¥ë¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¡¼¤Ë±Æ¶Á¤òµÚ¤Ü¤¹
-(½ªÎ»¤·¤¿¤ê¡¢Ää»ß¤·¤¿¤ê¡¢Æ°ºî¤ò·Ñ³¤·¤¿¤ê¡¢Ìµ»ë¤µ¤ì¤¿¤ê¤¹¤ë)¡£
-
-.\"O Each thread has its own signal mask, as set by
-.\"O .BR sigprocmask (2),
-.\"O but signals can be pending either: for the whole process
-.\"O (i.e., deliverable to any member of the thread group),
-.\"O when sent with
-.\"O .BR kill (2);
-.\"O or for an individual thread, when sent with
-.\"O .BR tgkill (2).
-.\"O A call to
-.\"O .BR sigpending (2)
-.\"O returns a signal set that is the union of the signals pending for the
-.\"O whole process and the signals that are pending for the calling thread.
-³Æ¡¹¤Î¥¹¥ì¥Ã¥É¤ÏÆȼ«¤Î¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤ò»ý¤Ã¤Æ¤ª¤ê¡¢
-.BR sigprocmask (2)
-¤ÇÀßÄê¤Ç¤­¤ë¡£
-¤À¤¬¡¢½èÍýÂÔ¤Á¤Î¥·¥°¥Ê¥ë¤Ë¤Ï¡¢
-.BR kill (2)
-¤ÇÁ÷¿®¤µ¤ì¤ë¥×¥í¥»¥¹Á´ÂΤËÂФ¹¤ë¤â¤Î (¤Ä¤Þ¤ê¡¢¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î
-¤É¤Î¥á¥ó¥Ð¡¼¤Ë¤âÇÛÁ÷¤Ç¤­¤ë¤â¤Î) ¤È¡¢
-.BR tgkill (2)
-¤ÇÁ÷¿®¤µ¤ì¤ë¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë¤â¤Î¤¬¤¢¤ê¤¨¤ë¡£
-.BR sigpending (2)
-¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¥×¥í¥»¥¹Á´ÂΤËÂФ¹¤ë½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤È¸Æ¤Ó½Ð¤·¸µ¤Î
-¥¹¥ì¥Ã¥É¤ËÂФ¹¤ë½èÍýÂÔ¤Á¥·¥°¥Ê¥ë¤ò·ë¹ç¤·¤¿¥·¥°¥Ê¥ë½¸¹ç¤¬ÊÖ¤µ¤ì¤ë¡£
-
-.\"O If
-.\"O .BR kill (2)
-.\"O is used to send a signal to a thread group,
-.\"O and the thread group has installed a handler for the signal, then
-.\"O the handler will be invoked in exactly one, arbitrarily selected
-.\"O member of the thread group that has not blocked the signal.
-.\"O If multiple threads in a group are waiting to accept the same signal using
-.\"O .BR sigwaitinfo (2),
-.\"O the kernel will arbitrarily select one of these threads
-.\"O to receive a signal sent using
-.\"O .BR kill (2).
-.BR kill (2)
-¤ò»È¤Ã¤Æ¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤¿¾ì¹ç¤Ç¡¢
-¤½¤Î¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤¬¤½¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬
-ÅÐÏ¿¤µ¤ì¤Æ¤¤¤¿¤È¤­¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Î
-¥á¥ó¥Ð¡¼¤Î¤¦¤Á¡¢¤¿¤À°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤Ç¤À¤±µ¯Æ°¤µ¤ì¤ë¡£¥Ï¥ó¥É¥é¤¬
-µ¯Æ°¤µ¤ì¤ë¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤Î¥·¥°¥Ê¥ë¤ò¶Ø»ß (block) ¤·¤Æ¤¤¤Ê¤¤
-¥á¥ó¥Ð¡¼¤ÎÃ椫¤é°ì¤Ä¤À¤±¤¬¾¡¼ê¤Ë (arbitrarily) Áª¤Ð¤ì¤ë¡£
-¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤¬
-.BR sigwaitinfo (2)
-¤ò»È¤Ã¤ÆƱ¤¸¥·¥°¥Ê¥ë¤òÂԤäƤ¤¤ë¾ì¹ç¡¢
-¤³¤ì¤é¤Î¥¹¥ì¥Ã¥É¤ÎÃ椫¤é°ì¤Ä¤ò¥«¡¼¥Í¥ë¤¬¾¡¼ê¤ËÁªÂò¤·¡¢
-¤½¤Î¥¹¥ì¥Ã¥É¤¬
-.B kill (2)
-¤ò»È¤Ã¤ÆÁ÷¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤ò¼õ¿®¤¹¤ë¡£
-.TP
-.\"O .BR CLONE_UNTRACED " (since Linux 2.5.46)"
-.BR CLONE_UNTRACED " (Linux 2.5.46 °Ê¹ß)"
-.\"O If
-.\"O .B CLONE_UNTRACED
-.\"O is specified, then a tracing process cannot force
-.\"O .B CLONE_PTRACE
-.\"O on this child process.
-.B CLONE_UNTRACED
-¤¬»ØÄꤵ¤ì¤ë¤È¡¢ trace ¤ò¹Ô¤Ã¤Æ¤¤¤ë¥×¥í¥»¥¹¤Ï
-¤³¤Î»Ò¥×¥í¥»¥¹¤Ë
-.B CLONE_PTRACE
-¤òŬÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£
-.TP
-.B CLONE_VFORK
-.\"O If
-.\"O .B CLONE_VFORK
-.\"O is set, the execution of the calling process is suspended
-.\"O until the child releases its virtual memory
-.\"O resources via a call to
-.\"O .BR execve (2)
-.\"O or
-.\"O .BR _exit (2)
-.\"O (as with
-.\"O .BR vfork (2)).
-.B CLONE_VFORK
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢
-.RB ( vfork (2)
-¤ÈƱÍͤË) »Ò¥×¥í¥»¥¹¤¬
-.BR execve (2)
-¤Þ¤¿¤Ï
-.BR _exit (2)
-¤Ë¤è¤Ã¤Æ²¾ÁÛ¥á¥â¥ê¤ò²òÊü¤¹¤ë¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¹Ô¤ÏÄä»ß¤µ¤ì¤ë¡£
-
-.\"O If
-.\"O .B CLONE_VFORK
-.\"O is not set then both the calling process and the child are schedulable
-.\"O after the call, and an application should not rely on execution occurring
-.\"O in any particular order.
-.B CLONE_VFORK
-¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-.BR clone ()
-¸Æ¤Ó½Ð¤·¸å¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î
-ξÊý¤¬¥¹¥±¥¸¥å¡¼¥ëÂоݤȤʤꡢ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤ì¤é¤Î¥×¥í¥»¥¹¤Î
-¼Â¹Ô½ç½ø¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-.TP
-.B CLONE_VM
-.\"O If
-.\"O .B CLONE_VM
-.\"O is set, the calling process and the child process run in the same memory
-.\"O space.
-.\"O In particular, memory writes performed by the calling process
-.\"O or by the child process are also visible in the other process.
-.\"O Moreover, any memory mapping or unmapping performed with
-.\"O .BR mmap (2)
-.\"O or
-.\"O .BR munmap (2)
-.\"O by the child or calling process also affects the other process.
-.B CLONE_VM
-¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤ÏƱ¤¸¥á¥â¥ê¶õ´Ö¤Ç
-¼Â¹Ô¤µ¤ì¤ë¡£Æäˡ¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ä»Ò¥×¥í¥»¥¹¤Î°ìÊý¤¬¥á¥â¥ê¤Ë
-½ñ¤­¹þ¤ó¤ÀÆâÍƤϤ⤦°ìÊý¤Î¥×¥í¥»¥¹¤«¤é¤â¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤µ¤é¤Ë¡¢
-»Ò¥×¥í¥»¥¹¤ä¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î°ìÊý¤¬
-.BR mmap (2)
-¤ä
-.BR munmap (2)
-¤ò»È¤Ã¤Æ¥á¥â¥ê¤ò¥Þ¥Ã¥×¤·¤¿¤ê¥¢¥ó¥Þ¥Ã¥×¤·¤¿¾ì¹ç¡¢
-¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤â±Æ¶Á¤¬µÚ¤Ö¡£
-
-.\"O If
-.\"O .B CLONE_VM
-.\"O is not set, the child process runs in a separate copy of the memory
-.\"O space of the calling process at the time of
-.\"O .BR clone ().
-.\"O Memory writes or file mappings/unmappings performed by one of the
-.\"O processes do not affect the other, as with
-.\"O .BR fork (2).
-.B CLONE_VM
-¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢»Ò¥×¥í¥»¥¹¤Ï
-.BR clone ()
-¤¬¼Â¹Ô¤µ¤ì¤¿»þÅÀ¤Ç¤Î¡¢¿Æ¥×¥í¥»¥¹¤Î¥á¥â¥ê¶õ´Ö¤ò¥³¥Ô¡¼¤·¤¿
-Ê̤Υá¥â¥ê¶õ´Ö¤Ç¼Â¹Ô¤µ¤ì¤ë¡£
-°ìÊý¤Î¥×¥í¥»¥¹¤¬¹Ô¤Ã¤¿¥á¥â¥ê¤Ø¤Î½ñ¤­¹þ¤ß¤ä
-¥Õ¥¡¥¤¥ë¤Î¥Þ¥Ã¥×/¥¢¥ó¥Þ¥Ã¥×¤Ï¡¢
-.BR fork (2)
-¤Î¾ì¹ç¤ÈƱÍÍ¡¢¤â¤¦°ìÊý¤Î¥×¥í¥»¥¹¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¡£
-.SS "sys_clone"
-.\"O The
-.\"O .B sys_clone
-.\"O system call corresponds more closely to
-.\"O .BR fork (2)
-.\"O in that execution in the child continues from the point of the
-.\"O call.
-.\"O Thus,
-.\"O .B sys_clone
-.\"O only requires the
-.\"O .I flags
-.\"O and
-.\"O .I child_stack
-.\"O arguments, which have the same meaning as for
-.\"O .BR clone ().
-.\"O (Note that the order of these arguments differs from
-.\"O .BR clone ().)
-.B sys_clone
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤è¤ê
-.BR fork (2)
-¤Ë¶á¤¤¤«¤¿¤Á¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢»Ò¥×¥í¥»¥¹¤Î¼Â¹Ô¤¬¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤¿¾ì½ê¤«¤é
-³¤±¤é¤ì¤ë¡£
-¤½¤Î¤¿¤á¡¢
-.B sys_clone
-¤¬É¬ÍפȤ¹¤ë°ú¤­¿ô¤Ï
-.I flags
-¤È
-.I child_stack
-¤À¤±¤Ç¤¢¤ê¡¢¤½¤ì¤é¤Ï
-.BR clone ()
-¤ÈƱ¤¸°ÕÌ£¤ò»ý¤Ä
-(¤³¤ì¤é¤Î°ú¤­¿ô¤Î½çÈÖ¤Ï
-.BR clone ()
-¤È¤Ï°Û¤Ê¤ë¤³¤È¤ËÃí°Õ¤»¤è)¡£
-
-.\"O Another difference for
-.\"O .B sys_clone
-.\"O is that the
-.\"O .I child_stack
-.\"O argument may be zero, in which case copy-on-write semantics ensure that the
-.\"O child gets separate copies of stack pages when either process modifies
-.\"O the stack.
-.\"O In this case, for correct operation, the
-.\"O .B CLONE_VM
-.\"O option should not be specified.
-.B sys_clone
-¤Î¤â¤¦°ì¤Ä¤Î°ã¤¤¤Ï¡¢
-.I child_stack
-°ú¤­¿ô¤¬¥¼¥í¤Ç¤âÎɤ¤¤³¤È¤Ç¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢¤É¤Á¤é¤«¤Î¥×¥í¥»¥¹¤¬
-¥¹¥¿¥Ã¥¯¤òÊѹ¹¤·¤¿»þ¤Ë¡¢½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy-on-write) Êý¼°¤Ë¤è¤ê
-»Ò¥×¥í¥»¥¹¤¬¥¹¥¿¥Ã¥¯¡¦¥Ú¡¼¥¸¤ÎÆÈΩ¤·¤¿¥³¥Ô¡¼¤òÆÀ¤é¤ì¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£
-¤³¤Î¾ì¹ç¡¢Àµ¾ï¤ËÆ°ºî¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢
-.B CLONE_VM
-¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
-
-.\"O In Linux 2.4 and earlier,
-.\"O .BR clone ()
-.\"O does not take arguments
-.\"O .IR ptid ,
-.\"O .IR tls ,
-.\"O and
-.\"O .IR ctid .
-Linux 2.4 °ÊÁ°¤Ç¤Ï¡¢
-.BR clone ()
-¤Ï°ú¤­¿ô
-.IR ptid ,
-.IR tls ,
-.IR ctid
-¤ò¼è¤é¤Ê¤¤¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O .\" gettid(2) returns current->pid;
-.\"O .\" getpid(2) returns current->tgid;
-.\"O On success, the thread ID of the child process is returned
-.\"O in the caller's thread of execution.
-.\"O On failure, \-1 is returned
-.\"O in the caller's context, no child process will be created, and
-.\"O .I errno
-.\"O will be set appropriately.
-.\" gettid(2) ¤Ï current->pid ¤òÊÖ¤¹
-.\" getpid(2) ¤Ï current->tgid ¤òÊÖ¤¹
-À®¸ù¤·¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¼Â¹Ô¥¹¥ì¥Ã¥É¤Ë¤Ï»Ò¥×¥í¥»¥¹¤Î¥¹¥ì¥Ã¥ÉID ¤¬ÊÖ¤µ¤ì¤ë¡£
-¼ºÇÔ¤·¤¿¾ì¹ç¡¢ ¸Æ¤Ó½Ð¤·¸µ¤Î¥³¥ó¥Æ¥­¥¹¥È¤Ë¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢»Ò¥×¥í¥»¥¹¤Ï
-ºîÀ®¤µ¤ì¤º¡¢
-.I errno
-¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B EAGAIN
-.\"O Too many processes are already running.
-¤¹¤Ç¤Ë¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤¬Â¿¤¹¤®¤ë¡£
-.TP
-.B EINVAL
-.\"O .B CLONE_SIGHAND
-.\"O was specified, but
-.\"O .B CLONE_VM
-.\"O was not.
-.\"O (Since Linux 2.6.0-test6.)
-.B CLONE_SIGHAND
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¤¬¡¢
-.B CLONE_VM
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
-(Linux 2.6.0-test6 °Ê¹ß)
-.TP
-.B EINVAL
-.\"O .B CLONE_THREAD
-.\"O was specified, but
-.\"O .B CLONE_SIGHAND
-.\"O was not.
-.\"O (Since Linux 2.5.35.)
-.B CLONE_THREAD
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¤¬¡¢
-.B CLONE_SIGHAND
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
-(Linux 2.5.35 °Ê¹ß)
-.\" .TP
-.\" .B EINVAL
-.\"O .\" Precisely one of
-.\"O .\" .B CLONE_DETACHED
-.\"O .\" and
-.\"O .\" .B CLONE_THREAD
-.\"O .\" was specified.
-.\"O .\" (Since Linux 2.6.0-test6.)
-.\" .B CLONE_DETACHED
-.\" ¤È
-.\" .B CLONE_THREAD
-.\" ¤Î¤¤¤º¤ì¤«°ìÊý¤À¤±¤¬»ØÄꤵ¤ì¤¿¡£
-.\" (Linux 2.6.0-test6 °Ê¹ß)
-.TP
-.B EINVAL
-.\"O Both
-.\"O .B CLONE_FS
-.\"O and
-.\"O .B CLONE_NEWNS
-.\"O were specified in
-.\"O .IR flags .
-.B CLONE_FS
-¤È
-.B CLONE_NEWNS
-¤ÎξÊý¤¬
-.I flags
-¤Ë»ØÄꤵ¤ì¤¿¡£
-.TP
-.B EINVAL
-.\"O Both
-.\"O .B CLONE_NEWIPC
-.\"O and
-.\"O .B CLONE_SYSVSEM
-.\"O were specified in
-.\"O .IR flags .
-.B CLONE_NEWIPC
-¤È
-.B CLONE_SYSVSEM
-¤ÎξÊý¤¬
-.I flags
-¤Ë»ØÄꤵ¤ì¤¿¡£
-.TP
-.B EINVAL
-.\"O Both
-.\"O .BR CLONE_NEWPID
-.\"O and
-.\"O .BR CLONE_THREAD
-.\"O were specified in
-.\"O .IR flags .
-.B CLONE_NEWPID
-¤È
-.B CLONE_THREAD
-¤ÎξÊý¤¬
-.I flags
-¤Ë»ØÄꤵ¤ì¤¿¡£
-.TP
-.B EINVAL
-.\"O Returned by
-.\"O .BR clone ()
-.\"O when a zero value is specified for
-.\"O .IR child_stack .
-.I child_stack
-¤Ë¥¼¥í¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë
-.BR clone ()
-¤¬ÊÖ¤¹¡£
-.TP
-.B EINVAL
-.\"O .BR CLONE_NEWIPC
-.\"O was specified in
-.\"O .IR flags ,
-.\"O but the kernel was not configured with the
-.\"O .B CONFIG_SYSVIPC
-.\"O and
-.\"O .BR CONFIG_IPC_NS
-.\"O options.
-.I flags
-¤Ë
-.B CLONE_NEWIPC
-¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó
-.B CONFIG_SYSVIPC
-¤È
-.B CONFIG_IPC_NS
-¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
-.TP
-.B EINVAL
-.\"O .BR CLONE_NEWNET
-.\"O was specified in
-.\"O .IR flags ,
-.\"O but the kernel was not configured with the
-.\"O .B CONFIG_NET_NS
-.\"O option.
-.I flags
-¤Ë
-.B CLONE_NEWNET
-¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó
-.B CONFIG_NET_NS
-¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
-.TP
-.B EINVAL
-.\"O .BR CLONE_NEWPID
-.\"O was specified in
-.\"O .IR flags ,
-.\"O but the kernel was not configured with the
-.\"O .B CONFIG_PID_NS
-.\"O option.
-.I flags
-¤Ë
-.B CLONE_NEWPID
-¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó
-.B CONFIG_PID_NS
-¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
-.TP
-.B EINVAL
-.\"O .BR CLONE_NEWUTS
-.\"O was specified in
-.\"O .IR flags ,
-.\"O but the kernel was not configured with the
-.\"O .B CONFIG_UTS
-.\"O option.
-.I flags
-¤Ë
-.B CLONE_NEWUTS
-¤¬»ØÄꤵ¤ì¤¿¤¬¡¢¥«¡¼¥Í¥ë¤Ç¥ª¥×¥·¥ç¥ó
-.B CONFIG_UTS
-¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
-.TP
-.B ENOMEM
-.\"O Cannot allocate sufficient memory to allocate a task structure for the
-.\"O child, or to copy those parts of the caller's context that need to be
-.\"O copied.
-»Ò¥×¥í¥»¥¹¤Î¤¿¤á¤Ë³ÎÊݤ¹¤Ù¤­¥¿¥¹¥¯¹½Â¤ÂΤ䡢¸Æ¤Ó½Ð¤·¸µ¤Î¥³¥ó¥Æ¥­¥¹¥È¤Î
-°ìÉô¤ò¥³¥Ô¡¼¤¹¤ë¤Î¤ËɬÍפʥá¥â¥ê¤ò½½Ê¬¤Ë³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£
-.TP
-.B EPERM
-.\"O .BR CLONE_NEWIPC ,
-.\"O .BR CLONE_NEWNET ,
-.\"O .BR CLONE_NEWNS ,
-.\"O .BR CLONE_NEWPID ,
-.\"O or
-.\"O .BR CLONE_NEWUTS
-.\"O was specified by an unprivileged process (process without \fBCAP_SYS_ADMIN\fP).
-ÈóÆø¢¥×¥í¥»¥¹ (\fBCAP_SYS_ADMIN\fP ¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹) ¤¬
-.BR CLONE_NEWIPC ,
-.BR CLONE_NEWNET ,
-.BR CLONE_NEWNS ,
-.BR CLONE_NEWPID ,
-.BR CLONE_NEWUTS
-¤ò»ØÄꤷ¤¿¡£
-.TP
-.B EPERM
-.\"O .B CLONE_PID
-.\"O was specified by a process other than process 0.
-PID ¤¬ 0 °Ê³°¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ
-.B CLONE_PID
-¤¬»ØÄꤵ¤ì¤¿¡£
-.\"O .SH VERSIONS
-.SH ¥Ð¡¼¥¸¥ç¥ó
-.\"O There is no entry for
-.\"O .BR clone ()
-.\"O in libc5.
-.\"O glibc2 provides
-.\"O .BR clone ()
-.\"O as described in this manual page.
-libc5 ¤Ë¤Ï
-.BR clone ()
-¤Ï¤Ê¤¤¡£glibc2 ¤Ç¤Ï
-.BR clone ()
-¤¬Ä󶡤µ¤ì¤Æ¤ª¤ê¡¢¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ëµ­ºÜ¤ÎÄ̤ê¤Ç¤¢¤ë¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O The
-.\"O .BR clone ()
-.\"O and
-.\"O .B sys_clone
-.\"O calls are Linux-specific and should not be used in programs
-.\"O intended to be portable.
-.BR clone ()
-¤È
-.B sys_clone
-¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­
-¤Ç¤Ï¤Ê¤¤¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O In the kernel 2.4.x series,
-.\"O .B CLONE_THREAD
-.\"O generally does not make the parent of the new thread the same
-.\"O as the parent of the calling process.
-.\"O However, for kernel versions 2.4.7 to 2.4.18 the
-.\"O .B CLONE_THREAD
-.\"O flag implied the
-.\"O .B CLONE_PARENT
-.\"O flag (as in kernel 2.6).
-¥«¡¼¥Í¥ë 2.4.x ·ÏÎó¤Ç¤Ï¡¢°ìÈÌŪ¤Ë¤Ï
-.B CLONE_THREAD
-¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¤â¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î¿Æ¤ò
-¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¿Æ¤ÈƱ¤¸¤Ë¤Ï¤·¤Ê¤¤¡£
-¤·¤«¤·¡¢¥Ð¡¼¥¸¥ç¥ó 2.4.7¡Á2.4.18 ¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢
-(¥«¡¼¥Í¥ë 2.6 ¤ÈƱ¤¸¤è¤¦¤Ë) CLONE_THREAD ¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢
-°ÅÌۤΤ¦¤Á¤Ë CLONE_PARENT ¥Õ¥é¥°¤ò»ØÄꤷ¤¿¤³¤È¤Ë¤Ê¤ë¡£
-
-.\"O For a while there was
-.\"O .B CLONE_DETACHED
-.\"O (introduced in 2.5.32):
-.\"O parent wants no child-exit signal.
-.\"O In 2.6.2 the need to give this
-.\"O together with
-.\"O .B CLONE_THREAD
-.\"O disappeared.
-.\"O This flag is still defined, but has no effect.
-.B CLONE_DETACHED
-¤È¤¤¤¦¥Õ¥é¥°¤¬¡¢2.5.32 ¤ÇƳÆþ¤µ¤ì¤Æ°ÊÍ褷¤Ð¤é¤¯¤Î´Ö¸ºß¤·¤¿¡£
-¤³¤Î¥Õ¥é¥°¤Ï¿Æ¥×¥í¥»¥¹¤¬»Ò¥×¥í¥»¥¹½ªÎ»¤Î¥·¥°¥Ê¥ë¤òɬÍפȤ·¤Ê¤¤¤³¤È¤ò
-ɽ¤¹¤â¤Î¤Ç¤¢¤ë¡£
-2.6.2 ¤Ç¡¢ CLONE_DETATCHED ¤ò CLONE_THREAD ¤È°ì½ï¤Ë»ØÄꤹ¤ëɬÍפϤʤ¯¤Ê¤Ã¤¿¡£
-¤³¤Î¥Õ¥é¥°¤Ï¤Þ¤ÀÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢²¿¤Î¸ú²Ì¤â¤Ê¤¤¡£
-
-.\"O On i386,
-.\"O .BR clone ()
-.\"O should not be called through vsyscall, but directly through
-.\"O .IR "int $0x80" .
-i386 ¾å¤Ç¤Ï¡¢
-.BR clone ()
-¤Ï vsyscall ·Ðͳ¤Ç¤Ï¤Ê¤¯¡¢Ä¾ÀÜ
-.I "int $0x80"
-·Ðͳ¤Ç¸Æ¤Ó½Ð¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-
-.\"O On ia64, a different system call is used:
-ia64 ¤Ç¤Ï¡¢Ê̤Υ·¥¹¥Æ¥à¥³¡¼¥ë¤¬»ÈÍѤµ¤ì¤ë:
+このフラグは Linux 2.6.25 以降では\fI非推奨\fPであり、
+Linux 2.6.38 で完全に\fI削除\fPされた。
+.TP 
+\fBCLONE_SYSVSEM\fP (Linux 2.5.10 以降)
+\fBCLONE_SYSVSEM\fP がセットされると、子プロセスと呼び出し元プロセスは一つの System\ V セマフォのアンドゥ値リスト
+(\fBsemop\fP(2)  参照) を共有する。このフラグがセットされていなければ、 子プロセスは独自のアンドゥリストを持つ
+(リストの初期値は空である)。
+.TP 
+\fBCLONE_THREAD\fP (Linux 2.4.0\-test8以降)
+\fBCLONE_THREAD\fP が設定された場合、子プロセスは呼び出し元のプロセスと同じスレッドグループに 置かれる。 \fBCLONE_THREAD\fP
+についての以降の議論を読みやすくするため、 「スレッド」という用語はスレッドグループの中のプロセスを 参照するのに使うこととする。
+
+スレッドグループは、 スレッド集合で一つの PID を共有するという POSIX スレッドの概念をサポートするために Linux 2.4
+に加えられた機能であった。 内部的には、この共有 PID はいわゆるそのスレッドグループの スレッドグループ識別子 (TGID) である。 Linux
+2.4 以降では、 \fBgetpid\fP(2)  の呼び出しではそのプロセスのスレッドグループ ID を返す。
+
+あるグループに属するスレッドは (システム全体で) 一意なスレッド ID (TID)  で区別できる。新しいスレッドの TID は \fBclone\fP()
+の呼び出し元へ関数の結果として返され、 スレッドは自分自身の TID を \fBgettid\fP(2)  で取得できる。
+
+\fBCLONE_THREAD\fP を指定せずに \fBclone\fP()  の呼び出しが行われると、 生成されたスレッドはそのスレッドの TID と同じ値の
+TGID を持つ 新しいスレッドグループに置かれる。このスレッドは 新しいスレッドグループの「リーダー」である。
+
+\fBCLONE_THREAD\fP を指定して作成された新しいスレッドは、 (\fBCLONE_PARENT\fP の場合と同様に)  \fBclone\fP()
+を呼び出し元と同じ親プロセスを持つ。 そのため、 \fBgetppid\fP(2)  を呼ぶと、一つのスレッドグループに属すスレッドは全て同じ値を返す。
+\fBCLONE_THREAD\fP で作られたスレッドが終了した際に、 そのスレッドを \fBclone\fP()  を使って生成したスレッドには
+\fBSIGCHLD\fP (もしくは他の終了シグナル) は送信されない。 また、 \fBwait\fP(2)
+を使って終了したスレッドの状態を取得することもできない (そのようなスレッドは \fIdetached\fP (分離された) といわれる)。
+
+スレッドグループに属す全てのスレッドが終了した後、 そのスレッドグループの親プロセスに \fBSIGCHLD\fP (もしくは他の終了シグナル) が送られる。
+
+スレッドグループに属すいずれかのスレッドが \fBexecve\fP(2)  を実行すると、スレッドグループリーダー以外の全てのスレッドは
+終了され、新しいプロセスがそのスレッドグループリーダーの下で 実行される。
+
+スレッドグループに属すスレッドの一つが \fBfork\fP(2)  を使って子プロセスを作成した場合、 スレッドグループのどのスレッドであっても その子供を
+\fBwait\fP(2)  できる。
+
+Linux 2.5.35 以降では、 \fBCLONE_THREAD\fP を指定する場合、 \fIflags\fP に \fBCLONE_SIGHAND\fP
+も含まれていなければならない (Linux 2.6.0\-test6 以降では、 \fBCLONE_SIGHAND\fP を指定する場合 \fBCLONE_VM\fP
+も指定する必要がある点に注意すること)。
+
+\fBkill\fP(2)  を使ってスレッドグループ全体 (つまり TGID) にシグナルを送ることもできれば、 \fBtgkill\fP(2)
+を使って特定のスレッド (つまり TID) にシグナルを送ることもできる。
+
+シグナルの配送と処理はプロセス全体に影響する: ハンドラを設定していないシグナルがあるスレッドに配送されると、
+そのシグナルはスレッドグループの全メンバーに影響を及ぼす (終了したり、停止したり、動作を継続したり、無視されたりする)。
+
+各々のスレッドは独自のシグナルマスクを持っており、 \fBsigprocmask\fP(2)  で設定できる。 だが、処理待ちのシグナルには、
+\fBkill\fP(2)  で送信されるプロセス全体に対するもの (つまり、スレッドグループの どのメンバーにも配送できるもの) と、
+\fBtgkill\fP(2)  で送信される個々のスレッドに対するものがありえる。 \fBsigpending\fP(2)
+を呼び出すと、プロセス全体に対する処理待ちシグナルと呼び出し元の スレッドに対する処理待ちシグナルを結合したシグナル集合が返される。
+
+\fBkill\fP(2)  を使ってスレッドグループにシグナルが送られた場合で、 そのスレッドグループがそのシグナルに対するシグナルハンドラが
+登録されていたときには、シグナルハンドラはスレッドグループの メンバーのうち、ただ一つのスレッドでだけ起動される。ハンドラが
+起動されるスレッドは、そのシグナルを禁止 (block) していない メンバーの中から一つだけが勝手に (arbitrarily) 選ばれる。
+スレッドグループに属す複数のスレッドが \fBsigwaitinfo\fP(2)  を使って同じシグナルを待っている場合、
+これらのスレッドの中から一つをカーネルが勝手に選択し、 そのスレッドが \fBkill (2)\fP を使って送信されたシグナルを受信する。
+.TP 
+\fBCLONE_UNTRACED\fP (Linux 2.5.46 以降)
+\fBCLONE_UNTRACED\fP が指定されると、 trace を行っているプロセスは この子プロセスに \fBCLONE_PTRACE\fP
+を適用することができない。
+.TP 
+\fBCLONE_VFORK\fP (Linux 2.2 以降)
+\fBCLONE_VFORK\fP が設定された場合、 (\fBvfork\fP(2)  と同様に) 子プロセスが \fBexecve\fP(2)  または
+\fB_exit\fP(2)  によって仮想メモリを解放するまで、呼び出し元のプロセスの実行は停止される。
+
+\fBCLONE_VFORK\fP が設定されていない場合、 \fBclone\fP()  呼び出し後は、呼び出し元のプロセスと子プロセスの
+両方がスケジュール対象となり、アプリケーションはこれらのプロセスの 実行順序に依存しないようにすべきである。
+.TP 
+\fBCLONE_VM\fP (Linux 2.0 以降)
+\fBCLONE_VM\fP が設定された場合、呼び出し元のプロセスと子プロセスは同じメモリ空間で
+実行される。特に、呼び出し元のプロセスや子プロセスの一方がメモリに 書き込んだ内容はもう一方のプロセスからも見ることができる。さらに、
+子プロセスや呼び出し元のプロセスの一方が \fBmmap\fP(2)  や \fBmunmap\fP(2)  を使ってメモリをマップしたりアンマップした場合、
+もう一方のプロセスにも影響が及ぶ。
+
+\fBCLONE_VM\fP が設定されていない場合、子プロセスは \fBclone\fP()  が実行された時点での、親プロセスのメモリ空間をコピーした
+別のメモリ空間で実行される。 一方のプロセスが行ったメモリへの書き込みや ファイルのマップ/アンマップは、 \fBfork\fP(2)
+の場合と同様、もう一方のプロセスには影響しない。
+.SS 素のシステムコールのインターフェース
+素の \fBclone\fP システムコールは、より \fBfork\fP(2) に近いかたちになっており、
+子プロセスの実行が呼び出しが行われた場所から続けられる。 そのため、 \fBclone\fP() ラッパー関数の引き数 \fIfn\fP と \fIarg\fP
+は省略される。 また、 引き数の順序も違っている。 x86 と他の多くのアーキテクチャにおける、 素のシステムコールのインターフェースは、
+おおまかには次のようになっている。
+.in +4
 .nf
 
-.BI "int __clone2(int (*" "fn" ")(void *), "
-.BI "             void *" child_stack_base ", size_t " stack_size ,
-.BI "             int " flags ", void *" "arg" ", ... "
-.BI "          /* pid_t *" ptid ", struct user_desc *" tls \
-", pid_t *" ctid " */ );"
+\fBlong clone(unsigned long \fP\fIflags\fP\fB, void *\fP\fIchild_stack\fP\fB,\fP
+\fB           void *\fP\fIptid\fP\fB, void *\fP\fIctid\fP\fB,\fP
+\fB           struct pt_regs *\fP\fIregs\fP\fB);\fP
+
 .fi
+.in
+生のシステムコールのもう一つの違いは、 \fIchild_stack\fP 引き数がゼロでも良いことである。この場合には、どちらかのプロセスが
+スタックを変更した時に、書き込み時コピー (copy\-on\-write) 方式により
+子プロセスがスタックページの独立したコピーを得られることが保証される。 この場合、正常に動作させるためには、 \fBCLONE_VM\fP
+オプションを指定してはならない。
+
+いくつかのアーキテクチャでは、システムコールの引き数の順序は上記とは異なっている。 microblaze, ARM, ARM 64, PA\-RISC,
+arc, Power PC, xtensa, MIPS アーキテクチャでは、 4 番目と 5 番目の引き数の順番が逆である。 cris と s390
+アーキテクチャでは、最初と 2 番目の引き数の順番が逆である。
+.SS "blackfin, m68k, sparc"
+blackfin, m68k, sparc では引き数渡しの規約が上記の説明とは異なる。 詳細は、カーネル (と glibc) のソースを参照のこと。
+.SS ia64
+ia64 では、別のインターフェースが使用される:
+.nf
+
+\fBint __clone2(int (*\fP\fIfn\fP\fB)(void *), \fP
+\fB             void *\fP\fIchild_stack_base\fP\fB, size_t \fP\fIstack_size\fP\fB,\fP
+\fB             int \fP\fIflags\fP\fB, void *\fP\fIarg\fP\fB, ... \fP
+\fB          /* pid_t *\fP\fIptid\fP\fB, struct user_desc *\fP\fItls\fP\fB, pid_t *\fP\fIctid\fP\fB */ );\fP
+.fi
+.PP
+上記のプロトタイプは glibc ラッパー関数用のものである。 素のシステムコールのインターフェースには引き数 \fIfn\fP と \fIarg\fP がない。
+また、引き数の順序が変わり、 \fIflags\fP が最初の引き数で、 \fItls\fP が最後の引き数である。
 .PP
-.\"O The
-.\"O .BR __clone2 ()
-.\"O system call operates in the same way as
-.\"O .BR clone (),
-.\"O except that
-.\"O .I child_stack_base
-.\"O points to the lowest address of the child's stack area,
-.\"O and
-.\"O .I stack_size
-.\"O specifies the size of the stack pointed to by
-.\"O .IR child_stack_base .
-.BR __clone2 ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
-.BR clone ()
-¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¤¬¡¢°Ê²¼¤ÎÅÀ¤¬°Û¤Ê¤ë:
-.I child_stack_base
-¤Ï»Ò¥×¥í¥»¥¹¤Î¥¹¥¿¥Ã¥¯¥¨¥ê¥¢¤ÎºÇ¾®¤Î¥¢¥É¥ì¥¹¤ò»Ø¤·¡¢
-.I stack_size
-¤Ï
-.I child_stack_base
-¤¬»Ø¤·¼¨¤¹¥¹¥¿¥Ã¥¯¥¨¥ê¥¢¤ÎÂ礭¤µ¤ò¼¨¤¹¡£
-.\"O .SH BUGS
-.SH ¥Ð¥°
-.\"O Versions of the GNU C library that include the NPTL threading library
-.\"O contain a wrapper function for
-.\"O .BR getpid (2)
-.\"O that performs caching of PIDs.
-NPTL ¥¹¥ì¥Ã¥É¡¦¥é¥¤¥Ö¥é¥ê¤ò´Þ¤ó¤Ç¤¤¤ë GNU C ¥é¥¤¥Ö¥é¥ê¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó
-¤Ë¤Ï¡¢
-.BR getpid (2)
-¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬´Þ¤Þ¤ì¤Æ¤ª¤ê¡¢¤³¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï PID ¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¡£
-.\"O This caching relies on support in the glibc wrapper for
-.\"O .BR clone (),
-.\"O but as currently implemented,
-.\"O the cache may not be up to date in some circumstances.
-¤³¤Î¥­¥ã¥Ã¥·¥å½èÍý¤¬Àµ¤·¤¯Æ°ºî¤¹¤ë¤¿¤á¤Ë¤Ï glibc ¤Î
-.BR clone (2)
-¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤Î½õ¤±¤¬É¬ÍפÀ¤¬¡¢¸½¾õ¤Î¼ÂÁõ¤Ç¤Ï¡¢
-¤¢¤ë¾õ¶·²¼¤Ë¤ª¤¤¤Æ¥­¥ã¥Ã¥·¥å¤¬ºÇ¿·¤È¤Ê¤é¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ë¡£
-.\"O In particular,
-.\"O if a signal is delivered to the child immediately after the
-.\"O .BR clone ()
-.\"O call, then a call to
-.\"O .BR getpid ()
-.\"O in a handler for the signal may return the PID
-.\"O of the calling process ("the parent"),
-.\"O if the clone wrapper has not yet had a chance to update the PID
-.\"O cache in the child.
-Æäˡ¢
-.BR clone ()
-¤Î¸Æ¤Ó½Ð¤·Ä¾¸å¤Ë¥·¥°¥Ê¥ë¤¬»Ò¥×¥í¥»¥¹¤ËÇÛÁ÷¤µ¤ì¤¿¾ì¹ç¤Ë¡¢
-¤½¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ï¥ó¥É¥éÆâ¤Ç
-.BR getpid ()
-¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤ì¤Þ¤Ç¤Ë clone ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤¬»Ò¥×¥í¥»¥¹¤Î PID ¥­¥ã¥Ã¥·¥å¤ò
-¹¹¿·¤¹¤ëµ¡²ñ¤¬ÆÀ¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹ ("¿Æ¥×¥í¥»¥¹") ¤Î PID ¤¬
-ÊÖ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
-.\"O (This discussion ignores the case where the child was created using
-.\"O .BR CLONE_THREAD ,
-.\"O when
-.\"O .BR getpid ()
-.\"O .I should
-.\"O return the same value in the child and in the process that called
-.\"O .BR clone (),
-.\"O since the caller and the child are in the same thread group.
-.\"O The stale-cache problem also does not occur if the
-.\"O .I flags
-.\"O argument includes
-.\"O .BR CLONE_VM .)
-(¤³¤ÎµÄÏÀ¤Ç¤Ï¡¢»Ò¥×¥í¥»¥¹¤¬
-.B CLONE_THREAD
-¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤Î¤³¤È¤Ï̵»ë¤·¤Æ¤¤¤ë¡£
-»Ò¥×¥í¥»¥¹¤¬
-.B CLONE_THREAD
-¤òºî¤Ã¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢
-¸Æ¤Ó½Ð¤·¸µ¤È»Ò¥×¥í¥»¥¹¤ÏƱ¤¸¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤Î¤Ç¡¢
-.BR getpid ()
-¤Ï»Ò¥×¥í¥»¥¹¤È
-.BR clone ()
-¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ÇƱ¤¸ÃͤòÊÖ¤¹¤Î¤¬¡ÖÀµ¤·¤¤¡×¡£
-¥­¥ã¥Ã¥·¥å¤¬ºÇ¿·¤È¤Ê¤é¤Ê¤¤ÌäÂê (stale-cache problem) ¤Ï¡¢
-.I flags
-¤Ë
-.B CLONE_VM
-¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤âȯÀ¸¤·¤Ê¤¤¡£)
-.\"O To get the truth, it may be necessary to use code such as the following:
-ËÜÅö¤ÎÃͤòÆÀ¤ë¤¿¤á¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ê¥³¡¼¥É¤ò»È¤¦É¬Íפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
+\fB__clone2\fP() は \fBclone\fP() と同じように動作するが、以下の点が異なる: \fIchild_stack_base\fP
+は子プロセスのスタックエリアの最小のアドレスを指し、 \fIstack_size\fP は \fIchild_stack_base\fP
+が指し示すスタックエリアの大きさを示す。
+.SS "Linux 2.4 以前"
+Linux 2.4 以前では、 \fBclone\fP()  は引き数 \fIptid\fP, \fItls\fP, \fIctid\fP を取らない。
+.SH 返り値
+.\" gettid(2) returns current->pid;
+.\" getpid(2) returns current->tgid;
+成功した場合、呼び出し元の実行スレッドには子プロセスのスレッドID が返される。 失敗した場合、 呼び出し元のコンテキストには \-1
+が返され、子プロセスは 作成されず、 \fIerrno\fP が適切に設定される。
+.SH エラー
+.TP 
+\fBEAGAIN\fP
+すでに実行中のプロセスが多すぎる。
+.TP 
+\fBEINVAL\fP
+\fBCLONE_SIGHAND\fP が指定されていたが、 \fBCLONE_VM\fP が指定されていなかった。 (Linux 2.6.0\-test6 以降)
+.TP 
+\fBEINVAL\fP
+.\" .TP
+.\" .B EINVAL
+.\" Precisely one of
+.\" .B CLONE_DETACHED
+.\" and
+.\" .B CLONE_THREAD
+.\" was specified.
+.\" (Since Linux 2.6.0-test6.)
+\fBCLONE_THREAD\fP が指定されていたが、 \fBCLONE_SIGHAND\fP が指定されていなかった。 (Linux 2.5.35 以降)
+.TP 
+\fBEINVAL\fP
+\fBCLONE_FS\fP と \fBCLONE_NEWNS\fP の両方が \fIflags\fP に指定された。
+.TP 
+\fBEINVAL\fP
+\fBCLONE_NEWIPC\fP と \fBCLONE_SYSVSEM\fP の両方が \fIflags\fP に指定された。
+.TP 
+\fBEINVAL\fP
+\fBCLONE_NEWPID\fP と \fBCLONE_THREAD\fP の両方が \fIflags\fP に指定された。
+.TP 
+\fBEINVAL\fP
+\fIchild_stack\fP にゼロを指定した場合に \fBclone\fP()  が返す。
+.TP 
+\fBEINVAL\fP
+\fIflags\fP に \fBCLONE_NEWIPC\fP が指定されたが、カーネルでオプション \fBCONFIG_SYSVIPC\fP と
+\fBCONFIG_IPC_NS\fP が有効になっていなかった。
+.TP 
+\fBEINVAL\fP
+\fIflags\fP に \fBCLONE_NEWNET\fP が指定されたが、カーネルでオプション \fBCONFIG_NET_NS\fP が有効になっていなかった。
+.TP 
+\fBEINVAL\fP
+\fIflags\fP に \fBCLONE_NEWPID\fP が指定されたが、カーネルでオプション \fBCONFIG_PID_NS\fP が有効になっていなかった。
+.TP 
+\fBEINVAL\fP
+\fIflags\fP に \fBCLONE_NEWUTS\fP が指定されたが、カーネルでオプション \fBCONFIG_UTS\fP が有効になっていなかった。
+.TP 
+\fBENOMEM\fP
+子プロセスのために確保すべきタスク構造体や、呼び出し元のコンテキストの 一部をコピーするのに必要なメモリを十分に割り当てることができない。
+.TP 
+\fBEPERM\fP
+非特権プロセス (\fBCAP_SYS_ADMIN\fP を持たないプロセス) が \fBCLONE_NEWIPC\fP, \fBCLONE_NEWNET\fP,
+\fBCLONE_NEWNS\fP, \fBCLONE_NEWPID\fP, \fBCLONE_NEWUTS\fP を指定した。
+.TP 
+\fBEPERM\fP
+PID が 0 以外のプロセスによって \fBCLONE_PID\fP が指定された。
+.SH バージョン
+libc5 には \fBclone\fP()  はない。glibc2 では \fBclone\fP()  が提供されており、このマニュアルページに記載の通りである。
+.SH 準拠
+\fBclone\fP() は Linux 特有であり、移植を考慮したプログラムでは使用すべき ではない。
+.SH 注意
+カーネル 2.4.x 系列では、一般的には \fBCLONE_THREAD\fP フラグを指定しても新しいスレッドの親を
+呼び出し元プロセスの親と同じにはしない。 しかし、バージョン 2.4.7〜2.4.18 のカーネルでは、 (カーネル 2.6 と同じように)
+CLONE_THREAD フラグを指定すると、 暗黙のうちに CLONE_PARENT フラグを指定したことになる。
+
+\fBCLONE_DETACHED\fP というフラグが、2.5.32 で導入されて以来しばらくの間存在した。
+このフラグは親プロセスが子プロセス終了のシグナルを必要としないことを 表すものである。 2.6.2 で、 CLONE_DETATCHED を
+CLONE_THREAD と一緒に指定する必要はなくなった。 このフラグはまだ定義されているが、何の効果もない。
+
+i386 上では、 \fBclone\fP()  は vsyscall 経由ではなく、直接 \fIint $0x80\fP 経由で呼び出すべきである。
+.SH バグ
+NPTL スレッドライブラリを含んでいる GNU C ライブラリのいくつかのバージョン には、 \fBgetpid\fP(2)
+のラッパー関数が含まれており、このラッパー関数は PID をキャッシュする。 このキャッシュ処理が正しく動作するためには glibc の
+\fBclone\fP()  のラッパー関数での助けが必要だが、現状の実装では、 ある状況下においてキャッシュが最新とならない可能性がある。 特に、
+\fBclone\fP()  の呼び出し直後にシグナルが子プロセスに配送された場合に、 そのシグナルに対するハンドラ内で \fBgetpid\fP(2)
+を呼び出すと、それまでに clone のラッパー関数が子プロセスの PID キャッシュを 更新する機会が得られていなければ、呼び出し元プロセス
+("親プロセス") の PID が 返される可能性がある。 (この議論では、子プロセスが \fBCLONE_THREAD\fP
+を使って作成された場合のことは無視している。 子プロセスが \fBCLONE_THREAD\fP を作って作成された場合には、
+呼び出し元と子プロセスは同じスレッドグループに属すので、 \fBgetpid\fP(2)  は子プロセスと \fBclone\fP()
+を呼び出したプロセスで同じ値を返すのが「正しい」。 キャッシュが最新とならない問題 (stale\-cache problem) は、 \fIflags\fP
+に \fBCLONE_VM\fP が含まれている場合にも発生しない。)  本当の値を得るためには、次のようなコードを使う必要があるかもしれない。
 .nf
 
     #include <syscall.h>
@@ -1816,16 +552,102 @@ NPTL 
 .\" See also the following bug reports
 .\" https://bugzilla.redhat.com/show_bug.cgi?id=417521
 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=6910
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR fork (2),
-.BR futex (2),
-.BR getpid (2),
-.BR gettid (2),
-.BR set_thread_area (2),
-.BR set_tid_address (2),
-.BR tkill (2),
-.BR unshare (2),
-.BR wait (2),
-.BR capabilities (7),
-.BR pthreads (7)
+.SH 例
+以下のプログラムは、 別の UTS 名前空間で動作する子プロセスを \fBclone\fP() を使って作成する例である。 子プロセスは、自分の UTS
+名前空間においてホスト名を変更する。 それから、親プロセスと子プロセスの両方でシステムのホスト名を表示し、 親プロセスと子プロセスの UTS
+名前空間でホスト名が異なることを確認する。 このプログラムの使用方法については \fBsetns\fP(2) を参照。
+.SS プログラムのソース
+.nf
+#define _GNU_SOURCE
+#include <sys/wait.h>
+#include <sys/utsname.h>
+#include <sched.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \e
+                        } while (0)
+
+static int              /* clone された子プロセスの開始関数 */
+childFunc(void *arg)
+{
+    struct utsname uts;
+
+    /* 子プロセスの UTS 名前空間でホスト名を変更する */
+
+    if (sethostname(arg, strlen(arg)) == \-1)
+        errExit("sethostname");
+
+    /* ホスト名を取得し表示する */
+
+    if (uname(&uts) == \-1)
+        errExit("uname");
+    printf("uts.nodename in child:  %s\en", uts.nodename);
+
+    /* sleep を使ってしばらく名前空間をオープンされたままにする。
+       これにより実験を行うことができる \-\- 例えば、
+       別のプロセスがこの名前空間に参加するなど。 */
+
+    sleep(200);
+
+    return 0;           /* 子プロセスを終了する */
+}
+
+#define STACK_SIZE (1024 * 1024)    /* clone される子プロセスのスタックサイズ */
+
+int
+main(int argc, char *argv[])
+{
+    char *stack;                    /* スタックバッファの先頭 */
+    char *stackTop;                 /* スタックバッファの末尾 */
+    pid_t pid;
+    struct utsname uts;
+
+    if (argc < 2) {
+        fprintf(stderr, "Usage: %s <child\-hostname>\en", argv[0]);
+        exit(EXIT_SUCCESS);
+    }
+
+    /* 子プロセス用のスタックを割り当てる */
+
+    stack = malloc(STACK_SIZE);
+    if (stack == NULL)
+        errExit("malloc");
+    stackTop = stack + STACK_SIZE;  /* スタックは下方向に伸びるものとする */
+
+    /* 自分専用の UTS 名前空間を持つ子プロセスを作成する;
+       子プロセスは childFunc() の実行を開始する */
+
+    pid = clone(childFunc, stackTop, CLONE_NEWUTS | SIGCHLD, argv[1]);
+    if (pid == \-1)
+        errExit("clone");
+    printf("clone() returned %ld\en", (long) pid);
+
+    /* 親プロセスの実行はここに来る */
+
+    sleep(1);           /* 子プロセスがホスト名を変更する時間を与える */
+
+    /* 親プロセスの UTS 名前空間でのホスト名を表示する;
+       これは子プロセスの UTS 名前空間でのホスト名とは異なる */
+
+    if (uname(&uts) == \-1)
+        errExit("uname");
+    printf("uts.nodename in parent: %s\en", uts.nodename);
+
+    if (waitpid(pid, NULL, 0) == \-1)    /* 子プロセスを待つ */
+        errExit("waitpid");
+    printf("child has terminated\en");
+
+    exit(EXIT_SUCCESS);
+}
+.fi
+.SH 関連項目
+\fBfork\fP(2), \fBfutex\fP(2), \fBgetpid\fP(2), \fBgettid\fP(2), \fBkcmp\fP(2),
+\fBset_thread_area\fP(2), \fBset_tid_address\fP(2), \fBsetns\fP(2), \fBtkill\fP(2),
+\fBunshare\fP(2), \fBwait\fP(2), \fBcapabilities\fP(7), \fBpthreads\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.67 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。