aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/prctl.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/prctl.go')
-rw-r--r--internal/prctl.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/internal/prctl.go b/internal/prctl.go
index 857371b5..ae8392a6 100644
--- a/internal/prctl.go
+++ b/internal/prctl.go
@@ -2,17 +2,22 @@ package internal
import "syscall"
-func PR_SET_DUMPABLE__SUID_DUMP_DISABLE() error {
+const (
+ SUID_DUMP_DISABLE = iota
+ SUID_DUMP_USER
+)
+
+func SetDumpable(dumpable uintptr) error {
// linux/sched/coredump.h
- if _, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_DUMPABLE, 0, 0); errno != 0 {
+ if _, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_DUMPABLE, dumpable, 0); errno != 0 {
return errno
}
return nil
}
-func PR_SET_PDEATHSIG__SIGKILL() error {
- if _, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, uintptr(syscall.SIGKILL), 0); errno != 0 {
+func SetPdeathsig(sig syscall.Signal) error {
+ if _, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, uintptr(sig), 0); errno != 0 {
return errno
}