8000 proofreaders review fixes · python/cpython@51c60d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 51c60d4

Browse files
committed
proofreaders review fixes
1 parent b9d3a34 commit 51c60d4

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

Doc/library/os.rst

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -571,21 +571,23 @@ process and user.
571571

572572
.. function:: setns(fd, nstype=0)
573573

574-
Reassociate thread with a namespace, see the :manpage:`setns(2)` man page for more details.
574+
Reassociate the current with a namespace.
575+
See the :manpage:`setns(2)` man page for more details.
575576

576577
If *fd* refers to a ``/proc/[pid]/ns/`` link, ``setns()`` reassociates the
577578
calling thread with the namespace associated with that link, subject to any
578-
constraints imposed by the *nstype* argument (or any if ``0``).
579+
constraints imposed by the *nstype* argument (a *nstype* of ``0`` means no
580+
constraints).
579581
Since Linux 5.8, *fd* may refer to a PID file descriptor obtained from
580582
:func:`~os.pidfd_open`. In this case ``setns()`` reassociates the calling thread
581583
into one or more of the same namespaces as the thread referred to by *fd*
582-
subject to any constraints imposed by the *nstype*, which is
583-
a bit mask specified by combining one or more of the ``CLONE_NEW*`` constants,
584-
e.g. ``setns(fd, os.CLONE_NEWUTS | os.CLONE_NEWPID)``.
585-
The callers memberships in unspecified namespaces are left unchanged.
584+
subject to any constraints imposed by *nstype*, which is a bit mask specified
585+
by combining one or more of the ``CLONE_NEW*`` constants,
586+
e.g., as ``setns(fd, os.CLONE_NEWUTS | os.CLONE_NEWPID)``.
587+
The caller's memberships in unspecified namespaces are left unchanged.
586588
*fd* can be any object with a :meth:`fileno` method, or a raw file descriptor.
587589

588-
This example reassociates the thread with the ``init`` process' network namespace::
590+
This example reassociates the thread with the ``init`` process's network namespace::
589591

590592
fd = os.open("/proc/1/ns/net", os.O_RDONLY)
591593
os.setns(fd, os.CLONE_NEWNET)
@@ -595,6 +597,10 @@ process and user.
595597

596598
.. versionadded:: 3.12
597599

600+
.. seealso::
601+
602+
The :func:`~os.unshare` function.
603+
598604
.. function:: setpgrp()
599605

600606
Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on
@@ -760,12 +766,15 @@ process and user.
760766

761767
.. function:: unshare(flags)
762768

763-
Disassociate parts of the process execution context, see the :manpage:`unshare(2)`
769+
Disassociate parts of the process execution context, and move them into a
770+
newly created namespace.
771+
See the :manpage:`unshare(2)`
764772
man page for more details.
765773
The *flags* argument is a bit mask combining zero or more of the ``CLONE_*``
766774
constants using ``|`` (bitwise or), that specifies which parts of the execution
767-
context should be unshared.
768-
If *flags* is specified as zero, no changes are made to the calling process'
775+
context should be unshared from their existing associations and moved to a
776+
new namespace..
777+
If *flags* is specified as zero, no changes are made to the calling process's
769778
execution context.
770779

771780
.. availability:: Linux 2.6.16 or newer.

0 commit comments

Comments
 (0)
0