plan9

Imports

Imports #

"syscall"
"unsafe"
"unsafe"
"unsafe"
"bytes"
"strings"
"unsafe"
"bytes"
"syscall"
"unsafe"
"unsafe"
"syscall"
"syscall"
"runtime"
"unsafe"
"errors"

Constants & Variables

DMAPPEND const #

Dir.Mode bits

const DMAPPEND = 0x40000000

DMAUTH const #

Dir.Mode bits

const DMAUTH = 0x08000000

DMDIR const #

Dir.Mode bits

const DMDIR = 0x80000000

DMEXCL const #

Dir.Mode bits

const DMEXCL = 0x20000000

DMEXEC const #

Dir.Mode bits

const DMEXEC = 0x1

DMMOUNT const #

Dir.Mode bits

const DMMOUNT = 0x10000000

DMREAD const #

Dir.Mode bits

const DMREAD = 0x4

DMTMP const #

Dir.Mode bits

const DMTMP = 0x04000000

DMWRITE const #

Dir.Mode bits

const DMWRITE = 0x2

EACCES var #

The following errors do not correspond to any Plan 9 system messages. Invented to support what package os and others expect.

var EACCES = *ast.CallExpr

EAFNOSUPPORT var #

Errors

var EAFNOSUPPORT = *ast.CallExpr

EBUSY var #

Errors

var EBUSY = *ast.CallExpr

EEXIST var #

Errors

var EEXIST = *ast.CallExpr

EINTR var #

Errors

var EINTR = *ast.CallExpr

EINVAL var #

Errors

var EINVAL = *ast.CallExpr

EIO var #

Errors

var EIO = *ast.CallExpr

EISDIR var #

Errors

var EISDIR = *ast.CallExpr

EMFILE var #

Errors

var EMFILE = *ast.CallExpr

ENAMETOOLONG var #

Errors

var ENAMETOOLONG = *ast.CallExpr

ENOENT var #

Errors

var ENOENT = *ast.CallExpr

ENOTDIR var #

Errors

var ENOTDIR = *ast.CallExpr

EPERM var #

Errors

var EPERM = *ast.CallExpr

EPLAN9 var #

Errors

var EPLAN9 = *ast.CallExpr

ERRMAX const #

const ERRMAX = 128

ETIMEDOUT var #

Errors

var ETIMEDOUT = *ast.CallExpr

ErrBadName var #

var ErrBadName = *ast.CallExpr

ErrBadStat var #

var ErrBadStat = *ast.CallExpr

ErrShortStat var #

var ErrShortStat = *ast.CallExpr

MAFTER const #

Mount and bind flags

const MAFTER = 0x0002

MBEFORE const #

Mount and bind flags

const MBEFORE = 0x0001

MCACHE const #

Mount and bind flags

const MCACHE = 0x0010

MCREATE const #

Mount and bind flags

const MCREATE = 0x0004

MMASK const #

Mount and bind flags

const MMASK = 0x0017

MORDER const #

Mount and bind flags

const MORDER = 0x0003

MREPL const #

Mount and bind flags

const MREPL = 0x0000

O_APPEND const #

Constants

const O_APPEND = 0x00400

O_ASYNC const #

Constants

const O_ASYNC = 0x00000

O_CLOEXEC const #

Open modes

const O_CLOEXEC = 32

O_CREAT const #

Invented values to support what package os expects.

const O_CREAT = 0x02000

O_EXCL const #

Open modes

const O_EXCL = 0x1000

O_NOCTTY const #

Constants

const O_NOCTTY = 0x00000

O_NONBLOCK const #

Constants

const O_NONBLOCK = 0x00000

O_RDONLY const #

Open modes

const O_RDONLY = 0

O_RDWR const #

Open modes

const O_RDWR = 2

O_SYNC const #

Constants

const O_SYNC = 0x00000

O_TRUNC const #

Open modes

const O_TRUNC = 16

O_WRONLY const #

Open modes

const O_WRONLY = 1

QTAPPEND const #

Qid.Type bits

const QTAPPEND = 0x40

QTAUTH const #

Qid.Type bits

const QTAUTH = 0x08

QTDIR const #

Qid.Type bits

const QTDIR = 0x80

QTEXCL const #

Qid.Type bits

const QTEXCL = 0x20

QTFILE const #

Qid.Type bits

const QTFILE = 0x00

QTMOUNT const #

Qid.Type bits

const QTMOUNT = 0x10

QTTMP const #

Qid.Type bits

const QTTMP = 0x04

RFCENVG const #

Rfork flags

const RFCENVG = *ast.BinaryExpr

RFCFDG const #

Rfork flags

const RFCFDG = *ast.BinaryExpr

RFCNAMEG const #

Rfork flags

const RFCNAMEG = *ast.BinaryExpr

RFENVG const #

Rfork flags

const RFENVG = *ast.BinaryExpr

RFFDG const #

Rfork flags

const RFFDG = *ast.BinaryExpr

RFMEM const #

Rfork flags

const RFMEM = *ast.BinaryExpr

RFNAMEG const #

Rfork flags

const RFNAMEG = *ast.BinaryExpr

RFNOMNT const #

Rfork flags

const RFNOMNT = *ast.BinaryExpr

RFNOTEG const #

Rfork flags

const RFNOTEG = *ast.BinaryExpr

RFNOWAIT const #

Rfork flags

const RFNOWAIT = *ast.BinaryExpr

RFPROC const #

Rfork flags

const RFPROC = *ast.BinaryExpr

RFREND const #

Rfork flags

const RFREND = *ast.BinaryExpr

STATFIXLEN const #

const STATFIXLEN = 49

STATMAX const #

const STATMAX = 65535

SYS_ALARM const #

const SYS_ALARM = 6

SYS_AWAIT const #

const SYS_AWAIT = 47

SYS_BIND const #

const SYS_BIND = 2

SYS_BRK_ const #

const SYS_BRK_ = 24

SYS_CHDIR const #

const SYS_CHDIR = 3

SYS_CLOSE const #

const SYS_CLOSE = 4

SYS_CREATE const #

const SYS_CREATE = 22

SYS_DUP const #

const SYS_DUP = 5

SYS_ERRSTR const #

const SYS_ERRSTR = 41

SYS_EXEC const #

const SYS_EXEC = 7

SYS_EXITS const #

const SYS_EXITS = 8

SYS_FAUTH const #

const SYS_FAUTH = 10

SYS_FD2PATH const #

const SYS_FD2PATH = 23

SYS_FSTAT const #

const SYS_FSTAT = 43

SYS_FVERSION const #

const SYS_FVERSION = 40

SYS_FWSTAT const #

const SYS_FWSTAT = 45

SYS_MOUNT const #

const SYS_MOUNT = 46

SYS_NOTED const #

const SYS_NOTED = 29

SYS_NOTIFY const #

const SYS_NOTIFY = 28

SYS_NSEC const #

const SYS_NSEC = 53

SYS_OPEN const #

const SYS_OPEN = 14

SYS_OSEEK const #

const SYS_OSEEK = 16

SYS_PIPE const #

const SYS_PIPE = 21

SYS_PREAD const #

const SYS_PREAD = 50

SYS_PWRITE const #

const SYS_PWRITE = 51

SYS_REMOVE const #

const SYS_REMOVE = 25

SYS_RENDEZVOUS const #

const SYS_RENDEZVOUS = 34

SYS_RFORK const #

const SYS_RFORK = 19

SYS_SEEK const #

const SYS_SEEK = 39

SYS_SEGATTACH const #

const SYS_SEGATTACH = 30

SYS_SEGBRK const #

const SYS_SEGBRK = 12

SYS_SEGDETACH const #

const SYS_SEGDETACH = 31

SYS_SEGFLUSH const #

const SYS_SEGFLUSH = 33

SYS_SEGFREE const #

const SYS_SEGFREE = 32

SYS_SEMACQUIRE const #

const SYS_SEMACQUIRE = 37

SYS_SEMRELEASE const #

const SYS_SEMRELEASE = 38

SYS_SLEEP const #

const SYS_SLEEP = 17

SYS_STAT const #

const SYS_STAT = 42

SYS_SYSR1 const #

const SYS_SYSR1 = 0

SYS_TSEMACQUIRE const #

const SYS_TSEMACQUIRE = 52

SYS_UNMOUNT const #

const SYS_UNMOUNT = 35

SYS_WSTAT const #

const SYS_WSTAT = 44

S_IFBLK const #

Constants

const S_IFBLK = 0x6000

S_IFCHR const #

Constants

const S_IFCHR = 0x2000

S_IFDIR const #

Constants

const S_IFDIR = 0x4000

S_IFIFO const #

Constants

const S_IFIFO = 0x1000

S_IFLNK const #

Constants

const S_IFLNK = 0xa000

S_IFMT const #

Constants

const S_IFMT = 0x1f000

S_IFREG const #

Constants

const S_IFREG = 0x8000

S_IFSOCK const #

Constants

const S_IFSOCK = 0xc000

SocketDisableIPv6 var #

For testing: clients can set this flag to force creation of IPv6 sockets to return EAFNOSUPPORT.

var SocketDisableIPv6 bool

Stderr var #

var Stderr = 2

Stdin var #

var Stdin = 0

Stdout var #

var Stdout = 1

_zero var #

Single-word zero for use when we need a valid pointer to 0 bytes. See mksyscall.pl.

var _zero uintptr

ioSync var #

var ioSync int64

nullDir var #

var nullDir = Dir{...}

raceenabled const #

const raceenabled = true

raceenabled const #

const raceenabled = false

Type Aliases

Note type #

A Note is a string describing a process note. It implements the os.Signal interface.

type Note string

Structs

Dir struct #

A Dir contains the metadata for a file.

type Dir struct {
Type uint16
Dev uint32
Qid Qid
Mode uint32
Atime uint32
Mtime uint32
Length int64
Name string
Uid string
Gid string
Muid string
}

Qid struct #

A Qid represents a 9P server's unique identification for a file.

type Qid struct {
Path uint64
Vers uint32
Type uint8
}

Timespec struct #

type Timespec struct {
Sec int32
Nsec int32
}

Timeval struct #

type Timeval struct {
Sec int32
Usec int32
}

Waitmsg struct #

type Waitmsg struct {
Pid int
Time [3]uint32
Msg string
}

Functions

Await function #

func Await(w *Waitmsg) (err error)

Bind function #

func Bind(name string, old string, flag int) (err error)

BytePtrFromString function #

BytePtrFromString returns a pointer to a NUL-terminated array of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL).

func BytePtrFromString(s string) (*byte, error)

BytePtrToString function #

BytePtrToString takes a pointer to a sequence of text and returns the corresponding string. If the pointer is nil, it returns the empty string. It assumes that the text sequence is terminated at a zero byte; if the zero byte is not present, the program may crash.

func BytePtrToString(p *byte) string

ByteSliceFromString function #

ByteSliceFromString returns a NUL-terminated slice of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL).

func ByteSliceFromString(s string) ([]byte, error)

ByteSliceToString function #

ByteSliceToString returns a string form of the text represented by the slice s, with a terminating NUL and any bytes after the NUL removed.

func ByteSliceToString(s []byte) string

Chdir function #

func Chdir(path string) error

Chdir function #

func Chdir(path string) error

Clearenv function #

func Clearenv()

Close function #

func Close(fd int) (err error)

Close function #

func Close(fd int) (err error)

Close function #

func Close(fd int) (err error)

Create function #

func Create(path string, mode int, perm uint32) (fd int, err error)

Dup function #

func Dup(oldfd int, newfd int) (fd int, err error)

Dup function #

func Dup(oldfd int, newfd int) (fd int, err error)

Dup function #

func Dup(oldfd int, newfd int) (fd int, err error)

Environ function #

func Environ() []string

Exit function #

func Exit(code int)

ExitStatus method #

func (w Waitmsg) ExitStatus() int

Exited method #

func (w Waitmsg) Exited() bool

Fchdir function #

func Fchdir(fd int) (err error)

Fd2path function #

func Fd2path(fd int) (path string, err error)

Fstat function #

func Fstat(fd int, edir []byte) (n int, err error)

Fstat function #

func Fstat(fd int, edir []byte) (n int, err error)

Fstat function #

func Fstat(fd int, edir []byte) (n int, err error)

Fwstat function #

func Fwstat(fd int, edir []byte) (err error)

Fwstat function #

func Fwstat(fd int, edir []byte) (err error)

Fwstat function #

func Fwstat(fd int, edir []byte) (err error)

Getegid function #

func Getegid() (egid int)

Getenv function #

func Getenv(key string) (value string, found bool)

Geteuid function #

func Geteuid() (euid int)

Getgid function #

func Getgid() (gid int)

Getgroups function #

func Getgroups() (gids []int, err error)

Getpagesize function #

func Getpagesize() int

Getpid function #

func Getpid() (pid int)

Getppid function #

func Getppid() (ppid int)

Gettimeofday function #

func Gettimeofday(tv *Timeval) error

Getuid function #

func Getuid() (uid int)

Getwd function #

func Getwd() (wd string, err error)

Getwd function #

func Getwd() (wd string, err error)

Marshal method #

Marshal encodes a 9P stat message corresponding to d into b If there isn't enough space in b for a stat message, ErrShortStat is returned.

func (d *Dir) Marshal(b []byte) (n int, err error)

Mkdir function #

func Mkdir(path string, mode uint32) (err error)

Mount function #

func Mount(fd int, afd int, old string, flag int, aname string) (err error)

Nano method #

func (ts *Timespec) Nano() int64

Nano method #

func (tv *Timeval) Nano() int64

NsecToTimeval function #

func NsecToTimeval(nsec int64) (tv Timeval)

Null method #

Null assigns special "don't touch" values to members of d to avoid modifying them during plan9.Wstat.

func (d *Dir) Null()

Open function #

func Open(path string, mode int) (fd int, err error)

Pipe function #

func Pipe(p []int) (err error)

Pread function #

func Pread(fd int, p []byte, offset int64) (n int, err error)

Pread function #

func Pread(fd int, p []byte, offset int64) (n int, err error)

Pread function #

func Pread(fd int, p []byte, offset int64) (n int, err error)

Pwrite function #

func Pwrite(fd int, p []byte, offset int64) (n int, err error)

Pwrite function #

func Pwrite(fd int, p []byte, offset int64) (n int, err error)

Pwrite function #

func Pwrite(fd int, p []byte, offset int64) (n int, err error)

RawSyscall function #

func RawSyscall(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err uintptr)

RawSyscall6 function #

func RawSyscall6(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err uintptr)

Read function #

func Read(fd int, p []byte) (n int, err error)

Remove function #

func Remove(path string) error

Seek function #

func Seek(fd int, offset int64, whence int) (newoffset int64, err error)

Setenv function #

func Setenv(key string, value string) error

Signal method #

func (n Note) Signal()

Signaled method #

func (w Waitmsg) Signaled() bool

Stat function #

func Stat(path string, edir []byte) (n int, err error)

String method #

func (n Note) String() string

Syscall function #

func Syscall(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err syscall.ErrorString)

Syscall6 function #

func Syscall6(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err syscall.ErrorString)

Unix method #

func (tv *Timeval) Unix() (sec int64, nsec int64)

Unix method #

func (ts *Timespec) Unix() (sec int64, nsec int64)

UnmarshalDir function #

UnmarshalDir decodes a single 9P stat message from b and returns the resulting Dir. If b is too small to hold a valid stat message, ErrShortStat is returned. If the stat message itself is invalid, ErrBadStat is returned.

func UnmarshalDir(b []byte) (*Dir, error)

Unmount function #

func Unmount(name string, old string) (err error)

Unsetenv function #

func Unsetenv(key string) error

Write function #

func Write(fd int, p []byte) (n int, err error)

Wstat function #

func Wstat(path string, edir []byte) (err error)

atoi function #

func atoi(b []byte) (n uint)

await function #

func await(s []byte) (n int, err error)

await function #

func await(s []byte) (n int, err error)

await function #

func await(s []byte) (n int, err error)

bind function #

func bind(name string, old string, flag int) (err error)

bind function #

func bind(name string, old string, flag int) (err error)

bind function #

func bind(name string, old string, flag int) (err error)

chdir function #

func chdir(path string) (err error)

chdir function #

func chdir(path string) (err error)

chdir function #

func chdir(path string) (err error)

create function #

func create(path string, mode int, perm uint32) (fd int, err error)

create function #

func create(path string, mode int, perm uint32) (fd int, err error)

create function #

func create(path string, mode int, perm uint32) (fd int, err error)

cstring function #

func cstring(s []byte) string

errstr function #

func errstr() string

exit function #

Implemented in assembly to import from runtime.

func exit(code int)

fd2path function #

func fd2path(fd int, buf []byte) (err error)

fd2path function #

func fd2path(fd int, buf []byte) (err error)

fd2path function #

func fd2path(fd int, buf []byte) (err error)

fixwd function #

func fixwd()

fixwd function #

func fixwd()

gbit16 function #

gbit16 reads a 16-bit number in little-endian order from b and returns it with the remaining slice of b.

func gbit16(b []byte) (uint16, []byte)

gbit32 function #

gbit32 reads a 32-bit number in little-endian order from b and returns it with the remaining slice of b.

func gbit32(b []byte) (uint32, []byte)

gbit64 function #

gbit64 reads a 64-bit number in little-endian order from b and returns it with the remaining slice of b.

func gbit64(b []byte) (uint64, []byte)

gbit8 function #

gbit8 reads an 8-bit number from b and returns it with the remaining slice of b.

func gbit8(b []byte) (uint8, []byte)

gstring function #

gstring reads a string from b, prefixed with a 16-bit length in little-endian order. It returns the string with the remaining slice of b and a boolean. If the length is greater than the number of bytes in b, the boolean will be false.

func gstring(b []byte) (string, []byte, bool)

itoa function #

func itoa(val int) string

mount function #

func mount(fd int, afd int, old string, flag int, aname string) (err error)

mount function #

func mount(fd int, afd int, old string, flag int, aname string) (err error)

mount function #

func mount(fd int, afd int, old string, flag int, aname string) (err error)

nsec function #

func nsec() int64

open function #

func open(path string, mode int) (fd int, err error)

open function #

func open(path string, mode int) (fd int, err error)

open function #

func open(path string, mode int) (fd int, err error)

pbit16 function #

pbit16 copies the 16-bit number v to b in little-endian order and returns the remaining slice of b.

func pbit16(b []byte, v uint16) []byte

pbit32 function #

pbit32 copies the 32-bit number v to b in little-endian order and returns the remaining slice of b.

func pbit32(b []byte, v uint32) []byte

pbit64 function #

pbit64 copies the 64-bit number v to b in little-endian order and returns the remaining slice of b.

func pbit64(b []byte, v uint64) []byte

pbit8 function #

pbit8 copies the 8-bit number v to b and returns the remaining slice of b.

func pbit8(b []byte, v uint8) []byte

pipe function #

func pipe(p *[2]int32) (err error)

pipe function #

func pipe(p *[2]int32) (err error)

pipe function #

func pipe(p *[2]int32) (err error)

pstring function #

pstring copies the string s to b, prepending it with a 16-bit length in little-endian order, and returning the remaining slice of b..

func pstring(b []byte, s string) []byte

raceAcquire function #

func raceAcquire(addr unsafe.Pointer)

raceAcquire function #

func raceAcquire(addr unsafe.Pointer)

raceReadRange function #

func raceReadRange(addr unsafe.Pointer, len int)

raceReadRange function #

func raceReadRange(addr unsafe.Pointer, len int)

raceReleaseMerge function #

func raceReleaseMerge(addr unsafe.Pointer)

raceReleaseMerge function #

func raceReleaseMerge(addr unsafe.Pointer)

raceWriteRange function #

func raceWriteRange(addr unsafe.Pointer, len int)

raceWriteRange function #

func raceWriteRange(addr unsafe.Pointer, len int)

readnum function #

func readnum(path string) (uint, error)

remove function #

func remove(path string) (err error)

remove function #

func remove(path string) (err error)

remove function #

func remove(path string) (err error)

seek function #

Underlying system call writes to newoffset via pointer. Implemented in assembly to avoid allocation.

func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)

stat function #

func stat(path string, edir []byte) (n int, err error)

stat function #

func stat(path string, edir []byte) (n int, err error)

stat function #

func stat(path string, edir []byte) (n int, err error)

use function #

use is a no-op, but the compiler cannot see that it is. Calling use(p) ensures that p is kept live until that point. go:noescape

func use(p unsafe.Pointer)

wstat function #

func wstat(path string, edir []byte) (err error)

wstat function #

func wstat(path string, edir []byte) (err error)

wstat function #

func wstat(path string, edir []byte) (err error)

Generated with Arrow