mirror of https://github.com/mkerrisk/man-pages
clone.2: Place list of CLONE_* flags in alphabetical order
(No content changes.) Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
24bbe02c17
commit
f5dbc7c8e9
290
man2/clone.2
290
man2/clone.2
|
@ -43,7 +43,7 @@
|
||||||
.\" FIXME 2.6.25: CLONE_IO flag to clone() causes I/O contexts (used in the
|
.\" FIXME 2.6.25: CLONE_IO flag to clone() causes I/O contexts (used in the
|
||||||
.\" CFQ block I/O scheduler) to be shared with the new child process.
|
.\" CFQ block I/O scheduler) to be shared with the new child process.
|
||||||
.\"
|
.\"
|
||||||
.TH CLONE 2 2008-09-23 "Linux" "Linux Programmer's Manual"
|
.TH CLONE 2 2008-11-18 "Linux" "Linux Programmer's Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
clone, __clone2 \- create a child process
|
clone, __clone2 \- create a child process
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -155,53 +155,20 @@ may also be bitwise-or'ed with zero or more of the following constants,
|
||||||
in order to specify what is shared between the calling process
|
in order to specify what is shared between the calling process
|
||||||
and the child process:
|
and the child process:
|
||||||
.TP
|
.TP
|
||||||
.BR CLONE_PARENT " (since Linux 2.3.12)"
|
.BR CLONE_CHILD_CLEARTID " (since Linux 2.5.49)"
|
||||||
If
|
Erase child thread ID at location
|
||||||
.B CLONE_PARENT
|
.I child_tidptr
|
||||||
is set, then the parent of the new child (as returned by
|
in child memory when the child exits, and do a wakeup on the futex
|
||||||
.BR getppid (2))
|
at that address.
|
||||||
will be the same as that of the calling process.
|
The address involved may be changed by the
|
||||||
|
.BR set_tid_address (2)
|
||||||
If
|
system call.
|
||||||
.B CLONE_PARENT
|
This is used by threading libraries.
|
||||||
is not set, then (as with
|
|
||||||
.BR fork (2))
|
|
||||||
the child's parent is the calling process.
|
|
||||||
|
|
||||||
Note that it is the parent process, as returned by
|
|
||||||
.BR getppid (2),
|
|
||||||
which is signaled when the child terminates, so that
|
|
||||||
if
|
|
||||||
.B CLONE_PARENT
|
|
||||||
is set, then the parent of the calling process, rather than the
|
|
||||||
calling process itself, will be signaled.
|
|
||||||
.TP
|
.TP
|
||||||
.B CLONE_FS
|
.BR CLONE_CHILD_SETTID " (since Linux 2.5.49)"
|
||||||
If
|
Store child thread ID at location
|
||||||
.B CLONE_FS
|
.I child_tidptr
|
||||||
is set, the caller and the child process share the same file system
|
in child memory.
|
||||||
information.
|
|
||||||
This includes the root of the file system, the current
|
|
||||||
working directory, and the umask.
|
|
||||||
Any call to
|
|
||||||
.BR chroot (2),
|
|
||||||
.BR chdir (2),
|
|
||||||
or
|
|
||||||
.BR umask (2)
|
|
||||||
performed by the calling process or the child process also affects the
|
|
||||||
other process.
|
|
||||||
|
|
||||||
If
|
|
||||||
.B CLONE_FS
|
|
||||||
is not set, the child process works on a copy of the file system
|
|
||||||
information of the calling process at the time of the
|
|
||||||
.BR clone ()
|
|
||||||
call.
|
|
||||||
Calls to
|
|
||||||
.BR chroot (2),
|
|
||||||
.BR chdir (2),
|
|
||||||
.BR umask (2)
|
|
||||||
performed later by one of the processes do not affect the other process.
|
|
||||||
.TP
|
.TP
|
||||||
.B CLONE_FILES
|
.B CLONE_FILES
|
||||||
If
|
If
|
||||||
|
@ -230,6 +197,33 @@ or change file descriptor flags,
|
||||||
performed by either the calling
|
performed by either the calling
|
||||||
process or the child process do not affect the other process.
|
process or the child process do not affect the other process.
|
||||||
.TP
|
.TP
|
||||||
|
.B CLONE_FS
|
||||||
|
If
|
||||||
|
.B CLONE_FS
|
||||||
|
is set, the caller and the child process share the same file system
|
||||||
|
information.
|
||||||
|
This includes the root of the file system, the current
|
||||||
|
working directory, and the umask.
|
||||||
|
Any call to
|
||||||
|
.BR chroot (2),
|
||||||
|
.BR chdir (2),
|
||||||
|
or
|
||||||
|
.BR umask (2)
|
||||||
|
performed by the calling process or the child process also affects the
|
||||||
|
other process.
|
||||||
|
|
||||||
|
If
|
||||||
|
.B CLONE_FS
|
||||||
|
is not set, the child process works on a copy of the file system
|
||||||
|
information of the calling process at the time of the
|
||||||
|
.BR clone ()
|
||||||
|
call.
|
||||||
|
Calls to
|
||||||
|
.BR chroot (2),
|
||||||
|
.BR chdir (2),
|
||||||
|
.BR umask (2)
|
||||||
|
performed later by one of the processes do not affect the other process.
|
||||||
|
.TP
|
||||||
.BR CLONE_NEWNS " (since Linux 2.4.19)"
|
.BR CLONE_NEWNS " (since Linux 2.4.19)"
|
||||||
Start the child in a new namespace.
|
Start the child in a new namespace.
|
||||||
|
|
||||||
|
@ -272,6 +266,60 @@ in the same
|
||||||
.BR clone ()
|
.BR clone ()
|
||||||
call.
|
call.
|
||||||
.TP
|
.TP
|
||||||
|
.BR CLONE_PARENT " (since Linux 2.3.12)"
|
||||||
|
If
|
||||||
|
.B CLONE_PARENT
|
||||||
|
is set, then the parent of the new child (as returned by
|
||||||
|
.BR getppid (2))
|
||||||
|
will be the same as that of the calling process.
|
||||||
|
|
||||||
|
If
|
||||||
|
.B CLONE_PARENT
|
||||||
|
is not set, then (as with
|
||||||
|
.BR fork (2))
|
||||||
|
the child's parent is the calling process.
|
||||||
|
|
||||||
|
Note that it is the parent process, as returned by
|
||||||
|
.BR getppid (2),
|
||||||
|
which is signaled when the child terminates, so that
|
||||||
|
if
|
||||||
|
.B CLONE_PARENT
|
||||||
|
is set, then the parent of the calling process, rather than the
|
||||||
|
calling process itself, will be signaled.
|
||||||
|
.TP
|
||||||
|
.BR CLONE_PARENT_SETTID " (since Linux 2.5.49)"
|
||||||
|
Store child thread ID at location
|
||||||
|
.I parent_tidptr
|
||||||
|
in parent and child memory.
|
||||||
|
(In Linux 2.5.32-2.5.48 there was a flag
|
||||||
|
.B CLONE_SETTID
|
||||||
|
that did this.)
|
||||||
|
.TP
|
||||||
|
.BR CLONE_PID " (obsolete)"
|
||||||
|
If
|
||||||
|
.B CLONE_PID
|
||||||
|
is set, the child process is created with the same process ID as
|
||||||
|
the calling process.
|
||||||
|
This is good for hacking the system, but otherwise
|
||||||
|
of not much use.
|
||||||
|
Since 2.3.21 this flag can be
|
||||||
|
specified only by the system boot process (PID 0).
|
||||||
|
It disappeared in Linux 2.5.16.
|
||||||
|
.TP
|
||||||
|
.B CLONE_PTRACE
|
||||||
|
If
|
||||||
|
.B CLONE_PTRACE
|
||||||
|
is specified, and the calling process is being traced,
|
||||||
|
then trace the child also (see
|
||||||
|
.BR ptrace (2)).
|
||||||
|
.TP
|
||||||
|
.BR CLONE_SETTLS " (since Linux 2.5.32)"
|
||||||
|
The
|
||||||
|
.I newtls
|
||||||
|
argument is the new TLS (Thread Local Storage) descriptor.
|
||||||
|
(See
|
||||||
|
.BR set_thread_area (2).)
|
||||||
|
.TP
|
||||||
.B CLONE_SIGHAND
|
.B CLONE_SIGHAND
|
||||||
If
|
If
|
||||||
.B CLONE_SIGHAND
|
.B CLONE_SIGHAND
|
||||||
|
@ -307,20 +355,6 @@ if
|
||||||
.B CLONE_SIGHAND
|
.B CLONE_SIGHAND
|
||||||
is specified
|
is specified
|
||||||
.TP
|
.TP
|
||||||
.B CLONE_PTRACE
|
|
||||||
If
|
|
||||||
.B CLONE_PTRACE
|
|
||||||
is specified, and the calling process is being traced,
|
|
||||||
then trace the child also (see
|
|
||||||
.BR ptrace (2)).
|
|
||||||
.TP
|
|
||||||
.BR CLONE_UNTRACED " (since Linux 2.5.46)"
|
|
||||||
If
|
|
||||||
.B CLONE_UNTRACED
|
|
||||||
is specified, then a tracing process cannot force
|
|
||||||
.B CLONE_PTRACE
|
|
||||||
on this child process.
|
|
||||||
.TP
|
|
||||||
.BR CLONE_STOPPED " (since Linux 2.6.0-test2)"
|
.BR CLONE_STOPPED " (since Linux 2.6.0-test2)"
|
||||||
If
|
If
|
||||||
.B CLONE_STOPPED
|
.B CLONE_STOPPED
|
||||||
|
@ -335,56 +369,14 @@ You probably never wanted to use it,
|
||||||
you certainly shouldn't be using it, and soon it will go away.
|
you certainly shouldn't be using it, and soon it will go away.
|
||||||
.\" glibc 2.8 removed this defn from bits/sched.h
|
.\" glibc 2.8 removed this defn from bits/sched.h
|
||||||
.TP
|
.TP
|
||||||
.B CLONE_VFORK
|
.BR CLONE_SYSVSEM " (since Linux 2.5.10)"
|
||||||
If
|
If
|
||||||
.B CLONE_VFORK
|
.B CLONE_SYSVSEM
|
||||||
is set, the execution of the calling process is suspended
|
is set, then the child and the calling process share
|
||||||
until the child releases its virtual memory
|
a single list of System V semaphore undo values (see
|
||||||
resources via a call to
|
.BR semop (2)).
|
||||||
.BR execve (2)
|
If this flag is not set, then the child has a separate undo list,
|
||||||
or
|
which is initially empty.
|
||||||
.BR _exit (2)
|
|
||||||
(as with
|
|
||||||
.BR vfork (2)).
|
|
||||||
|
|
||||||
If
|
|
||||||
.B CLONE_VFORK
|
|
||||||
is not set then both the calling process and the child are schedulable
|
|
||||||
after the call, and an application should not rely on execution occurring
|
|
||||||
in any particular order.
|
|
||||||
.TP
|
|
||||||
.B CLONE_VM
|
|
||||||
If
|
|
||||||
.B CLONE_VM
|
|
||||||
is set, the calling process and the child process run in the same memory
|
|
||||||
space.
|
|
||||||
In particular, memory writes performed by the calling process
|
|
||||||
or by the child process are also visible in the other process.
|
|
||||||
Moreover, any memory mapping or unmapping performed with
|
|
||||||
.BR mmap (2)
|
|
||||||
or
|
|
||||||
.BR munmap (2)
|
|
||||||
by the child or calling process also affects the other process.
|
|
||||||
|
|
||||||
If
|
|
||||||
.B CLONE_VM
|
|
||||||
is not set, the child process runs in a separate copy of the memory
|
|
||||||
space of the calling process at the time of
|
|
||||||
.BR clone ().
|
|
||||||
Memory writes or file mappings/unmappings performed by one of the
|
|
||||||
processes do not affect the other, as with
|
|
||||||
.BR fork (2).
|
|
||||||
.TP
|
|
||||||
.BR CLONE_PID " (obsolete)"
|
|
||||||
If
|
|
||||||
.B CLONE_PID
|
|
||||||
is set, the child process is created with the same process ID as
|
|
||||||
the calling process.
|
|
||||||
This is good for hacking the system, but otherwise
|
|
||||||
of not much use.
|
|
||||||
Since 2.3.21 this flag can be
|
|
||||||
specified only by the system boot process (PID 0).
|
|
||||||
It disappeared in Linux 2.5.16.
|
|
||||||
.TP
|
.TP
|
||||||
.BR CLONE_THREAD " (since Linux 2.4.0-test8)"
|
.BR CLONE_THREAD " (since Linux 2.4.0-test8)"
|
||||||
If
|
If
|
||||||
|
@ -503,44 +495,52 @@ the kernel will arbitrarily select one of these threads
|
||||||
to receive a signal sent using
|
to receive a signal sent using
|
||||||
.BR kill (2).
|
.BR kill (2).
|
||||||
.TP
|
.TP
|
||||||
.BR CLONE_SYSVSEM " (since Linux 2.5.10)"
|
.BR CLONE_UNTRACED " (since Linux 2.5.46)"
|
||||||
If
|
If
|
||||||
.B CLONE_SYSVSEM
|
.B CLONE_UNTRACED
|
||||||
is set, then the child and the calling process share
|
is specified, then a tracing process cannot force
|
||||||
a single list of System V semaphore undo values (see
|
.B CLONE_PTRACE
|
||||||
.BR semop (2)).
|
on this child process.
|
||||||
If this flag is not set, then the child has a separate undo list,
|
|
||||||
which is initially empty.
|
|
||||||
.TP
|
.TP
|
||||||
.BR CLONE_SETTLS " (since Linux 2.5.32)"
|
.B CLONE_VFORK
|
||||||
The
|
If
|
||||||
.I newtls
|
.B CLONE_VFORK
|
||||||
argument is the new TLS (Thread Local Storage) descriptor.
|
is set, the execution of the calling process is suspended
|
||||||
(See
|
until the child releases its virtual memory
|
||||||
.BR set_thread_area (2).)
|
resources via a call to
|
||||||
|
.BR execve (2)
|
||||||
|
or
|
||||||
|
.BR _exit (2)
|
||||||
|
(as with
|
||||||
|
.BR vfork (2)).
|
||||||
|
|
||||||
|
If
|
||||||
|
.B CLONE_VFORK
|
||||||
|
is not set then both the calling process and the child are schedulable
|
||||||
|
after the call, and an application should not rely on execution occurring
|
||||||
|
in any particular order.
|
||||||
.TP
|
.TP
|
||||||
.BR CLONE_PARENT_SETTID " (since Linux 2.5.49)"
|
.B CLONE_VM
|
||||||
Store child thread ID at location
|
If
|
||||||
.I parent_tidptr
|
.B CLONE_VM
|
||||||
in parent and child memory.
|
is set, the calling process and the child process run in the same memory
|
||||||
(In Linux 2.5.32-2.5.48 there was a flag
|
space.
|
||||||
.B CLONE_SETTID
|
In particular, memory writes performed by the calling process
|
||||||
that did this.)
|
or by the child process are also visible in the other process.
|
||||||
.TP
|
Moreover, any memory mapping or unmapping performed with
|
||||||
.BR CLONE_CHILD_SETTID " (since Linux 2.5.49)"
|
.BR mmap (2)
|
||||||
Store child thread ID at location
|
or
|
||||||
.I child_tidptr
|
.BR munmap (2)
|
||||||
in child memory.
|
by the child or calling process also affects the other process.
|
||||||
.TP
|
|
||||||
.BR CLONE_CHILD_CLEARTID " (since Linux 2.5.49)"
|
If
|
||||||
Erase child thread ID at location
|
.B CLONE_VM
|
||||||
.I child_tidptr
|
is not set, the child process runs in a separate copy of the memory
|
||||||
in child memory when the child exits, and do a wakeup on the futex
|
space of the calling process at the time of
|
||||||
at that address.
|
.BR clone ().
|
||||||
The address involved may be changed by the
|
Memory writes or file mappings/unmappings performed by one of the
|
||||||
.BR set_tid_address (2)
|
processes do not affect the other, as with
|
||||||
system call.
|
.BR fork (2).
|
||||||
This is used by threading libraries.
|
|
||||||
.SS "sys_clone"
|
.SS "sys_clone"
|
||||||
The
|
The
|
||||||
.B sys_clone
|
.B sys_clone
|
||||||
|
|
Loading…
Reference in New Issue