Commit 6bf00075 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

syscall: don't allocate when boxing common Errno values into errors

Fixes #8859

Change-Id: If8098e6edad1f83dc35fa84f4431689e8ee97678
Reviewed-on: https://go-review.googlesource.com/6701Reviewed-by: default avatarRob Pike <r@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 180fbb16
...@@ -292,7 +292,7 @@ while(<>) { ...@@ -292,7 +292,7 @@ while(<>) {
$text .= "\t}\n"; $text .= "\t}\n";
} elsif ($do_errno) { } elsif ($do_errno) {
$text .= "\tif e1 != 0 {\n"; $text .= "\tif e1 != 0 {\n";
$text .= "\t\terr = e1\n"; $text .= "\t\terr = errnoErr(e1)\n";
$text .= "\t}\n"; $text .= "\t}\n";
} }
$text .= "\treturn\n"; $text .= "\treturn\n";
......
...@@ -116,6 +116,30 @@ func (e Errno) Timeout() bool { ...@@ -116,6 +116,30 @@ func (e Errno) Timeout() bool {
return e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT return e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT
} }
// Do the interface allocations only once for common
// Errno values.
var (
errEAGAIN error = EAGAIN
errEINVAL error = EINVAL
errENOENT error = ENOENT
)
// errnoErr returns common boxed Errno values, to prevent
// allocations at runtime.
func errnoErr(e Errno) error {
switch e {
case 0:
return nil
case EAGAIN:
return errEAGAIN
case EINVAL:
return errEINVAL
case ENOENT:
return errENOENT
}
return e
}
// A Signal is a number describing a process signal. // A Signal is a number describing a process signal.
// It implements the os.Signal interface. // It implements the os.Signal interface.
type Signal int type Signal int
......
...@@ -11,7 +11,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { ...@@ -11,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) r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -21,7 +21,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { ...@@ -21,7 +21,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
func setgroups(ngid int, gid *_Gid_t) (err error) { func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -32,7 +32,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err ...@@ -32,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) r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0) wpid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -43,7 +43,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { ...@@ -43,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))) r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -53,7 +53,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { ...@@ -53,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) { func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -63,7 +63,7 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { ...@@ -63,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) { func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -74,7 +74,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) { ...@@ -74,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)) r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -84,7 +84,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) { ...@@ -84,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) { 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) _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -94,7 +94,7 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen ...@@ -94,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) { 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) _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -104,7 +104,7 @@ func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) ...@@ -104,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) { func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -114,7 +114,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { ...@@ -114,7 +114,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
func getsockname(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))) _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -124,7 +124,7 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { ...@@ -124,7 +124,7 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
func Shutdown(s int, how int) (err error) { func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -134,7 +134,7 @@ func Shutdown(s int, how int) (err error) { ...@@ -134,7 +134,7 @@ func Shutdown(s int, how int) (err error) {
func socketpair(domain int, typ int, proto int, fd *[2]int32) (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) _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -151,7 +151,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl ...@@ -151,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))) 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) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -167,7 +167,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( ...@@ -167,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)) _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -178,7 +178,7 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -178,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)) r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -189,7 +189,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -189,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)) r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -200,7 +200,7 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne ...@@ -200,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))) r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -216,7 +216,7 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) ...@@ -216,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)) _, _, 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 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -232,7 +232,7 @@ func utimes(path string, timeval *[2]Timeval) (err error) { ...@@ -232,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) _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -242,7 +242,7 @@ func utimes(path string, timeval *[2]Timeval) (err error) { ...@@ -242,7 +242,7 @@ func utimes(path string, timeval *[2]Timeval) (err error) {
func futimes(fd int, 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) _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -253,7 +253,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -253,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)) r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -263,7 +263,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -263,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) { 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) _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -275,7 +275,7 @@ func pipe() (r int, w int, err error) { ...@@ -275,7 +275,7 @@ func pipe() (r int, w int, err error) {
r = int(r0) r = int(r0)
w = int(r1) w = int(r1)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -285,7 +285,7 @@ func pipe() (r int, w int, err error) { ...@@ -285,7 +285,7 @@ func pipe() (r int, w int, err error) {
func kill(pid int, signum int, posix int) (err error) { func kill(pid int, signum int, posix int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -301,7 +301,7 @@ func Access(path string, mode uint32) (err error) { ...@@ -301,7 +301,7 @@ func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -311,7 +311,7 @@ func Access(path string, mode uint32) (err error) { ...@@ -311,7 +311,7 @@ func Access(path string, mode uint32) (err error) {
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -327,7 +327,7 @@ func Chdir(path string) (err error) { ...@@ -327,7 +327,7 @@ func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -343,7 +343,7 @@ func Chflags(path string, flags int) (err error) { ...@@ -343,7 +343,7 @@ func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -359,7 +359,7 @@ func Chmod(path string, mode uint32) (err error) { ...@@ -359,7 +359,7 @@ func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -375,7 +375,7 @@ func Chown(path string, uid int, gid int) (err error) { ...@@ -375,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)) _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -391,7 +391,7 @@ func Chroot(path string) (err error) { ...@@ -391,7 +391,7 @@ func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -401,7 +401,7 @@ func Chroot(path string) (err error) { ...@@ -401,7 +401,7 @@ func Chroot(path string) (err error) {
func Close(fd int) (err error) { func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -412,7 +412,7 @@ func Dup(fd int) (nfd int, err error) { ...@@ -412,7 +412,7 @@ func Dup(fd int) (nfd int, err error) {
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0) nfd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -422,7 +422,7 @@ func Dup(fd int) (nfd int, err error) { ...@@ -422,7 +422,7 @@ func Dup(fd int) (nfd int, err error) {
func Dup2(from int, to int) (err error) { func Dup2(from int, to int) (err error) {
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -444,7 +444,7 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { ...@@ -444,7 +444,7 @@ func Exchangedata(path1 string, path2 string, options int) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -461,7 +461,7 @@ func Exit(code int) { ...@@ -461,7 +461,7 @@ func Exit(code int) {
func Fchdir(fd int) (err error) { func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -471,7 +471,7 @@ func Fchdir(fd int) (err error) { ...@@ -471,7 +471,7 @@ func Fchdir(fd int) (err error) {
func Fchflags(fd int, flags int) (err error) { func Fchflags(fd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -481,7 +481,7 @@ func Fchflags(fd int, flags int) (err error) { ...@@ -481,7 +481,7 @@ func Fchflags(fd int, flags int) (err error) {
func Fchmod(fd int, mode uint32) (err error) { func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -491,7 +491,7 @@ func Fchmod(fd int, mode uint32) (err error) { ...@@ -491,7 +491,7 @@ func Fchmod(fd int, mode uint32) (err error) {
func Fchown(fd int, uid int, gid int) (err error) { func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -501,7 +501,7 @@ func Fchown(fd int, uid int, gid int) (err error) { ...@@ -501,7 +501,7 @@ func Fchown(fd int, uid int, gid int) (err error) {
func Flock(fd int, how int) (err error) { func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -512,7 +512,7 @@ func Fpathconf(fd int, name int) (val int, err error) { ...@@ -512,7 +512,7 @@ func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -522,7 +522,7 @@ func Fpathconf(fd int, name int) (val int, err error) { ...@@ -522,7 +522,7 @@ func Fpathconf(fd int, name int) (val int, err error) {
func Fstat(fd int, stat *Stat_t) (err error) { func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -532,7 +532,7 @@ func Fstat(fd int, stat *Stat_t) (err error) { ...@@ -532,7 +532,7 @@ func Fstat(fd int, stat *Stat_t) (err error) {
func Fstatfs(fd int, stat *Statfs_t) (err error) { func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -542,7 +542,7 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) { ...@@ -542,7 +542,7 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) {
func Fsync(fd int) (err error) { func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -552,7 +552,7 @@ func Fsync(fd int) (err error) { ...@@ -552,7 +552,7 @@ func Fsync(fd int) (err error) {
func Ftruncate(fd int, length int64) (err error) { func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32)) _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -569,7 +569,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ...@@ -569,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) r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -612,7 +612,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -612,7 +612,7 @@ func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0) pgid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -647,7 +647,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -647,7 +647,7 @@ func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0) prio = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -657,7 +657,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -657,7 +657,7 @@ func Getpriority(which int, who int) (prio int, err error) {
func Getrlimit(which int, lim *Rlimit) (err error) { func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -667,7 +667,7 @@ func Getrlimit(which int, lim *Rlimit) (err error) { ...@@ -667,7 +667,7 @@ func Getrlimit(which int, lim *Rlimit) (err error) {
func Getrusage(who int, rusage *Rusage) (err error) { func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -678,7 +678,7 @@ func Getsid(pid int) (sid int, err error) { ...@@ -678,7 +678,7 @@ func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0) sid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -705,7 +705,7 @@ func Kqueue() (fd int, err error) { ...@@ -705,7 +705,7 @@ func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -721,7 +721,7 @@ func Lchown(path string, uid int, gid int) (err error) { ...@@ -721,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)) _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -743,7 +743,7 @@ func Link(path string, link string) (err error) { ...@@ -743,7 +743,7 @@ func Link(path string, link string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -753,7 +753,7 @@ func Link(path string, link string) (err error) { ...@@ -753,7 +753,7 @@ func Link(path string, link string) (err error) {
func Listen(s int, backlog int) (err error) { func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -769,7 +769,7 @@ func Lstat(path string, stat *Stat_t) (err error) { ...@@ -769,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) _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -785,7 +785,7 @@ func Mkdir(path string, mode uint32) (err error) { ...@@ -785,7 +785,7 @@ func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -801,7 +801,7 @@ func Mkfifo(path string, mode uint32) (err error) { ...@@ -801,7 +801,7 @@ func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -817,7 +817,7 @@ func Mknod(path string, mode uint32, dev int) (err error) { ...@@ -817,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)) _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -833,7 +833,7 @@ func Mlock(b []byte) (err error) { ...@@ -833,7 +833,7 @@ func Mlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -843,7 +843,7 @@ func Mlock(b []byte) (err error) { ...@@ -843,7 +843,7 @@ func Mlock(b []byte) (err error) {
func Mlockall(flags int) (err error) { func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -859,7 +859,7 @@ func Mprotect(b []byte, prot int) (err error) { ...@@ -859,7 +859,7 @@ func Mprotect(b []byte, prot int) (err error) {
} }
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -875,7 +875,7 @@ func Munlock(b []byte) (err error) { ...@@ -875,7 +875,7 @@ func Munlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -885,7 +885,7 @@ func Munlock(b []byte) (err error) { ...@@ -885,7 +885,7 @@ func Munlock(b []byte) (err error) {
func Munlockall() (err error) { func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -902,7 +902,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { ...@@ -902,7 +902,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -919,7 +919,7 @@ func Pathconf(path string, name int) (val int, err error) { ...@@ -919,7 +919,7 @@ func Pathconf(path string, name int) (val int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -936,7 +936,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { ...@@ -936,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), uintptr(offset>>32), 0) r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -953,7 +953,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { ...@@ -953,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), uintptr(offset>>32), 0) r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -970,7 +970,7 @@ func read(fd int, p []byte) (n int, err error) { ...@@ -970,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))) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -993,7 +993,7 @@ func Readlink(path string, buf []byte) (n int, err error) { ...@@ -993,7 +993,7 @@ func Readlink(path string, buf []byte) (n int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1015,7 +1015,7 @@ func Rename(from string, to string) (err error) { ...@@ -1015,7 +1015,7 @@ func Rename(from string, to string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1031,7 +1031,7 @@ func Revoke(path string) (err error) { ...@@ -1031,7 +1031,7 @@ func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1047,7 +1047,7 @@ func Rmdir(path string) (err error) { ...@@ -1047,7 +1047,7 @@ func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1058,7 +1058,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { ...@@ -1058,7 +1058,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)
newoffset = int64(int64(r1)<<32 | int64(r0)) newoffset = int64(int64(r1)<<32 | int64(r0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1068,7 +1068,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { ...@@ -1068,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) { 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) _, _, 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 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1078,7 +1078,7 @@ func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { ...@@ -1078,7 +1078,7 @@ func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
func Setegid(egid int) (err error) { func Setegid(egid int) (err error) {
_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1088,7 +1088,7 @@ func Setegid(egid int) (err error) { ...@@ -1088,7 +1088,7 @@ func Setegid(egid int) (err error) {
func Seteuid(euid int) (err error) { func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1098,7 +1098,7 @@ func Seteuid(euid int) (err error) { ...@@ -1098,7 +1098,7 @@ func Seteuid(euid int) (err error) {
func Setgid(gid int) (err error) { func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1114,7 +1114,7 @@ func Setlogin(name string) (err error) { ...@@ -1114,7 +1114,7 @@ func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1124,7 +1124,7 @@ func Setlogin(name string) (err error) { ...@@ -1124,7 +1124,7 @@ func Setlogin(name string) (err error) {
func Setpgid(pid int, pgid int) (err error) { func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1134,7 +1134,7 @@ func Setpgid(pid int, pgid int) (err error) { ...@@ -1134,7 +1134,7 @@ func Setpgid(pid int, pgid int) (err error) {
func Setpriority(which int, who int, prio int) (err error) { func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1144,7 +1144,7 @@ func Setpriority(which int, who int, prio int) (err error) { ...@@ -1144,7 +1144,7 @@ func Setpriority(which int, who int, prio int) (err error) {
func Setprivexec(flag int) (err error) { func Setprivexec(flag int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1154,7 +1154,7 @@ func Setprivexec(flag int) (err error) { ...@@ -1154,7 +1154,7 @@ func Setprivexec(flag int) (err error) {
func Setregid(rgid int, egid int) (err error) { func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1164,7 +1164,7 @@ func Setregid(rgid int, egid int) (err error) { ...@@ -1164,7 +1164,7 @@ func Setregid(rgid int, egid int) (err error) {
func Setreuid(ruid int, euid int) (err error) { func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1174,7 +1174,7 @@ func Setreuid(ruid int, euid int) (err error) { ...@@ -1174,7 +1174,7 @@ func Setreuid(ruid int, euid int) (err error) {
func Setrlimit(which int, lim *Rlimit) (err error) { func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1185,7 +1185,7 @@ func Setsid() (pid int, err error) { ...@@ -1185,7 +1185,7 @@ func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0) pid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1195,7 +1195,7 @@ func Setsid() (pid int, err error) { ...@@ -1195,7 +1195,7 @@ func Setsid() (pid int, err error) {
func Settimeofday(tp *Timeval) (err error) { func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1205,7 +1205,7 @@ func Settimeofday(tp *Timeval) (err error) { ...@@ -1205,7 +1205,7 @@ func Settimeofday(tp *Timeval) (err error) {
func Setuid(uid int) (err error) { func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1221,7 +1221,7 @@ func Stat(path string, stat *Stat_t) (err error) { ...@@ -1221,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) _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1237,7 +1237,7 @@ func Statfs(path string, stat *Statfs_t) (err error) { ...@@ -1237,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) _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1259,7 +1259,7 @@ func Symlink(path string, link string) (err error) { ...@@ -1259,7 +1259,7 @@ func Symlink(path string, link string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1269,7 +1269,7 @@ func Symlink(path string, link string) (err error) { ...@@ -1269,7 +1269,7 @@ func Symlink(path string, link string) (err error) {
func Sync() (err error) { func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1285,7 +1285,7 @@ func Truncate(path string, length int64) (err error) { ...@@ -1285,7 +1285,7 @@ func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1309,7 +1309,7 @@ func Undelete(path string) (err error) { ...@@ -1309,7 +1309,7 @@ func Undelete(path string) (err error) {
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1325,7 +1325,7 @@ func Unlink(path string) (err error) { ...@@ -1325,7 +1325,7 @@ func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1341,7 +1341,7 @@ func Unmount(path string, flags int) (err error) { ...@@ -1341,7 +1341,7 @@ func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1358,7 +1358,7 @@ func write(fd int, p []byte) (n int, err error) { ...@@ -1358,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))) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1369,7 +1369,7 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( ...@@ -1369,7 +1369,7 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (
r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)
ret = uintptr(r0) ret = uintptr(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1379,7 +1379,7 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( ...@@ -1379,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) { func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1390,7 +1390,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) { ...@@ -1390,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)) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1401,7 +1401,7 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { ...@@ -1401,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)) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1413,7 +1413,7 @@ func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { ...@@ -1413,7 +1413,7 @@ func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) {
sec = int32(r0) sec = int32(r0)
usec = int32(r1) usec = int32(r1)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -11,7 +11,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { ...@@ -11,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) r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -21,7 +21,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { ...@@ -21,7 +21,7 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
func setgroups(ngid int, gid *_Gid_t) (err error) { func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -32,7 +32,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err ...@@ -32,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) r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0) wpid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -43,7 +43,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { ...@@ -43,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))) r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -53,7 +53,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { ...@@ -53,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) { func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -63,7 +63,7 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { ...@@ -63,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) { func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -74,7 +74,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) { ...@@ -74,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)) r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -84,7 +84,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) { ...@@ -84,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) { 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) _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -94,7 +94,7 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen ...@@ -94,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) { 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) _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -104,7 +104,7 @@ func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) ...@@ -104,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) { func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -114,7 +114,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { ...@@ -114,7 +114,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
func getsockname(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))) _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -124,7 +124,7 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { ...@@ -124,7 +124,7 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
func Shutdown(s int, how int) (err error) { func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -134,7 +134,7 @@ func Shutdown(s int, how int) (err error) { ...@@ -134,7 +134,7 @@ func Shutdown(s int, how int) (err error) {
func socketpair(domain int, typ int, proto int, fd *[2]int32) (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) _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -151,7 +151,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl ...@@ -151,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))) 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) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -167,7 +167,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( ...@@ -167,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)) _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -178,7 +178,7 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -178,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)) r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -189,7 +189,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -189,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)) r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -200,7 +200,7 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne ...@@ -200,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))) r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -216,7 +216,7 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) ...@@ -216,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)) _, _, 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 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -232,7 +232,7 @@ func utimes(path string, timeval *[2]Timeval) (err error) { ...@@ -232,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) _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -242,7 +242,7 @@ func utimes(path string, timeval *[2]Timeval) (err error) { ...@@ -242,7 +242,7 @@ func utimes(path string, timeval *[2]Timeval) (err error) {
func futimes(fd int, 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) _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -253,7 +253,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -253,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)) r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -263,7 +263,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -263,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) { 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) _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -275,7 +275,7 @@ func pipe() (r int, w int, err error) { ...@@ -275,7 +275,7 @@ func pipe() (r int, w int, err error) {
r = int(r0) r = int(r0)
w = int(r1) w = int(r1)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -285,7 +285,7 @@ func pipe() (r int, w int, err error) { ...@@ -285,7 +285,7 @@ func pipe() (r int, w int, err error) {
func kill(pid int, signum int, posix int) (err error) { func kill(pid int, signum int, posix int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -301,7 +301,7 @@ func Access(path string, mode uint32) (err error) { ...@@ -301,7 +301,7 @@ func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -311,7 +311,7 @@ func Access(path string, mode uint32) (err error) { ...@@ -311,7 +311,7 @@ func Access(path string, mode uint32) (err error) {
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -327,7 +327,7 @@ func Chdir(path string) (err error) { ...@@ -327,7 +327,7 @@ func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -343,7 +343,7 @@ func Chflags(path string, flags int) (err error) { ...@@ -343,7 +343,7 @@ func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -359,7 +359,7 @@ func Chmod(path string, mode uint32) (err error) { ...@@ -359,7 +359,7 @@ func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -375,7 +375,7 @@ func Chown(path string, uid int, gid int) (err error) { ...@@ -375,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)) _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -391,7 +391,7 @@ func Chroot(path string) (err error) { ...@@ -391,7 +391,7 @@ func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -401,7 +401,7 @@ func Chroot(path string) (err error) { ...@@ -401,7 +401,7 @@ func Chroot(path string) (err error) {
func Close(fd int) (err error) { func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -412,7 +412,7 @@ func Dup(fd int) (nfd int, err error) { ...@@ -412,7 +412,7 @@ func Dup(fd int) (nfd int, err error) {
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0) nfd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -422,7 +422,7 @@ func Dup(fd int) (nfd int, err error) { ...@@ -422,7 +422,7 @@ func Dup(fd int) (nfd int, err error) {
func Dup2(from int, to int) (err error) { func Dup2(from int, to int) (err error) {
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -444,7 +444,7 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { ...@@ -444,7 +444,7 @@ func Exchangedata(path1 string, path2 string, options int) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -461,7 +461,7 @@ func Exit(code int) { ...@@ -461,7 +461,7 @@ func Exit(code int) {
func Fchdir(fd int) (err error) { func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -471,7 +471,7 @@ func Fchdir(fd int) (err error) { ...@@ -471,7 +471,7 @@ func Fchdir(fd int) (err error) {
func Fchflags(fd int, flags int) (err error) { func Fchflags(fd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -481,7 +481,7 @@ func Fchflags(fd int, flags int) (err error) { ...@@ -481,7 +481,7 @@ func Fchflags(fd int, flags int) (err error) {
func Fchmod(fd int, mode uint32) (err error) { func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -491,7 +491,7 @@ func Fchmod(fd int, mode uint32) (err error) { ...@@ -491,7 +491,7 @@ func Fchmod(fd int, mode uint32) (err error) {
func Fchown(fd int, uid int, gid int) (err error) { func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -501,7 +501,7 @@ func Fchown(fd int, uid int, gid int) (err error) { ...@@ -501,7 +501,7 @@ func Fchown(fd int, uid int, gid int) (err error) {
func Flock(fd int, how int) (err error) { func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -512,7 +512,7 @@ func Fpathconf(fd int, name int) (val int, err error) { ...@@ -512,7 +512,7 @@ func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -522,7 +522,7 @@ func Fpathconf(fd int, name int) (val int, err error) { ...@@ -522,7 +522,7 @@ func Fpathconf(fd int, name int) (val int, err error) {
func Fstat(fd int, stat *Stat_t) (err error) { func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -532,7 +532,7 @@ func Fstat(fd int, stat *Stat_t) (err error) { ...@@ -532,7 +532,7 @@ func Fstat(fd int, stat *Stat_t) (err error) {
func Fstatfs(fd int, stat *Statfs_t) (err error) { func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -542,7 +542,7 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) { ...@@ -542,7 +542,7 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) {
func Fsync(fd int) (err error) { func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -552,7 +552,7 @@ func Fsync(fd int) (err error) { ...@@ -552,7 +552,7 @@ func Fsync(fd int) (err error) {
func Ftruncate(fd int, length int64) (err error) { func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -569,7 +569,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ...@@ -569,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) r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -612,7 +612,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -612,7 +612,7 @@ func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0) pgid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -647,7 +647,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -647,7 +647,7 @@ func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0) prio = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -657,7 +657,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -657,7 +657,7 @@ func Getpriority(which int, who int) (prio int, err error) {
func Getrlimit(which int, lim *Rlimit) (err error) { func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -667,7 +667,7 @@ func Getrlimit(which int, lim *Rlimit) (err error) { ...@@ -667,7 +667,7 @@ func Getrlimit(which int, lim *Rlimit) (err error) {
func Getrusage(who int, rusage *Rusage) (err error) { func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -678,7 +678,7 @@ func Getsid(pid int) (sid int, err error) { ...@@ -678,7 +678,7 @@ func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0) sid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -705,7 +705,7 @@ func Kqueue() (fd int, err error) { ...@@ -705,7 +705,7 @@ func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -721,7 +721,7 @@ func Lchown(path string, uid int, gid int) (err error) { ...@@ -721,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)) _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -743,7 +743,7 @@ func Link(path string, link string) (err error) { ...@@ -743,7 +743,7 @@ func Link(path string, link string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -753,7 +753,7 @@ func Link(path string, link string) (err error) { ...@@ -753,7 +753,7 @@ func Link(path string, link string) (err error) {
func Listen(s int, backlog int) (err error) { func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -769,7 +769,7 @@ func Lstat(path string, stat *Stat_t) (err error) { ...@@ -769,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) _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -785,7 +785,7 @@ func Mkdir(path string, mode uint32) (err error) { ...@@ -785,7 +785,7 @@ func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -801,7 +801,7 @@ func Mkfifo(path string, mode uint32) (err error) { ...@@ -801,7 +801,7 @@ func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -817,7 +817,7 @@ func Mknod(path string, mode uint32, dev int) (err error) { ...@@ -817,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)) _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -833,7 +833,7 @@ func Mlock(b []byte) (err error) { ...@@ -833,7 +833,7 @@ func Mlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -843,7 +843,7 @@ func Mlock(b []byte) (err error) { ...@@ -843,7 +843,7 @@ func Mlock(b []byte) (err error) {
func Mlockall(flags int) (err error) { func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -859,7 +859,7 @@ func Mprotect(b []byte, prot int) (err error) { ...@@ -859,7 +859,7 @@ func Mprotect(b []byte, prot int) (err error) {
} }
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -875,7 +875,7 @@ func Munlock(b []byte) (err error) { ...@@ -875,7 +875,7 @@ func Munlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -885,7 +885,7 @@ func Munlock(b []byte) (err error) { ...@@ -885,7 +885,7 @@ func Munlock(b []byte) (err error) {
func Munlockall() (err error) { func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -902,7 +902,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { ...@@ -902,7 +902,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -919,7 +919,7 @@ func Pathconf(path string, name int) (val int, err error) { ...@@ -919,7 +919,7 @@ func Pathconf(path string, name int) (val int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -936,7 +936,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { ...@@ -936,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) r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -953,7 +953,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { ...@@ -953,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) r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -970,7 +970,7 @@ func read(fd int, p []byte) (n int, err error) { ...@@ -970,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))) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -993,7 +993,7 @@ func Readlink(path string, buf []byte) (n int, err error) { ...@@ -993,7 +993,7 @@ func Readlink(path string, buf []byte) (n int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1015,7 +1015,7 @@ func Rename(from string, to string) (err error) { ...@@ -1015,7 +1015,7 @@ func Rename(from string, to string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1031,7 +1031,7 @@ func Revoke(path string) (err error) { ...@@ -1031,7 +1031,7 @@ func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1047,7 +1047,7 @@ func Rmdir(path string) (err error) { ...@@ -1047,7 +1047,7 @@ func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1058,7 +1058,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { ...@@ -1058,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)) r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
newoffset = int64(r0) newoffset = int64(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1068,7 +1068,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { ...@@ -1068,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) { 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) _, _, 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 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1078,7 +1078,7 @@ func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { ...@@ -1078,7 +1078,7 @@ func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
func Setegid(egid int) (err error) { func Setegid(egid int) (err error) {
_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1088,7 +1088,7 @@ func Setegid(egid int) (err error) { ...@@ -1088,7 +1088,7 @@ func Setegid(egid int) (err error) {
func Seteuid(euid int) (err error) { func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1098,7 +1098,7 @@ func Seteuid(euid int) (err error) { ...@@ -1098,7 +1098,7 @@ func Seteuid(euid int) (err error) {
func Setgid(gid int) (err error) { func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1114,7 +1114,7 @@ func Setlogin(name string) (err error) { ...@@ -1114,7 +1114,7 @@ func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1124,7 +1124,7 @@ func Setlogin(name string) (err error) { ...@@ -1124,7 +1124,7 @@ func Setlogin(name string) (err error) {
func Setpgid(pid int, pgid int) (err error) { func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1134,7 +1134,7 @@ func Setpgid(pid int, pgid int) (err error) { ...@@ -1134,7 +1134,7 @@ func Setpgid(pid int, pgid int) (err error) {
func Setpriority(which int, who int, prio int) (err error) { func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1144,7 +1144,7 @@ func Setpriority(which int, who int, prio int) (err error) { ...@@ -1144,7 +1144,7 @@ func Setpriority(which int, who int, prio int) (err error) {
func Setprivexec(flag int) (err error) { func Setprivexec(flag int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1154,7 +1154,7 @@ func Setprivexec(flag int) (err error) { ...@@ -1154,7 +1154,7 @@ func Setprivexec(flag int) (err error) {
func Setregid(rgid int, egid int) (err error) { func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1164,7 +1164,7 @@ func Setregid(rgid int, egid int) (err error) { ...@@ -1164,7 +1164,7 @@ func Setregid(rgid int, egid int) (err error) {
func Setreuid(ruid int, euid int) (err error) { func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1174,7 +1174,7 @@ func Setreuid(ruid int, euid int) (err error) { ...@@ -1174,7 +1174,7 @@ func Setreuid(ruid int, euid int) (err error) {
func Setrlimit(which int, lim *Rlimit) (err error) { func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1185,7 +1185,7 @@ func Setsid() (pid int, err error) { ...@@ -1185,7 +1185,7 @@ func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0) pid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1195,7 +1195,7 @@ func Setsid() (pid int, err error) { ...@@ -1195,7 +1195,7 @@ func Setsid() (pid int, err error) {
func Settimeofday(tp *Timeval) (err error) { func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1205,7 +1205,7 @@ func Settimeofday(tp *Timeval) (err error) { ...@@ -1205,7 +1205,7 @@ func Settimeofday(tp *Timeval) (err error) {
func Setuid(uid int) (err error) { func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1221,7 +1221,7 @@ func Stat(path string, stat *Stat_t) (err error) { ...@@ -1221,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) _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1237,7 +1237,7 @@ func Statfs(path string, stat *Statfs_t) (err error) { ...@@ -1237,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) _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1259,7 +1259,7 @@ func Symlink(path string, link string) (err error) { ...@@ -1259,7 +1259,7 @@ func Symlink(path string, link string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1269,7 +1269,7 @@ func Symlink(path string, link string) (err error) { ...@@ -1269,7 +1269,7 @@ func Symlink(path string, link string) (err error) {
func Sync() (err error) { func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1285,7 +1285,7 @@ func Truncate(path string, length int64) (err error) { ...@@ -1285,7 +1285,7 @@ func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1309,7 +1309,7 @@ func Undelete(path string) (err error) { ...@@ -1309,7 +1309,7 @@ func Undelete(path string) (err error) {
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1325,7 +1325,7 @@ func Unlink(path string) (err error) { ...@@ -1325,7 +1325,7 @@ func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1341,7 +1341,7 @@ func Unmount(path string, flags int) (err error) { ...@@ -1341,7 +1341,7 @@ func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1358,7 +1358,7 @@ func write(fd int, p []byte) (n int, err error) { ...@@ -1358,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))) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1369,7 +1369,7 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( ...@@ -1369,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)) r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
ret = uintptr(r0) ret = uintptr(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1379,7 +1379,7 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( ...@@ -1379,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) { func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1390,7 +1390,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) { ...@@ -1390,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)) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1401,7 +1401,7 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { ...@@ -1401,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)) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1413,7 +1413,7 @@ func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { ...@@ -1413,7 +1413,7 @@ func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {
sec = int64(r0) sec = int64(r0)
usec = int32(r1) usec = int32(r1)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -22,7 +22,7 @@ func linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in ...@@ -22,7 +22,7 @@ func linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -39,7 +39,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) ...@@ -39,7 +39,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -62,7 +62,7 @@ func readlinkat(dirfd int, path string, buf []byte) (n int, err error) { ...@@ -62,7 +62,7 @@ func readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -84,7 +84,7 @@ func symlinkat(oldpath string, newdirfd int, newpath string) (err error) { ...@@ -84,7 +84,7 @@ func symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -100,7 +100,7 @@ func unlinkat(dirfd int, path string, flags int) (err error) { ...@@ -100,7 +100,7 @@ func unlinkat(dirfd int, path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -116,7 +116,7 @@ func utimes(path string, times *[2]Timeval) (err error) { ...@@ -116,7 +116,7 @@ func utimes(path string, times *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -132,7 +132,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) { ...@@ -132,7 +132,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
_, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -142,7 +142,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) { ...@@ -142,7 +142,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) { func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times))) _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -159,7 +159,7 @@ func Getcwd(buf []byte) (n int, err error) { ...@@ -159,7 +159,7 @@ func Getcwd(buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0) r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -170,7 +170,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err ...@@ -170,7 +170,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) r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0) wpid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -180,7 +180,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err ...@@ -180,7 +180,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
func ptrace(request int, pid int, addr uintptr, data uintptr) (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) _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -196,7 +196,7 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { ...@@ -196,7 +196,7 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {
_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -224,7 +224,7 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt ...@@ -224,7 +224,7 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
use(unsafe.Pointer(_p2)) use(unsafe.Pointer(_p2))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -240,7 +240,7 @@ func Acct(path string) (err error) { ...@@ -240,7 +240,7 @@ func Acct(path string) (err error) {
_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -251,7 +251,7 @@ func Adjtimex(buf *Timex) (state int, err error) { ...@@ -251,7 +251,7 @@ func Adjtimex(buf *Timex) (state int, err error) {
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
state = int(r0) state = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -267,7 +267,7 @@ func Chdir(path string) (err error) { ...@@ -267,7 +267,7 @@ func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -283,7 +283,7 @@ func Chroot(path string) (err error) { ...@@ -283,7 +283,7 @@ func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -293,7 +293,7 @@ func Chroot(path string) (err error) { ...@@ -293,7 +293,7 @@ func Chroot(path string) (err error) {
func Close(fd int) (err error) { func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -304,7 +304,7 @@ func Dup(oldfd int) (fd int, err error) { ...@@ -304,7 +304,7 @@ func Dup(oldfd int) (fd int, err error) {
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -314,7 +314,7 @@ func Dup(oldfd int) (fd int, err error) { ...@@ -314,7 +314,7 @@ func Dup(oldfd int) (fd int, err error) {
func Dup3(oldfd int, newfd int, flags int) (err error) { func Dup3(oldfd int, newfd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -325,7 +325,7 @@ func EpollCreate(size int) (fd int, err error) { ...@@ -325,7 +325,7 @@ func EpollCreate(size int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -336,7 +336,7 @@ func EpollCreate1(flag int) (fd int, err error) { ...@@ -336,7 +336,7 @@ func EpollCreate1(flag int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -346,7 +346,7 @@ func EpollCreate1(flag int) (fd int, err error) { ...@@ -346,7 +346,7 @@ func EpollCreate1(flag int) (fd int, err error) {
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -363,7 +363,7 @@ func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { ...@@ -363,7 +363,7 @@ func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -386,7 +386,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -386,7 +386,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -396,7 +396,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -396,7 +396,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32)) _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -406,7 +406,7 @@ func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { ...@@ -406,7 +406,7 @@ func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
func Fchdir(fd int) (err error) { func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -416,7 +416,7 @@ func Fchdir(fd int) (err error) { ...@@ -416,7 +416,7 @@ func Fchdir(fd int) (err error) {
func Fchmod(fd int, mode uint32) (err error) { func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -432,7 +432,7 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -432,7 +432,7 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -448,7 +448,7 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { ...@@ -448,7 +448,7 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -459,7 +459,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -459,7 +459,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -469,7 +469,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -469,7 +469,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
func Fdatasync(fd int) (err error) { func Fdatasync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -479,7 +479,7 @@ func Fdatasync(fd int) (err error) { ...@@ -479,7 +479,7 @@ func Fdatasync(fd int) (err error) {
func Flock(fd int, how int) (err error) { func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -489,7 +489,7 @@ func Flock(fd int, how int) (err error) { ...@@ -489,7 +489,7 @@ func Flock(fd int, how int) (err error) {
func Fsync(fd int) (err error) { func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -506,7 +506,7 @@ func Getdents(fd int, buf []byte) (n int, err error) { ...@@ -506,7 +506,7 @@ func Getdents(fd int, buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -517,7 +517,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -517,7 +517,7 @@ func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0) pgid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -544,7 +544,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -544,7 +544,7 @@ func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0) prio = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -554,7 +554,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -554,7 +554,7 @@ func Getpriority(which int, who int) (prio int, err error) {
func Getrusage(who int, rusage *Rusage) (err error) { func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -591,7 +591,7 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { ...@@ -591,7 +591,7 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
sz = int(r0) sz = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -608,7 +608,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e ...@@ -608,7 +608,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
watchdesc = int(r0) watchdesc = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -619,7 +619,7 @@ func InotifyInit() (fd int, err error) { ...@@ -619,7 +619,7 @@ func InotifyInit() (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -630,7 +630,7 @@ func InotifyInit1(flags int) (fd int, err error) { ...@@ -630,7 +630,7 @@ func InotifyInit1(flags int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -641,7 +641,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { ...@@ -641,7 +641,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
success = int(r0) success = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -651,7 +651,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { ...@@ -651,7 +651,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
func Kill(pid int, sig Signal) (err error) { func Kill(pid int, sig Signal) (err error) {
_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -668,7 +668,7 @@ func Klogctl(typ int, buf []byte) (n int, err error) { ...@@ -668,7 +668,7 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -691,7 +691,7 @@ func Listxattr(path string, dest []byte) (sz int, err error) { ...@@ -691,7 +691,7 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
sz = int(r0) sz = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -707,7 +707,7 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { ...@@ -707,7 +707,7 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -723,7 +723,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { ...@@ -723,7 +723,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -733,7 +733,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { ...@@ -733,7 +733,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
func Nanosleep(time *Timespec, leftover *Timespec) (err error) { func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -743,7 +743,7 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) { ...@@ -743,7 +743,7 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
func Pause() (err error) { func Pause() (err error) {
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -765,7 +765,7 @@ func PivotRoot(newroot string, putold string) (err error) { ...@@ -765,7 +765,7 @@ func PivotRoot(newroot string, putold string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -775,7 +775,7 @@ func PivotRoot(newroot string, putold string) (err error) { ...@@ -775,7 +775,7 @@ func PivotRoot(newroot string, putold string) (err error) {
func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {
_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -792,7 +792,7 @@ func read(fd int, p []byte) (n int, err error) { ...@@ -792,7 +792,7 @@ func read(fd int, p []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -814,7 +814,7 @@ func Removexattr(path string, attr string) (err error) { ...@@ -814,7 +814,7 @@ func Removexattr(path string, attr string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -836,7 +836,7 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e ...@@ -836,7 +836,7 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -852,7 +852,7 @@ func Setdomainname(p []byte) (err error) { ...@@ -852,7 +852,7 @@ func Setdomainname(p []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -868,7 +868,7 @@ func Sethostname(p []byte) (err error) { ...@@ -868,7 +868,7 @@ func Sethostname(p []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -878,7 +878,7 @@ func Sethostname(p []byte) (err error) { ...@@ -878,7 +878,7 @@ func Sethostname(p []byte) (err error) {
func Setpgid(pid int, pgid int) (err error) { func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -889,7 +889,7 @@ func Setsid() (pid int, err error) { ...@@ -889,7 +889,7 @@ func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0) pid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -899,7 +899,7 @@ func Setsid() (pid int, err error) { ...@@ -899,7 +899,7 @@ func Setsid() (pid int, err error) {
func Settimeofday(tv *Timeval) (err error) { func Settimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -909,7 +909,7 @@ func Settimeofday(tv *Timeval) (err error) { ...@@ -909,7 +909,7 @@ func Settimeofday(tv *Timeval) (err error) {
func Setpriority(which int, who int, prio int) (err error) { func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -937,7 +937,7 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { ...@@ -937,7 +937,7 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -954,7 +954,7 @@ func Sync() { ...@@ -954,7 +954,7 @@ func Sync() {
func Sysinfo(info *Sysinfo_t) (err error) { func Sysinfo(info *Sysinfo_t) (err error) {
_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -965,7 +965,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { ...@@ -965,7 +965,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)
n = int64(int64(r1)<<32 | int64(r0)) n = int64(int64(r1)<<32 | int64(r0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -975,7 +975,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { ...@@ -975,7 +975,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
func Tgkill(tgid int, tid int, sig Signal) (err error) { func Tgkill(tgid int, tid int, sig Signal) (err error) {
_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -986,7 +986,7 @@ func Times(tms *Tms) (ticks uintptr, err error) { ...@@ -986,7 +986,7 @@ func Times(tms *Tms) (ticks uintptr, err error) {
r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
ticks = uintptr(r0) ticks = uintptr(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1004,7 +1004,7 @@ func Umask(mask int) (oldmask int) { ...@@ -1004,7 +1004,7 @@ func Umask(mask int) (oldmask int) {
func Uname(buf *Utsname) (err error) { func Uname(buf *Utsname) (err error) {
_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1020,7 +1020,7 @@ func Unmount(target string, flags int) (err error) { ...@@ -1020,7 +1020,7 @@ func Unmount(target string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1030,7 +1030,7 @@ func Unmount(target string, flags int) (err error) { ...@@ -1030,7 +1030,7 @@ func Unmount(target string, flags int) (err error) {
func Unshare(flags int) (err error) { func Unshare(flags int) (err error) {
_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1040,7 +1040,7 @@ func Unshare(flags int) (err error) { ...@@ -1040,7 +1040,7 @@ func Unshare(flags int) (err error) {
func Ustat(dev int, ubuf *Ustat_t) (err error) { func Ustat(dev int, ubuf *Ustat_t) (err error) {
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1056,7 +1056,7 @@ func Utime(path string, buf *Utimbuf) (err error) { ...@@ -1056,7 +1056,7 @@ func Utime(path string, buf *Utimbuf) (err error) {
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1073,7 +1073,7 @@ func write(fd int, p []byte) (n int, err error) { ...@@ -1073,7 +1073,7 @@ func write(fd int, p []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1083,7 +1083,7 @@ func write(fd int, p []byte) (n int, err error) { ...@@ -1083,7 +1083,7 @@ func write(fd int, p []byte) (n int, err error) {
func exitThread(code int) (err error) { func exitThread(code int) (err error) {
_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1094,7 +1094,7 @@ func readlen(fd int, p *byte, np int) (n int, err error) { ...@@ -1094,7 +1094,7 @@ func readlen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1105,7 +1105,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) { ...@@ -1105,7 +1105,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1115,7 +1115,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) { ...@@ -1115,7 +1115,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) {
func munmap(addr uintptr, length uintptr) (err error) { func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1131,7 +1131,7 @@ func Madvise(b []byte, advice int) (err error) { ...@@ -1131,7 +1131,7 @@ func Madvise(b []byte, advice int) (err error) {
} }
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1147,7 +1147,7 @@ func Mprotect(b []byte, prot int) (err error) { ...@@ -1147,7 +1147,7 @@ func Mprotect(b []byte, prot int) (err error) {
} }
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1163,7 +1163,7 @@ func Mlock(b []byte) (err error) { ...@@ -1163,7 +1163,7 @@ func Mlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1179,7 +1179,7 @@ func Munlock(b []byte) (err error) { ...@@ -1179,7 +1179,7 @@ func Munlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1189,7 +1189,7 @@ func Munlock(b []byte) (err error) { ...@@ -1189,7 +1189,7 @@ func Munlock(b []byte) (err error) {
func Mlockall(flags int) (err error) { func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1199,7 +1199,7 @@ func Mlockall(flags int) (err error) { ...@@ -1199,7 +1199,7 @@ func Mlockall(flags int) (err error) {
func Munlockall() (err error) { func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1209,7 +1209,7 @@ func Munlockall() (err error) { ...@@ -1209,7 +1209,7 @@ func Munlockall() (err error) {
func pipe(p *[2]_C_int) (err error) { func pipe(p *[2]_C_int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1219,7 +1219,7 @@ func pipe(p *[2]_C_int) (err error) { ...@@ -1219,7 +1219,7 @@ func pipe(p *[2]_C_int) (err error) {
func pipe2(p *[2]_C_int, flags int) (err error) { func pipe2(p *[2]_C_int, flags int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1229,7 +1229,7 @@ func pipe2(p *[2]_C_int, flags int) (err error) { ...@@ -1229,7 +1229,7 @@ func pipe2(p *[2]_C_int, flags int) (err error) {
func Dup2(oldfd int, newfd int) (err error) { func Dup2(oldfd int, newfd int) (err error) {
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1239,7 +1239,7 @@ func Dup2(oldfd int, newfd int) (err error) { ...@@ -1239,7 +1239,7 @@ func Dup2(oldfd int, newfd int) (err error) {
func Fchown(fd int, uid int, gid int) (err error) { func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1249,7 +1249,7 @@ func Fchown(fd int, uid int, gid int) (err error) { ...@@ -1249,7 +1249,7 @@ func Fchown(fd int, uid int, gid int) (err error) {
func Fstat(fd int, stat *Stat_t) (err error) { func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1259,7 +1259,7 @@ func Fstat(fd int, stat *Stat_t) (err error) { ...@@ -1259,7 +1259,7 @@ func Fstat(fd int, stat *Stat_t) (err error) {
func Ftruncate(fd int, length int64) (err error) { func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32)) _, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1301,7 +1301,7 @@ func Getuid() (uid int) { ...@@ -1301,7 +1301,7 @@ func Getuid() (uid int) {
func Ioperm(from int, num int, on int) (err error) { func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1311,7 +1311,7 @@ func Ioperm(from int, num int, on int) (err error) { ...@@ -1311,7 +1311,7 @@ func Ioperm(from int, num int, on int) (err error) {
func Iopl(level int) (err error) { func Iopl(level int) (err error) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1327,7 +1327,7 @@ func Lchown(path string, uid int, gid int) (err error) { ...@@ -1327,7 +1327,7 @@ func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1343,7 +1343,7 @@ func Lstat(path string, stat *Stat_t) (err error) { ...@@ -1343,7 +1343,7 @@ func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1360,7 +1360,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { ...@@ -1360,7 +1360,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1377,7 +1377,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { ...@@ -1377,7 +1377,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1388,7 +1388,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e ...@@ -1388,7 +1388,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
written = int(r0) written = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1398,7 +1398,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e ...@@ -1398,7 +1398,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
func Setfsgid(gid int) (err error) { func Setfsgid(gid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) _, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1408,7 +1408,7 @@ func Setfsgid(gid int) (err error) { ...@@ -1408,7 +1408,7 @@ func Setfsgid(gid int) (err error) {
func Setfsuid(uid int) (err error) { func Setfsuid(uid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) _, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1418,7 +1418,7 @@ func Setfsuid(uid int) (err error) { ...@@ -1418,7 +1418,7 @@ func Setfsuid(uid int) (err error) {
func Setregid(rgid int, egid int) (err error) { func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0) _, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1428,7 +1428,7 @@ func Setregid(rgid int, egid int) (err error) { ...@@ -1428,7 +1428,7 @@ func Setregid(rgid int, egid int) (err error) {
func Setresgid(rgid int, egid int, sgid int) (err error) { func Setresgid(rgid int, egid int, sgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid)) _, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1438,7 +1438,7 @@ func Setresgid(rgid int, egid int, sgid int) (err error) { ...@@ -1438,7 +1438,7 @@ func Setresgid(rgid int, egid int, sgid int) (err error) {
func Setresuid(ruid int, euid int, suid int) (err error) { func Setresuid(ruid int, euid int, suid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid)) _, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1448,7 +1448,7 @@ func Setresuid(ruid int, euid int, suid int) (err error) { ...@@ -1448,7 +1448,7 @@ func Setresuid(ruid int, euid int, suid int) (err error) {
func Setreuid(ruid int, euid int) (err error) { func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0) _, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1459,7 +1459,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i ...@@ -1459,7 +1459,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1475,7 +1475,7 @@ func Stat(path string, stat *Stat_t) (err error) { ...@@ -1475,7 +1475,7 @@ func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1485,7 +1485,7 @@ func Stat(path string, stat *Stat_t) (err error) { ...@@ -1485,7 +1485,7 @@ func Stat(path string, stat *Stat_t) (err error) {
func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { func SyncFileRange(fd int, off int64, n int64, flags int) (err error) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags)) _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1501,7 +1501,7 @@ func Truncate(path string, length int64) (err error) { ...@@ -1501,7 +1501,7 @@ func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) _, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1512,7 +1512,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) { ...@@ -1512,7 +1512,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
nn = int(r0) nn = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1522,7 +1522,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) { ...@@ -1522,7 +1522,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) {
func setgroups(n int, list *_Gid_t) (err error) { func setgroups(n int, list *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) _, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1533,7 +1533,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err ...@@ -1533,7 +1533,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1544,7 +1544,7 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset ...@@ -1544,7 +1544,7 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset
r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))
xaddr = uintptr(r0) xaddr = uintptr(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1554,7 +1554,7 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset ...@@ -1554,7 +1554,7 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset
func getrlimit(resource int, rlim *rlimit32) (err error) { func getrlimit(resource int, rlim *rlimit32) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1564,7 +1564,7 @@ func getrlimit(resource int, rlim *rlimit32) (err error) { ...@@ -1564,7 +1564,7 @@ func getrlimit(resource int, rlim *rlimit32) (err error) {
func setrlimit(resource int, rlim *rlimit32) (err error) { func setrlimit(resource int, rlim *rlimit32) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1574,7 +1574,7 @@ func setrlimit(resource int, rlim *rlimit32) (err error) { ...@@ -1574,7 +1574,7 @@ func setrlimit(resource int, rlim *rlimit32) (err error) {
func Gettimeofday(tv *Timeval) (err error) { func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1585,7 +1585,7 @@ func Time(t *Time_t) (tt Time_t, err error) { ...@@ -1585,7 +1585,7 @@ func Time(t *Time_t) (tt Time_t, err error) {
r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)
tt = Time_t(r0) tt = Time_t(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -22,7 +22,7 @@ func linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in ...@@ -22,7 +22,7 @@ func linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -39,7 +39,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) ...@@ -39,7 +39,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -62,7 +62,7 @@ func readlinkat(dirfd int, path string, buf []byte) (n int, err error) { ...@@ -62,7 +62,7 @@ func readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -84,7 +84,7 @@ func symlinkat(oldpath string, newdirfd int, newpath string) (err error) { ...@@ -84,7 +84,7 @@ func symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -100,7 +100,7 @@ func unlinkat(dirfd int, path string, flags int) (err error) { ...@@ -100,7 +100,7 @@ func unlinkat(dirfd int, path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -116,7 +116,7 @@ func utimes(path string, times *[2]Timeval) (err error) { ...@@ -116,7 +116,7 @@ func utimes(path string, times *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -132,7 +132,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) { ...@@ -132,7 +132,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
_, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -142,7 +142,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) { ...@@ -142,7 +142,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) { func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times))) _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -159,7 +159,7 @@ func Getcwd(buf []byte) (n int, err error) { ...@@ -159,7 +159,7 @@ func Getcwd(buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0) r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -170,7 +170,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err ...@@ -170,7 +170,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) r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0) wpid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -180,7 +180,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err ...@@ -180,7 +180,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
func ptrace(request int, pid int, addr uintptr, data uintptr) (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) _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -196,7 +196,7 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { ...@@ -196,7 +196,7 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {
_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -224,7 +224,7 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt ...@@ -224,7 +224,7 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
use(unsafe.Pointer(_p2)) use(unsafe.Pointer(_p2))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -240,7 +240,7 @@ func Acct(path string) (err error) { ...@@ -240,7 +240,7 @@ func Acct(path string) (err error) {
_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -251,7 +251,7 @@ func Adjtimex(buf *Timex) (state int, err error) { ...@@ -251,7 +251,7 @@ func Adjtimex(buf *Timex) (state int, err error) {
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
state = int(r0) state = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -267,7 +267,7 @@ func Chdir(path string) (err error) { ...@@ -267,7 +267,7 @@ func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -283,7 +283,7 @@ func Chroot(path string) (err error) { ...@@ -283,7 +283,7 @@ func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -293,7 +293,7 @@ func Chroot(path string) (err error) { ...@@ -293,7 +293,7 @@ func Chroot(path string) (err error) {
func Close(fd int) (err error) { func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -304,7 +304,7 @@ func Dup(oldfd int) (fd int, err error) { ...@@ -304,7 +304,7 @@ func Dup(oldfd int) (fd int, err error) {
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -314,7 +314,7 @@ func Dup(oldfd int) (fd int, err error) { ...@@ -314,7 +314,7 @@ func Dup(oldfd int) (fd int, err error) {
func Dup3(oldfd int, newfd int, flags int) (err error) { func Dup3(oldfd int, newfd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -325,7 +325,7 @@ func EpollCreate(size int) (fd int, err error) { ...@@ -325,7 +325,7 @@ func EpollCreate(size int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -336,7 +336,7 @@ func EpollCreate1(flag int) (fd int, err error) { ...@@ -336,7 +336,7 @@ func EpollCreate1(flag int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -346,7 +346,7 @@ func EpollCreate1(flag int) (fd int, err error) { ...@@ -346,7 +346,7 @@ func EpollCreate1(flag int) (fd int, err error) {
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -363,7 +363,7 @@ func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { ...@@ -363,7 +363,7 @@ func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -386,7 +386,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -386,7 +386,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -396,7 +396,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -396,7 +396,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -406,7 +406,7 @@ func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { ...@@ -406,7 +406,7 @@ func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
func Fchdir(fd int) (err error) { func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -416,7 +416,7 @@ func Fchdir(fd int) (err error) { ...@@ -416,7 +416,7 @@ func Fchdir(fd int) (err error) {
func Fchmod(fd int, mode uint32) (err error) { func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -432,7 +432,7 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -432,7 +432,7 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -448,7 +448,7 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { ...@@ -448,7 +448,7 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -459,7 +459,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -459,7 +459,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -469,7 +469,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -469,7 +469,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
func Fdatasync(fd int) (err error) { func Fdatasync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -479,7 +479,7 @@ func Fdatasync(fd int) (err error) { ...@@ -479,7 +479,7 @@ func Fdatasync(fd int) (err error) {
func Flock(fd int, how int) (err error) { func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -489,7 +489,7 @@ func Flock(fd int, how int) (err error) { ...@@ -489,7 +489,7 @@ func Flock(fd int, how int) (err error) {
func Fsync(fd int) (err error) { func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -506,7 +506,7 @@ func Getdents(fd int, buf []byte) (n int, err error) { ...@@ -506,7 +506,7 @@ func Getdents(fd int, buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -517,7 +517,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -517,7 +517,7 @@ func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0) pgid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -544,7 +544,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -544,7 +544,7 @@ func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0) prio = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -554,7 +554,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -554,7 +554,7 @@ func Getpriority(which int, who int) (prio int, err error) {
func Getrusage(who int, rusage *Rusage) (err error) { func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -591,7 +591,7 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { ...@@ -591,7 +591,7 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
sz = int(r0) sz = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -608,7 +608,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e ...@@ -608,7 +608,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
watchdesc = int(r0) watchdesc = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -619,7 +619,7 @@ func InotifyInit() (fd int, err error) { ...@@ -619,7 +619,7 @@ func InotifyInit() (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -630,7 +630,7 @@ func InotifyInit1(flags int) (fd int, err error) { ...@@ -630,7 +630,7 @@ func InotifyInit1(flags int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -641,7 +641,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { ...@@ -641,7 +641,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
success = int(r0) success = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -651,7 +651,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { ...@@ -651,7 +651,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
func Kill(pid int, sig Signal) (err error) { func Kill(pid int, sig Signal) (err error) {
_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -668,7 +668,7 @@ func Klogctl(typ int, buf []byte) (n int, err error) { ...@@ -668,7 +668,7 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -691,7 +691,7 @@ func Listxattr(path string, dest []byte) (sz int, err error) { ...@@ -691,7 +691,7 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
sz = int(r0) sz = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -707,7 +707,7 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { ...@@ -707,7 +707,7 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -723,7 +723,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { ...@@ -723,7 +723,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -733,7 +733,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { ...@@ -733,7 +733,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
func Nanosleep(time *Timespec, leftover *Timespec) (err error) { func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -743,7 +743,7 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) { ...@@ -743,7 +743,7 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
func Pause() (err error) { func Pause() (err error) {
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -765,7 +765,7 @@ func PivotRoot(newroot string, putold string) (err error) { ...@@ -765,7 +765,7 @@ func PivotRoot(newroot string, putold string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -775,7 +775,7 @@ func PivotRoot(newroot string, putold string) (err error) { ...@@ -775,7 +775,7 @@ func PivotRoot(newroot string, putold string) (err error) {
func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {
_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -792,7 +792,7 @@ func read(fd int, p []byte) (n int, err error) { ...@@ -792,7 +792,7 @@ func read(fd int, p []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -814,7 +814,7 @@ func Removexattr(path string, attr string) (err error) { ...@@ -814,7 +814,7 @@ func Removexattr(path string, attr string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -836,7 +836,7 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e ...@@ -836,7 +836,7 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -852,7 +852,7 @@ func Setdomainname(p []byte) (err error) { ...@@ -852,7 +852,7 @@ func Setdomainname(p []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -868,7 +868,7 @@ func Sethostname(p []byte) (err error) { ...@@ -868,7 +868,7 @@ func Sethostname(p []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -878,7 +878,7 @@ func Sethostname(p []byte) (err error) { ...@@ -878,7 +878,7 @@ func Sethostname(p []byte) (err error) {
func Setpgid(pid int, pgid int) (err error) { func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -889,7 +889,7 @@ func Setsid() (pid int, err error) { ...@@ -889,7 +889,7 @@ func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0) pid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -899,7 +899,7 @@ func Setsid() (pid int, err error) { ...@@ -899,7 +899,7 @@ func Setsid() (pid int, err error) {
func Settimeofday(tv *Timeval) (err error) { func Settimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -909,7 +909,7 @@ func Settimeofday(tv *Timeval) (err error) { ...@@ -909,7 +909,7 @@ func Settimeofday(tv *Timeval) (err error) {
func Setpriority(which int, who int, prio int) (err error) { func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -937,7 +937,7 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { ...@@ -937,7 +937,7 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -954,7 +954,7 @@ func Sync() { ...@@ -954,7 +954,7 @@ func Sync() {
func Sysinfo(info *Sysinfo_t) (err error) { func Sysinfo(info *Sysinfo_t) (err error) {
_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -965,7 +965,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { ...@@ -965,7 +965,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)
n = int64(r0) n = int64(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -975,7 +975,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { ...@@ -975,7 +975,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
func Tgkill(tgid int, tid int, sig Signal) (err error) { func Tgkill(tgid int, tid int, sig Signal) (err error) {
_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -986,7 +986,7 @@ func Times(tms *Tms) (ticks uintptr, err error) { ...@@ -986,7 +986,7 @@ func Times(tms *Tms) (ticks uintptr, err error) {
r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
ticks = uintptr(r0) ticks = uintptr(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1004,7 +1004,7 @@ func Umask(mask int) (oldmask int) { ...@@ -1004,7 +1004,7 @@ func Umask(mask int) (oldmask int) {
func Uname(buf *Utsname) (err error) { func Uname(buf *Utsname) (err error) {
_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1020,7 +1020,7 @@ func Unmount(target string, flags int) (err error) { ...@@ -1020,7 +1020,7 @@ func Unmount(target string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1030,7 +1030,7 @@ func Unmount(target string, flags int) (err error) { ...@@ -1030,7 +1030,7 @@ func Unmount(target string, flags int) (err error) {
func Unshare(flags int) (err error) { func Unshare(flags int) (err error) {
_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1040,7 +1040,7 @@ func Unshare(flags int) (err error) { ...@@ -1040,7 +1040,7 @@ func Unshare(flags int) (err error) {
func Ustat(dev int, ubuf *Ustat_t) (err error) { func Ustat(dev int, ubuf *Ustat_t) (err error) {
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1056,7 +1056,7 @@ func Utime(path string, buf *Utimbuf) (err error) { ...@@ -1056,7 +1056,7 @@ func Utime(path string, buf *Utimbuf) (err error) {
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1073,7 +1073,7 @@ func write(fd int, p []byte) (n int, err error) { ...@@ -1073,7 +1073,7 @@ func write(fd int, p []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1083,7 +1083,7 @@ func write(fd int, p []byte) (n int, err error) { ...@@ -1083,7 +1083,7 @@ func write(fd int, p []byte) (n int, err error) {
func exitThread(code int) (err error) { func exitThread(code int) (err error) {
_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1094,7 +1094,7 @@ func readlen(fd int, p *byte, np int) (n int, err error) { ...@@ -1094,7 +1094,7 @@ func readlen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1105,7 +1105,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) { ...@@ -1105,7 +1105,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1115,7 +1115,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) { ...@@ -1115,7 +1115,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) {
func munmap(addr uintptr, length uintptr) (err error) { func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1131,7 +1131,7 @@ func Madvise(b []byte, advice int) (err error) { ...@@ -1131,7 +1131,7 @@ func Madvise(b []byte, advice int) (err error) {
} }
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1147,7 +1147,7 @@ func Mprotect(b []byte, prot int) (err error) { ...@@ -1147,7 +1147,7 @@ func Mprotect(b []byte, prot int) (err error) {
} }
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1163,7 +1163,7 @@ func Mlock(b []byte) (err error) { ...@@ -1163,7 +1163,7 @@ func Mlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1179,7 +1179,7 @@ func Munlock(b []byte) (err error) { ...@@ -1179,7 +1179,7 @@ func Munlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1189,7 +1189,7 @@ func Munlock(b []byte) (err error) { ...@@ -1189,7 +1189,7 @@ func Munlock(b []byte) (err error) {
func Mlockall(flags int) (err error) { func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1199,7 +1199,7 @@ func Mlockall(flags int) (err error) { ...@@ -1199,7 +1199,7 @@ func Mlockall(flags int) (err error) {
func Munlockall() (err error) { func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1209,7 +1209,7 @@ func Munlockall() (err error) { ...@@ -1209,7 +1209,7 @@ func Munlockall() (err error) {
func Dup2(oldfd int, newfd int) (err error) { func Dup2(oldfd int, newfd int) (err error) {
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1219,7 +1219,7 @@ func Dup2(oldfd int, newfd int) (err error) { ...@@ -1219,7 +1219,7 @@ func Dup2(oldfd int, newfd int) (err error) {
func Fchown(fd int, uid int, gid int) (err error) { func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1229,7 +1229,7 @@ func Fchown(fd int, uid int, gid int) (err error) { ...@@ -1229,7 +1229,7 @@ func Fchown(fd int, uid int, gid int) (err error) {
func Fstat(fd int, stat *Stat_t) (err error) { func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1239,7 +1239,7 @@ func Fstat(fd int, stat *Stat_t) (err error) { ...@@ -1239,7 +1239,7 @@ func Fstat(fd int, stat *Stat_t) (err error) {
func Fstatfs(fd int, buf *Statfs_t) (err error) { func Fstatfs(fd int, buf *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1249,7 +1249,7 @@ func Fstatfs(fd int, buf *Statfs_t) (err error) { ...@@ -1249,7 +1249,7 @@ func Fstatfs(fd int, buf *Statfs_t) (err error) {
func Ftruncate(fd int, length int64) (err error) { func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1283,7 +1283,7 @@ func Getgid() (gid int) { ...@@ -1283,7 +1283,7 @@ func Getgid() (gid int) {
func Getrlimit(resource int, rlim *Rlimit) (err error) { func Getrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1301,7 +1301,7 @@ func Getuid() (uid int) { ...@@ -1301,7 +1301,7 @@ func Getuid() (uid int) {
func Ioperm(from int, num int, on int) (err error) { func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1311,7 +1311,7 @@ func Ioperm(from int, num int, on int) (err error) { ...@@ -1311,7 +1311,7 @@ func Ioperm(from int, num int, on int) (err error) {
func Iopl(level int) (err error) { func Iopl(level int) (err error) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1327,7 +1327,7 @@ func Lchown(path string, uid int, gid int) (err error) { ...@@ -1327,7 +1327,7 @@ func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1337,7 +1337,7 @@ func Lchown(path string, uid int, gid int) (err error) { ...@@ -1337,7 +1337,7 @@ func Lchown(path string, uid int, gid int) (err error) {
func Listen(s int, n int) (err error) { func Listen(s int, n int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1353,7 +1353,7 @@ func Lstat(path string, stat *Stat_t) (err error) { ...@@ -1353,7 +1353,7 @@ func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1370,7 +1370,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { ...@@ -1370,7 +1370,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1387,7 +1387,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { ...@@ -1387,7 +1387,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1398,7 +1398,7 @@ func Seek(fd int, offset int64, whence int) (off int64, err error) { ...@@ -1398,7 +1398,7 @@ func Seek(fd int, offset int64, whence int) (off int64, err error) {
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
off = int64(r0) off = int64(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1409,7 +1409,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err ...@@ -1409,7 +1409,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1420,7 +1420,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e ...@@ -1420,7 +1420,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
written = int(r0) written = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1430,7 +1430,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e ...@@ -1430,7 +1430,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
func Setfsgid(gid int) (err error) { func Setfsgid(gid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1440,7 +1440,7 @@ func Setfsgid(gid int) (err error) { ...@@ -1440,7 +1440,7 @@ func Setfsgid(gid int) (err error) {
func Setfsuid(uid int) (err error) { func Setfsuid(uid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1450,7 +1450,7 @@ func Setfsuid(uid int) (err error) { ...@@ -1450,7 +1450,7 @@ func Setfsuid(uid int) (err error) {
func Setregid(rgid int, egid int) (err error) { func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1460,7 +1460,7 @@ func Setregid(rgid int, egid int) (err error) { ...@@ -1460,7 +1460,7 @@ func Setregid(rgid int, egid int) (err error) {
func Setresgid(rgid int, egid int, sgid int) (err error) { func Setresgid(rgid int, egid int, sgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1470,7 +1470,7 @@ func Setresgid(rgid int, egid int, sgid int) (err error) { ...@@ -1470,7 +1470,7 @@ func Setresgid(rgid int, egid int, sgid int) (err error) {
func Setresuid(ruid int, euid int, suid int) (err error) { func Setresuid(ruid int, euid int, suid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1480,7 +1480,7 @@ func Setresuid(ruid int, euid int, suid int) (err error) { ...@@ -1480,7 +1480,7 @@ func Setresuid(ruid int, euid int, suid int) (err error) {
func Setrlimit(resource int, rlim *Rlimit) (err error) { func Setrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1490,7 +1490,7 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { ...@@ -1490,7 +1490,7 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) {
func Setreuid(ruid int, euid int) (err error) { func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1500,7 +1500,7 @@ func Setreuid(ruid int, euid int) (err error) { ...@@ -1500,7 +1500,7 @@ func Setreuid(ruid int, euid int) (err error) {
func Shutdown(fd int, how int) (err error) { func Shutdown(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1511,7 +1511,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i ...@@ -1511,7 +1511,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int64(r0) n = int64(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1527,7 +1527,7 @@ func Stat(path string, stat *Stat_t) (err error) { ...@@ -1527,7 +1527,7 @@ func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1543,7 +1543,7 @@ func Statfs(path string, buf *Statfs_t) (err error) { ...@@ -1543,7 +1543,7 @@ func Statfs(path string, buf *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1553,7 +1553,7 @@ func Statfs(path string, buf *Statfs_t) (err error) { ...@@ -1553,7 +1553,7 @@ func Statfs(path string, buf *Statfs_t) (err error) {
func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { func SyncFileRange(fd int, off int64, n int64, flags int) (err error) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1569,7 +1569,7 @@ func Truncate(path string, length int64) (err error) { ...@@ -1569,7 +1569,7 @@ func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1580,7 +1580,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { ...@@ -1580,7 +1580,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))) r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1591,7 +1591,7 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, ...@@ -1591,7 +1591,7 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int,
r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1601,7 +1601,7 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, ...@@ -1601,7 +1601,7 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int,
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1611,7 +1611,7 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { ...@@ -1611,7 +1611,7 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
func connect(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)) _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1622,7 +1622,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) { ...@@ -1622,7 +1622,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
nn = int(r0) nn = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1632,7 +1632,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) { ...@@ -1632,7 +1632,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) {
func setgroups(n int, list *_Gid_t) (err error) { func setgroups(n int, list *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1642,7 +1642,7 @@ func setgroups(n int, list *_Gid_t) (err error) { ...@@ -1642,7 +1642,7 @@ func setgroups(n int, list *_Gid_t) (err error) {
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (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) _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1652,7 +1652,7 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen ...@@ -1652,7 +1652,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) { 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) _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1663,7 +1663,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) { ...@@ -1663,7 +1663,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1673,7 +1673,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) { ...@@ -1673,7 +1673,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
func socketpair(domain int, typ int, proto int, fd *[2]int32) (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) _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1683,7 +1683,7 @@ func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { ...@@ -1683,7 +1683,7 @@ func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1693,7 +1693,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { ...@@ -1693,7 +1693,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
func getsockname(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))) _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1710,7 +1710,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl ...@@ -1710,7 +1710,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))) 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) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1726,7 +1726,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( ...@@ -1726,7 +1726,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)) _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1737,7 +1737,7 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -1737,7 +1737,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)) r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1748,7 +1748,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -1748,7 +1748,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)) r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1759,7 +1759,7 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6 ...@@ -1759,7 +1759,7 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))
xaddr = uintptr(r0) xaddr = uintptr(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1769,7 +1769,7 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6 ...@@ -1769,7 +1769,7 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6
func pipe(p *[2]_C_int) (err error) { func pipe(p *[2]_C_int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1779,7 +1779,7 @@ func pipe(p *[2]_C_int) (err error) { ...@@ -1779,7 +1779,7 @@ func pipe(p *[2]_C_int) (err error) {
func pipe2(p *[2]_C_int, flags int) (err error) { func pipe2(p *[2]_C_int, flags int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -22,7 +22,7 @@ func linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in ...@@ -22,7 +22,7 @@ func linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -39,7 +39,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) ...@@ -39,7 +39,7 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -62,7 +62,7 @@ func readlinkat(dirfd int, path string, buf []byte) (n int, err error) { ...@@ -62,7 +62,7 @@ func readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -84,7 +84,7 @@ func symlinkat(oldpath string, newdirfd int, newpath string) (err error) { ...@@ -84,7 +84,7 @@ func symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -100,7 +100,7 @@ func unlinkat(dirfd int, path string, flags int) (err error) { ...@@ -100,7 +100,7 @@ func unlinkat(dirfd int, path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -116,7 +116,7 @@ func utimes(path string, times *[2]Timeval) (err error) { ...@@ -116,7 +116,7 @@ func utimes(path string, times *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -132,7 +132,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) { ...@@ -132,7 +132,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
_, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -142,7 +142,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) { ...@@ -142,7 +142,7 @@ func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) { func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times))) _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -159,7 +159,7 @@ func Getcwd(buf []byte) (n int, err error) { ...@@ -159,7 +159,7 @@ func Getcwd(buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0) r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -170,7 +170,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err ...@@ -170,7 +170,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) r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0) wpid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -180,7 +180,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err ...@@ -180,7 +180,7 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
func ptrace(request int, pid int, addr uintptr, data uintptr) (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) _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -196,7 +196,7 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { ...@@ -196,7 +196,7 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {
_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -224,7 +224,7 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt ...@@ -224,7 +224,7 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
use(unsafe.Pointer(_p2)) use(unsafe.Pointer(_p2))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -240,7 +240,7 @@ func Acct(path string) (err error) { ...@@ -240,7 +240,7 @@ func Acct(path string) (err error) {
_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -251,7 +251,7 @@ func Adjtimex(buf *Timex) (state int, err error) { ...@@ -251,7 +251,7 @@ func Adjtimex(buf *Timex) (state int, err error) {
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
state = int(r0) state = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -267,7 +267,7 @@ func Chdir(path string) (err error) { ...@@ -267,7 +267,7 @@ func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -283,7 +283,7 @@ func Chroot(path string) (err error) { ...@@ -283,7 +283,7 @@ func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -293,7 +293,7 @@ func Chroot(path string) (err error) { ...@@ -293,7 +293,7 @@ func Chroot(path string) (err error) {
func Close(fd int) (err error) { func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -304,7 +304,7 @@ func Dup(oldfd int) (fd int, err error) { ...@@ -304,7 +304,7 @@ func Dup(oldfd int) (fd int, err error) {
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -314,7 +314,7 @@ func Dup(oldfd int) (fd int, err error) { ...@@ -314,7 +314,7 @@ func Dup(oldfd int) (fd int, err error) {
func Dup3(oldfd int, newfd int, flags int) (err error) { func Dup3(oldfd int, newfd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -325,7 +325,7 @@ func EpollCreate(size int) (fd int, err error) { ...@@ -325,7 +325,7 @@ func EpollCreate(size int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -336,7 +336,7 @@ func EpollCreate1(flag int) (fd int, err error) { ...@@ -336,7 +336,7 @@ func EpollCreate1(flag int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -346,7 +346,7 @@ func EpollCreate1(flag int) (fd int, err error) { ...@@ -346,7 +346,7 @@ func EpollCreate1(flag int) (fd int, err error) {
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -363,7 +363,7 @@ func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { ...@@ -363,7 +363,7 @@ func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -386,7 +386,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -386,7 +386,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -396,7 +396,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -396,7 +396,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32)) _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -406,7 +406,7 @@ func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { ...@@ -406,7 +406,7 @@ func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
func Fchdir(fd int) (err error) { func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -416,7 +416,7 @@ func Fchdir(fd int) (err error) { ...@@ -416,7 +416,7 @@ func Fchdir(fd int) (err error) {
func Fchmod(fd int, mode uint32) (err error) { func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -432,7 +432,7 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { ...@@ -432,7 +432,7 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -448,7 +448,7 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { ...@@ -448,7 +448,7 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -459,7 +459,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -459,7 +459,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0) val = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -469,7 +469,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { ...@@ -469,7 +469,7 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
func Fdatasync(fd int) (err error) { func Fdatasync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -479,7 +479,7 @@ func Fdatasync(fd int) (err error) { ...@@ -479,7 +479,7 @@ func Fdatasync(fd int) (err error) {
func Flock(fd int, how int) (err error) { func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -489,7 +489,7 @@ func Flock(fd int, how int) (err error) { ...@@ -489,7 +489,7 @@ func Flock(fd int, how int) (err error) {
func Fsync(fd int) (err error) { func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -506,7 +506,7 @@ func Getdents(fd int, buf []byte) (n int, err error) { ...@@ -506,7 +506,7 @@ func Getdents(fd int, buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -517,7 +517,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -517,7 +517,7 @@ func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0) pgid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -544,7 +544,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -544,7 +544,7 @@ func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0) prio = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -554,7 +554,7 @@ func Getpriority(which int, who int) (prio int, err error) { ...@@ -554,7 +554,7 @@ func Getpriority(which int, who int) (prio int, err error) {
func Getrusage(who int, rusage *Rusage) (err error) { func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -591,7 +591,7 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { ...@@ -591,7 +591,7 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
sz = int(r0) sz = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -608,7 +608,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e ...@@ -608,7 +608,7 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
watchdesc = int(r0) watchdesc = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -619,7 +619,7 @@ func InotifyInit() (fd int, err error) { ...@@ -619,7 +619,7 @@ func InotifyInit() (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -630,7 +630,7 @@ func InotifyInit1(flags int) (fd int, err error) { ...@@ -630,7 +630,7 @@ func InotifyInit1(flags int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -641,7 +641,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { ...@@ -641,7 +641,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
success = int(r0) success = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -651,7 +651,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { ...@@ -651,7 +651,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
func Kill(pid int, sig Signal) (err error) { func Kill(pid int, sig Signal) (err error) {
_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -668,7 +668,7 @@ func Klogctl(typ int, buf []byte) (n int, err error) { ...@@ -668,7 +668,7 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -691,7 +691,7 @@ func Listxattr(path string, dest []byte) (sz int, err error) { ...@@ -691,7 +691,7 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
sz = int(r0) sz = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -707,7 +707,7 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { ...@@ -707,7 +707,7 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -723,7 +723,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { ...@@ -723,7 +723,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -733,7 +733,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { ...@@ -733,7 +733,7 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
func Nanosleep(time *Timespec, leftover *Timespec) (err error) { func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -743,7 +743,7 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) { ...@@ -743,7 +743,7 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
func Pause() (err error) { func Pause() (err error) {
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -765,7 +765,7 @@ func PivotRoot(newroot string, putold string) (err error) { ...@@ -765,7 +765,7 @@ func PivotRoot(newroot string, putold string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -775,7 +775,7 @@ func PivotRoot(newroot string, putold string) (err error) { ...@@ -775,7 +775,7 @@ func PivotRoot(newroot string, putold string) (err error) {
func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {
_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -792,7 +792,7 @@ func read(fd int, p []byte) (n int, err error) { ...@@ -792,7 +792,7 @@ func read(fd int, p []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -814,7 +814,7 @@ func Removexattr(path string, attr string) (err error) { ...@@ -814,7 +814,7 @@ func Removexattr(path string, attr string) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -836,7 +836,7 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e ...@@ -836,7 +836,7 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -852,7 +852,7 @@ func Setdomainname(p []byte) (err error) { ...@@ -852,7 +852,7 @@ func Setdomainname(p []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -868,7 +868,7 @@ func Sethostname(p []byte) (err error) { ...@@ -868,7 +868,7 @@ func Sethostname(p []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -878,7 +878,7 @@ func Sethostname(p []byte) (err error) { ...@@ -878,7 +878,7 @@ func Sethostname(p []byte) (err error) {
func Setpgid(pid int, pgid int) (err error) { func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -889,7 +889,7 @@ func Setsid() (pid int, err error) { ...@@ -889,7 +889,7 @@ func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0) pid = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -899,7 +899,7 @@ func Setsid() (pid int, err error) { ...@@ -899,7 +899,7 @@ func Setsid() (pid int, err error) {
func Settimeofday(tv *Timeval) (err error) { func Settimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -909,7 +909,7 @@ func Settimeofday(tv *Timeval) (err error) { ...@@ -909,7 +909,7 @@ func Settimeofday(tv *Timeval) (err error) {
func Setpriority(which int, who int, prio int) (err error) { func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -937,7 +937,7 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { ...@@ -937,7 +937,7 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) {
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
use(unsafe.Pointer(_p1)) use(unsafe.Pointer(_p1))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -954,7 +954,7 @@ func Sync() { ...@@ -954,7 +954,7 @@ func Sync() {
func Sysinfo(info *Sysinfo_t) (err error) { func Sysinfo(info *Sysinfo_t) (err error) {
_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -965,7 +965,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { ...@@ -965,7 +965,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)
n = int64(int64(r1)<<32 | int64(r0)) n = int64(int64(r1)<<32 | int64(r0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -975,7 +975,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { ...@@ -975,7 +975,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
func Tgkill(tgid int, tid int, sig Signal) (err error) { func Tgkill(tgid int, tid int, sig Signal) (err error) {
_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -986,7 +986,7 @@ func Times(tms *Tms) (ticks uintptr, err error) { ...@@ -986,7 +986,7 @@ func Times(tms *Tms) (ticks uintptr, err error) {
r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
ticks = uintptr(r0) ticks = uintptr(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1004,7 +1004,7 @@ func Umask(mask int) (oldmask int) { ...@@ -1004,7 +1004,7 @@ func Umask(mask int) (oldmask int) {
func Uname(buf *Utsname) (err error) { func Uname(buf *Utsname) (err error) {
_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1020,7 +1020,7 @@ func Unmount(target string, flags int) (err error) { ...@@ -1020,7 +1020,7 @@ func Unmount(target string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1030,7 +1030,7 @@ func Unmount(target string, flags int) (err error) { ...@@ -1030,7 +1030,7 @@ func Unmount(target string, flags int) (err error) {
func Unshare(flags int) (err error) { func Unshare(flags int) (err error) {
_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1040,7 +1040,7 @@ func Unshare(flags int) (err error) { ...@@ -1040,7 +1040,7 @@ func Unshare(flags int) (err error) {
func Ustat(dev int, ubuf *Ustat_t) (err error) { func Ustat(dev int, ubuf *Ustat_t) (err error) {
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1056,7 +1056,7 @@ func Utime(path string, buf *Utimbuf) (err error) { ...@@ -1056,7 +1056,7 @@ func Utime(path string, buf *Utimbuf) (err error) {
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1073,7 +1073,7 @@ func write(fd int, p []byte) (n int, err error) { ...@@ -1073,7 +1073,7 @@ func write(fd int, p []byte) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1083,7 +1083,7 @@ func write(fd int, p []byte) (n int, err error) { ...@@ -1083,7 +1083,7 @@ func write(fd int, p []byte) (n int, err error) {
func exitThread(code int) (err error) { func exitThread(code int) (err error) {
_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1094,7 +1094,7 @@ func readlen(fd int, p *byte, np int) (n int, err error) { ...@@ -1094,7 +1094,7 @@ func readlen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1105,7 +1105,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) { ...@@ -1105,7 +1105,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1115,7 +1115,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) { ...@@ -1115,7 +1115,7 @@ func writelen(fd int, p *byte, np int) (n int, err error) {
func munmap(addr uintptr, length uintptr) (err error) { func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1131,7 +1131,7 @@ func Madvise(b []byte, advice int) (err error) { ...@@ -1131,7 +1131,7 @@ func Madvise(b []byte, advice int) (err error) {
} }
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1147,7 +1147,7 @@ func Mprotect(b []byte, prot int) (err error) { ...@@ -1147,7 +1147,7 @@ func Mprotect(b []byte, prot int) (err error) {
} }
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1163,7 +1163,7 @@ func Mlock(b []byte) (err error) { ...@@ -1163,7 +1163,7 @@ func Mlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1179,7 +1179,7 @@ func Munlock(b []byte) (err error) { ...@@ -1179,7 +1179,7 @@ func Munlock(b []byte) (err error) {
} }
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1189,7 +1189,7 @@ func Munlock(b []byte) (err error) { ...@@ -1189,7 +1189,7 @@ func Munlock(b []byte) (err error) {
func Mlockall(flags int) (err error) { func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1199,7 +1199,7 @@ func Mlockall(flags int) (err error) { ...@@ -1199,7 +1199,7 @@ func Mlockall(flags int) (err error) {
func Munlockall() (err error) { func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1209,7 +1209,7 @@ func Munlockall() (err error) { ...@@ -1209,7 +1209,7 @@ func Munlockall() (err error) {
func pipe2(p *[2]_C_int, flags int) (err error) { func pipe2(p *[2]_C_int, flags int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1220,7 +1220,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { ...@@ -1220,7 +1220,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))) r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1231,7 +1231,7 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, ...@@ -1231,7 +1231,7 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int,
r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1241,7 +1241,7 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, ...@@ -1241,7 +1241,7 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int,
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1251,7 +1251,7 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { ...@@ -1251,7 +1251,7 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
func connect(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)) _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1262,7 +1262,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) { ...@@ -1262,7 +1262,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
nn = int(r0) nn = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1272,7 +1272,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) { ...@@ -1272,7 +1272,7 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) {
func setgroups(n int, list *_Gid_t) (err error) { func setgroups(n int, list *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) _, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1282,7 +1282,7 @@ func setgroups(n int, list *_Gid_t) (err error) { ...@@ -1282,7 +1282,7 @@ func setgroups(n int, list *_Gid_t) (err error) {
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (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) _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1292,7 +1292,7 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen ...@@ -1292,7 +1292,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) { 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) _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1303,7 +1303,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) { ...@@ -1303,7 +1303,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0) fd = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1313,7 +1313,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) { ...@@ -1313,7 +1313,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1323,7 +1323,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { ...@@ -1323,7 +1323,7 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
func getsockname(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))) _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1340,7 +1340,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl ...@@ -1340,7 +1340,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))) 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) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1356,7 +1356,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( ...@@ -1356,7 +1356,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)) _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1366,7 +1366,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( ...@@ -1366,7 +1366,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (
func socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) { func socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0) _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1377,7 +1377,7 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -1377,7 +1377,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)) r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1388,7 +1388,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -1388,7 +1388,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)) r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1398,7 +1398,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { ...@@ -1398,7 +1398,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
func Dup2(oldfd int, newfd int) (err error) { func Dup2(oldfd int, newfd int) (err error) {
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1408,7 +1408,7 @@ func Dup2(oldfd int, newfd int) (err error) { ...@@ -1408,7 +1408,7 @@ func Dup2(oldfd int, newfd int) (err error) {
func Fchown(fd int, uid int, gid int) (err error) { func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1418,7 +1418,7 @@ func Fchown(fd int, uid int, gid int) (err error) { ...@@ -1418,7 +1418,7 @@ func Fchown(fd int, uid int, gid int) (err error) {
func Fstat(fd int, stat *Stat_t) (err error) { func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1466,7 +1466,7 @@ func Lchown(path string, uid int, gid int) (err error) { ...@@ -1466,7 +1466,7 @@ func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1476,7 +1476,7 @@ func Lchown(path string, uid int, gid int) (err error) { ...@@ -1476,7 +1476,7 @@ func Lchown(path string, uid int, gid int) (err error) {
func Listen(s int, n int) (err error) { func Listen(s int, n int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1492,7 +1492,7 @@ func Lstat(path string, stat *Stat_t) (err error) { ...@@ -1492,7 +1492,7 @@ func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1503,7 +1503,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e ...@@ -1503,7 +1503,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
written = int(r0) written = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1514,7 +1514,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err ...@@ -1514,7 +1514,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1524,7 +1524,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err ...@@ -1524,7 +1524,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
func Setfsgid(gid int) (err error) { func Setfsgid(gid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) _, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1534,7 +1534,7 @@ func Setfsgid(gid int) (err error) { ...@@ -1534,7 +1534,7 @@ func Setfsgid(gid int) (err error) {
func Setfsuid(uid int) (err error) { func Setfsuid(uid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) _, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1544,7 +1544,7 @@ func Setfsuid(uid int) (err error) { ...@@ -1544,7 +1544,7 @@ func Setfsuid(uid int) (err error) {
func Setregid(rgid int, egid int) (err error) { func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0) _, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1554,7 +1554,7 @@ func Setregid(rgid int, egid int) (err error) { ...@@ -1554,7 +1554,7 @@ func Setregid(rgid int, egid int) (err error) {
func Setresgid(rgid int, egid int, sgid int) (err error) { func Setresgid(rgid int, egid int, sgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid)) _, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1564,7 +1564,7 @@ func Setresgid(rgid int, egid int, sgid int) (err error) { ...@@ -1564,7 +1564,7 @@ func Setresgid(rgid int, egid int, sgid int) (err error) {
func Setresuid(ruid int, euid int, suid int) (err error) { func Setresuid(ruid int, euid int, suid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid)) _, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1574,7 +1574,7 @@ func Setresuid(ruid int, euid int, suid int) (err error) { ...@@ -1574,7 +1574,7 @@ func Setresuid(ruid int, euid int, suid int) (err error) {
func Setreuid(ruid int, euid int) (err error) { func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0) _, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1584,7 +1584,7 @@ func Setreuid(ruid int, euid int) (err error) { ...@@ -1584,7 +1584,7 @@ func Setreuid(ruid int, euid int) (err error) {
func Shutdown(fd int, how int) (err error) { func Shutdown(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1595,7 +1595,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i ...@@ -1595,7 +1595,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1611,7 +1611,7 @@ func Stat(path string, stat *Stat_t) (err error) { ...@@ -1611,7 +1611,7 @@ func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1621,7 +1621,7 @@ func Stat(path string, stat *Stat_t) (err error) { ...@@ -1621,7 +1621,7 @@ func Stat(path string, stat *Stat_t) (err error) {
func Gettimeofday(tv *Timeval) (err error) { func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1632,7 +1632,7 @@ func Time(t *Time_t) (tt Time_t, err error) { ...@@ -1632,7 +1632,7 @@ func Time(t *Time_t) (tt Time_t, err error) {
r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)
tt = Time_t(r0) tt = Time_t(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1649,7 +1649,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { ...@@ -1649,7 +1649,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1666,7 +1666,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { ...@@ -1666,7 +1666,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0) n = int(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1682,7 +1682,7 @@ func Truncate(path string, length int64) (err error) { ...@@ -1682,7 +1682,7 @@ func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) _, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)
use(unsafe.Pointer(_p0)) use(unsafe.Pointer(_p0))
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1692,7 +1692,7 @@ func Truncate(path string, length int64) (err error) { ...@@ -1692,7 +1692,7 @@ func Truncate(path string, length int64) (err error) {
func Ftruncate(fd int, length int64) (err error) { func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0) _, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1703,7 +1703,7 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset ...@@ -1703,7 +1703,7 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset
r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))
xaddr = uintptr(r0) xaddr = uintptr(r0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1713,7 +1713,7 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset ...@@ -1713,7 +1713,7 @@ func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset
func getrlimit(resource int, rlim *rlimit32) (err error) { func getrlimit(resource int, rlim *rlimit32) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return return
} }
...@@ -1723,7 +1723,7 @@ func getrlimit(resource int, rlim *rlimit32) (err error) { ...@@ -1723,7 +1723,7 @@ func getrlimit(resource int, rlim *rlimit32) (err error) {
func setrlimit(resource int, rlim *rlimit32) (err error) { func setrlimit(resource int, rlim *rlimit32) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 { if e1 != 0 {
err = e1 err = errnoErr(e1)
} }
return 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