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

Function SendFile

internal/cmsg/cmsg.go:120–128  ·  view source on GitHub ↗

SendFile sends a file over the given AF_UNIX socket. file.Name() is also included so that if the other end uses RecvFile, the file will have the same name information.

(socket, file *os.File)

Source from the content-addressed store, hash-verified

118// included so that if the other end uses RecvFile, the file will have the same
119// name information.
120func SendFile(socket, file *os.File) error {
121 name := file.Name()
122 if len(name) >= MaxNameLen {
123 return fmt.Errorf("sendfd: filename too long: %s", name)
124 }
125 err := SendRawFd(socket, name, file.Fd())
126 runtime.KeepAlive(file)
127 return err
128}
129
130// SendRawFd sends a specific file descriptor over the given AF_UNIX socket.
131func SendRawFd(socket *os.File, msg string, fd uintptr) error {

Callers 3

criuNotificationsMethod · 0.92
doWriteSyncFunction · 0.92
SendFileFunction · 0.92

Calls 1

SendRawFdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…