...
Source file src/pkg/os/wait_wait6.go
1
2
3
4
5
6
7 package os
8
9 import (
10 "runtime"
11 "syscall"
12 )
13
14 const _P_PID = 0
15
16
17
18
19 func (p *Process) blockUntilWaitable() (bool, error) {
20 var errno syscall.Errno
21
22
23
24 if runtime.GOARCH == "386" {
25 _, _, errno = syscall.Syscall9(syscall.SYS_WAIT6, _P_PID, uintptr(p.Pid), 0, 0, syscall.WEXITED|syscall.WNOWAIT, 0, 0, 0, 0)
26 } else if runtime.GOARCH == "arm" {
27 _, _, errno = syscall.Syscall9(syscall.SYS_WAIT6, _P_PID, 0, uintptr(p.Pid), 0, 0, syscall.WEXITED|syscall.WNOWAIT, 0, 0, 0)
28 } else {
29 _, _, errno = syscall.Syscall6(syscall.SYS_WAIT6, _P_PID, uintptr(p.Pid), 0, syscall.WEXITED|syscall.WNOWAIT, 0, 0)
30 }
31 runtime.KeepAlive(p)
32 if errno != 0 {
33 return false, NewSyscallError("wait6", errno)
34 }
35 return true, nil
36 }
37
View as plain text