mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct: move cmsg helpers to new internal/cmsg package
These helpers all make more sense as a self-contained package and moving them has the added benefit of removing an unneeded libpathrs dependency (from libcontainer/utils's import of pathrs-lite) from several test binaries. Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/opencontainers/runc/internal/cmsg"
|
||||
)
|
||||
|
||||
// RecvFile waits for a file descriptor to be sent over the given AF_UNIX
|
||||
// socket. The file name of the remote file descriptor will be recreated
|
||||
// locally (it is sent as non-auxiliary data in the same payload).
|
||||
//
|
||||
// Deprecated: This method is deprecated and has been moved to an internal
|
||||
// package (see [cmsg.RecvFile]). It will be removed in runc 1.6.
|
||||
func RecvFile(socket *os.File) (*os.File, error) {
|
||||
return cmsg.RecvFile(socket)
|
||||
}
|
||||
|
||||
// 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.
|
||||
//
|
||||
// Deprecated: This method is deprecated and has been moved to an internal
|
||||
// package (see [cmsg.SendFile]). It will be removed in runc 1.6.
|
||||
func SendFile(socket, file *os.File) error {
|
||||
return cmsg.SendFile(socket, file)
|
||||
}
|
||||
|
||||
// SendRawFd sends a specific file descriptor over the given AF_UNIX socket.
|
||||
//
|
||||
// Deprecated: This method is deprecated and has been moved to an internal
|
||||
// package (see [cmsg.SendRawFd]). It will be removed in runc 1.6.
|
||||
func SendRawFd(socket *os.File, msg string, fd uintptr) error {
|
||||
return cmsg.SendRawFd(socket, msg, fd)
|
||||
}
|
||||
Reference in New Issue
Block a user