Home | History | Annotate | Download | only in syscall
      1 // mksyscall.pl -l32 -plan9 syscall_plan9.go
      2 // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
      3 
      4 // +build 386,plan9
      5 
      6 package syscall
      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 	use(unsafe.Pointer(_p0))
     63 	fd = int(r0)
     64 	if int32(r0) == -1 {
     65 		err = e1
     66 	}
     67 	return
     68 }
     69 
     70 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
     71 
     72 func create(path string, mode int, perm uint32) (fd int, err error) {
     73 	var _p0 *byte
     74 	_p0, err = BytePtrFromString(path)
     75 	if err != nil {
     76 		return
     77 	}
     78 	r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
     79 	use(unsafe.Pointer(_p0))
     80 	fd = int(r0)
     81 	if int32(r0) == -1 {
     82 		err = e1
     83 	}
     84 	return
     85 }
     86 
     87 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
     88 
     89 func remove(path string) (err error) {
     90 	var _p0 *byte
     91 	_p0, err = BytePtrFromString(path)
     92 	if err != nil {
     93 		return
     94 	}
     95 	r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0)
     96 	use(unsafe.Pointer(_p0))
     97 	if int32(r0) == -1 {
     98 		err = e1
     99 	}
    100 	return
    101 }
    102 
    103 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    104 
    105 func stat(path string, edir []byte) (n int, err error) {
    106 	var _p0 *byte
    107 	_p0, err = BytePtrFromString(path)
    108 	if err != nil {
    109 		return
    110 	}
    111 	var _p1 unsafe.Pointer
    112 	if len(edir) > 0 {
    113 		_p1 = unsafe.Pointer(&edir[0])
    114 	} else {
    115 		_p1 = unsafe.Pointer(&_zero)
    116 	}
    117 	r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))
    118 	use(unsafe.Pointer(_p0))
    119 	n = int(r0)
    120 	if int32(r0) == -1 {
    121 		err = e1
    122 	}
    123 	return
    124 }
    125 
    126 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    127 
    128 func bind(name string, old string, flag int) (err error) {
    129 	var _p0 *byte
    130 	_p0, err = BytePtrFromString(name)
    131 	if err != nil {
    132 		return
    133 	}
    134 	var _p1 *byte
    135 	_p1, err = BytePtrFromString(old)
    136 	if err != nil {
    137 		return
    138 	}
    139 	r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag))
    140 	use(unsafe.Pointer(_p0))
    141 	use(unsafe.Pointer(_p1))
    142 	if int32(r0) == -1 {
    143 		err = e1
    144 	}
    145 	return
    146 }
    147 
    148 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    149 
    150 func mount(fd int, afd int, old string, flag int, aname string) (err error) {
    151 	var _p0 *byte
    152 	_p0, err = BytePtrFromString(old)
    153 	if err != nil {
    154 		return
    155 	}
    156 	var _p1 *byte
    157 	_p1, err = BytePtrFromString(aname)
    158 	if err != nil {
    159 		return
    160 	}
    161 	r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0)
    162 	use(unsafe.Pointer(_p0))
    163 	use(unsafe.Pointer(_p1))
    164 	if int32(r0) == -1 {
    165 		err = e1
    166 	}
    167 	return
    168 }
    169 
    170 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    171 
    172 func wstat(path string, edir []byte) (err error) {
    173 	var _p0 *byte
    174 	_p0, err = BytePtrFromString(path)
    175 	if err != nil {
    176 		return
    177 	}
    178 	var _p1 unsafe.Pointer
    179 	if len(edir) > 0 {
    180 		_p1 = unsafe.Pointer(&edir[0])
    181 	} else {
    182 		_p1 = unsafe.Pointer(&_zero)
    183 	}
    184 	r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))
    185 	use(unsafe.Pointer(_p0))
    186 	if int32(r0) == -1 {
    187 		err = e1
    188 	}
    189 	return
    190 }
    191 
    192 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    193 
    194 func chdir(path string) (err error) {
    195 	var _p0 *byte
    196 	_p0, err = BytePtrFromString(path)
    197 	if err != nil {
    198 		return
    199 	}
    200 	r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
    201 	use(unsafe.Pointer(_p0))
    202 	if int32(r0) == -1 {
    203 		err = e1
    204 	}
    205 	return
    206 }
    207 
    208 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    209 
    210 func Dup(oldfd int, newfd int) (fd int, err error) {
    211 	r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0)
    212 	fd = int(r0)
    213 	if int32(r0) == -1 {
    214 		err = e1
    215 	}
    216 	return
    217 }
    218 
    219 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    220 
    221 func Pread(fd int, p []byte, offset int64) (n int, err error) {
    222 	var _p0 unsafe.Pointer
    223 	if len(p) > 0 {
    224 		_p0 = unsafe.Pointer(&p[0])
    225 	} else {
    226 		_p0 = unsafe.Pointer(&_zero)
    227 	}
    228 	r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
    229 	n = int(r0)
    230 	if int32(r0) == -1 {
    231 		err = e1
    232 	}
    233 	return
    234 }
    235 
    236 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    237 
    238 func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
    239 	var _p0 unsafe.Pointer
    240 	if len(p) > 0 {
    241 		_p0 = unsafe.Pointer(&p[0])
    242 	} else {
    243 		_p0 = unsafe.Pointer(&_zero)
    244 	}
    245 	r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
    246 	n = int(r0)
    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 Close(fd int) (err error) {
    256 	r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
    257 	if int32(r0) == -1 {
    258 		err = e1
    259 	}
    260 	return
    261 }
    262 
    263 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    264 
    265 func Fstat(fd int, edir []byte) (n int, err error) {
    266 	var _p0 unsafe.Pointer
    267 	if len(edir) > 0 {
    268 		_p0 = unsafe.Pointer(&edir[0])
    269 	} else {
    270 		_p0 = unsafe.Pointer(&_zero)
    271 	}
    272 	r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))
    273 	n = int(r0)
    274 	if int32(r0) == -1 {
    275 		err = e1
    276 	}
    277 	return
    278 }
    279 
    280 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    281 
    282 func Fwstat(fd int, edir []byte) (err error) {
    283 	var _p0 unsafe.Pointer
    284 	if len(edir) > 0 {
    285 		_p0 = unsafe.Pointer(&edir[0])
    286 	} else {
    287 		_p0 = unsafe.Pointer(&_zero)
    288 	}
    289 	r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))
    290 	if int32(r0) == -1 {
    291 		err = e1
    292 	}
    293 	return
    294 }
    295