| 1103 | } |
| 1104 | |
| 1105 | func 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 | |
| 1118 | func sendContainerProcessState(listenerPath string, state *specs.ContainerProcessState, file *os.File) error { |
| 1119 | conn, err := net.Dial("unix", listenerPath) |