From 4dd85833c17c56b9962182009b364a5ab1d5555a Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 6 Mar 2013 10:10:44 +0100 Subject: [PATCH] unshare.2: Document use of CLONE_THREAD, CLONE_SIGHAND, and CLONE_VM Signed-off-by: Michael Kerrisk --- man2/unshare.2 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/man2/unshare.2 b/man2/unshare.2 index 23b4791b3..e922e9917 100644 --- a/man2/unshare.2 +++ b/man2/unshare.2 @@ -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.