Commit 7ef74696 authored by Elias Naur's avatar Elias Naur

syscall: regenerate zsyscall_darwin_arm64.go with mksyscall.pl

Notably, this change fixes the TestTCPReadWriteAllocs test because
the errnoErr wrapper is now used, elimitating the allocation for
common errnos.

The change to Dup is caused by a CL 8095 that changed the Dup* calls
to use Syscall instead of RawSyscall.

Found while working on the new iOS builders.

Change-Id: I44ab9dcad27db190e175aa149865b33944f48674
Reviewed-on: https://go-review.googlesource.com/36061Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 7d889af2
// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// +build arm64,darwin
package syscall
import "unsafe"
......@@ -13,7 +11,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -23,7 +21,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -34,7 +32,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -45,7 +43,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -55,7 +53,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -65,7 +63,7 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -76,7 +74,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -86,7 +84,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -96,7 +94,7 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -106,7 +104,7 @@ func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr)
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -116,7 +114,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -126,7 +124,7 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -136,7 +134,7 @@ func Shutdown(s int, how int) (err error) {
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -153,7 +151,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -169,7 +167,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -180,7 +178,7 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -191,7 +189,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -202,7 +200,7 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -218,7 +216,7 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -234,7 +232,7 @@ func utimes(path string, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -244,7 +242,7 @@ func utimes(path string, timeval *[2]Timeval) (err error) {
func futimes(fd int, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -255,7 +253,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -265,7 +263,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -277,7 +275,7 @@ func pipe() (r int, w int, err error) {
r = int(r0)
w = int(r1)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -287,7 +285,7 @@ func pipe() (r int, w int, err error) {
func kill(pid int, signum int, posix int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -303,7 +301,7 @@ func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -313,7 +311,7 @@ func Access(path string, mode uint32) (err error) {
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -329,7 +327,7 @@ func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -345,7 +343,7 @@ func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -361,7 +359,7 @@ func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -377,7 +375,7 @@ func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -393,7 +391,7 @@ func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -403,7 +401,7 @@ func Chroot(path string) (err error) {
func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -411,10 +409,10 @@ func Close(fd int) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup(fd int) (nfd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -422,9 +420,9 @@ func Dup(fd int) (nfd int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup2(from int, to int) (err error) {
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -446,7 +444,7 @@ func Exchangedata(path1 string, path2 string, options int) (err error) {
use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -463,7 +461,7 @@ func Exit(code int) {
func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -473,7 +471,7 @@ func Fchdir(fd int) (err error) {
func Fchflags(fd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -483,7 +481,7 @@ func Fchflags(fd int, flags int) (err error) {
func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -493,7 +491,7 @@ func Fchmod(fd int, mode uint32) (err error) {
func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -503,7 +501,7 @@ func Fchown(fd int, uid int, gid int) (err error) {
func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -514,7 +512,7 @@ func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -524,7 +522,7 @@ func Fpathconf(fd int, name int) (val int, err error) {
func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -534,7 +532,7 @@ func Fstat(fd int, stat *Stat_t) (err error) {
func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -544,7 +542,7 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) {
func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -554,7 +552,7 @@ func Fsync(fd int) (err error) {
func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -571,7 +569,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -614,7 +612,7 @@ func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -649,7 +647,7 @@ func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -659,7 +657,7 @@ func Getpriority(which int, who int) (prio int, err error) {
func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -669,7 +667,7 @@ func Getrlimit(which int, lim *Rlimit) (err error) {
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -680,7 +678,7 @@ func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -707,7 +705,7 @@ func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -723,7 +721,7 @@ func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -745,7 +743,7 @@ func Link(path string, link string) (err error) {
use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -755,7 +753,7 @@ func Link(path string, link string) (err error) {
func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -771,7 +769,7 @@ func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -787,7 +785,7 @@ func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -803,7 +801,7 @@ func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -819,7 +817,7 @@ func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -835,7 +833,7 @@ func Mlock(b []byte) (err error) {
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -845,7 +843,7 @@ func Mlock(b []byte) (err error) {
func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -861,7 +859,7 @@ func Mprotect(b []byte, prot int) (err error) {
}
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -877,7 +875,7 @@ func Munlock(b []byte) (err error) {
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -887,7 +885,7 @@ func Munlock(b []byte) (err error) {
func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -904,7 +902,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
use(unsafe.Pointer(_p0))
fd = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -921,7 +919,7 @@ func Pathconf(path string, name int) (val int, err error) {
use(unsafe.Pointer(_p0))
val = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -938,7 +936,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -955,7 +953,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -972,7 +970,7 @@ func read(fd int, p []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -995,7 +993,7 @@ func Readlink(path string, buf []byte) (n int, err error) {
use(unsafe.Pointer(_p0))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1017,7 +1015,7 @@ func Rename(from string, to string) (err error) {
use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1033,7 +1031,7 @@ func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1049,7 +1047,7 @@ func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1060,7 +1058,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
newoffset = int64(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1070,7 +1068,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1080,7 +1078,7 @@ func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
func Setegid(egid int) (err error) {
_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1090,7 +1088,7 @@ func Setegid(egid int) (err error) {
func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1100,7 +1098,7 @@ func Seteuid(euid int) (err error) {
func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1116,7 +1114,7 @@ func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1126,7 +1124,7 @@ func Setlogin(name string) (err error) {
func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1136,7 +1134,7 @@ func Setpgid(pid int, pgid int) (err error) {
func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1146,7 +1144,7 @@ func Setpriority(which int, who int, prio int) (err error) {
func Setprivexec(flag int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1156,7 +1154,7 @@ func Setprivexec(flag int) (err error) {
func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1166,7 +1164,7 @@ func Setregid(rgid int, egid int) (err error) {
func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1176,7 +1174,7 @@ func Setreuid(ruid int, euid int) (err error) {
func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1187,7 +1185,7 @@ func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1197,7 +1195,7 @@ func Setsid() (pid int, err error) {
func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1207,7 +1205,7 @@ func Settimeofday(tp *Timeval) (err error) {
func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1223,7 +1221,7 @@ func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1239,7 +1237,7 @@ func Statfs(path string, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1261,7 +1259,7 @@ func Symlink(path string, link string) (err error) {
use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1271,7 +1269,7 @@ func Symlink(path string, link string) (err error) {
func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1287,7 +1285,7 @@ func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1311,7 +1309,7 @@ func Undelete(path string) (err error) {
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1327,7 +1325,7 @@ func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1343,7 +1341,7 @@ func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0))
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1360,7 +1358,7 @@ func write(fd int, p []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1371,7 +1369,7 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
ret = uintptr(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1381,7 +1379,7 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (
func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1392,7 +1390,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1403,7 +1401,7 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
......@@ -1415,7 +1413,7 @@ func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {
sec = int64(r0)
usec = int32(r1)
if e1 != 0 {
err = e1
err = errnoErr(e1)
}
return
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment