pgrp _C_int
cred *Credential
ngroups, groups uintptr
- upid uintptr
+ upid, ppid uintptr
)
rlim := origRlimitNofile.Load()
// Record parent PID so child can test if it has died.
- ppid, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
+ if sys.Pdeathsig != 0 {
+ ppid, _, _ = RawSyscall(SYS_GETPID, 0, 0, 0)
+ }
// guard against side effects of shuffling fds below.
// Make sure that nextfd is beyond any currently open files so
nextfd int
i int
caps caps
- fd1, flags uintptr
+ fd1, flags, ppid uintptr
puid, psetgroups, pgid []byte
uidmap, setgroups, gidmap []byte
clone3 *cloneArgs
}
// Record parent PID so child can test if it has died.
- ppid, _ := rawSyscallNoError(SYS_GETPID, 0, 0, 0)
+ if sys.Pdeathsig != 0 {
+ ppid, _ = rawSyscallNoError(SYS_GETPID, 0, 0, 0)
+ }
// Guard against side effects of shuffling fds below.
// Make sure that nextfd is beyond any currently open files so