Merge pull request #10060 from dcantah/unix-waitid
Replace direct waitid syscall with unix.Waitid
This commit is contained in:
commit
2adae6093e
@ -190,17 +190,13 @@ func getUsernsFD(uidMaps, gidMaps []syscall.SysProcIDMap) (_usernsFD *os.File, r
|
|||||||
}
|
}
|
||||||
|
|
||||||
func pidfdWaitid(pidFD *os.File) error {
|
func pidfdWaitid(pidFD *os.File) error {
|
||||||
// https://elixir.bootlin.com/linux/v5.4.258/source/include/uapi/linux/wait.h#L20
|
|
||||||
const PPidFD = 3
|
|
||||||
|
|
||||||
var e syscall.Errno
|
|
||||||
for {
|
for {
|
||||||
_, _, e = syscall.Syscall6(syscall.SYS_WAITID, PPidFD, pidFD.Fd(), 0, syscall.WEXITED, 0, 0)
|
err := unix.Waitid(unix.P_PIDFD, int(pidFD.Fd()), nil, unix.WEXITED, nil)
|
||||||
if e != syscall.EINTR {
|
if err == unix.EINTR {
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return e
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user