MCPcopy Index your code
hub / github.com/subtrace/subtrace / poll

Method poll

cmd/run/engine/process/process.go:197–213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195}
196
197func (p *Process) poll() (exited bool, _ error) {
198 if !p.pidfd.IncRef() {
199 return false, fmt.Errorf("pidfd: file closed")
200 }
201 defer p.pidfd.DecRef()
202
203 fds := []unix.PollFd{{Fd: int32(p.pidfd.FD()), Events: unix.POLLIN}}
204 _, err := unix.Poll(fds, -1)
205 if err == unix.EINTR {
206 return false, nil
207 }
208 if err != nil {
209 return false, err
210 }
211
212 return fds[0].Revents&unix.POLLIN != 0, nil
213}
214
215// Wait waits for the process to exit and cleans up resources in the end.
216func (p *Process) Wait() error {

Callers 1

WaitMethod · 0.95

Calls 3

IncRefMethod · 0.80
DecRefMethod · 0.80
FDMethod · 0.80

Tested by

no test coverage detected