Skip to contentSkip to conversation

New: unshare(2) applies to threads, not processes

Bug 59281 bugzilla-daemon-590EEB7GvNiWaY/[email protected] 2 participants 5 messages Jun 4, 2013 – May 5, 2015 2 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=59281

Summary: unshare(2) applies to threads, not processes
Product: Documentation
Version: unspecified
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: man-pages
AssignedTo: documentation_man-pages-ztI5WcYan/[email protected]
ReportedBy: [email protected]
Regression: No

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.

Signature · 7 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): bug-59281-11311-3bo0kxnWaOQUvHkbgXJLS5sdmw4N0Rt+2LY78lusg7I@public.gmane.org/

#2 lore raw

[Bug 59281] unshare(2) applies to threads, not processes

https://bugzilla.kernel.org/show_bug.cgi?id=59281

Steven Stewart-Gallus <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |sstewartgallus00@mylangara.
                   |                            |bc.ca

--- Comment #1 from Steven Stewart-Gallus <[email protected]> --- 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)"?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

[Bug 59281] unshare(2) applies to threads, not processes

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=59281

Michael Kerrisk <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |CODE_FIX

--- Comment #2 from Michael Kerrisk <[email protected]> --- (In reply to Florian Weimer from comment #0)

Quoted 3 lines

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

man2/unshare.2 +3 -3
@@ -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
Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): bug-59281-11311-WXII94vp1X-3bo0kxnWaOQUvHkbgXJLS5sdmw4N0Rt+2LY78lusg7I@public.gmane.org/

#5 lore raw

Re: [Bug 59281] unshare(2) applies to threads, not processes

Am 05.05.2015 09:36, schrieb bugzilla-daemon-590EEB7GvNiWaY/[email protected]:

Quoted 30 lines

https://bugzilla.kernel.org/show_bug.cgi?id=59281

Michael Kerrisk <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |CODE_FIX

--- Comment #2 from Michael Kerrisk <[email protected]> --- (In reply to Florian Weimer from comment #0)

Quoted 3 lines

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

man2/unshare.2 _BSD_SOURCE || _SVID_SOURCE · line 53

Quoted 7 lines
man2/unshare.2 +2 -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

man2/unshare.2 _BSD_SOURCE || _SVID_SOURCE · line 63

Quoted 12 lines
man2/unshare.2 +1 -1
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

[Bug 59281] unshare(2) applies to threads, not processes

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=59281

--- Comment #3 from walter <[email protected]> ---
Am 05.05.2015 09:36, schrieb bugzilla-daemon-590EEB7GvNiWaY/[email protected]:

Quoted 30 lines

https://bugzilla.kernel.org/show_bug.cgi?id=59281

Michael Kerrisk <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |CODE_FIX

--- Comment #2 from Michael Kerrisk <[email protected]> --- (In reply to Florian Weimer from comment #0)

Quoted 3 lines

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

man2/unshare.2 _BSD_SOURCE || _SVID_SOURCE · line 53

Quoted 7 lines
man2/unshare.2 +2 -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

Quoted 12 lines
man2/unshare.2 +1 -1
 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
Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html