summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linuxnamespaces/syscalls.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/linuxnamespaces/syscalls.py b/linuxnamespaces/syscalls.py
index be49632..d7154fc 100644
--- a/linuxnamespaces/syscalls.py
+++ b/linuxnamespaces/syscalls.py
@@ -343,6 +343,7 @@ class OpenTreeFlags(enum.IntFlag):
class PrctlOption(enum.IntEnum):
"""This value may be supplied to prctl(2) as option."""
+ PR_SET_PDEATHSIG = 1
PR_CAP_AMBIENT = 47
@@ -657,6 +658,13 @@ def prctl_raise_ambient_capabilities(capabilities: int) -> None:
)
+def prctl_set_pdeathsig(signum: int) -> None:
+ """Set the parent-death signal of the calling process."""
+ if signum < 0:
+ raise ValueError("invalid signal number")
+ prctl(PrctlOption.PR_SET_PDEATHSIG, signum)
+
+
def setns(fd: int, nstype: CloneFlags = CloneFlags.NONE) -> None:
"""Python wrapper for setns(2)."""
if fd < 0: