Browse code

Add helper function to make prctl system call. Docker-DCO-1.1-Signed-off-by: Mrunal Patel <mrunalp@gmail.com> (github: mrunalp)

Mrunal Patel authored on 2014/06/14 03:38:32
Showing 1 changed files
... ...
@@ -116,6 +116,13 @@ func Mknod(path string, mode uint32, dev int) error {
116 116
 	return syscall.Mknod(path, mode, dev)
117 117
 }
118 118
 
119
+func Prctl(option int, arg2, arg3, arg4, arg5 uintptr) error {
120
+	if _, _, err := syscall.Syscall6(syscall.SYS_PRCTL, uintptr(option), arg2, arg3, arg4, arg5, 0); err != 0 {
121
+		return err
122
+	}
123
+	return nil
124
+}
125
+
119 126
 func ParentDeathSignal(sig uintptr) error {
120 127
 	if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, sig, 0); err != 0 {
121 128
 		return err