p9p

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package p9p implements some Plan 9 Port functions.

Index

Constants

View Source
const (
	Topenfd = 98 + iota
	Ropenfd
)

The openfd 9P message type is from plan9port (see openfd(9)).

Variables

This section is empty.

Functions

func Pipe

func Pipe() (*os.File, *os.File, error)

Pipe returns a two-way pipe. Unlike os.Pipe, read and write is supported on both ends.

func ReceiveFD

func ReceiveFD(conn *net.UnixConn) (fd uintptr, err error)

ReceiveFD receives a file descriptor through a unix domain socket.

func SendFD

func SendFD(conn *net.UnixConn, fd uintptr) error

SendFD sends a file descriptor through a unix domain socket.

Types

type Fcall

type Fcall struct {
	plan9.Fcall
	Unixfd uint32 // Ropenfd
}

Fcall adds support for Topenfd and Ropenfd to 9fans.net/go/plan9.Fcall.

func ReadFcall

func ReadFcall(r io.Reader) (*Fcall, error)

ReadFcall reads a Fcall from reader r.

func UnmarshalFcall

func UnmarshalFcall(b []byte) (f *Fcall, err error)

UnmarshalFcall unmarshals a Fcall.

func (*Fcall) Bytes

func (f *Fcall) Bytes() ([]byte, error)

Bytes marshals the Fcall.

func (*Fcall) String

func (f *Fcall) String() string

String returns a string representation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL