MCPcopy
hub / github.com/opencontainers/runc / pidGetFd

Function pidGetFd

libcontainer/process_linux.go:1105–1116  ·  view source on GitHub ↗
(pid, srcFd int)

Source from the content-addressed store, hash-verified

1103}
1104
1105func pidGetFd(pid, srcFd int) (*os.File, error) {
1106 pidFd, err := unix.PidfdOpen(pid, 0)
1107 if err != nil {
1108 return nil, os.NewSyscallError("pidfd_open", err)
1109 }
1110 defer unix.Close(pidFd)
1111 fd, err := unix.PidfdGetfd(pidFd, srcFd, 0)
1112 if err != nil {
1113 return nil, os.NewSyscallError("pidfd_getfd", err)
1114 }
1115 return os.NewFile(uintptr(fd), "[pidfd_getfd]"), nil
1116}
1117
1118func sendContainerProcessState(listenerPath string, state *specs.ContainerProcessState, file *os.File) error {
1119 conn, err := net.Dial("unix", listenerPath)

Callers 2

startMethod · 0.85
startMethod · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…