aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/prctl.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/prctl.go')
-rw-r--r--internal/prctl.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/prctl.go b/internal/prctl.go
new file mode 100644
index 00000000..1c03edd9
--- /dev/null
+++ b/internal/prctl.go
@@ -0,0 +1,20 @@
+package internal
+
+import "syscall"
+
+func PR_SET_DUMPABLE__SUID_DUMP_DISABLE() error {
+ // linux/sched/coredump.h
+ if _, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_DUMPABLE, 0, 0); errno != 0 {
+ return errno
+ }
+
+ return nil
+}
+
+func PR_SET_PDEATHSIG__SIGKILL() error {
+ if _, _, errno := syscall.AllThreadsSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, uintptr(syscall.SIGKILL), 0); errno != 0 {
+ return errno
+ }
+
+ return nil
+}