2019-01-06 07:23:00 +03:00
|
|
|
// go run mksyscall.go -l32 -plan9 -tags plan9,amd64 syscall_plan9.go
|
|
|
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
|
|
|
|
2021-11-09 20:45:02 +03:00
|
|
|
//go:build plan9 && amd64
|
2014-08-12 01:48:46 +04:00
|
|
|
|
2014-08-12 02:58:26 +04:00
|
|
|
package plan9
|
2014-08-12 01:48:46 +04:00
|
|
|
|
|
|
|
import "unsafe"
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func fd2path(fd int, buf []byte) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(buf) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&buf[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-11 13:33:45 +03:00
|
|
|
func pipe(p *[2]int32) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func await(s []byte) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(s) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&s[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0)
|
|
|
|
n = int(r0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func open(path string, mode int) (fd int, err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
|
|
fd = int(r0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func create(path string, mode int, perm uint32) (fd int, err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
|
|
|
|
fd = int(r0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func remove(path string) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func stat(path string, edir []byte) (n int, err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-04-12 20:39:13 +03:00
|
|
|
var _p1 unsafe.Pointer
|
|
|
|
if len(edir) > 0 {
|
|
|
|
_p1 = unsafe.Pointer(&edir[0])
|
|
|
|
} else {
|
|
|
|
_p1 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))
|
|
|
|
n = int(r0)
|
2014-08-12 01:48:46 +04:00
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func bind(name string, old string, flag int) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(name)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(old)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag))
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func mount(fd int, afd int, old string, flag int, aname string) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(old)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(aname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func wstat(path string, edir []byte) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 unsafe.Pointer
|
|
|
|
if len(edir) > 0 {
|
|
|
|
_p1 = unsafe.Pointer(&edir[0])
|
|
|
|
} else {
|
|
|
|
_p1 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
2015-04-12 20:39:13 +03:00
|
|
|
r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func chdir(path string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Dup(oldfd int, newfd int) (fd int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0)
|
|
|
|
fd = int(r0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Pread(fd int, p []byte, offset int64) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(p) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&p[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
|
2014-08-12 01:48:46 +04:00
|
|
|
n = int(r0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 unsafe.Pointer
|
2015-04-12 20:39:13 +03:00
|
|
|
if len(p) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&p[0])
|
2014-08-12 01:48:46 +04:00
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
2015-04-12 20:39:13 +03:00
|
|
|
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
|
2014-08-12 01:48:46 +04:00
|
|
|
n = int(r0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-04-12 20:39:13 +03:00
|
|
|
func Close(fd int) (err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
2015-04-12 20:39:13 +03:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Fstat(fd int, edir []byte) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
2014-08-12 01:48:46 +04:00
|
|
|
if len(edir) > 0 {
|
2015-04-12 20:39:13 +03:00
|
|
|
_p0 = unsafe.Pointer(&edir[0])
|
2014-08-12 01:48:46 +04:00
|
|
|
} else {
|
2015-04-12 20:39:13 +03:00
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
2015-04-12 20:39:13 +03:00
|
|
|
r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))
|
|
|
|
n = int(r0)
|
2014-08-12 01:48:46 +04:00
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Fwstat(fd int, edir []byte) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(edir) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&edir[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))
|
|
|
|
if int32(r0) == -1 {
|
|
|
|
err = e1
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|