diff options
author | Helmut Grohne <helmut@subdivi.de> | 2025-06-03 07:47:21 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2025-06-03 07:47:21 +0200 |
commit | df414c672b240d114cca67565a1221813420cd46 (patch) | |
tree | aca30e818873259620e5b911f036416c13aef334 /linuxnamespaces | |
parent | cd000bef2c476342d74fc2a042dacfb3c2945b21 (diff) | |
download | python-linuxnamespaces-df414c672b240d114cca67565a1221813420cd46.tar.gz |
add wrapper for PR_SET_DUMPABLE prctl
Diffstat (limited to 'linuxnamespaces')
-rw-r--r-- | linuxnamespaces/syscalls.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/linuxnamespaces/syscalls.py b/linuxnamespaces/syscalls.py index 7f17c9f..b55be37 100644 --- a/linuxnamespaces/syscalls.py +++ b/linuxnamespaces/syscalls.py @@ -386,6 +386,7 @@ class PrctlOption(enum.IntEnum): """This value may be supplied to prctl(2) as option.""" PR_SET_PDEATHSIG = 1 + PR_SET_DUMPABLE = 4 PR_SET_CHILD_SUBREAPER = 36 PR_CAP_AMBIENT = 47 @@ -746,6 +747,11 @@ def prctl_set_child_subreaper(enabled: bool = True) -> None: prctl(PrctlOption.PR_SET_CHILD_SUBREAPER, int(enabled)) +def prctl_set_dumpable(enabled: bool) -> None: + """Set or clear the dumpable flag.""" + prctl(PrctlOption.PR_SET_DUMPABLE, int(enabled)) + + def prctl_set_pdeathsig(signum: int) -> None: """Set the parent-death signal of the calling process.""" if signum < 0: |