Bug 59281 - unshare(2) applies to threads, not processes
Summary: unshare(2) applies to threads, not processes
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-04 14:44 UTC by Florian Weimer
Modified: 2015-05-05 08:45 UTC (History)
2 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Florian Weimer 2013-06-04 14:44:24 UTC
My version starts with "unshare() allows a process to disassociate parts of its execution context", but I've been told that this incorrect because it applies to the calling thread only, not the entire process.
Comment 1 Steven Stewart-Gallus 2014-03-31 20:07:19 UTC
Well processes and threads are basically the same under Linux. That's basically the point of the unshare call. It should really say processes and threads though. Why not submit a patch correcting processes to "processes (or threads)"?
Comment 2 Michael Kerrisk 2015-05-05 07:36:34 UTC
(In reply to Florian Weimer from comment #0)
> My version starts with "unshare() allows a process to disassociate parts of
> its execution context", but I've been told that this incorrect because it
> applies to the calling thread only, not the entire process.

Florian, while I understand the motivation of this bug report, there's no really good fix. As Stuart notes, the line between thread and process in this context is fuzzy. Really, the reader needs to have a grasp on what clone(2) does.

Anyway, to improve things a little, I applied the patch below.

Cheers,

Michael

--- a/man2/unshare.2
+++ b/man2/unshare.2
@@ -49,15 +49,15 @@ _BSD_SOURCE || _SVID_SOURCE
 .ad b
 .SH DESCRIPTION
 .BR unshare ()
-allows a process to disassociate parts of its execution
-context that are currently being shared with other processes.
+allows a process (or thread) to disassociate parts of its execution
+context that are currently being shared with other processesi or theads).
 Part of the execution context, such as the mount namespace, is shared
 implicitly when a new process is created using
 .BR fork (2)
 or
 .BR vfork (2),
 while other parts, such as virtual memory, may be
-shared by explicit request when creating a process using
+shared by explicit request when creating a process or thread using
 .BR clone (2).
 
 The main use of
Comment 3 walter 2015-05-05 08:45:24 UTC
Am 05.05.2015 09:36, schrieb bugzilla-daemon@bugzilla.kernel.org:
> https://bugzilla.kernel.org/show_bug.cgi?id=59281
> 
> Michael Kerrisk <mtk.manpages@gmail.com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>                  CC|                            |mtk.manpages@gmail.com
>          Resolution|---                         |CODE_FIX
> 
> --- Comment #2 from Michael Kerrisk <mtk.manpages@gmail.com> ---
> (In reply to Florian Weimer from comment #0)
>> My version starts with "unshare() allows a process to disassociate parts of
>> its execution context", but I've been told that this incorrect because it
>> applies to the calling thread only, not the entire process.
> 
> Florian, while I understand the motivation of this bug report, there's no
> really good fix. As Stuart notes, the line between thread and process in this
> context is fuzzy. Really, the reader needs to have a grasp on what clone(2)
> does.
> 
> Anyway, to improve things a little, I applied the patch below.
> 
> Cheers,
> 
> Michael
> 
> --- a/man2/unshare.2
> +++ b/man2/unshare.2
> @@ -49,15 +49,15 @@ _BSD_SOURCE || _SVID_SOURCE
>  .ad b
>  .SH DESCRIPTION
>  .BR unshare ()
> -allows a process to disassociate parts of its execution
> -context that are currently being shared with other processes.
> +allows a process (or thread) to disassociate parts of its execution
> +context that are currently being shared with other processesi or theads).
							  ^^^^^^^
did you notice ?

re,
 wh

>  Part of the execution context, such as the mount namespace, is shared
>  implicitly when a new process is created using
>  .BR fork (2)
>  or
>  .BR vfork (2),
>  while other parts, such as virtual memory, may be
> -shared by explicit request when creating a process using
> +shared by explicit request when creating a process or thread using
>  .BR clone (2).
> 
>  The main use of
>

Note You need to log in before you can comment on or make changes to this bug.