Documentation ¶
Overview ¶
Package libfd provides low level file manipulation
Index ¶
- type FD
- func FromConn(conn net.Conn) (*FD, error)
- func FromDevIno(dev, ino uint64) (*FD, error)
- func FromFD(fdUintptr uintptr) (*FD, error)
- func FromFile(file *os.File) (*FD, error)
- func FromFilename(filename string) (*FD, error)
- func FromSyscallRawConn(raw syscall.RawConn) (*FD, error)
- func RecvFromConn(conn net.Conn) (*FD, error)
- type FDer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FD ¶
FD - a helpful utility for performing low level actions on a file defined by its Dev and Ino
func FromConn ¶
FromConn - create and FD for the underlying (Dev,Ino) for a net.Conn. Note: makes a separate file descriptor, so will survive conn.Close
func FromDevIno ¶
FromDevIno - create FD from (Dev,Ino) - only works if we already have a file open for (Dev,Ino)
func FromFD ¶
FromFD - makes an FD from a uintptr for underlying file descriptor. Note: makes a copy so will survive close of the original file descriptor
func FromFile ¶
FromFile - create and FD for the underlying (Dev,Ino) for a *os.File. Note: makes a separate file descriptor, so will survive file.Close
func FromFilename ¶
FromFilename - create an FD from a filename.
func FromSyscallRawConn ¶
FromSyscallRawConn - create and FD for the underlying (Dev,Ino) for a syscall.RawConn. Note: makes a separate file descriptor, so will survive Close of the original thing.
func RecvFromConn ¶
RecvFromConn - receives a file descriptor over conn if possibleand returns it as an FD. Generally only works for UnixConn
func (*FD) Dup ¶
Dup - creates a duplicate of FD with a distinct file descriptor for the same Dev,Inode
func (*FD) DupFile ¶
DupFile - creates a duplicate of FD with a distinct file descriptor for the same Dev,Inode and returns it as an *os.File
func (*FD) Filename ¶
Filename of FD - returns fmt.Sprintf("/proc/%d/FDUintptr/%d", os.Getpid(), fd.FDUintptr)
func (*FD) SendTo ¶
SendTo - Sends this FD as a file descriptor over conn if possible. Generally only works for UnixConn