aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/prctl.go
blob: 857371b53ff587522022209d87c514f0e4082be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, uintptr(syscall.SIGKILL), 0); errno != 0 {
		return errno
	}

	return nil
}