diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-02-05 00:37:32 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-02-05 00:37:32 +0100 |
| commit | 6960aecc25400320adee1b8802a86839326e15b6 (patch) | |
| tree | 334f7ca9491080a5e6f9a9747da77281c4958ba2 /vendor/golang.org/x/sys/plan9 | |
| download | hepi-6960aecc25400320adee1b8802a86839326e15b6.tar.gz | |
Engage!
Diffstat (limited to 'vendor/golang.org/x/sys/plan9')
22 files changed, 2367 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/plan9/asm.s b/vendor/golang.org/x/sys/plan9/asm.s new file mode 100644 index 0000000..06449eb --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/asm.s | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | // Copyright 2014 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | #include "textflag.h" | ||
| 6 | |||
| 7 | TEXT ·use(SB),NOSPLIT,$0 | ||
| 8 | RET | ||
diff --git a/vendor/golang.org/x/sys/plan9/asm_plan9_386.s b/vendor/golang.org/x/sys/plan9/asm_plan9_386.s new file mode 100644 index 0000000..bc5cab1 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/asm_plan9_386.s | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | #include "textflag.h" | ||
| 6 | |||
| 7 | // | ||
| 8 | // System call support for 386, Plan 9 | ||
| 9 | // | ||
| 10 | |||
| 11 | // Just jump to package syscall's implementation for all these functions. | ||
| 12 | // The runtime may know about them. | ||
| 13 | |||
| 14 | TEXT ·Syscall(SB),NOSPLIT,$0-32 | ||
| 15 | JMP syscall·Syscall(SB) | ||
| 16 | |||
| 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 | ||
| 18 | JMP syscall·Syscall6(SB) | ||
| 19 | |||
| 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 | ||
| 21 | JMP syscall·RawSyscall(SB) | ||
| 22 | |||
| 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 | ||
| 24 | JMP syscall·RawSyscall6(SB) | ||
| 25 | |||
| 26 | TEXT ·seek(SB),NOSPLIT,$0-36 | ||
| 27 | JMP syscall·seek(SB) | ||
| 28 | |||
| 29 | TEXT ·exit(SB),NOSPLIT,$4-4 | ||
| 30 | JMP syscall·exit(SB) | ||
diff --git a/vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s b/vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s new file mode 100644 index 0000000..d3448e6 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | #include "textflag.h" | ||
| 6 | |||
| 7 | // | ||
| 8 | // System call support for amd64, Plan 9 | ||
| 9 | // | ||
| 10 | |||
| 11 | // Just jump to package syscall's implementation for all these functions. | ||
| 12 | // The runtime may know about them. | ||
| 13 | |||
| 14 | TEXT ·Syscall(SB),NOSPLIT,$0-64 | ||
| 15 | JMP syscall·Syscall(SB) | ||
| 16 | |||
| 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 | ||
| 18 | JMP syscall·Syscall6(SB) | ||
| 19 | |||
| 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 | ||
| 21 | JMP syscall·RawSyscall(SB) | ||
| 22 | |||
| 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 | ||
| 24 | JMP syscall·RawSyscall6(SB) | ||
| 25 | |||
| 26 | TEXT ·seek(SB),NOSPLIT,$0-56 | ||
| 27 | JMP syscall·seek(SB) | ||
| 28 | |||
| 29 | TEXT ·exit(SB),NOSPLIT,$8-8 | ||
| 30 | JMP syscall·exit(SB) | ||
diff --git a/vendor/golang.org/x/sys/plan9/asm_plan9_arm.s b/vendor/golang.org/x/sys/plan9/asm_plan9_arm.s new file mode 100644 index 0000000..afb7c0a --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/asm_plan9_arm.s | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | #include "textflag.h" | ||
| 6 | |||
| 7 | // System call support for plan9 on arm | ||
| 8 | |||
| 9 | // Just jump to package syscall's implementation for all these functions. | ||
| 10 | // The runtime may know about them. | ||
| 11 | |||
| 12 | TEXT ·Syscall(SB),NOSPLIT,$0-32 | ||
| 13 | JMP syscall·Syscall(SB) | ||
| 14 | |||
| 15 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 | ||
| 16 | JMP syscall·Syscall6(SB) | ||
| 17 | |||
| 18 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 | ||
| 19 | JMP syscall·RawSyscall(SB) | ||
| 20 | |||
| 21 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 | ||
| 22 | JMP syscall·RawSyscall6(SB) | ||
| 23 | |||
| 24 | TEXT ·seek(SB),NOSPLIT,$0-36 | ||
| 25 | JMP syscall·exit(SB) | ||
diff --git a/vendor/golang.org/x/sys/plan9/const_plan9.go b/vendor/golang.org/x/sys/plan9/const_plan9.go new file mode 100644 index 0000000..b4e85a3 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/const_plan9.go | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | package plan9 | ||
| 2 | |||
| 3 | // Plan 9 Constants | ||
| 4 | |||
| 5 | // Open modes | ||
| 6 | const ( | ||
| 7 | O_RDONLY = 0 | ||
| 8 | O_WRONLY = 1 | ||
| 9 | O_RDWR = 2 | ||
| 10 | O_TRUNC = 16 | ||
| 11 | O_CLOEXEC = 32 | ||
| 12 | O_EXCL = 0x1000 | ||
| 13 | ) | ||
| 14 | |||
| 15 | // Rfork flags | ||
| 16 | const ( | ||
| 17 | RFNAMEG = 1 << 0 | ||
| 18 | RFENVG = 1 << 1 | ||
| 19 | RFFDG = 1 << 2 | ||
| 20 | RFNOTEG = 1 << 3 | ||
| 21 | RFPROC = 1 << 4 | ||
| 22 | RFMEM = 1 << 5 | ||
| 23 | RFNOWAIT = 1 << 6 | ||
| 24 | RFCNAMEG = 1 << 10 | ||
| 25 | RFCENVG = 1 << 11 | ||
| 26 | RFCFDG = 1 << 12 | ||
| 27 | RFREND = 1 << 13 | ||
| 28 | RFNOMNT = 1 << 14 | ||
| 29 | ) | ||
| 30 | |||
| 31 | // Qid.Type bits | ||
| 32 | const ( | ||
| 33 | QTDIR = 0x80 | ||
| 34 | QTAPPEND = 0x40 | ||
| 35 | QTEXCL = 0x20 | ||
| 36 | QTMOUNT = 0x10 | ||
| 37 | QTAUTH = 0x08 | ||
| 38 | QTTMP = 0x04 | ||
| 39 | QTFILE = 0x00 | ||
| 40 | ) | ||
| 41 | |||
| 42 | // Dir.Mode bits | ||
| 43 | const ( | ||
| 44 | DMDIR = 0x80000000 | ||
| 45 | DMAPPEND = 0x40000000 | ||
| 46 | DMEXCL = 0x20000000 | ||
| 47 | DMMOUNT = 0x10000000 | ||
| 48 | DMAUTH = 0x08000000 | ||
| 49 | DMTMP = 0x04000000 | ||
| 50 | DMREAD = 0x4 | ||
| 51 | DMWRITE = 0x2 | ||
| 52 | DMEXEC = 0x1 | ||
| 53 | ) | ||
| 54 | |||
| 55 | const ( | ||
| 56 | STATMAX = 65535 | ||
| 57 | ERRMAX = 128 | ||
| 58 | STATFIXLEN = 49 | ||
| 59 | ) | ||
| 60 | |||
| 61 | // Mount and bind flags | ||
| 62 | const ( | ||
| 63 | MREPL = 0x0000 | ||
| 64 | MBEFORE = 0x0001 | ||
| 65 | MAFTER = 0x0002 | ||
| 66 | MORDER = 0x0003 | ||
| 67 | MCREATE = 0x0004 | ||
| 68 | MCACHE = 0x0010 | ||
| 69 | MMASK = 0x0017 | ||
| 70 | ) | ||
diff --git a/vendor/golang.org/x/sys/plan9/dir_plan9.go b/vendor/golang.org/x/sys/plan9/dir_plan9.go new file mode 100644 index 0000000..0955e0c --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/dir_plan9.go | |||
| @@ -0,0 +1,212 @@ | |||
| 1 | // Copyright 2012 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | // Plan 9 directory marshalling. See intro(5). | ||
| 6 | |||
| 7 | package plan9 | ||
| 8 | |||
| 9 | import "errors" | ||
| 10 | |||
| 11 | var ( | ||
| 12 | ErrShortStat = errors.New("stat buffer too short") | ||
| 13 | ErrBadStat = errors.New("malformed stat buffer") | ||
| 14 | ErrBadName = errors.New("bad character in file name") | ||
| 15 | ) | ||
| 16 | |||
| 17 | // A Qid represents a 9P server's unique identification for a file. | ||
| 18 | type Qid struct { | ||
| 19 | Path uint64 // the file server's unique identification for the file | ||
| 20 | Vers uint32 // version number for given Path | ||
| 21 | Type uint8 // the type of the file (plan9.QTDIR for example) | ||
| 22 | } | ||
| 23 | |||
| 24 | // A Dir contains the metadata for a file. | ||
| 25 | type Dir struct { | ||
| 26 | // system-modified data | ||
| 27 | Type uint16 // server type | ||
| 28 | Dev uint32 // server subtype | ||
| 29 | |||
| 30 | // file data | ||
| 31 | Qid Qid // unique id from server | ||
| 32 | Mode uint32 // permissions | ||
| 33 | Atime uint32 // last read time | ||
| 34 | Mtime uint32 // last write time | ||
| 35 | Length int64 // file length | ||
| 36 | Name string // last element of path | ||
| 37 | Uid string // owner name | ||
| 38 | Gid string // group name | ||
| 39 | Muid string // last modifier name | ||
| 40 | } | ||
| 41 | |||
| 42 | var nullDir = Dir{ | ||
| 43 | Type: ^uint16(0), | ||
| 44 | Dev: ^uint32(0), | ||
| 45 | Qid: Qid{ | ||
| 46 | Path: ^uint64(0), | ||
| 47 | Vers: ^uint32(0), | ||
| 48 | Type: ^uint8(0), | ||
| 49 | }, | ||
| 50 | Mode: ^uint32(0), | ||
| 51 | Atime: ^uint32(0), | ||
| 52 | Mtime: ^uint32(0), | ||
| 53 | Length: ^int64(0), | ||
| 54 | } | ||
| 55 | |||
| 56 | // Null assigns special "don't touch" values to members of d to | ||
| 57 | // avoid modifying them during plan9.Wstat. | ||
| 58 | func (d *Dir) Null() { *d = nullDir } | ||
| 59 | |||
| 60 | // Marshal encodes a 9P stat message corresponding to d into b | ||
| 61 | // | ||
| 62 | // If there isn't enough space in b for a stat message, ErrShortStat is returned. | ||
| 63 | func (d *Dir) Marshal(b []byte) (n int, err error) { | ||
| 64 | n = STATFIXLEN + len(d.Name) + len(d.Uid) + len(d.Gid) + len(d.Muid) | ||
| 65 | if n > len(b) { | ||
| 66 | return n, ErrShortStat | ||
| 67 | } | ||
| 68 | |||
| 69 | for _, c := range d.Name { | ||
| 70 | if c == '/' { | ||
| 71 | return n, ErrBadName | ||
| 72 | } | ||
| 73 | } | ||
| 74 | |||
| 75 | b = pbit16(b, uint16(n)-2) | ||
| 76 | b = pbit16(b, d.Type) | ||
| 77 | b = pbit32(b, d.Dev) | ||
| 78 | b = pbit8(b, d.Qid.Type) | ||
| 79 | b = pbit32(b, d.Qid.Vers) | ||
| 80 | b = pbit64(b, d.Qid.Path) | ||
| 81 | b = pbit32(b, d.Mode) | ||
| 82 | b = pbit32(b, d.Atime) | ||
| 83 | b = pbit32(b, d.Mtime) | ||
| 84 | b = pbit64(b, uint64(d.Length)) | ||
| 85 | b = pstring(b, d.Name) | ||
| 86 | b = pstring(b, d.Uid) | ||
| 87 | b = pstring(b, d.Gid) | ||
| 88 | b = pstring(b, d.Muid) | ||
| 89 | |||
| 90 | return n, nil | ||
| 91 | } | ||
| 92 | |||
| 93 | // UnmarshalDir decodes a single 9P stat message from b and returns the resulting Dir. | ||
| 94 | // | ||
| 95 | // If b is too small to hold a valid stat message, ErrShortStat is returned. | ||
| 96 | // | ||
| 97 | // If the stat message itself is invalid, ErrBadStat is returned. | ||
| 98 | func UnmarshalDir(b []byte) (*Dir, error) { | ||
| 99 | if len(b) < STATFIXLEN { | ||
| 100 | return nil, ErrShortStat | ||
| 101 | } | ||
| 102 | size, buf := gbit16(b) | ||
| 103 | if len(b) != int(size)+2 { | ||
| 104 | return nil, ErrBadStat | ||
| 105 | } | ||
| 106 | b = buf | ||
| 107 | |||
| 108 | var d Dir | ||
| 109 | d.Type, b = gbit16(b) | ||
| 110 | d.Dev, b = gbit32(b) | ||
| 111 | d.Qid.Type, b = gbit8(b) | ||
| 112 | d.Qid.Vers, b = gbit32(b) | ||
| 113 | d.Qid.Path, b = gbit64(b) | ||
| 114 | d.Mode, b = gbit32(b) | ||
| 115 | d.Atime, b = gbit32(b) | ||
| 116 | d.Mtime, b = gbit32(b) | ||
| 117 | |||
| 118 | n, b := gbit64(b) | ||
| 119 | d.Length = int64(n) | ||
| 120 | |||
| 121 | var ok bool | ||
| 122 | if d.Name, b, ok = gstring(b); !ok { | ||
| 123 | return nil, ErrBadStat | ||
| 124 | } | ||
| 125 | if d.Uid, b, ok = gstring(b); !ok { | ||
| 126 | return nil, ErrBadStat | ||
| 127 | } | ||
| 128 | if d.Gid, b, ok = gstring(b); !ok { | ||
| 129 | return nil, ErrBadStat | ||
| 130 | } | ||
| 131 | if d.Muid, b, ok = gstring(b); !ok { | ||
| 132 | return nil, ErrBadStat | ||
| 133 | } | ||
| 134 | |||
| 135 | return &d, nil | ||
| 136 | } | ||
| 137 | |||
| 138 | // pbit8 copies the 8-bit number v to b and returns the remaining slice of b. | ||
| 139 | func pbit8(b []byte, v uint8) []byte { | ||
| 140 | b[0] = byte(v) | ||
| 141 | return b[1:] | ||
| 142 | } | ||
| 143 | |||
| 144 | // pbit16 copies the 16-bit number v to b in little-endian order and returns the remaining slice of b. | ||
| 145 | func pbit16(b []byte, v uint16) []byte { | ||
| 146 | b[0] = byte(v) | ||
| 147 | b[1] = byte(v >> 8) | ||
| 148 | return b[2:] | ||
| 149 | } | ||
| 150 | |||
| 151 | // pbit32 copies the 32-bit number v to b in little-endian order and returns the remaining slice of b. | ||
| 152 | func pbit32(b []byte, v uint32) []byte { | ||
| 153 | b[0] = byte(v) | ||
| 154 | b[1] = byte(v >> 8) | ||
| 155 | b[2] = byte(v >> 16) | ||
| 156 | b[3] = byte(v >> 24) | ||
| 157 | return b[4:] | ||
| 158 | } | ||
| 159 | |||
| 160 | // pbit64 copies the 64-bit number v to b in little-endian order and returns the remaining slice of b. | ||
| 161 | func pbit64(b []byte, v uint64) []byte { | ||
| 162 | b[0] = byte(v) | ||
| 163 | b[1] = byte(v >> 8) | ||
| 164 | b[2] = byte(v >> 16) | ||
| 165 | b[3] = byte(v >> 24) | ||
| 166 | b[4] = byte(v >> 32) | ||
| 167 | b[5] = byte(v >> 40) | ||
| 168 | b[6] = byte(v >> 48) | ||
| 169 | b[7] = byte(v >> 56) | ||
| 170 | return b[8:] | ||
| 171 | } | ||
| 172 | |||
| 173 | // pstring copies the string s to b, prepending it with a 16-bit length in little-endian order, and | ||
| 174 | // returning the remaining slice of b.. | ||
| 175 | func pstring(b []byte, s string) []byte { | ||
| 176 | b = pbit16(b, uint16(len(s))) | ||
| 177 | n := copy(b, s) | ||
| 178 | return b[n:] | ||
| 179 | } | ||
| 180 | |||
| 181 | // gbit8 reads an 8-bit number from b and returns it with the remaining slice of b. | ||
| 182 | func gbit8(b []byte) (uint8, []byte) { | ||
| 183 | return uint8(b[0]), b[1:] | ||
| 184 | } | ||
| 185 | |||
| 186 | // gbit16 reads a 16-bit number in little-endian order from b and returns it with the remaining slice of b. | ||
| 187 | func gbit16(b []byte) (uint16, []byte) { | ||
| 188 | return uint16(b[0]) | uint16(b[1])<<8, b[2:] | ||
| 189 | } | ||
| 190 | |||
| 191 | // gbit32 reads a 32-bit number in little-endian order from b and returns it with the remaining slice of b. | ||
| 192 | func gbit32(b []byte) (uint32, []byte) { | ||
| 193 | return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24, b[4:] | ||
| 194 | } | ||
| 195 | |||
| 196 | // gbit64 reads a 64-bit number in little-endian order from b and returns it with the remaining slice of b. | ||
| 197 | func gbit64(b []byte) (uint64, []byte) { | ||
| 198 | lo := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 | ||
| 199 | hi := uint32(b[4]) | uint32(b[5])<<8 | uint32(b[6])<<16 | uint32(b[7])<<24 | ||
| 200 | return uint64(lo) | uint64(hi)<<32, b[8:] | ||
| 201 | } | ||
| 202 | |||
| 203 | // gstring reads a string from b, prefixed with a 16-bit length in little-endian order. | ||
| 204 | // It returns the string with the remaining slice of b and a boolean. If the length is | ||
| 205 | // greater than the number of bytes in b, the boolean will be false. | ||
| 206 | func gstring(b []byte) (string, []byte, bool) { | ||
| 207 | n, b := gbit16(b) | ||
| 208 | if int(n) > len(b) { | ||
| 209 | return "", b, false | ||
| 210 | } | ||
| 211 | return string(b[:n]), b[n:], true | ||
| 212 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/env_plan9.go b/vendor/golang.org/x/sys/plan9/env_plan9.go new file mode 100644 index 0000000..8f19180 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/env_plan9.go | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Copyright 2011 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | // Plan 9 environment variables. | ||
| 6 | |||
| 7 | package plan9 | ||
| 8 | |||
| 9 | import ( | ||
| 10 | "syscall" | ||
| 11 | ) | ||
| 12 | |||
| 13 | func Getenv(key string) (value string, found bool) { | ||
| 14 | return syscall.Getenv(key) | ||
| 15 | } | ||
| 16 | |||
| 17 | func Setenv(key, value string) error { | ||
| 18 | return syscall.Setenv(key, value) | ||
| 19 | } | ||
| 20 | |||
| 21 | func Clearenv() { | ||
| 22 | syscall.Clearenv() | ||
| 23 | } | ||
| 24 | |||
| 25 | func Environ() []string { | ||
| 26 | return syscall.Environ() | ||
| 27 | } | ||
| 28 | |||
| 29 | func Unsetenv(key string) error { | ||
| 30 | return syscall.Unsetenv(key) | ||
| 31 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/errors_plan9.go b/vendor/golang.org/x/sys/plan9/errors_plan9.go new file mode 100644 index 0000000..65fe74d --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/errors_plan9.go | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | // Copyright 2011 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | package plan9 | ||
| 6 | |||
| 7 | import "syscall" | ||
| 8 | |||
| 9 | // Constants | ||
| 10 | const ( | ||
| 11 | // Invented values to support what package os expects. | ||
| 12 | O_CREAT = 0x02000 | ||
| 13 | O_APPEND = 0x00400 | ||
| 14 | O_NOCTTY = 0x00000 | ||
| 15 | O_NONBLOCK = 0x00000 | ||
| 16 | O_SYNC = 0x00000 | ||
| 17 | O_ASYNC = 0x00000 | ||
| 18 | |||
| 19 | S_IFMT = 0x1f000 | ||
| 20 | S_IFIFO = 0x1000 | ||
| 21 | S_IFCHR = 0x2000 | ||
| 22 | S_IFDIR = 0x4000 | ||
| 23 | S_IFBLK = 0x6000 | ||
| 24 | S_IFREG = 0x8000 | ||
| 25 | S_IFLNK = 0xa000 | ||
| 26 | S_IFSOCK = 0xc000 | ||
| 27 | ) | ||
| 28 | |||
| 29 | // Errors | ||
| 30 | var ( | ||
| 31 | EINVAL = syscall.NewError("bad arg in system call") | ||
| 32 | ENOTDIR = syscall.NewError("not a directory") | ||
| 33 | EISDIR = syscall.NewError("file is a directory") | ||
| 34 | ENOENT = syscall.NewError("file does not exist") | ||
| 35 | EEXIST = syscall.NewError("file already exists") | ||
| 36 | EMFILE = syscall.NewError("no free file descriptors") | ||
| 37 | EIO = syscall.NewError("i/o error") | ||
| 38 | ENAMETOOLONG = syscall.NewError("file name too long") | ||
| 39 | EINTR = syscall.NewError("interrupted") | ||
| 40 | EPERM = syscall.NewError("permission denied") | ||
| 41 | EBUSY = syscall.NewError("no free devices") | ||
| 42 | ETIMEDOUT = syscall.NewError("connection timed out") | ||
| 43 | EPLAN9 = syscall.NewError("not supported by plan 9") | ||
| 44 | |||
| 45 | // The following errors do not correspond to any | ||
| 46 | // Plan 9 system messages. Invented to support | ||
| 47 | // what package os and others expect. | ||
| 48 | EACCES = syscall.NewError("access permission denied") | ||
| 49 | EAFNOSUPPORT = syscall.NewError("address family not supported by protocol") | ||
| 50 | ) | ||
diff --git a/vendor/golang.org/x/sys/plan9/mkall.sh b/vendor/golang.org/x/sys/plan9/mkall.sh new file mode 100644 index 0000000..1650fbc --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/mkall.sh | |||
| @@ -0,0 +1,150 @@ | |||
| 1 | #!/usr/bin/env bash | ||
| 2 | # Copyright 2009 The Go Authors. All rights reserved. | ||
| 3 | # Use of this source code is governed by a BSD-style | ||
| 4 | # license that can be found in the LICENSE file. | ||
| 5 | |||
| 6 | # The plan9 package provides access to the raw system call | ||
| 7 | # interface of the underlying operating system. Porting Go to | ||
| 8 | # a new architecture/operating system combination requires | ||
| 9 | # some manual effort, though there are tools that automate | ||
| 10 | # much of the process. The auto-generated files have names | ||
| 11 | # beginning with z. | ||
| 12 | # | ||
| 13 | # This script runs or (given -n) prints suggested commands to generate z files | ||
| 14 | # for the current system. Running those commands is not automatic. | ||
| 15 | # This script is documentation more than anything else. | ||
| 16 | # | ||
| 17 | # * asm_${GOOS}_${GOARCH}.s | ||
| 18 | # | ||
| 19 | # This hand-written assembly file implements system call dispatch. | ||
| 20 | # There are three entry points: | ||
| 21 | # | ||
| 22 | # func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr); | ||
| 23 | # func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); | ||
| 24 | # func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr); | ||
| 25 | # | ||
| 26 | # The first and second are the standard ones; they differ only in | ||
| 27 | # how many arguments can be passed to the kernel. | ||
| 28 | # The third is for low-level use by the ForkExec wrapper; | ||
| 29 | # unlike the first two, it does not call into the scheduler to | ||
| 30 | # let it know that a system call is running. | ||
| 31 | # | ||
| 32 | # * syscall_${GOOS}.go | ||
| 33 | # | ||
| 34 | # This hand-written Go file implements system calls that need | ||
| 35 | # special handling and lists "//sys" comments giving prototypes | ||
| 36 | # for ones that can be auto-generated. Mksyscall reads those | ||
| 37 | # comments to generate the stubs. | ||
| 38 | # | ||
| 39 | # * syscall_${GOOS}_${GOARCH}.go | ||
| 40 | # | ||
| 41 | # Same as syscall_${GOOS}.go except that it contains code specific | ||
| 42 | # to ${GOOS} on one particular architecture. | ||
| 43 | # | ||
| 44 | # * types_${GOOS}.c | ||
| 45 | # | ||
| 46 | # This hand-written C file includes standard C headers and then | ||
| 47 | # creates typedef or enum names beginning with a dollar sign | ||
| 48 | # (use of $ in variable names is a gcc extension). The hardest | ||
| 49 | # part about preparing this file is figuring out which headers to | ||
| 50 | # include and which symbols need to be #defined to get the | ||
| 51 | # actual data structures that pass through to the kernel system calls. | ||
| 52 | # Some C libraries present alternate versions for binary compatibility | ||
| 53 | # and translate them on the way in and out of system calls, but | ||
| 54 | # there is almost always a #define that can get the real ones. | ||
| 55 | # See types_darwin.c and types_linux.c for examples. | ||
| 56 | # | ||
| 57 | # * zerror_${GOOS}_${GOARCH}.go | ||
| 58 | # | ||
| 59 | # This machine-generated file defines the system's error numbers, | ||
| 60 | # error strings, and signal numbers. The generator is "mkerrors.sh". | ||
| 61 | # Usually no arguments are needed, but mkerrors.sh will pass its | ||
| 62 | # arguments on to godefs. | ||
| 63 | # | ||
| 64 | # * zsyscall_${GOOS}_${GOARCH}.go | ||
| 65 | # | ||
| 66 | # Generated by mksyscall.pl; see syscall_${GOOS}.go above. | ||
| 67 | # | ||
| 68 | # * zsysnum_${GOOS}_${GOARCH}.go | ||
| 69 | # | ||
| 70 | # Generated by mksysnum_${GOOS}. | ||
| 71 | # | ||
| 72 | # * ztypes_${GOOS}_${GOARCH}.go | ||
| 73 | # | ||
| 74 | # Generated by godefs; see types_${GOOS}.c above. | ||
| 75 | |||
| 76 | GOOSARCH="${GOOS}_${GOARCH}" | ||
| 77 | |||
| 78 | # defaults | ||
| 79 | mksyscall="go run mksyscall.go" | ||
| 80 | mkerrors="./mkerrors.sh" | ||
| 81 | zerrors="zerrors_$GOOSARCH.go" | ||
| 82 | mksysctl="" | ||
| 83 | zsysctl="zsysctl_$GOOSARCH.go" | ||
| 84 | mksysnum= | ||
| 85 | mktypes= | ||
| 86 | run="sh" | ||
| 87 | |||
| 88 | case "$1" in | ||
| 89 | -syscalls) | ||
| 90 | for i in zsyscall*go | ||
| 91 | do | ||
| 92 | sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i | ||
| 93 | rm _$i | ||
| 94 | done | ||
| 95 | exit 0 | ||
| 96 | ;; | ||
| 97 | -n) | ||
| 98 | run="cat" | ||
| 99 | shift | ||
| 100 | esac | ||
| 101 | |||
| 102 | case "$#" in | ||
| 103 | 0) | ||
| 104 | ;; | ||
| 105 | *) | ||
| 106 | echo 'usage: mkall.sh [-n]' 1>&2 | ||
| 107 | exit 2 | ||
| 108 | esac | ||
| 109 | |||
| 110 | case "$GOOSARCH" in | ||
| 111 | _* | *_ | _) | ||
| 112 | echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 | ||
| 113 | exit 1 | ||
| 114 | ;; | ||
| 115 | plan9_386) | ||
| 116 | mkerrors= | ||
| 117 | mksyscall="go run mksyscall.go -l32 -plan9 -tags plan9,386" | ||
| 118 | mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h" | ||
| 119 | mktypes="XXX" | ||
| 120 | ;; | ||
| 121 | plan9_amd64) | ||
| 122 | mkerrors= | ||
| 123 | mksyscall="go run mksyscall.go -l32 -plan9 -tags plan9,amd64" | ||
| 124 | mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h" | ||
| 125 | mktypes="XXX" | ||
| 126 | ;; | ||
| 127 | plan9_arm) | ||
| 128 | mkerrors= | ||
| 129 | mksyscall="go run mksyscall.go -l32 -plan9 -tags plan9,arm" | ||
| 130 | mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h" | ||
| 131 | mktypes="XXX" | ||
| 132 | ;; | ||
| 133 | *) | ||
| 134 | echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 | ||
| 135 | exit 1 | ||
| 136 | ;; | ||
| 137 | esac | ||
| 138 | |||
| 139 | ( | ||
| 140 | if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi | ||
| 141 | case "$GOOS" in | ||
| 142 | plan9) | ||
| 143 | syscall_goos="syscall_$GOOS.go" | ||
| 144 | if [ -n "$mksyscall" ]; then echo "$mksyscall $syscall_goos |gofmt >zsyscall_$GOOSARCH.go"; fi | ||
| 145 | ;; | ||
| 146 | esac | ||
| 147 | if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi | ||
| 148 | if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi | ||
| 149 | if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go |gofmt >ztypes_$GOOSARCH.go"; fi | ||
| 150 | ) | $run | ||
diff --git a/vendor/golang.org/x/sys/plan9/mkerrors.sh b/vendor/golang.org/x/sys/plan9/mkerrors.sh new file mode 100644 index 0000000..526d04a --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/mkerrors.sh | |||
| @@ -0,0 +1,246 @@ | |||
| 1 | #!/usr/bin/env bash | ||
| 2 | # Copyright 2009 The Go Authors. All rights reserved. | ||
| 3 | # Use of this source code is governed by a BSD-style | ||
| 4 | # license that can be found in the LICENSE file. | ||
| 5 | |||
| 6 | # Generate Go code listing errors and other #defined constant | ||
| 7 | # values (ENAMETOOLONG etc.), by asking the preprocessor | ||
| 8 | # about the definitions. | ||
| 9 | |||
| 10 | unset LANG | ||
| 11 | export LC_ALL=C | ||
| 12 | export LC_CTYPE=C | ||
| 13 | |||
| 14 | CC=${CC:-gcc} | ||
| 15 | |||
| 16 | uname=$(uname) | ||
| 17 | |||
| 18 | includes=' | ||
| 19 | #include <sys/types.h> | ||
| 20 | #include <sys/file.h> | ||
| 21 | #include <fcntl.h> | ||
| 22 | #include <dirent.h> | ||
| 23 | #include <sys/socket.h> | ||
| 24 | #include <netinet/in.h> | ||
| 25 | #include <netinet/ip.h> | ||
| 26 | #include <netinet/ip6.h> | ||
| 27 | #include <netinet/tcp.h> | ||
| 28 | #include <errno.h> | ||
| 29 | #include <sys/signal.h> | ||
| 30 | #include <signal.h> | ||
| 31 | #include <sys/resource.h> | ||
| 32 | ' | ||
| 33 | |||
| 34 | ccflags="$@" | ||
| 35 | |||
| 36 | # Write go tool cgo -godefs input. | ||
| 37 | ( | ||
| 38 | echo package plan9 | ||
| 39 | echo | ||
| 40 | echo '/*' | ||
| 41 | indirect="includes_$(uname)" | ||
| 42 | echo "${!indirect} $includes" | ||
| 43 | echo '*/' | ||
| 44 | echo 'import "C"' | ||
| 45 | echo | ||
| 46 | echo 'const (' | ||
| 47 | |||
| 48 | # The gcc command line prints all the #defines | ||
| 49 | # it encounters while processing the input | ||
| 50 | echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags | | ||
| 51 | awk ' | ||
| 52 | $1 != "#define" || $2 ~ /\(/ || $3 == "" {next} | ||
| 53 | |||
| 54 | $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers | ||
| 55 | $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next} | ||
| 56 | $2 ~ /^(SCM_SRCRT)$/ {next} | ||
| 57 | $2 ~ /^(MAP_FAILED)$/ {next} | ||
| 58 | |||
| 59 | $2 !~ /^ETH_/ && | ||
| 60 | $2 !~ /^EPROC_/ && | ||
| 61 | $2 !~ /^EQUIV_/ && | ||
| 62 | $2 !~ /^EXPR_/ && | ||
| 63 | $2 ~ /^E[A-Z0-9_]+$/ || | ||
| 64 | $2 ~ /^B[0-9_]+$/ || | ||
| 65 | $2 ~ /^V[A-Z0-9]+$/ || | ||
| 66 | $2 ~ /^CS[A-Z0-9]/ || | ||
| 67 | $2 ~ /^I(SIG|CANON|CRNL|EXTEN|MAXBEL|STRIP|UTF8)$/ || | ||
| 68 | $2 ~ /^IGN/ || | ||
| 69 | $2 ~ /^IX(ON|ANY|OFF)$/ || | ||
| 70 | $2 ~ /^IN(LCR|PCK)$/ || | ||
| 71 | $2 ~ /(^FLU?SH)|(FLU?SH$)/ || | ||
| 72 | $2 ~ /^C(LOCAL|READ)$/ || | ||
| 73 | $2 == "BRKINT" || | ||
| 74 | $2 == "HUPCL" || | ||
| 75 | $2 == "PENDIN" || | ||
| 76 | $2 == "TOSTOP" || | ||
| 77 | $2 ~ /^PAR/ || | ||
| 78 | $2 ~ /^SIG[^_]/ || | ||
| 79 | $2 ~ /^O[CNPFP][A-Z]+[^_][A-Z]+$/ || | ||
| 80 | $2 ~ /^IN_/ || | ||
| 81 | $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || | ||
| 82 | $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || | ||
| 83 | $2 == "ICMPV6_FILTER" || | ||
| 84 | $2 == "SOMAXCONN" || | ||
| 85 | $2 == "NAME_MAX" || | ||
| 86 | $2 == "IFNAMSIZ" || | ||
| 87 | $2 ~ /^CTL_(MAXNAME|NET|QUERY)$/ || | ||
| 88 | $2 ~ /^SYSCTL_VERS/ || | ||
| 89 | $2 ~ /^(MS|MNT)_/ || | ||
| 90 | $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || | ||
| 91 | $2 ~ /^(O|F|FD|NAME|S|PTRACE|PT)_/ || | ||
| 92 | $2 ~ /^LINUX_REBOOT_CMD_/ || | ||
| 93 | $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || | ||
| 94 | $2 !~ "NLA_TYPE_MASK" && | ||
| 95 | $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ || | ||
| 96 | $2 ~ /^SIOC/ || | ||
| 97 | $2 ~ /^TIOC/ || | ||
| 98 | $2 !~ "RTF_BITS" && | ||
| 99 | $2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ || | ||
| 100 | $2 ~ /^BIOC/ || | ||
| 101 | $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || | ||
| 102 | $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|NOFILE|STACK)|RLIM_INFINITY/ || | ||
| 103 | $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || | ||
| 104 | $2 ~ /^CLONE_[A-Z_]+/ || | ||
| 105 | $2 !~ /^(BPF_TIMEVAL)$/ && | ||
| 106 | $2 ~ /^(BPF|DLT)_/ || | ||
| 107 | $2 !~ "WMESGLEN" && | ||
| 108 | $2 ~ /^W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", $2, $2)} | ||
| 109 | $2 ~ /^__WCOREFLAG$/ {next} | ||
| 110 | $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} | ||
| 111 | |||
| 112 | {next} | ||
| 113 | ' | sort | ||
| 114 | |||
| 115 | echo ')' | ||
| 116 | ) >_const.go | ||
| 117 | |||
| 118 | # Pull out the error names for later. | ||
| 119 | errors=$( | ||
| 120 | echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags | | ||
| 121 | awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | | ||
| 122 | sort | ||
| 123 | ) | ||
| 124 | |||
| 125 | # Pull out the signal names for later. | ||
| 126 | signals=$( | ||
| 127 | echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | | ||
| 128 | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | | ||
| 129 | grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT' | | ||
| 130 | sort | ||
| 131 | ) | ||
| 132 | |||
| 133 | # Again, writing regexps to a file. | ||
| 134 | echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags | | ||
| 135 | awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' | | ||
| 136 | sort >_error.grep | ||
| 137 | echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | | ||
| 138 | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | | ||
| 139 | grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT' | | ||
| 140 | sort >_signal.grep | ||
| 141 | |||
| 142 | echo '// mkerrors.sh' "$@" | ||
| 143 | echo '// Code generated by the command above; DO NOT EDIT.' | ||
| 144 | echo | ||
| 145 | go tool cgo -godefs -- "$@" _const.go >_error.out | ||
| 146 | cat _error.out | grep -vf _error.grep | grep -vf _signal.grep | ||
| 147 | echo | ||
| 148 | echo '// Errors' | ||
| 149 | echo 'const (' | ||
| 150 | cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= Errno(\1)/' | ||
| 151 | echo ')' | ||
| 152 | |||
| 153 | echo | ||
| 154 | echo '// Signals' | ||
| 155 | echo 'const (' | ||
| 156 | cat _error.out | grep -f _signal.grep | sed 's/=\(.*\)/= Signal(\1)/' | ||
| 157 | echo ')' | ||
| 158 | |||
| 159 | # Run C program to print error and syscall strings. | ||
| 160 | ( | ||
| 161 | echo -E " | ||
| 162 | #include <stdio.h> | ||
| 163 | #include <stdlib.h> | ||
| 164 | #include <errno.h> | ||
| 165 | #include <ctype.h> | ||
| 166 | #include <string.h> | ||
| 167 | #include <signal.h> | ||
| 168 | |||
| 169 | #define nelem(x) (sizeof(x)/sizeof((x)[0])) | ||
| 170 | |||
| 171 | enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below | ||
| 172 | |||
| 173 | int errors[] = { | ||
| 174 | " | ||
| 175 | for i in $errors | ||
| 176 | do | ||
| 177 | echo -E ' '$i, | ||
| 178 | done | ||
| 179 | |||
| 180 | echo -E " | ||
| 181 | }; | ||
| 182 | |||
| 183 | int signals[] = { | ||
| 184 | " | ||
| 185 | for i in $signals | ||
| 186 | do | ||
| 187 | echo -E ' '$i, | ||
| 188 | done | ||
| 189 | |||
| 190 | # Use -E because on some systems bash builtin interprets \n itself. | ||
| 191 | echo -E ' | ||
| 192 | }; | ||
| 193 | |||
| 194 | static int | ||
| 195 | intcmp(const void *a, const void *b) | ||
| 196 | { | ||
| 197 | return *(int*)a - *(int*)b; | ||
| 198 | } | ||
| 199 | |||
| 200 | int | ||
| 201 | main(void) | ||
| 202 | { | ||
| 203 | int i, j, e; | ||
| 204 | char buf[1024], *p; | ||
| 205 | |||
| 206 | printf("\n\n// Error table\n"); | ||
| 207 | printf("var errors = [...]string {\n"); | ||
| 208 | qsort(errors, nelem(errors), sizeof errors[0], intcmp); | ||
| 209 | for(i=0; i<nelem(errors); i++) { | ||
| 210 | e = errors[i]; | ||
| 211 | if(i > 0 && errors[i-1] == e) | ||
| 212 | continue; | ||
| 213 | strcpy(buf, strerror(e)); | ||
| 214 | // lowercase first letter: Bad -> bad, but STREAM -> STREAM. | ||
| 215 | if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) | ||
| 216 | buf[0] += a - A; | ||
| 217 | printf("\t%d: \"%s\",\n", e, buf); | ||
| 218 | } | ||
| 219 | printf("}\n\n"); | ||
| 220 | |||
| 221 | printf("\n\n// Signal table\n"); | ||
| 222 | printf("var signals = [...]string {\n"); | ||
| 223 | qsort(signals, nelem(signals), sizeof signals[0], intcmp); | ||
| 224 | for(i=0; i<nelem(signals); i++) { | ||
| 225 | e = signals[i]; | ||
| 226 | if(i > 0 && signals[i-1] == e) | ||
| 227 | continue; | ||
| 228 | strcpy(buf, strsignal(e)); | ||
| 229 | // lowercase first letter: Bad -> bad, but STREAM -> STREAM. | ||
| 230 | if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) | ||
| 231 | buf[0] += a - A; | ||
| 232 | // cut trailing : number. | ||
| 233 | p = strrchr(buf, ":"[0]); | ||
| 234 | if(p) | ||
| 235 | *p = '\0'; | ||
| 236 | printf("\t%d: \"%s\",\n", e, buf); | ||
| 237 | } | ||
| 238 | printf("}\n\n"); | ||
| 239 | |||
| 240 | return 0; | ||
| 241 | } | ||
| 242 | |||
| 243 | ' | ||
| 244 | ) >_errors.c | ||
| 245 | |||
| 246 | $CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out | ||
diff --git a/vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh b/vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh new file mode 100644 index 0000000..3c3ab05 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # Copyright 2009 The Go Authors. All rights reserved. | ||
| 3 | # Use of this source code is governed by a BSD-style | ||
| 4 | # license that can be found in the LICENSE file. | ||
| 5 | |||
| 6 | COMMAND="mksysnum_plan9.sh $@" | ||
| 7 | |||
| 8 | cat <<EOF | ||
| 9 | // $COMMAND | ||
| 10 | // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT | ||
| 11 | |||
| 12 | package plan9 | ||
| 13 | |||
| 14 | const( | ||
| 15 | EOF | ||
| 16 | |||
| 17 | SP='[ ]' # space or tab | ||
| 18 | sed "s/^#define${SP}\\([A-Z0-9_][A-Z0-9_]*\\)${SP}${SP}*\\([0-9][0-9]*\\)/SYS_\\1=\\2/g" \ | ||
| 19 | < $1 | grep -v SYS__ | ||
| 20 | |||
| 21 | cat <<EOF | ||
| 22 | ) | ||
| 23 | EOF | ||
diff --git a/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go b/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go new file mode 100644 index 0000000..73687de --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2015 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | //go:build go1.5 | ||
| 6 | |||
| 7 | package plan9 | ||
| 8 | |||
| 9 | import "syscall" | ||
| 10 | |||
| 11 | func fixwd() { | ||
| 12 | syscall.Fixwd() | ||
| 13 | } | ||
| 14 | |||
| 15 | func Getwd() (wd string, err error) { | ||
| 16 | return syscall.Getwd() | ||
| 17 | } | ||
| 18 | |||
| 19 | func Chdir(path string) error { | ||
| 20 | return syscall.Chdir(path) | ||
| 21 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/pwd_plan9.go b/vendor/golang.org/x/sys/plan9/pwd_plan9.go new file mode 100644 index 0000000..fb94582 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/pwd_plan9.go | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | // Copyright 2015 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | //go:build !go1.5 | ||
| 6 | |||
| 7 | package plan9 | ||
| 8 | |||
| 9 | func fixwd() { | ||
| 10 | } | ||
| 11 | |||
| 12 | func Getwd() (wd string, err error) { | ||
| 13 | fd, err := open(".", O_RDONLY) | ||
| 14 | if err != nil { | ||
| 15 | return "", err | ||
| 16 | } | ||
| 17 | defer Close(fd) | ||
| 18 | return Fd2path(fd) | ||
| 19 | } | ||
| 20 | |||
| 21 | func Chdir(path string) error { | ||
| 22 | return chdir(path) | ||
| 23 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/race.go b/vendor/golang.org/x/sys/plan9/race.go new file mode 100644 index 0000000..c02d9ed --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/race.go | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright 2012 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | //go:build plan9 && race | ||
| 6 | |||
| 7 | package plan9 | ||
| 8 | |||
| 9 | import ( | ||
| 10 | "runtime" | ||
| 11 | "unsafe" | ||
| 12 | ) | ||
| 13 | |||
| 14 | const raceenabled = true | ||
| 15 | |||
| 16 | func raceAcquire(addr unsafe.Pointer) { | ||
| 17 | runtime.RaceAcquire(addr) | ||
| 18 | } | ||
| 19 | |||
| 20 | func raceReleaseMerge(addr unsafe.Pointer) { | ||
| 21 | runtime.RaceReleaseMerge(addr) | ||
| 22 | } | ||
| 23 | |||
| 24 | func raceReadRange(addr unsafe.Pointer, len int) { | ||
| 25 | runtime.RaceReadRange(addr, len) | ||
| 26 | } | ||
| 27 | |||
| 28 | func raceWriteRange(addr unsafe.Pointer, len int) { | ||
| 29 | runtime.RaceWriteRange(addr, len) | ||
| 30 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/race0.go b/vendor/golang.org/x/sys/plan9/race0.go new file mode 100644 index 0000000..7b15e15 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/race0.go | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | // Copyright 2012 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | //go:build plan9 && !race | ||
| 6 | |||
| 7 | package plan9 | ||
| 8 | |||
| 9 | import ( | ||
| 10 | "unsafe" | ||
| 11 | ) | ||
| 12 | |||
| 13 | const raceenabled = false | ||
| 14 | |||
| 15 | func raceAcquire(addr unsafe.Pointer) { | ||
| 16 | } | ||
| 17 | |||
| 18 | func raceReleaseMerge(addr unsafe.Pointer) { | ||
| 19 | } | ||
| 20 | |||
| 21 | func raceReadRange(addr unsafe.Pointer, len int) { | ||
| 22 | } | ||
| 23 | |||
| 24 | func raceWriteRange(addr unsafe.Pointer, len int) { | ||
| 25 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/str.go b/vendor/golang.org/x/sys/plan9/str.go new file mode 100644 index 0000000..ba3e8ff --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/str.go | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | //go:build plan9 | ||
| 6 | |||
| 7 | package plan9 | ||
| 8 | |||
| 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency | ||
| 10 | if val < 0 { | ||
| 11 | return "-" + itoa(-val) | ||
| 12 | } | ||
| 13 | var buf [32]byte // big enough for int64 | ||
| 14 | i := len(buf) - 1 | ||
| 15 | for val >= 10 { | ||
| 16 | buf[i] = byte(val%10 + '0') | ||
| 17 | i-- | ||
| 18 | val /= 10 | ||
| 19 | } | ||
| 20 | buf[i] = byte(val + '0') | ||
| 21 | return string(buf[i:]) | ||
| 22 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/syscall.go b/vendor/golang.org/x/sys/plan9/syscall.go new file mode 100644 index 0000000..d631fd6 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/syscall.go | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | //go:build plan9 | ||
| 6 | |||
| 7 | // Package plan9 contains an interface to the low-level operating system | ||
| 8 | // primitives. OS details vary depending on the underlying system, and | ||
| 9 | // by default, godoc will display the OS-specific documentation for the current | ||
| 10 | // system. If you want godoc to display documentation for another | ||
| 11 | // system, set $GOOS and $GOARCH to the desired system. For example, if | ||
| 12 | // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS | ||
| 13 | // to freebsd and $GOARCH to arm. | ||
| 14 | // | ||
| 15 | // The primary use of this package is inside other packages that provide a more | ||
| 16 | // portable interface to the system, such as "os", "time" and "net". Use | ||
| 17 | // those packages rather than this one if you can. | ||
| 18 | // | ||
| 19 | // For details of the functions and data types in this package consult | ||
| 20 | // the manuals for the appropriate operating system. | ||
| 21 | // | ||
| 22 | // These calls return err == nil to indicate success; otherwise | ||
| 23 | // err represents an operating system error describing the failure and | ||
| 24 | // holds a value of type syscall.ErrorString. | ||
| 25 | package plan9 // import "golang.org/x/sys/plan9" | ||
| 26 | |||
| 27 | import ( | ||
| 28 | "bytes" | ||
| 29 | "strings" | ||
| 30 | "unsafe" | ||
| 31 | ) | ||
| 32 | |||
| 33 | // ByteSliceFromString returns a NUL-terminated slice of bytes | ||
| 34 | // containing the text of s. If s contains a NUL byte at any | ||
| 35 | // location, it returns (nil, EINVAL). | ||
| 36 | func ByteSliceFromString(s string) ([]byte, error) { | ||
| 37 | if strings.IndexByte(s, 0) != -1 { | ||
| 38 | return nil, EINVAL | ||
| 39 | } | ||
| 40 | a := make([]byte, len(s)+1) | ||
| 41 | copy(a, s) | ||
| 42 | return a, nil | ||
| 43 | } | ||
| 44 | |||
| 45 | // BytePtrFromString returns a pointer to a NUL-terminated array of | ||
| 46 | // bytes containing the text of s. If s contains a NUL byte at any | ||
| 47 | // location, it returns (nil, EINVAL). | ||
| 48 | func BytePtrFromString(s string) (*byte, error) { | ||
| 49 | a, err := ByteSliceFromString(s) | ||
| 50 | if err != nil { | ||
| 51 | return nil, err | ||
| 52 | } | ||
| 53 | return &a[0], nil | ||
| 54 | } | ||
| 55 | |||
| 56 | // ByteSliceToString returns a string form of the text represented by the slice s, with a terminating NUL and any | ||
| 57 | // bytes after the NUL removed. | ||
| 58 | func ByteSliceToString(s []byte) string { | ||
| 59 | if i := bytes.IndexByte(s, 0); i != -1 { | ||
| 60 | s = s[:i] | ||
| 61 | } | ||
| 62 | return string(s) | ||
| 63 | } | ||
| 64 | |||
| 65 | // BytePtrToString takes a pointer to a sequence of text and returns the corresponding string. | ||
| 66 | // If the pointer is nil, it returns the empty string. It assumes that the text sequence is terminated | ||
| 67 | // at a zero byte; if the zero byte is not present, the program may crash. | ||
| 68 | func BytePtrToString(p *byte) string { | ||
| 69 | if p == nil { | ||
| 70 | return "" | ||
| 71 | } | ||
| 72 | if *p == 0 { | ||
| 73 | return "" | ||
| 74 | } | ||
| 75 | |||
| 76 | // Find NUL terminator. | ||
| 77 | n := 0 | ||
| 78 | for ptr := unsafe.Pointer(p); *(*byte)(ptr) != 0; n++ { | ||
| 79 | ptr = unsafe.Pointer(uintptr(ptr) + 1) | ||
| 80 | } | ||
| 81 | |||
| 82 | return string(unsafe.Slice(p, n)) | ||
| 83 | } | ||
| 84 | |||
| 85 | // Single-word zero for use when we need a valid pointer to 0 bytes. | ||
| 86 | // See mksyscall.pl. | ||
| 87 | var _zero uintptr | ||
| 88 | |||
| 89 | func (ts *Timespec) Unix() (sec int64, nsec int64) { | ||
| 90 | return int64(ts.Sec), int64(ts.Nsec) | ||
| 91 | } | ||
| 92 | |||
| 93 | func (tv *Timeval) Unix() (sec int64, nsec int64) { | ||
| 94 | return int64(tv.Sec), int64(tv.Usec) * 1000 | ||
| 95 | } | ||
| 96 | |||
| 97 | func (ts *Timespec) Nano() int64 { | ||
| 98 | return int64(ts.Sec)*1e9 + int64(ts.Nsec) | ||
| 99 | } | ||
| 100 | |||
| 101 | func (tv *Timeval) Nano() int64 { | ||
| 102 | return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 | ||
| 103 | } | ||
| 104 | |||
| 105 | // use is a no-op, but the compiler cannot see that it is. | ||
| 106 | // Calling use(p) ensures that p is kept live until that point. | ||
| 107 | // | ||
| 108 | //go:noescape | ||
| 109 | func use(p unsafe.Pointer) | ||
diff --git a/vendor/golang.org/x/sys/plan9/syscall_plan9.go b/vendor/golang.org/x/sys/plan9/syscall_plan9.go new file mode 100644 index 0000000..d079d81 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/syscall_plan9.go | |||
| @@ -0,0 +1,361 @@ | |||
| 1 | // Copyright 2011 The Go Authors. All rights reserved. | ||
| 2 | // Use of this source code is governed by a BSD-style | ||
| 3 | // license that can be found in the LICENSE file. | ||
| 4 | |||
| 5 | // Plan 9 system calls. | ||
| 6 | // This file is compiled as ordinary Go code, | ||
| 7 | // but it is also input to mksyscall, | ||
| 8 | // which parses the //sys lines and generates system call stubs. | ||
| 9 | // Note that sometimes we use a lowercase //sys name and | ||
| 10 | // wrap it in our own nicer implementation. | ||
| 11 | |||
| 12 | package plan9 | ||
| 13 | |||
| 14 | import ( | ||
| 15 | "bytes" | ||
| 16 | "syscall" | ||
| 17 | "unsafe" | ||
| 18 | ) | ||
| 19 | |||
| 20 | // A Note is a string describing a process note. | ||
| 21 | // It implements the os.Signal interface. | ||
| 22 | type Note string | ||
| 23 | |||
| 24 | func (n Note) Signal() {} | ||
| 25 | |||
| 26 | func (n Note) String() string { | ||
| 27 | return string(n) | ||
| 28 | } | ||
| 29 | |||
| 30 | var ( | ||
| 31 | Stdin = 0 | ||
| 32 | Stdout = 1 | ||
| 33 | Stderr = 2 | ||
| 34 | ) | ||
| 35 | |||
| 36 | // For testing: clients can set this flag to force | ||
| 37 | // creation of IPv6 sockets to return EAFNOSUPPORT. | ||
| 38 | var SocketDisableIPv6 bool | ||
| 39 | |||
| 40 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.ErrorString) | ||
| 41 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.ErrorString) | ||
| 42 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) | ||
| 43 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) | ||
| 44 | |||
| 45 | func atoi(b []byte) (n uint) { | ||
| 46 | n = 0 | ||
| 47 | for i := 0; i < len(b); i++ { | ||
| 48 | n = n*10 + uint(b[i]-'0') | ||
| 49 | } | ||
| 50 | return | ||
| 51 | } | ||
| 52 | |||
| 53 | func cstring(s []byte) string { | ||
| 54 | i := bytes.IndexByte(s, 0) | ||
| 55 | if i == -1 { | ||
| 56 | i = len(s) | ||
| 57 | } | ||
| 58 | return string(s[:i]) | ||
| 59 | } | ||
| 60 | |||
| 61 | func errstr() string { | ||
| 62 | var buf [ERRMAX]byte | ||
| 63 | |||
| 64 | RawSyscall(SYS_ERRSTR, uintptr(unsafe.Pointer(&buf[0])), uintptr(len(buf)), 0) | ||
| 65 | |||
| 66 | buf[len(buf)-1] = 0 | ||
| 67 | return cstring(buf[:]) | ||
| 68 | } | ||
| 69 | |||
| 70 | // Implemented in assembly to import from runtime. | ||
| 71 | func exit(code int) | ||
| 72 | |||
| 73 | func Exit(code int) { exit(code) } | ||
| 74 | |||
| 75 | func readnum(path string) (uint, error) { | ||
| 76 | var b [12]byte | ||
| 77 | |||
| 78 | fd, e := Open(path, O_RDONLY) | ||
| 79 | if e != nil { | ||
| 80 | return 0, e | ||
| 81 | } | ||
| 82 | defer Close(fd) | ||
| 83 | |||
| 84 | n, e := Pread(fd, b[:], 0) | ||
| 85 | |||
| 86 | if e != nil { | ||
| 87 | return 0, e | ||
| 88 | } | ||
| 89 | |||
| 90 | m := 0 | ||
| 91 | for ; m < n && b[m] == ' '; m++ { | ||
| 92 | } | ||
| 93 | |||
| 94 | return atoi(b[m : n-1]), nil | ||
| 95 | } | ||
| 96 | |||
| 97 | func Getpid() (pid int) { | ||
| 98 | n, _ := readnum("#c/pid") | ||
| 99 | return int(n) | ||
| 100 | } | ||
| 101 | |||
| 102 | func Getppid() (ppid int) { | ||
| 103 | n, _ := readnum("#c/ppid") | ||
| 104 | return int(n) | ||
| 105 | } | ||
| 106 | |||
| 107 | func Read(fd int, p []byte) (n int, err error) { | ||
| 108 | return Pread(fd, p, -1) | ||
| 109 | } | ||
| 110 | |||
| 111 | func Write(fd int, p []byte) (n int, err error) { | ||
| 112 | return Pwrite(fd, p, -1) | ||
| 113 | } | ||
| 114 | |||
| 115 | var ioSync int64 | ||
| 116 | |||
| 117 | //sys fd2path(fd int, buf []byte) (err error) | ||
| 118 | |||
| 119 | func Fd2path(fd int) (path string, err error) { | ||
| 120 | var buf [512]byte | ||
| 121 | |||
| 122 | e := fd2path(fd, buf[:]) | ||
| 123 | if e != nil { | ||
| 124 | return "", e | ||
| 125 | } | ||
| 126 | return cstring(buf[:]), nil | ||
| 127 | } | ||
| 128 | |||
| 129 | //sys pipe(p *[2]int32) (err error) | ||
| 130 | |||
| 131 | func Pipe(p []int) (err error) { | ||
| 132 | if len(p) != 2 { | ||
| 133 | return syscall.ErrorString("bad arg in system call") | ||
| 134 | } | ||
| 135 | var pp [2]int32 | ||
| 136 | err = pipe(&pp) | ||
| 137 | if err == nil { | ||
| 138 | p[0] = int(pp[0]) | ||
| 139 | p[1] = int(pp[1]) | ||
| 140 | } | ||
| 141 | return | ||
| 142 | } | ||
| 143 | |||
| 144 | // Underlying system call writes to newoffset via pointer. | ||
| 145 | // Implemented in assembly to avoid allocation. | ||
| 146 | func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) | ||
| 147 | |||
| 148 | func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { | ||
| 149 | newoffset, e := seek(0, fd, offset, whence) | ||
| 150 | |||
| 151 | if newoffset == -1 { | ||
| 152 | err = syscall.ErrorString(e) | ||
| 153 | } | ||
| 154 | return | ||
| 155 | } | ||
| 156 | |||
| 157 | func Mkdir(path string, mode uint32) (err error) { | ||
| 158 | fd, err := Create(path, O_RDONLY, DMDIR|mode) | ||
| 159 | |||
| 160 | if fd != -1 { | ||
| 161 | Close(fd) | ||
| 162 | } | ||
| 163 | |||
| 164 | return | ||
| 165 | } | ||
| 166 | |||
| 167 | type Waitmsg struct { | ||
| 168 | Pid int | ||
| 169 | Time [3]uint32 | ||
| 170 | Msg string | ||
| 171 | } | ||
| 172 | |||
| 173 | func (w Waitmsg) Exited() bool { return true } | ||
| 174 | func (w Waitmsg) Signaled() bool { return false } | ||
| 175 | |||
| 176 | func (w Waitmsg) ExitStatus() int { | ||
| 177 | if len(w.Msg) == 0 { | ||
| 178 | // a normal exit returns no message | ||
| 179 | return 0 | ||
| 180 | } | ||
| 181 | return 1 | ||
| 182 | } | ||
| 183 | |||
| 184 | //sys await(s []byte) (n int, err error) | ||
| 185 | |||
| 186 | func Await(w *Waitmsg) (err error) { | ||
| 187 | var buf [512]byte | ||
| 188 | var f [5][]byte | ||
| 189 | |||
| 190 | n, err := await(buf[:]) | ||
| 191 | |||
| 192 | if err != nil || w == nil { | ||
| 193 | return | ||
| 194 | } | ||
| 195 | |||
| 196 | nf := 0 | ||
| 197 | p := 0 | ||
| 198 | for i := 0; i < n && nf < len(f)-1; i++ { | ||
| 199 | if buf[i] == ' ' { | ||
| 200 | f[nf] = buf[p:i] | ||
| 201 | p = i + 1 | ||
| 202 | nf++ | ||
| 203 | } | ||
| 204 | } | ||
| 205 | f[nf] = buf[p:] | ||
| 206 | nf++ | ||
| 207 | |||
| 208 | if nf != len(f) { | ||
| 209 | return syscall.ErrorString("invalid wait message") | ||
| 210 | } | ||
| 211 | w.Pid = int(atoi(f[0])) | ||
| 212 | w.Time[0] = uint32(atoi(f[1])) | ||
| 213 | w.Time[1] = uint32(atoi(f[2])) | ||
| 214 | w.Time[2] = uint32(atoi(f[3])) | ||
| 215 | w.Msg = cstring(f[4]) | ||
| 216 | if w.Msg == "''" { | ||
| 217 | // await() returns '' for no error | ||
| 218 | w.Msg = "" | ||
| 219 | } | ||
| 220 | return | ||
| 221 | } | ||
| 222 | |||
| 223 | func Unmount(name, old string) (err error) { | ||
| 224 | fixwd() | ||
| 225 | oldp, err := BytePtrFromString(old) | ||
| 226 | if err != nil { | ||
| 227 | return err | ||
| 228 | } | ||
| 229 | oldptr := uintptr(unsafe.Pointer(oldp)) | ||
| 230 | |||
| 231 | var r0 uintptr | ||
| 232 | var e syscall.ErrorString | ||
| 233 | |||
| 234 | // bind(2) man page: If name is zero, everything bound or mounted upon old is unbound or unmounted. | ||
| 235 | if name == "" { | ||
| 236 | r0, _, e = Syscall(SYS_UNMOUNT, _zero, oldptr, 0) | ||
| 237 | } else { | ||
| 238 | namep, err := BytePtrFromString(name) | ||
| 239 | if err != nil { | ||
| 240 | return err | ||
| 241 | } | ||
| 242 | r0, _, e = Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(namep)), oldptr, 0) | ||
| 243 | } | ||
| 244 | |||
| 245 | if int32(r0) == -1 { | ||
| 246 | err = e | ||
| 247 | } | ||
| 248 | return | ||
| 249 | } | ||
| 250 | |||
| 251 | func Fchdir(fd int) (err error) { | ||
| 252 | path, err := Fd2path(fd) | ||
| 253 | |||
| 254 | if err != nil { | ||
| 255 | return | ||
| 256 | } | ||
| 257 | |||
| 258 | return Chdir(path) | ||
| 259 | } | ||
| 260 | |||
| 261 | type Timespec struct { | ||
| 262 | Sec int32 | ||
| 263 | Nsec int32 | ||
| 264 | } | ||
| 265 | |||
| 266 | type Timeval struct { | ||
| 267 | Sec int32 | ||
| 268 | Usec int32 | ||
| 269 | } | ||
| 270 | |||
| 271 | func NsecToTimeval(nsec int64) (tv Timeval) { | ||
| 272 | nsec += 999 // round up to microsecond | ||
| 273 | tv.Usec = int32(nsec % 1e9 / 1e3) | ||
| 274 | tv.Sec = int32(nsec / 1e9) | ||
| 275 | return | ||
| 276 | } | ||
| 277 | |||
| 278 | func nsec() int64 { | ||
| 279 | var scratch int64 | ||
| 280 | |||
| 281 | r0, _, _ := Syscall(SYS_NSEC, uintptr(unsafe.Pointer(&scratch)), 0, 0) | ||
| 282 | // TODO(aram): remove hack after I fix _nsec in the pc64 kernel. | ||
| 283 | if r0 == 0 { | ||
| 284 | return scratch | ||
| 285 | } | ||
| 286 | return int64(r0) | ||
| 287 | } | ||
| 288 | |||
| 289 | func Gettimeofday(tv *Timeval) error { | ||
| 290 | nsec := nsec() | ||
| 291 | *tv = NsecToTimeval(nsec) | ||
| 292 | return nil | ||
| 293 | } | ||
| 294 | |||
| 295 | func Getpagesize() int { return 0x1000 } | ||
| 296 | |||
| 297 | func Getegid() (egid int) { return -1 } | ||
| 298 | func Geteuid() (euid int) { return -1 } | ||
| 299 | func Getgid() (gid int) { return -1 } | ||
| 300 | func Getuid() (uid int) { return -1 } | ||
| 301 | |||
| 302 | func Getgroups() (gids []int, err error) { | ||
| 303 | return make([]int, 0), nil | ||
| 304 | } | ||
| 305 | |||
| 306 | //sys open(path string, mode int) (fd int, err error) | ||
| 307 | |||
| 308 | func Open(path string, mode int) (fd int, err error) { | ||
| 309 | fixwd() | ||
| 310 | return open(path, mode) | ||
| 311 | } | ||
| 312 | |||
| 313 | //sys create(path string, mode int, perm uint32) (fd int, err error) | ||
| 314 | |||
| 315 | func Create(path string, mode int, perm uint32) (fd int, err error) { | ||
| 316 | fixwd() | ||
| 317 | return create(path, mode, perm) | ||
| 318 | } | ||
| 319 | |||
| 320 | //sys remove(path string) (err error) | ||
| 321 | |||
| 322 | func Remove(path string) error { | ||
| 323 | fixwd() | ||
| 324 | return remove(path) | ||
| 325 | } | ||
| 326 | |||
| 327 | //sys stat(path string, edir []byte) (n int, err error) | ||
| 328 | |||
| 329 | func Stat(path string, edir []byte) (n int, err error) { | ||
| 330 | fixwd() | ||
| 331 | return stat(path, edir) | ||
| 332 | } | ||
| 333 | |||
| 334 | //sys bind(name string, old string, flag int) (err error) | ||
| 335 | |||
| 336 | func Bind(name string, old string, flag int) (err error) { | ||
| 337 | fixwd() | ||
| 338 | return bind(name, old, flag) | ||
| 339 | } | ||
| 340 | |||
| 341 | //sys mount(fd int, afd int, old string, flag int, aname string) (err error) | ||
| 342 | |||
| 343 | func Mount(fd int, afd int, old string, flag int, aname string) (err error) { | ||
| 344 | fixwd() | ||
| 345 | return mount(fd, afd, old, flag, aname) | ||
| 346 | } | ||
| 347 | |||
| 348 | //sys wstat(path string, edir []byte) (err error) | ||
| 349 | |||
| 350 | func Wstat(path string, edir []byte) (err error) { | ||
| 351 | fixwd() | ||
| 352 | return wstat(path, edir) | ||
| 353 | } | ||
| 354 | |||
| 355 | //sys chdir(path string) (err error) | ||
| 356 | //sys Dup(oldfd int, newfd int) (fd int, err error) | ||
| 357 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) | ||
| 358 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) | ||
| 359 | //sys Close(fd int) (err error) | ||
| 360 | //sys Fstat(fd int, edir []byte) (n int, err error) | ||
| 361 | //sys Fwstat(fd int, edir []byte) (err error) | ||
diff --git a/vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go b/vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go new file mode 100644 index 0000000..f780d5c --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go | |||
| @@ -0,0 +1,284 @@ | |||
| 1 | // go run mksyscall.go -l32 -plan9 -tags plan9,386 syscall_plan9.go | ||
| 2 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
| 3 | |||
| 4 | //go:build plan9 && 386 | ||
| 5 | |||
| 6 | package plan9 | ||
| 7 | |||
| 8 | import "unsafe" | ||
| 9 | |||
| 10 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 11 | |||
| 12 | func fd2path(fd int, buf []byte) (err error) { | ||
| 13 | var _p0 unsafe.Pointer | ||
| 14 | if len(buf) > 0 { | ||
| 15 | _p0 = unsafe.Pointer(&buf[0]) | ||
| 16 | } else { | ||
| 17 | _p0 = unsafe.Pointer(&_zero) | ||
| 18 | } | ||
| 19 | r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) | ||
| 20 | if int32(r0) == -1 { | ||
| 21 | err = e1 | ||
| 22 | } | ||
| 23 | return | ||
| 24 | } | ||
| 25 | |||
| 26 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 27 | |||
| 28 | func pipe(p *[2]int32) (err error) { | ||
| 29 | r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) | ||
| 30 | if int32(r0) == -1 { | ||
| 31 | err = e1 | ||
| 32 | } | ||
| 33 | return | ||
| 34 | } | ||
| 35 | |||
| 36 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 37 | |||
| 38 | func await(s []byte) (n int, err error) { | ||
| 39 | var _p0 unsafe.Pointer | ||
| 40 | if len(s) > 0 { | ||
| 41 | _p0 = unsafe.Pointer(&s[0]) | ||
| 42 | } else { | ||
| 43 | _p0 = unsafe.Pointer(&_zero) | ||
| 44 | } | ||
| 45 | r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) | ||
| 46 | n = int(r0) | ||
| 47 | if int32(r0) == -1 { | ||
| 48 | err = e1 | ||
| 49 | } | ||
| 50 | return | ||
| 51 | } | ||
| 52 | |||
| 53 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 54 | |||
| 55 | func open(path string, mode int) (fd int, err error) { | ||
| 56 | var _p0 *byte | ||
| 57 | _p0, err = BytePtrFromString(path) | ||
| 58 | if err != nil { | ||
| 59 | return | ||
| 60 | } | ||
| 61 | r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) | ||
| 62 | fd = int(r0) | ||
| 63 | if int32(r0) == -1 { | ||
| 64 | err = e1 | ||
| 65 | } | ||
| 66 | return | ||
| 67 | } | ||
| 68 | |||
| 69 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 70 | |||
| 71 | func create(path string, mode int, perm uint32) (fd int, err error) { | ||
| 72 | var _p0 *byte | ||
| 73 | _p0, err = BytePtrFromString(path) | ||
| 74 | if err != nil { | ||
| 75 | return | ||
| 76 | } | ||
| 77 | r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) | ||
| 78 | fd = int(r0) | ||
| 79 | if int32(r0) == -1 { | ||
| 80 | err = e1 | ||
| 81 | } | ||
| 82 | return | ||
| 83 | } | ||
| 84 | |||
| 85 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 86 | |||
| 87 | func remove(path string) (err error) { | ||
| 88 | var _p0 *byte | ||
| 89 | _p0, err = BytePtrFromString(path) | ||
| 90 | if err != nil { | ||
| 91 | return | ||
| 92 | } | ||
| 93 | r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) | ||
| 94 | if int32(r0) == -1 { | ||
| 95 | err = e1 | ||
| 96 | } | ||
| 97 | return | ||
| 98 | } | ||
| 99 | |||
| 100 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 101 | |||
| 102 | func stat(path string, edir []byte) (n int, err error) { | ||
| 103 | var _p0 *byte | ||
| 104 | _p0, err = BytePtrFromString(path) | ||
| 105 | if err != nil { | ||
| 106 | return | ||
| 107 | } | ||
| 108 | var _p1 unsafe.Pointer | ||
| 109 | if len(edir) > 0 { | ||
| 110 | _p1 = unsafe.Pointer(&edir[0]) | ||
| 111 | } else { | ||
| 112 | _p1 = unsafe.Pointer(&_zero) | ||
| 113 | } | ||
| 114 | r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) | ||
| 115 | n = int(r0) | ||
| 116 | if int32(r0) == -1 { | ||
| 117 | err = e1 | ||
| 118 | } | ||
| 119 | return | ||
| 120 | } | ||
| 121 | |||
| 122 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 123 | |||
| 124 | func bind(name string, old string, flag int) (err error) { | ||
| 125 | var _p0 *byte | ||
| 126 | _p0, err = BytePtrFromString(name) | ||
| 127 | if err != nil { | ||
| 128 | return | ||
| 129 | } | ||
| 130 | var _p1 *byte | ||
| 131 | _p1, err = BytePtrFromString(old) | ||
| 132 | if err != nil { | ||
| 133 | return | ||
| 134 | } | ||
| 135 | r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) | ||
| 136 | if int32(r0) == -1 { | ||
| 137 | err = e1 | ||
| 138 | } | ||
| 139 | return | ||
| 140 | } | ||
| 141 | |||
| 142 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 143 | |||
| 144 | func mount(fd int, afd int, old string, flag int, aname string) (err error) { | ||
| 145 | var _p0 *byte | ||
| 146 | _p0, err = BytePtrFromString(old) | ||
| 147 | if err != nil { | ||
| 148 | return | ||
| 149 | } | ||
| 150 | var _p1 *byte | ||
| 151 | _p1, err = BytePtrFromString(aname) | ||
| 152 | if err != nil { | ||
| 153 | return | ||
| 154 | } | ||
| 155 | r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0) | ||
| 156 | if int32(r0) == -1 { | ||
| 157 | err = e1 | ||
| 158 | } | ||
| 159 | return | ||
| 160 | } | ||
| 161 | |||
| 162 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 163 | |||
| 164 | func wstat(path string, edir []byte) (err error) { | ||
| 165 | var _p0 *byte | ||
| 166 | _p0, err = BytePtrFromString(path) | ||
| 167 | if err != nil { | ||
| 168 | return | ||
| 169 | } | ||
| 170 | var _p1 unsafe.Pointer | ||
| 171 | if len(edir) > 0 { | ||
| 172 | _p1 = unsafe.Pointer(&edir[0]) | ||
| 173 | } else { | ||
| 174 | _p1 = unsafe.Pointer(&_zero) | ||
| 175 | } | ||
| 176 | r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) | ||
| 177 | if int32(r0) == -1 { | ||
| 178 | err = e1 | ||
| 179 | } | ||
| 180 | return | ||
| 181 | } | ||
| 182 | |||
| 183 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 184 | |||
| 185 | func chdir(path string) (err error) { | ||
| 186 | var _p0 *byte | ||
| 187 | _p0, err = BytePtrFromString(path) | ||
| 188 | if err != nil { | ||
| 189 | return | ||
| 190 | } | ||
| 191 | r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) | ||
| 192 | if int32(r0) == -1 { | ||
| 193 | err = e1 | ||
| 194 | } | ||
| 195 | return | ||
| 196 | } | ||
| 197 | |||
| 198 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 199 | |||
| 200 | func Dup(oldfd int, newfd int) (fd int, err error) { | ||
| 201 | r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) | ||
| 202 | fd = int(r0) | ||
| 203 | if int32(r0) == -1 { | ||
| 204 | err = e1 | ||
| 205 | } | ||
| 206 | return | ||
| 207 | } | ||
| 208 | |||
| 209 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 210 | |||
| 211 | func Pread(fd int, p []byte, offset int64) (n int, err error) { | ||
| 212 | var _p0 unsafe.Pointer | ||
| 213 | if len(p) > 0 { | ||
| 214 | _p0 = unsafe.Pointer(&p[0]) | ||
| 215 | } else { | ||
| 216 | _p0 = unsafe.Pointer(&_zero) | ||
| 217 | } | ||
| 218 | r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) | ||
| 219 | n = int(r0) | ||
| 220 | if int32(r0) == -1 { | ||
| 221 | err = e1 | ||
| 222 | } | ||
| 223 | return | ||
| 224 | } | ||
| 225 | |||
| 226 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 227 | |||
| 228 | func Pwrite(fd int, p []byte, offset int64) (n int, err error) { | ||
| 229 | var _p0 unsafe.Pointer | ||
| 230 | if len(p) > 0 { | ||
| 231 | _p0 = unsafe.Pointer(&p[0]) | ||
| 232 | } else { | ||
| 233 | _p0 = unsafe.Pointer(&_zero) | ||
| 234 | } | ||
| 235 | r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) | ||
| 236 | n = int(r0) | ||
| 237 | if int32(r0) == -1 { | ||
| 238 | err = e1 | ||
| 239 | } | ||
| 240 | return | ||
| 241 | } | ||
| 242 | |||
| 243 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 244 | |||
| 245 | func Close(fd int) (err error) { | ||
| 246 | r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) | ||
| 247 | if int32(r0) == -1 { | ||
| 248 | err = e1 | ||
| 249 | } | ||
| 250 | return | ||
| 251 | } | ||
| 252 | |||
| 253 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 254 | |||
| 255 | func Fstat(fd int, edir []byte) (n int, err error) { | ||
| 256 | var _p0 unsafe.Pointer | ||
| 257 | if len(edir) > 0 { | ||
| 258 | _p0 = unsafe.Pointer(&edir[0]) | ||
| 259 | } else { | ||
| 260 | _p0 = unsafe.Pointer(&_zero) | ||
| 261 | } | ||
| 262 | r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) | ||
| 263 | n = int(r0) | ||
| 264 | if int32(r0) == -1 { | ||
| 265 | err = e1 | ||
| 266 | } | ||
| 267 | return | ||
| 268 | } | ||
| 269 | |||
| 270 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 271 | |||
| 272 | func Fwstat(fd int, edir []byte) (err error) { | ||
| 273 | var _p0 unsafe.Pointer | ||
| 274 | if len(edir) > 0 { | ||
| 275 | _p0 = unsafe.Pointer(&edir[0]) | ||
| 276 | } else { | ||
| 277 | _p0 = unsafe.Pointer(&_zero) | ||
| 278 | } | ||
| 279 | r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) | ||
| 280 | if int32(r0) == -1 { | ||
| 281 | err = e1 | ||
| 282 | } | ||
| 283 | return | ||
| 284 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go b/vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go new file mode 100644 index 0000000..7de6106 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go | |||
| @@ -0,0 +1,284 @@ | |||
| 1 | // go run mksyscall.go -l32 -plan9 -tags plan9,amd64 syscall_plan9.go | ||
| 2 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
| 3 | |||
| 4 | //go:build plan9 && amd64 | ||
| 5 | |||
| 6 | package plan9 | ||
| 7 | |||
| 8 | import "unsafe" | ||
| 9 | |||
| 10 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 11 | |||
| 12 | func fd2path(fd int, buf []byte) (err error) { | ||
| 13 | var _p0 unsafe.Pointer | ||
| 14 | if len(buf) > 0 { | ||
| 15 | _p0 = unsafe.Pointer(&buf[0]) | ||
| 16 | } else { | ||
| 17 | _p0 = unsafe.Pointer(&_zero) | ||
| 18 | } | ||
| 19 | r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) | ||
| 20 | if int32(r0) == -1 { | ||
| 21 | err = e1 | ||
| 22 | } | ||
| 23 | return | ||
| 24 | } | ||
| 25 | |||
| 26 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 27 | |||
| 28 | func pipe(p *[2]int32) (err error) { | ||
| 29 | r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) | ||
| 30 | if int32(r0) == -1 { | ||
| 31 | err = e1 | ||
| 32 | } | ||
| 33 | return | ||
| 34 | } | ||
| 35 | |||
| 36 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 37 | |||
| 38 | func await(s []byte) (n int, err error) { | ||
| 39 | var _p0 unsafe.Pointer | ||
| 40 | if len(s) > 0 { | ||
| 41 | _p0 = unsafe.Pointer(&s[0]) | ||
| 42 | } else { | ||
| 43 | _p0 = unsafe.Pointer(&_zero) | ||
| 44 | } | ||
| 45 | r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) | ||
| 46 | n = int(r0) | ||
| 47 | if int32(r0) == -1 { | ||
| 48 | err = e1 | ||
| 49 | } | ||
| 50 | return | ||
| 51 | } | ||
| 52 | |||
| 53 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 54 | |||
| 55 | func open(path string, mode int) (fd int, err error) { | ||
| 56 | var _p0 *byte | ||
| 57 | _p0, err = BytePtrFromString(path) | ||
| 58 | if err != nil { | ||
| 59 | return | ||
| 60 | } | ||
| 61 | r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) | ||
| 62 | fd = int(r0) | ||
| 63 | if int32(r0) == -1 { | ||
| 64 | err = e1 | ||
| 65 | } | ||
| 66 | return | ||
| 67 | } | ||
| 68 | |||
| 69 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 70 | |||
| 71 | func create(path string, mode int, perm uint32) (fd int, err error) { | ||
| 72 | var _p0 *byte | ||
| 73 | _p0, err = BytePtrFromString(path) | ||
| 74 | if err != nil { | ||
| 75 | return | ||
| 76 | } | ||
| 77 | r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) | ||
| 78 | fd = int(r0) | ||
| 79 | if int32(r0) == -1 { | ||
| 80 | err = e1 | ||
| 81 | } | ||
| 82 | return | ||
| 83 | } | ||
| 84 | |||
| 85 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 86 | |||
| 87 | func remove(path string) (err error) { | ||
| 88 | var _p0 *byte | ||
| 89 | _p0, err = BytePtrFromString(path) | ||
| 90 | if err != nil { | ||
| 91 | return | ||
| 92 | } | ||
| 93 | r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) | ||
| 94 | if int32(r0) == -1 { | ||
| 95 | err = e1 | ||
| 96 | } | ||
| 97 | return | ||
| 98 | } | ||
| 99 | |||
| 100 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 101 | |||
| 102 | func stat(path string, edir []byte) (n int, err error) { | ||
| 103 | var _p0 *byte | ||
| 104 | _p0, err = BytePtrFromString(path) | ||
| 105 | if err != nil { | ||
| 106 | return | ||
| 107 | } | ||
| 108 | var _p1 unsafe.Pointer | ||
| 109 | if len(edir) > 0 { | ||
| 110 | _p1 = unsafe.Pointer(&edir[0]) | ||
| 111 | } else { | ||
| 112 | _p1 = unsafe.Pointer(&_zero) | ||
| 113 | } | ||
| 114 | r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) | ||
| 115 | n = int(r0) | ||
| 116 | if int32(r0) == -1 { | ||
| 117 | err = e1 | ||
| 118 | } | ||
| 119 | return | ||
| 120 | } | ||
| 121 | |||
| 122 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 123 | |||
| 124 | func bind(name string, old string, flag int) (err error) { | ||
| 125 | var _p0 *byte | ||
| 126 | _p0, err = BytePtrFromString(name) | ||
| 127 | if err != nil { | ||
| 128 | return | ||
| 129 | } | ||
| 130 | var _p1 *byte | ||
| 131 | _p1, err = BytePtrFromString(old) | ||
| 132 | if err != nil { | ||
| 133 | return | ||
| 134 | } | ||
| 135 | r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) | ||
| 136 | if int32(r0) == -1 { | ||
| 137 | err = e1 | ||
| 138 | } | ||
| 139 | return | ||
| 140 | } | ||
| 141 | |||
| 142 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 143 | |||
| 144 | func mount(fd int, afd int, old string, flag int, aname string) (err error) { | ||
| 145 | var _p0 *byte | ||
| 146 | _p0, err = BytePtrFromString(old) | ||
| 147 | if err != nil { | ||
| 148 | return | ||
| 149 | } | ||
| 150 | var _p1 *byte | ||
| 151 | _p1, err = BytePtrFromString(aname) | ||
| 152 | if err != nil { | ||
| 153 | return | ||
| 154 | } | ||
| 155 | r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0) | ||
| 156 | if int32(r0) == -1 { | ||
| 157 | err = e1 | ||
| 158 | } | ||
| 159 | return | ||
| 160 | } | ||
| 161 | |||
| 162 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 163 | |||
| 164 | func wstat(path string, edir []byte) (err error) { | ||
| 165 | var _p0 *byte | ||
| 166 | _p0, err = BytePtrFromString(path) | ||
| 167 | if err != nil { | ||
| 168 | return | ||
| 169 | } | ||
| 170 | var _p1 unsafe.Pointer | ||
| 171 | if len(edir) > 0 { | ||
| 172 | _p1 = unsafe.Pointer(&edir[0]) | ||
| 173 | } else { | ||
| 174 | _p1 = unsafe.Pointer(&_zero) | ||
| 175 | } | ||
| 176 | r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) | ||
| 177 | if int32(r0) == -1 { | ||
| 178 | err = e1 | ||
| 179 | } | ||
| 180 | return | ||
| 181 | } | ||
| 182 | |||
| 183 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 184 | |||
| 185 | func chdir(path string) (err error) { | ||
| 186 | var _p0 *byte | ||
| 187 | _p0, err = BytePtrFromString(path) | ||
| 188 | if err != nil { | ||
| 189 | return | ||
| 190 | } | ||
| 191 | r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) | ||
| 192 | if int32(r0) == -1 { | ||
| 193 | err = e1 | ||
| 194 | } | ||
| 195 | return | ||
| 196 | } | ||
| 197 | |||
| 198 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 199 | |||
| 200 | func Dup(oldfd int, newfd int) (fd int, err error) { | ||
| 201 | r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) | ||
| 202 | fd = int(r0) | ||
| 203 | if int32(r0) == -1 { | ||
| 204 | err = e1 | ||
| 205 | } | ||
| 206 | return | ||
| 207 | } | ||
| 208 | |||
| 209 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 210 | |||
| 211 | func Pread(fd int, p []byte, offset int64) (n int, err error) { | ||
| 212 | var _p0 unsafe.Pointer | ||
| 213 | if len(p) > 0 { | ||
| 214 | _p0 = unsafe.Pointer(&p[0]) | ||
| 215 | } else { | ||
| 216 | _p0 = unsafe.Pointer(&_zero) | ||
| 217 | } | ||
| 218 | r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) | ||
| 219 | n = int(r0) | ||
| 220 | if int32(r0) == -1 { | ||
| 221 | err = e1 | ||
| 222 | } | ||
| 223 | return | ||
| 224 | } | ||
| 225 | |||
| 226 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 227 | |||
| 228 | func Pwrite(fd int, p []byte, offset int64) (n int, err error) { | ||
| 229 | var _p0 unsafe.Pointer | ||
| 230 | if len(p) > 0 { | ||
| 231 | _p0 = unsafe.Pointer(&p[0]) | ||
| 232 | } else { | ||
| 233 | _p0 = unsafe.Pointer(&_zero) | ||
| 234 | } | ||
| 235 | r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) | ||
| 236 | n = int(r0) | ||
| 237 | if int32(r0) == -1 { | ||
| 238 | err = e1 | ||
| 239 | } | ||
| 240 | return | ||
| 241 | } | ||
| 242 | |||
| 243 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 244 | |||
| 245 | func Close(fd int) (err error) { | ||
| 246 | r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) | ||
| 247 | if int32(r0) == -1 { | ||
| 248 | err = e1 | ||
| 249 | } | ||
| 250 | return | ||
| 251 | } | ||
| 252 | |||
| 253 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 254 | |||
| 255 | func Fstat(fd int, edir []byte) (n int, err error) { | ||
| 256 | var _p0 unsafe.Pointer | ||
| 257 | if len(edir) > 0 { | ||
| 258 | _p0 = unsafe.Pointer(&edir[0]) | ||
| 259 | } else { | ||
| 260 | _p0 = unsafe.Pointer(&_zero) | ||
| 261 | } | ||
| 262 | r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) | ||
| 263 | n = int(r0) | ||
| 264 | if int32(r0) == -1 { | ||
| 265 | err = e1 | ||
| 266 | } | ||
| 267 | return | ||
| 268 | } | ||
| 269 | |||
| 270 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 271 | |||
| 272 | func Fwstat(fd int, edir []byte) (err error) { | ||
| 273 | var _p0 unsafe.Pointer | ||
| 274 | if len(edir) > 0 { | ||
| 275 | _p0 = unsafe.Pointer(&edir[0]) | ||
| 276 | } else { | ||
| 277 | _p0 = unsafe.Pointer(&_zero) | ||
| 278 | } | ||
| 279 | r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) | ||
| 280 | if int32(r0) == -1 { | ||
| 281 | err = e1 | ||
| 282 | } | ||
| 283 | return | ||
| 284 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/zsyscall_plan9_arm.go b/vendor/golang.org/x/sys/plan9/zsyscall_plan9_arm.go new file mode 100644 index 0000000..ea85780 --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/zsyscall_plan9_arm.go | |||
| @@ -0,0 +1,284 @@ | |||
| 1 | // go run mksyscall.go -l32 -plan9 -tags plan9,arm syscall_plan9.go | ||
| 2 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
| 3 | |||
| 4 | //go:build plan9 && arm | ||
| 5 | |||
| 6 | package plan9 | ||
| 7 | |||
| 8 | import "unsafe" | ||
| 9 | |||
| 10 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 11 | |||
| 12 | func fd2path(fd int, buf []byte) (err error) { | ||
| 13 | var _p0 unsafe.Pointer | ||
| 14 | if len(buf) > 0 { | ||
| 15 | _p0 = unsafe.Pointer(&buf[0]) | ||
| 16 | } else { | ||
| 17 | _p0 = unsafe.Pointer(&_zero) | ||
| 18 | } | ||
| 19 | r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) | ||
| 20 | if int32(r0) == -1 { | ||
| 21 | err = e1 | ||
| 22 | } | ||
| 23 | return | ||
| 24 | } | ||
| 25 | |||
| 26 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 27 | |||
| 28 | func pipe(p *[2]int32) (err error) { | ||
| 29 | r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) | ||
| 30 | if int32(r0) == -1 { | ||
| 31 | err = e1 | ||
| 32 | } | ||
| 33 | return | ||
| 34 | } | ||
| 35 | |||
| 36 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 37 | |||
| 38 | func await(s []byte) (n int, err error) { | ||
| 39 | var _p0 unsafe.Pointer | ||
| 40 | if len(s) > 0 { | ||
| 41 | _p0 = unsafe.Pointer(&s[0]) | ||
| 42 | } else { | ||
| 43 | _p0 = unsafe.Pointer(&_zero) | ||
| 44 | } | ||
| 45 | r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) | ||
| 46 | n = int(r0) | ||
| 47 | if int32(r0) == -1 { | ||
| 48 | err = e1 | ||
| 49 | } | ||
| 50 | return | ||
| 51 | } | ||
| 52 | |||
| 53 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 54 | |||
| 55 | func open(path string, mode int) (fd int, err error) { | ||
| 56 | var _p0 *byte | ||
| 57 | _p0, err = BytePtrFromString(path) | ||
| 58 | if err != nil { | ||
| 59 | return | ||
| 60 | } | ||
| 61 | r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) | ||
| 62 | fd = int(r0) | ||
| 63 | if int32(r0) == -1 { | ||
| 64 | err = e1 | ||
| 65 | } | ||
| 66 | return | ||
| 67 | } | ||
| 68 | |||
| 69 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 70 | |||
| 71 | func create(path string, mode int, perm uint32) (fd int, err error) { | ||
| 72 | var _p0 *byte | ||
| 73 | _p0, err = BytePtrFromString(path) | ||
| 74 | if err != nil { | ||
| 75 | return | ||
| 76 | } | ||
| 77 | r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) | ||
| 78 | fd = int(r0) | ||
| 79 | if int32(r0) == -1 { | ||
| 80 | err = e1 | ||
| 81 | } | ||
| 82 | return | ||
| 83 | } | ||
| 84 | |||
| 85 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 86 | |||
| 87 | func remove(path string) (err error) { | ||
| 88 | var _p0 *byte | ||
| 89 | _p0, err = BytePtrFromString(path) | ||
| 90 | if err != nil { | ||
| 91 | return | ||
| 92 | } | ||
| 93 | r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) | ||
| 94 | if int32(r0) == -1 { | ||
| 95 | err = e1 | ||
| 96 | } | ||
| 97 | return | ||
| 98 | } | ||
| 99 | |||
| 100 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 101 | |||
| 102 | func stat(path string, edir []byte) (n int, err error) { | ||
| 103 | var _p0 *byte | ||
| 104 | _p0, err = BytePtrFromString(path) | ||
| 105 | if err != nil { | ||
| 106 | return | ||
| 107 | } | ||
| 108 | var _p1 unsafe.Pointer | ||
| 109 | if len(edir) > 0 { | ||
| 110 | _p1 = unsafe.Pointer(&edir[0]) | ||
| 111 | } else { | ||
| 112 | _p1 = unsafe.Pointer(&_zero) | ||
| 113 | } | ||
| 114 | r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) | ||
| 115 | n = int(r0) | ||
| 116 | if int32(r0) == -1 { | ||
| 117 | err = e1 | ||
| 118 | } | ||
| 119 | return | ||
| 120 | } | ||
| 121 | |||
| 122 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 123 | |||
| 124 | func bind(name string, old string, flag int) (err error) { | ||
| 125 | var _p0 *byte | ||
| 126 | _p0, err = BytePtrFromString(name) | ||
| 127 | if err != nil { | ||
| 128 | return | ||
| 129 | } | ||
| 130 | var _p1 *byte | ||
| 131 | _p1, err = BytePtrFromString(old) | ||
| 132 | if err != nil { | ||
| 133 | return | ||
| 134 | } | ||
| 135 | r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) | ||
| 136 | if int32(r0) == -1 { | ||
| 137 | err = e1 | ||
| 138 | } | ||
| 139 | return | ||
| 140 | } | ||
| 141 | |||
| 142 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 143 | |||
| 144 | func mount(fd int, afd int, old string, flag int, aname string) (err error) { | ||
| 145 | var _p0 *byte | ||
| 146 | _p0, err = BytePtrFromString(old) | ||
| 147 | if err != nil { | ||
| 148 | return | ||
| 149 | } | ||
| 150 | var _p1 *byte | ||
| 151 | _p1, err = BytePtrFromString(aname) | ||
| 152 | if err != nil { | ||
| 153 | return | ||
| 154 | } | ||
| 155 | r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0) | ||
| 156 | if int32(r0) == -1 { | ||
| 157 | err = e1 | ||
| 158 | } | ||
| 159 | return | ||
| 160 | } | ||
| 161 | |||
| 162 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 163 | |||
| 164 | func wstat(path string, edir []byte) (err error) { | ||
| 165 | var _p0 *byte | ||
| 166 | _p0, err = BytePtrFromString(path) | ||
| 167 | if err != nil { | ||
| 168 | return | ||
| 169 | } | ||
| 170 | var _p1 unsafe.Pointer | ||
| 171 | if len(edir) > 0 { | ||
| 172 | _p1 = unsafe.Pointer(&edir[0]) | ||
| 173 | } else { | ||
| 174 | _p1 = unsafe.Pointer(&_zero) | ||
| 175 | } | ||
| 176 | r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) | ||
| 177 | if int32(r0) == -1 { | ||
| 178 | err = e1 | ||
| 179 | } | ||
| 180 | return | ||
| 181 | } | ||
| 182 | |||
| 183 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 184 | |||
| 185 | func chdir(path string) (err error) { | ||
| 186 | var _p0 *byte | ||
| 187 | _p0, err = BytePtrFromString(path) | ||
| 188 | if err != nil { | ||
| 189 | return | ||
| 190 | } | ||
| 191 | r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) | ||
| 192 | if int32(r0) == -1 { | ||
| 193 | err = e1 | ||
| 194 | } | ||
| 195 | return | ||
| 196 | } | ||
| 197 | |||
| 198 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 199 | |||
| 200 | func Dup(oldfd int, newfd int) (fd int, err error) { | ||
| 201 | r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) | ||
| 202 | fd = int(r0) | ||
| 203 | if int32(r0) == -1 { | ||
| 204 | err = e1 | ||
| 205 | } | ||
| 206 | return | ||
| 207 | } | ||
| 208 | |||
| 209 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 210 | |||
| 211 | func Pread(fd int, p []byte, offset int64) (n int, err error) { | ||
| 212 | var _p0 unsafe.Pointer | ||
| 213 | if len(p) > 0 { | ||
| 214 | _p0 = unsafe.Pointer(&p[0]) | ||
| 215 | } else { | ||
| 216 | _p0 = unsafe.Pointer(&_zero) | ||
| 217 | } | ||
| 218 | r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) | ||
| 219 | n = int(r0) | ||
| 220 | if int32(r0) == -1 { | ||
| 221 | err = e1 | ||
| 222 | } | ||
| 223 | return | ||
| 224 | } | ||
| 225 | |||
| 226 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 227 | |||
| 228 | func Pwrite(fd int, p []byte, offset int64) (n int, err error) { | ||
| 229 | var _p0 unsafe.Pointer | ||
| 230 | if len(p) > 0 { | ||
| 231 | _p0 = unsafe.Pointer(&p[0]) | ||
| 232 | } else { | ||
| 233 | _p0 = unsafe.Pointer(&_zero) | ||
| 234 | } | ||
| 235 | r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) | ||
| 236 | n = int(r0) | ||
| 237 | if int32(r0) == -1 { | ||
| 238 | err = e1 | ||
| 239 | } | ||
| 240 | return | ||
| 241 | } | ||
| 242 | |||
| 243 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 244 | |||
| 245 | func Close(fd int) (err error) { | ||
| 246 | r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) | ||
| 247 | if int32(r0) == -1 { | ||
| 248 | err = e1 | ||
| 249 | } | ||
| 250 | return | ||
| 251 | } | ||
| 252 | |||
| 253 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 254 | |||
| 255 | func Fstat(fd int, edir []byte) (n int, err error) { | ||
| 256 | var _p0 unsafe.Pointer | ||
| 257 | if len(edir) > 0 { | ||
| 258 | _p0 = unsafe.Pointer(&edir[0]) | ||
| 259 | } else { | ||
| 260 | _p0 = unsafe.Pointer(&_zero) | ||
| 261 | } | ||
| 262 | r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) | ||
| 263 | n = int(r0) | ||
| 264 | if int32(r0) == -1 { | ||
| 265 | err = e1 | ||
| 266 | } | ||
| 267 | return | ||
| 268 | } | ||
| 269 | |||
| 270 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
| 271 | |||
| 272 | func Fwstat(fd int, edir []byte) (err error) { | ||
| 273 | var _p0 unsafe.Pointer | ||
| 274 | if len(edir) > 0 { | ||
| 275 | _p0 = unsafe.Pointer(&edir[0]) | ||
| 276 | } else { | ||
| 277 | _p0 = unsafe.Pointer(&_zero) | ||
| 278 | } | ||
| 279 | r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) | ||
| 280 | if int32(r0) == -1 { | ||
| 281 | err = e1 | ||
| 282 | } | ||
| 283 | return | ||
| 284 | } | ||
diff --git a/vendor/golang.org/x/sys/plan9/zsysnum_plan9.go b/vendor/golang.org/x/sys/plan9/zsysnum_plan9.go new file mode 100644 index 0000000..22e8abd --- /dev/null +++ b/vendor/golang.org/x/sys/plan9/zsysnum_plan9.go | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | // mksysnum_plan9.sh /opt/plan9/sys/src/libc/9syscall/sys.h | ||
| 2 | // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT | ||
| 3 | |||
| 4 | package plan9 | ||
| 5 | |||
| 6 | const ( | ||
| 7 | SYS_SYSR1 = 0 | ||
| 8 | SYS_BIND = 2 | ||
| 9 | SYS_CHDIR = 3 | ||
| 10 | SYS_CLOSE = 4 | ||
| 11 | SYS_DUP = 5 | ||
| 12 | SYS_ALARM = 6 | ||
| 13 | SYS_EXEC = 7 | ||
| 14 | SYS_EXITS = 8 | ||
| 15 | SYS_FAUTH = 10 | ||
| 16 | SYS_SEGBRK = 12 | ||
| 17 | SYS_OPEN = 14 | ||
| 18 | SYS_OSEEK = 16 | ||
| 19 | SYS_SLEEP = 17 | ||
| 20 | SYS_RFORK = 19 | ||
| 21 | SYS_PIPE = 21 | ||
| 22 | SYS_CREATE = 22 | ||
| 23 | SYS_FD2PATH = 23 | ||
| 24 | SYS_BRK_ = 24 | ||
| 25 | SYS_REMOVE = 25 | ||
| 26 | SYS_NOTIFY = 28 | ||
| 27 | SYS_NOTED = 29 | ||
| 28 | SYS_SEGATTACH = 30 | ||
| 29 | SYS_SEGDETACH = 31 | ||
| 30 | SYS_SEGFREE = 32 | ||
| 31 | SYS_SEGFLUSH = 33 | ||
| 32 | SYS_RENDEZVOUS = 34 | ||
| 33 | SYS_UNMOUNT = 35 | ||
| 34 | SYS_SEMACQUIRE = 37 | ||
| 35 | SYS_SEMRELEASE = 38 | ||
| 36 | SYS_SEEK = 39 | ||
| 37 | SYS_FVERSION = 40 | ||
| 38 | SYS_ERRSTR = 41 | ||
| 39 | SYS_STAT = 42 | ||
| 40 | SYS_FSTAT = 43 | ||
| 41 | SYS_WSTAT = 44 | ||
| 42 | SYS_FWSTAT = 45 | ||
| 43 | SYS_MOUNT = 46 | ||
| 44 | SYS_AWAIT = 47 | ||
| 45 | SYS_PREAD = 50 | ||
| 46 | SYS_PWRITE = 51 | ||
| 47 | SYS_TSEMACQUIRE = 52 | ||
| 48 | SYS_NSEC = 53 | ||
| 49 | ) | ||
