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

Method getFD

cmd/run/engine/process/process.go:184–195  ·  view source on GitHub ↗
(targetFD int)

Source from the content-addressed store, hash-verified

182}
183
184func (p *Process) getFD(targetFD int) (*fd.FD, syscall.Errno) {
185 if !p.pidfd.IncRef() {
186 return nil, unix.EBADF
187 }
188 defer p.pidfd.DecRef()
189
190 ret, _, errno := unix.Syscall(unix.SYS_PIDFD_GETFD, uintptr(p.pidfd.FD()), uintptr(targetFD), 0)
191 if errno != 0 {
192 return nil, errno
193 }
194 return fd.NewFD(int(ret)), 0
195}
196
197func (p *Process) poll() (exited bool, _ error) {
198 if !p.pidfd.IncRef() {

Callers 2

resolveDirfdMethod · 0.95
ImportInodeMethod · 0.95

Calls 4

NewFDFunction · 0.92
IncRefMethod · 0.80
DecRefMethod · 0.80
FDMethod · 0.80

Tested by

no test coverage detected