summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2018-09-07 15:44:24 (GMT)
committerGitHub <noreply@github.com>2018-09-07 15:44:24 (GMT)
commit254a4663d8c5970ae2928185c50ebaa6c7e62c80 (patch)
tree30dfeb3927b8693f2ed5317917824c56033a620a /Doc
parent5e922658fb55734bf8b4c6246033ea93af172ff7 (diff)
downloadcpython-254a4663d8c5970ae2928185c50ebaa6c7e62c80.zip
cpython-254a4663d8c5970ae2928185c50ebaa6c7e62c80.tar.gz
cpython-254a4663d8c5970ae2928185c50ebaa6c7e62c80.tar.bz2
bpo-20104: Add flag capabilities to posix_spawn (GH-6693)
Implement the "attributes objects" parameter of `os.posix_spawn` to complete the implementation and fully cover the underlying API.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/os.rst34
1 files changed, 33 insertions, 1 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index df136da..b8d6fff 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -3394,7 +3394,9 @@ written in Python, such as a mail server's external command delivery program.
subprocesses.
-.. function:: posix_spawn(path, argv, env, file_actions=None)
+.. function:: posix_spawn(path, argv, env, file_actions=None, /, *, \
+ setpgroup=None, resetids=False, setsigmask=(), \
+ setsigdef=(), scheduler=None)
Wraps the :c:func:`posix_spawn` C library API for use from Python.
@@ -3432,6 +3434,36 @@ written in Python, such as a mail server's external command delivery program.
:c:func:`posix_spawn_file_actions_adddup2` API calls used to prepare
for the :c:func:`posix_spawn` call itself.
+ The *setpgroup* argument will set the process group of the child to the value
+ specified. If the value specified is 0, the child's process group ID will be
+ made the same as its process ID. If the value of *setpgroup* is not set, the
+ child will inherit the parent's process group ID. This argument corresponds
+ to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag.
+
+ If the *resetids* argument is ``True`` it will reset the effective UID and
+ GID of the child to the real UID and GID of the parent process. If the
+ argument is ``False``, then the child retains the effective UID and GID of
+ the parent. In either case, if the set-user-ID and set-group-ID permission
+ bits are enabled on the executable file, their effect will override the
+ setting of the effective UID and GID. This argument corresponds to the C
+ library :c:data:`POSIX_SPAWN_RESETIDS` flag.
+
+ The *setsigmask* argument will set the signal mask to the signal set
+ specified. If the parameter is not used, then the child inherits the
+ parent's signal mask. This argument corresponds to the C library
+ :c:data:`POSIX_SPAWN_SETSIGMASK` flag.
+
+ The *sigdef* argument will reset the disposition of all signals in the set
+ specified. This argument corresponds to the C library
+ :c:data:`POSIX_SPAWN_SETSIGDEF` flag.
+
+ The *scheduler* argument must be a tuple containing the (optional) scheduler
+ policy and an instance of :class:`sched_param` with the scheduler parameters.
+ A value of ``None`` in the place of the scheduler policy indicates that is
+ not being provided. This argument is a combination of the C library
+ :c:data:`POSIX_SPAWN_SETSCHEDPARAM` and :c:data:`POSIX_SPAWN_SETSCHEDULER`
+ flags.
+
.. versionadded:: 3.7