Add helper function to make prctl system call.
Docker-DCO-1.1-Signed-off-by: Mrunal Patel <mrunalp@gmail.com> (github: mrunalp)
This commit is contained in:
parent
dd675e63ba
commit
cf77f49865
1 changed files with 7 additions and 0 deletions
|
@ -116,6 +116,13 @@ func Mknod(path string, mode uint32, dev int) error {
|
||||||
return syscall.Mknod(path, mode, dev)
|
return syscall.Mknod(path, mode, dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Prctl(option int, arg2, arg3, arg4, arg5 uintptr) error {
|
||||||
|
if _, _, err := syscall.Syscall6(syscall.SYS_PRCTL, uintptr(option), arg2, arg3, arg4, arg5, 0); err != 0 {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func ParentDeathSignal(sig uintptr) error {
|
func ParentDeathSignal(sig uintptr) error {
|
||||||
if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, sig, 0); err != 0 {
|
if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, sig, 0); err != 0 {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue