unshare.2: Document use of CLONE_THREAD, CLONE_SIGHAND, and CLONE_VM

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2013-03-06 10:10:44 +01:00
parent 98029e6531
commit 4dd85833c1
1 changed files with 23 additions and 0 deletions

View File

@ -239,6 +239,20 @@ capability.
.\" Unshare virtual memory, so that the calling process no
.\" longer shares its virtual address space with any other process.
.PP
In addition,
.BR CLONE_THREAD ,
.BR CLONE_SIGHAND ,
and
.BR CLONE_VM
can be specified in
.I flags
if the caller is single threaded (i.e., it is not sharing
its address space with another process or thread).
In this case, these flags have no effect.
If the process is multithreaded, then
the use of these flags results in an error.
.\" See kernel/fork.c::check_unshare_flags()
.PP
If
.I flags
is specified as zero, then
@ -256,6 +270,15 @@ is set to indicate the error.
An invalid bit was specified in
.IR flags .
.TP
.B EINVAL
.BR CLONE_THREAD ,
.BR CLONE_SIGHAND ,
or
.BR CLONE_VM
was specified in
.IR flags ,
and the caller is multithreaded.
.TP
.B ENOMEM
Cannot allocate sufficient memory to copy parts of caller's
context that need to be unshared.