summaryrefslogtreecommitdiff
path: root/linuxnamespaces
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-05-17 10:53:07 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-05-17 10:53:07 +0200
commit4eee83c87fe5b62c1029dae4a5c0b67badd4a33a (patch)
tree610b6bd62b796da03ac381fef1c0566ff5b78f40 /linuxnamespaces
parentad413c3165bfe6c5296133473c2aa9c626704f75 (diff)
downloadpython-linuxnamespaces-4eee83c87fe5b62c1029dae4a5c0b67badd4a33a.tar.gz
add prctl_set_child_subreaper
Diffstat (limited to 'linuxnamespaces')
-rw-r--r--linuxnamespaces/syscalls.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/linuxnamespaces/syscalls.py b/linuxnamespaces/syscalls.py
index 368f437..2a35a69 100644
--- a/linuxnamespaces/syscalls.py
+++ b/linuxnamespaces/syscalls.py
@@ -348,6 +348,7 @@ class PrctlOption(enum.IntEnum):
"""This value may be supplied to prctl(2) as option."""
PR_SET_PDEATHSIG = 1
+ PR_SET_CHILD_SUBREAPER = 36
PR_CAP_AMBIENT = 47
@@ -668,6 +669,11 @@ def prctl_raise_ambient_capabilities(capabilities: int) -> None:
)
+def prctl_set_child_subreaper(enabled: bool = True) -> None:
+ """Enable or disable being a child subreaper."""
+ prctl(PrctlOption.PR_SET_CHILD_SUBREAPER, int(enabled))
+
+
def prctl_set_pdeathsig(signum: int) -> None:
"""Set the parent-death signal of the calling process."""
if signum < 0: