From cf77f49865a79c88df80f1a8057c419b7f6ddd19 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Fri, 13 Jun 2014 11:38:32 -0700 Subject: [PATCH] Add helper function to make prctl system call. Docker-DCO-1.1-Signed-off-by: Mrunal Patel (github: mrunalp) --- system/calls_linux.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/system/calls_linux.go b/system/calls_linux.go index 6986051..125fd25 100644 --- a/system/calls_linux.go +++ b/system/calls_linux.go @@ -116,6 +116,13 @@ func Mknod(path string, mode uint32, dev int) error { 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 { if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, sig, 0); err != 0 { return err