Imports #
"syscall"
"unsafe"
"unsafe"
"unsafe"
"bytes"
"strings"
"unsafe"
"bytes"
"syscall"
"unsafe"
"unsafe"
"syscall"
"syscall"
"runtime"
"unsafe"
"errors"
"syscall"
"unsafe"
"unsafe"
"unsafe"
"bytes"
"strings"
"unsafe"
"bytes"
"syscall"
"unsafe"
"unsafe"
"syscall"
"syscall"
"runtime"
"unsafe"
"errors"
Dir.Mode bits
const DMAPPEND = 0x40000000
Dir.Mode bits
const DMAUTH = 0x08000000
Dir.Mode bits
const DMDIR = 0x80000000
Dir.Mode bits
const DMEXCL = 0x20000000
Dir.Mode bits
const DMEXEC = 0x1
Dir.Mode bits
const DMMOUNT = 0x10000000
Dir.Mode bits
const DMREAD = 0x4
Dir.Mode bits
const DMTMP = 0x04000000
Dir.Mode bits
const DMWRITE = 0x2
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
Errors
var EAFNOSUPPORT = *ast.CallExpr
Errors
var EBUSY = *ast.CallExpr
Errors
var EEXIST = *ast.CallExpr
Errors
var EINTR = *ast.CallExpr
Errors
var EINVAL = *ast.CallExpr
Errors
var EIO = *ast.CallExpr
Errors
var EISDIR = *ast.CallExpr
Errors
var EMFILE = *ast.CallExpr
Errors
var ENAMETOOLONG = *ast.CallExpr
Errors
var ENOENT = *ast.CallExpr
Errors
var ENOTDIR = *ast.CallExpr
Errors
var EPERM = *ast.CallExpr
Errors
var EPLAN9 = *ast.CallExpr
const ERRMAX = 128
Errors
var ETIMEDOUT = *ast.CallExpr
var ErrBadName = *ast.CallExpr
var ErrBadStat = *ast.CallExpr
var ErrShortStat = *ast.CallExpr
Mount and bind flags
const MAFTER = 0x0002
Mount and bind flags
const MBEFORE = 0x0001
Mount and bind flags
const MCACHE = 0x0010
Mount and bind flags
const MCREATE = 0x0004
Mount and bind flags
const MMASK = 0x0017
Mount and bind flags
const MORDER = 0x0003
Mount and bind flags
const MREPL = 0x0000
Constants
const O_APPEND = 0x00400
Constants
const O_ASYNC = 0x00000
Open modes
const O_CLOEXEC = 32
Invented values to support what package os expects.
const O_CREAT = 0x02000
Open modes
const O_EXCL = 0x1000
Constants
const O_NOCTTY = 0x00000
Constants
const O_NONBLOCK = 0x00000
Open modes
const O_RDONLY = 0
Open modes
const O_RDWR = 2
Constants
const O_SYNC = 0x00000
Open modes
const O_TRUNC = 16
Open modes
const O_WRONLY = 1
Qid.Type bits
const QTAPPEND = 0x40
Qid.Type bits
const QTAUTH = 0x08
Qid.Type bits
const QTDIR = 0x80
Qid.Type bits
const QTEXCL = 0x20
Qid.Type bits
const QTFILE = 0x00
Qid.Type bits
const QTMOUNT = 0x10
Qid.Type bits
const QTTMP = 0x04
Rfork flags
const RFCENVG = *ast.BinaryExpr
Rfork flags
const RFCFDG = *ast.BinaryExpr
Rfork flags
const RFCNAMEG = *ast.BinaryExpr
Rfork flags
const RFENVG = *ast.BinaryExpr
Rfork flags
const RFFDG = *ast.BinaryExpr
Rfork flags
const RFMEM = *ast.BinaryExpr
Rfork flags
const RFNAMEG = *ast.BinaryExpr
Rfork flags
const RFNOMNT = *ast.BinaryExpr
Rfork flags
const RFNOTEG = *ast.BinaryExpr
Rfork flags
const RFNOWAIT = *ast.BinaryExpr
Rfork flags
const RFPROC = *ast.BinaryExpr
Rfork flags
const RFREND = *ast.BinaryExpr
const STATFIXLEN = 49
const STATMAX = 65535
const SYS_ALARM = 6
const SYS_AWAIT = 47
const SYS_BIND = 2
const SYS_BRK_ = 24
const SYS_CHDIR = 3
const SYS_CLOSE = 4
const SYS_CREATE = 22
const SYS_DUP = 5
const SYS_ERRSTR = 41
const SYS_EXEC = 7
const SYS_EXITS = 8
const SYS_FAUTH = 10
const SYS_FD2PATH = 23
const SYS_FSTAT = 43
const SYS_FVERSION = 40
const SYS_FWSTAT = 45
const SYS_MOUNT = 46
const SYS_NOTED = 29
const SYS_NOTIFY = 28
const SYS_NSEC = 53
const SYS_OPEN = 14
const SYS_OSEEK = 16
const SYS_PIPE = 21
const SYS_PREAD = 50
const SYS_PWRITE = 51
const SYS_REMOVE = 25
const SYS_RENDEZVOUS = 34
const SYS_RFORK = 19
const SYS_SEEK = 39
const SYS_SEGATTACH = 30
const SYS_SEGBRK = 12
const SYS_SEGDETACH = 31
const SYS_SEGFLUSH = 33
const SYS_SEGFREE = 32
const SYS_SEMACQUIRE = 37
const SYS_SEMRELEASE = 38
const SYS_SLEEP = 17
const SYS_STAT = 42
const SYS_SYSR1 = 0
const SYS_TSEMACQUIRE = 52
const SYS_UNMOUNT = 35
const SYS_WSTAT = 44
Constants
const S_IFBLK = 0x6000
Constants
const S_IFCHR = 0x2000
Constants
const S_IFDIR = 0x4000
Constants
const S_IFIFO = 0x1000
Constants
const S_IFLNK = 0xa000
Constants
const S_IFMT = 0x1f000
Constants
const S_IFREG = 0x8000
Constants
const S_IFSOCK = 0xc000
For testing: clients can set this flag to force creation of IPv6 sockets to return EAFNOSUPPORT.
var SocketDisableIPv6 bool
var Stderr = 2
var Stdin = 0
var Stdout = 1
Single-word zero for use when we need a valid pointer to 0 bytes. See mksyscall.pl.
var _zero uintptr
var ioSync int64
var nullDir = Dir{...}
const raceenabled = true
const raceenabled = false
A Note is a string describing a process note. It implements the os.Signal interface.
type Note string
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
}
A Qid represents a 9P server's unique identification for a file.
type Qid struct {
Path uint64
Vers uint32
Type uint8
}
type Timespec struct {
Sec int32
Nsec int32
}
type Timeval struct {
Sec int32
Usec int32
}
type Waitmsg struct {
Pid int
Time [3]uint32
Msg string
}
func Await(w *Waitmsg) (err error)
func Bind(name string, old string, flag int) (err error)
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 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 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 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
func Chdir(path string) error
func Chdir(path string) error
func Clearenv()
func Close(fd int) (err error)
func Close(fd int) (err error)
func Close(fd int) (err error)
func Create(path string, mode int, perm uint32) (fd int, err error)
func Dup(oldfd int, newfd int) (fd int, err error)
func Dup(oldfd int, newfd int) (fd int, err error)
func Dup(oldfd int, newfd int) (fd int, err error)
func Environ() []string
func Exit(code int)
func (w Waitmsg) ExitStatus() int
func (w Waitmsg) Exited() bool
func Fchdir(fd int) (err error)
func Fd2path(fd int) (path string, err error)
func Fstat(fd int, edir []byte) (n int, err error)
func Fstat(fd int, edir []byte) (n int, err error)
func Fstat(fd int, edir []byte) (n int, err error)
func Fwstat(fd int, edir []byte) (err error)
func Fwstat(fd int, edir []byte) (err error)
func Fwstat(fd int, edir []byte) (err error)
func Getegid() (egid int)
func Getenv(key string) (value string, found bool)
func Geteuid() (euid int)
func Getgid() (gid int)
func Getgroups() (gids []int, err error)
func Getpagesize() int
func Getpid() (pid int)
func Getppid() (ppid int)
func Gettimeofday(tv *Timeval) error
func Getuid() (uid int)
func Getwd() (wd string, err error)
func Getwd() (wd string, err error)
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)
func Mkdir(path string, mode uint32) (err error)
func Mount(fd int, afd int, old string, flag int, aname string) (err error)
func (ts *Timespec) Nano() int64
func (tv *Timeval) Nano() int64
func NsecToTimeval(nsec int64) (tv Timeval)
Null assigns special "don't touch" values to members of d to avoid modifying them during plan9.Wstat.
func (d *Dir) Null()
func Open(path string, mode int) (fd int, err error)
func Pipe(p []int) (err error)
func Pread(fd int, p []byte, offset int64) (n int, err error)
func Pread(fd int, p []byte, offset int64) (n int, err error)
func Pread(fd int, p []byte, offset int64) (n int, err error)
func Pwrite(fd int, p []byte, offset int64) (n int, err error)
func Pwrite(fd int, p []byte, offset int64) (n int, err error)
func Pwrite(fd int, p []byte, offset int64) (n int, err error)
func RawSyscall(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err uintptr)
func RawSyscall6(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err uintptr)
func Read(fd int, p []byte) (n int, err error)
func Remove(path string) error
func Seek(fd int, offset int64, whence int) (newoffset int64, err error)
func Setenv(key string, value string) error
func (n Note) Signal()
func (w Waitmsg) Signaled() bool
func Stat(path string, edir []byte) (n int, err error)
func (n Note) String() string
func Syscall(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err syscall.ErrorString)
func Syscall6(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err syscall.ErrorString)
func (tv *Timeval) Unix() (sec int64, nsec int64)
func (ts *Timespec) Unix() (sec int64, nsec int64)
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)
func Unmount(name string, old string) (err error)
func Unsetenv(key string) error
func Write(fd int, p []byte) (n int, err error)
func Wstat(path string, edir []byte) (err error)
func atoi(b []byte) (n uint)
func await(s []byte) (n int, err error)
func await(s []byte) (n int, err error)
func await(s []byte) (n int, err error)
func bind(name string, old string, flag int) (err error)
func bind(name string, old string, flag int) (err error)
func bind(name string, old string, flag int) (err error)
func chdir(path string) (err error)
func chdir(path string) (err error)
func chdir(path string) (err error)
func create(path string, mode int, perm uint32) (fd int, err error)
func create(path string, mode int, perm uint32) (fd int, err error)
func create(path string, mode int, perm uint32) (fd int, err error)
func cstring(s []byte) string
func errstr() string
Implemented in assembly to import from runtime.
func exit(code int)
func fd2path(fd int, buf []byte) (err error)
func fd2path(fd int, buf []byte) (err error)
func fd2path(fd int, buf []byte) (err error)
func fixwd()
func fixwd()
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 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 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 reads an 8-bit number from b and returns it with the remaining slice of b.
func gbit8(b []byte) (uint8, []byte)
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)
func itoa(val int) string
func mount(fd int, afd int, old string, flag int, aname string) (err error)
func mount(fd int, afd int, old string, flag int, aname string) (err error)
func mount(fd int, afd int, old string, flag int, aname string) (err error)
func nsec() int64
func open(path string, mode int) (fd int, err error)
func open(path string, mode int) (fd int, err error)
func open(path string, mode int) (fd int, err error)
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 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 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 copies the 8-bit number v to b and returns the remaining slice of b.
func pbit8(b []byte, v uint8) []byte
func pipe(p *[2]int32) (err error)
func pipe(p *[2]int32) (err error)
func pipe(p *[2]int32) (err error)
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
func raceAcquire(addr unsafe.Pointer)
func raceAcquire(addr unsafe.Pointer)
func raceReadRange(addr unsafe.Pointer, len int)
func raceReadRange(addr unsafe.Pointer, len int)
func raceReleaseMerge(addr unsafe.Pointer)
func raceReleaseMerge(addr unsafe.Pointer)
func raceWriteRange(addr unsafe.Pointer, len int)
func raceWriteRange(addr unsafe.Pointer, len int)
func readnum(path string) (uint, error)
func remove(path string) (err error)
func remove(path string) (err error)
func remove(path string) (err error)
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)
func stat(path string, edir []byte) (n int, err error)
func stat(path string, edir []byte) (n int, err error)
func stat(path string, edir []byte) (n int, err error)
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)
func wstat(path string, edir []byte) (err error)
func wstat(path string, edir []byte) (err error)
func wstat(path string, edir []byte) (err error)
Generated with Arrow