syscall: use error
- syscall (not os) now defines the Errno type.
- the low-level assembly functions Syscall, Syscall6, and so on
return Errno, not uintptr
- syscall wrappers all return error, not uintptr.
R=golang-dev, mikioh.mikioh, r, alex.brainman
CC=golang-dev
https://golang.org/cl/5372080
diff --git a/doc/progs/file.go b/doc/progs/file.go
index 7806b65..e1aadaa 100644
--- a/doc/progs/file.go
+++ b/doc/progs/file.go
@@ -28,10 +28,7 @@
)
func OpenFile(name string, mode int, perm uint32) (file *File, err error) {
- r, e := syscall.Open(name, mode, perm)
- if e != 0 {
- err = os.Errno(e)
- }
+ r, err := syscall.Open(name, mode, perm)
return newFile(r, name), err
}
@@ -54,22 +51,16 @@
if file == nil {
return os.EINVAL
}
- e := syscall.Close(file.fd)
+ err := syscall.Close(file.fd)
file.fd = -1 // so it can't be closed again
- if e != 0 {
- return os.Errno(e)
- }
- return nil
+ return err
}
func (file *File) Read(b []byte) (ret int, err error) {
if file == nil {
return -1, os.EINVAL
}
- r, e := syscall.Read(file.fd, b)
- if e != 0 {
- err = os.Errno(e)
- }
+ r, err := syscall.Read(file.fd, b)
return int(r), err
}
@@ -77,10 +68,7 @@
if file == nil {
return -1, os.EINVAL
}
- r, e := syscall.Write(file.fd, b)
- if e != 0 {
- err = os.Errno(e)
- }
+ r, err := syscall.Write(file.fd, b)
return int(r), err
}
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
index cca3f6f..c532262 100644
--- a/src/cmd/cgo/out.go
+++ b/src/cmd/cgo/out.go
@@ -45,10 +45,10 @@
fmt.Fprintf(fgo2, "// Created by cgo - DO NOT EDIT\n\n")
fmt.Fprintf(fgo2, "package %s\n\n", p.PackageName)
fmt.Fprintf(fgo2, "import \"unsafe\"\n\n")
- fmt.Fprintf(fgo2, "import \"os\"\n\n")
+ fmt.Fprintf(fgo2, "import \"syscall\"\n\n")
fmt.Fprintf(fgo2, "import _ \"runtime/cgo\"\n\n")
fmt.Fprintf(fgo2, "type _ unsafe.Pointer\n\n")
- fmt.Fprintf(fgo2, "func _Cerrno(dst *error, x int) { *dst = os.Errno(x) }\n")
+ fmt.Fprintf(fgo2, "func _Cerrno(dst *error, x int) { *dst = syscall.Errno(x) }\n")
for name, def := range typedef {
fmt.Fprintf(fgo2, "type %s ", name)
diff --git a/src/pkg/crypto/rand/rand_windows.go b/src/pkg/crypto/rand/rand_windows.go
index 590571d..2b2bd4b 100644
--- a/src/pkg/crypto/rand/rand_windows.go
+++ b/src/pkg/crypto/rand/rand_windows.go
@@ -28,16 +28,16 @@
if r.prov == 0 {
const provType = syscall.PROV_RSA_FULL
const flags = syscall.CRYPT_VERIFYCONTEXT | syscall.CRYPT_SILENT
- errno := syscall.CryptAcquireContext(&r.prov, nil, nil, provType, flags)
- if errno != 0 {
+ err := syscall.CryptAcquireContext(&r.prov, nil, nil, provType, flags)
+ if err != nil {
r.mu.Unlock()
- return 0, os.NewSyscallError("CryptAcquireContext", errno)
+ return 0, os.NewSyscallError("CryptAcquireContext", err)
}
}
r.mu.Unlock()
- errno := syscall.CryptGenRandom(r.prov, uint32(len(b)), &b[0])
- if errno != 0 {
- return 0, os.NewSyscallError("CryptGenRandom", errno)
+ err = syscall.CryptGenRandom(r.prov, uint32(len(b)), &b[0])
+ if err != nil {
+ return 0, os.NewSyscallError("CryptGenRandom", err)
}
return len(b), nil
}
diff --git a/src/pkg/crypto/tls/root_windows.go b/src/pkg/crypto/tls/root_windows.go
index b8e27a9..13073dc 100644
--- a/src/pkg/crypto/tls/root_windows.go
+++ b/src/pkg/crypto/tls/root_windows.go
@@ -12,8 +12,8 @@
)
func loadStore(roots *x509.CertPool, name string) {
- store, errno := syscall.CertOpenSystemStore(syscall.InvalidHandle, syscall.StringToUTF16Ptr(name))
- if errno != 0 {
+ store, err := syscall.CertOpenSystemStore(syscall.InvalidHandle, syscall.StringToUTF16Ptr(name))
+ if err != nil {
return
}
diff --git a/src/pkg/exp/inotify/inotify_linux.go b/src/pkg/exp/inotify/inotify_linux.go
index d6b7e85..f124366 100644
--- a/src/pkg/exp/inotify/inotify_linux.go
+++ b/src/pkg/exp/inotify/inotify_linux.go
@@ -105,9 +105,9 @@
watchEntry.flags |= flags
flags |= syscall.IN_MASK_ADD
}
- wd, errno := syscall.InotifyAddWatch(w.fd, path, flags)
- if wd == -1 {
- return &os.PathError{"inotify_add_watch", path, os.Errno(errno)}
+ wd, err := syscall.InotifyAddWatch(w.fd, path, flags)
+ if err != nil {
+ return &os.PathError{"inotify_add_watch", path, err}
}
if !found {
@@ -139,14 +139,10 @@
// readEvents reads from the inotify file descriptor, converts the
// received events into Event objects and sends them via the Event channel
func (w *Watcher) readEvents() {
- var (
- buf [syscall.SizeofInotifyEvent * 4096]byte // Buffer for a maximum of 4096 raw events
- n int // Number of bytes read with read()
- errno int // Syscall errno
- )
+ var buf [syscall.SizeofInotifyEvent * 4096]byte
for {
- n, errno = syscall.Read(w.fd, buf[0:])
+ n, err := syscall.Read(w.fd, buf[0:])
// See if there is a message on the "done" channel
var done bool
select {
@@ -156,16 +152,16 @@
// If EOF or a "done" message is received
if n == 0 || done {
- errno := syscall.Close(w.fd)
- if errno == -1 {
- w.Error <- os.NewSyscallError("close", errno)
+ err := syscall.Close(w.fd)
+ if err != nil {
+ w.Error <- os.NewSyscallError("close", err)
}
close(w.Event)
close(w.Error)
return
}
if n < 0 {
- w.Error <- os.NewSyscallError("read", errno)
+ w.Error <- os.NewSyscallError("read", err)
continue
}
if n < syscall.SizeofInotifyEvent {
diff --git a/src/pkg/net/fd.go b/src/pkg/net/fd.go
index 025075d..70e04a2 100644
--- a/src/pkg/net/fd.go
+++ b/src/pkg/net/fd.go
@@ -278,8 +278,8 @@
func newFD(fd, family, proto int, net string) (f *netFD, err error) {
onceStartServer.Do(startServer)
- if e := syscall.SetNonblock(fd, true); e != 0 {
- return nil, os.Errno(e)
+ if e := syscall.SetNonblock(fd, true); e != nil {
+ return nil, e
}
f = &netFD{
sysfd: fd,
@@ -306,19 +306,19 @@
}
func (fd *netFD) connect(ra syscall.Sockaddr) (err error) {
- e := syscall.Connect(fd.sysfd, ra)
- if e == syscall.EINPROGRESS {
- var errno int
+ err = syscall.Connect(fd.sysfd, ra)
+ if err == syscall.EINPROGRESS {
pollserver.WaitWrite(fd)
- e, errno = syscall.GetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_ERROR)
- if errno != 0 {
- return os.NewSyscallError("getsockopt", errno)
+ var e int
+ e, err = syscall.GetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_ERROR)
+ if err != nil {
+ return os.NewSyscallError("getsockopt", err)
+ }
+ if e != 0 {
+ err = syscall.Errno(e)
}
}
- if e != 0 {
- return os.Errno(e)
- }
- return nil
+ return err
}
// Add a reference to this fd.
@@ -362,9 +362,9 @@
if fd == nil || fd.sysfile == nil {
return os.EINVAL
}
- errno := syscall.Shutdown(fd.sysfd, how)
- if errno != 0 {
- return &OpError{"shutdown", fd.net, fd.laddr, os.Errno(errno)}
+ err := syscall.Shutdown(fd.sysfd, how)
+ if err != nil {
+ return &OpError{"shutdown", fd.net, fd.laddr, err}
}
return nil
}
@@ -377,6 +377,14 @@
return fd.shutdown(syscall.SHUT_WR)
}
+type timeoutError struct{}
+
+func (e *timeoutError) Error() string { return "i/o timeout" }
+func (e *timeoutError) Timeout() bool { return true }
+func (e *timeoutError) Temporary() bool { return true }
+
+var errTimeout error = &timeoutError{}
+
func (fd *netFD) Read(p []byte) (n int, err error) {
if fd == nil {
return 0, os.EINVAL
@@ -393,24 +401,24 @@
} else {
fd.rdeadline = 0
}
- var oserr error
for {
- var errno int
- n, errno = syscall.Read(fd.sysfile.Fd(), p)
- if errno == syscall.EAGAIN && fd.rdeadline >= 0 {
- pollserver.WaitRead(fd)
- continue
+ n, err = syscall.Read(fd.sysfile.Fd(), p)
+ if err == syscall.EAGAIN {
+ if fd.rdeadline >= 0 {
+ pollserver.WaitRead(fd)
+ continue
+ }
+ err = errTimeout
}
- if errno != 0 {
+ if err != nil {
n = 0
- oserr = os.Errno(errno)
- } else if n == 0 && errno == 0 && fd.proto != syscall.SOCK_DGRAM {
+ } else if n == 0 && err == nil && fd.proto != syscall.SOCK_DGRAM {
err = io.EOF
}
break
}
- if oserr != nil {
- err = &OpError{"read", fd.net, fd.raddr, oserr}
+ if err != nil && err != io.EOF {
+ err = &OpError{"read", fd.net, fd.raddr, err}
}
return
}
@@ -428,22 +436,22 @@
} else {
fd.rdeadline = 0
}
- var oserr error
for {
- var errno int
- n, sa, errno = syscall.Recvfrom(fd.sysfd, p, 0)
- if errno == syscall.EAGAIN && fd.rdeadline >= 0 {
- pollserver.WaitRead(fd)
- continue
+ n, sa, err = syscall.Recvfrom(fd.sysfd, p, 0)
+ if err == syscall.EAGAIN {
+ if fd.rdeadline >= 0 {
+ pollserver.WaitRead(fd)
+ continue
+ }
+ err = errTimeout
}
- if errno != 0 {
+ if err != nil {
n = 0
- oserr = os.Errno(errno)
}
break
}
- if oserr != nil {
- err = &OpError{"read", fd.net, fd.laddr, oserr}
+ if err != nil {
+ err = &OpError{"read", fd.net, fd.laddr, err}
}
return
}
@@ -461,24 +469,22 @@
} else {
fd.rdeadline = 0
}
- var oserr error
for {
- var errno int
- n, oobn, flags, sa, errno = syscall.Recvmsg(fd.sysfd, p, oob, 0)
- if errno == syscall.EAGAIN && fd.rdeadline >= 0 {
- pollserver.WaitRead(fd)
- continue
+ n, oobn, flags, sa, err = syscall.Recvmsg(fd.sysfd, p, oob, 0)
+ if err == syscall.EAGAIN {
+ if fd.rdeadline >= 0 {
+ pollserver.WaitRead(fd)
+ continue
+ }
+ err = errTimeout
}
- if errno != 0 {
- oserr = os.Errno(errno)
- }
- if n == 0 {
- oserr = io.EOF
+ if err == nil && n == 0 {
+ err = io.EOF
}
break
}
- if oserr != nil {
- err = &OpError{"read", fd.net, fd.laddr, oserr}
+ if err != nil && err != io.EOF {
+ err = &OpError{"read", fd.net, fd.laddr, err}
return
}
return
@@ -501,32 +507,34 @@
fd.wdeadline = 0
}
nn := 0
- var oserr error
for {
- n, errno := syscall.Write(fd.sysfile.Fd(), p[nn:])
+ var n int
+ n, err = syscall.Write(fd.sysfile.Fd(), p[nn:])
if n > 0 {
nn += n
}
if nn == len(p) {
break
}
- if errno == syscall.EAGAIN && fd.wdeadline >= 0 {
- pollserver.WaitWrite(fd)
- continue
+ if err == syscall.EAGAIN {
+ if fd.wdeadline >= 0 {
+ pollserver.WaitWrite(fd)
+ continue
+ }
+ err = errTimeout
}
- if errno != 0 {
+ if err != nil {
n = 0
- oserr = os.Errno(errno)
break
}
if n == 0 {
- oserr = io.ErrUnexpectedEOF
+ err = io.ErrUnexpectedEOF
break
}
}
- if oserr != nil {
- err = &OpError{"write", fd.net, fd.raddr, oserr}
+ if err != nil {
+ err = &OpError{"write", fd.net, fd.raddr, err}
}
return nn, err
}
@@ -544,22 +552,21 @@
} else {
fd.wdeadline = 0
}
- var oserr error
for {
- errno := syscall.Sendto(fd.sysfd, p, 0, sa)
- if errno == syscall.EAGAIN && fd.wdeadline >= 0 {
- pollserver.WaitWrite(fd)
- continue
- }
- if errno != 0 {
- oserr = os.Errno(errno)
+ err = syscall.Sendto(fd.sysfd, p, 0, sa)
+ if err == syscall.EAGAIN {
+ if fd.wdeadline >= 0 {
+ pollserver.WaitWrite(fd)
+ continue
+ }
+ err = errTimeout
}
break
}
- if oserr == nil {
+ if err == nil {
n = len(p)
} else {
- err = &OpError{"write", fd.net, fd.raddr, oserr}
+ err = &OpError{"write", fd.net, fd.raddr, err}
}
return
}
@@ -577,24 +584,22 @@
} else {
fd.wdeadline = 0
}
- var oserr error
for {
- var errno int
- errno = syscall.Sendmsg(fd.sysfd, p, oob, sa, 0)
- if errno == syscall.EAGAIN && fd.wdeadline >= 0 {
- pollserver.WaitWrite(fd)
- continue
- }
- if errno != 0 {
- oserr = os.Errno(errno)
+ err = syscall.Sendmsg(fd.sysfd, p, oob, sa, 0)
+ if err == syscall.EAGAIN {
+ if fd.wdeadline >= 0 {
+ pollserver.WaitWrite(fd)
+ continue
+ }
+ err = errTimeout
}
break
}
- if oserr == nil {
+ if err == nil {
n = len(p)
oobn = len(oob)
} else {
- err = &OpError{"write", fd.net, fd.raddr, oserr}
+ err = &OpError{"write", fd.net, fd.raddr, err}
}
return
}
@@ -615,25 +620,26 @@
// See ../syscall/exec.go for description of ForkLock.
// It is okay to hold the lock across syscall.Accept
// because we have put fd.sysfd into non-blocking mode.
- syscall.ForkLock.RLock()
- var s, e int
+ var s int
var rsa syscall.Sockaddr
for {
if fd.closing {
- syscall.ForkLock.RUnlock()
return nil, os.EINVAL
}
- s, rsa, e = syscall.Accept(fd.sysfd)
- if e != syscall.EAGAIN || fd.rdeadline < 0 {
- break
- }
- syscall.ForkLock.RUnlock()
- pollserver.WaitRead(fd)
syscall.ForkLock.RLock()
- }
- if e != 0 {
- syscall.ForkLock.RUnlock()
- return nil, &OpError{"accept", fd.net, fd.laddr, os.Errno(e)}
+ s, rsa, err = syscall.Accept(fd.sysfd)
+ if err != nil {
+ syscall.ForkLock.RUnlock()
+ if err == syscall.EAGAIN {
+ if fd.rdeadline >= 0 {
+ pollserver.WaitRead(fd)
+ continue
+ }
+ err = errTimeout
+ }
+ return nil, &OpError{"accept", fd.net, fd.laddr, err}
+ }
+ break
}
syscall.CloseOnExec(s)
syscall.ForkLock.RUnlock()
@@ -648,19 +654,19 @@
}
func (fd *netFD) dup() (f *os.File, err error) {
- ns, e := syscall.Dup(fd.sysfd)
- if e != 0 {
- return nil, &OpError{"dup", fd.net, fd.laddr, os.Errno(e)}
+ ns, err := syscall.Dup(fd.sysfd)
+ if err != nil {
+ return nil, &OpError{"dup", fd.net, fd.laddr, err}
}
// We want blocking mode for the new fd, hence the double negative.
- if e = syscall.SetNonblock(ns, false); e != 0 {
- return nil, &OpError{"setnonblock", fd.net, fd.laddr, os.Errno(e)}
+ if err = syscall.SetNonblock(ns, false); err != nil {
+ return nil, &OpError{"setnonblock", fd.net, fd.laddr, err}
}
return os.NewFile(ns, fd.sysfile.Name()), nil
}
-func closesocket(s int) (errno int) {
+func closesocket(s int) error {
return syscall.Close(s)
}
diff --git a/src/pkg/net/fd_darwin.go b/src/pkg/net/fd_darwin.go
index c25a510..5216404 100644
--- a/src/pkg/net/fd_darwin.go
+++ b/src/pkg/net/fd_darwin.go
@@ -24,9 +24,8 @@
func newpollster() (p *pollster, err error) {
p = new(pollster)
- var e int
- if p.kq, e = syscall.Kqueue(); e != 0 {
- return nil, os.NewSyscallError("kqueue", e)
+ if p.kq, err = syscall.Kqueue(); err != nil {
+ return nil, os.NewSyscallError("kqueue", err)
}
p.events = p.eventbuf[0:0]
return p, nil
@@ -52,15 +51,15 @@
}
syscall.SetKevent(ev, fd, kmode, flags)
- n, e := syscall.Kevent(p.kq, p.kbuf[0:], p.kbuf[0:], nil)
- if e != 0 {
- return false, os.NewSyscallError("kevent", e)
+ n, err := syscall.Kevent(p.kq, p.kbuf[0:], p.kbuf[0:], nil)
+ if err != nil {
+ return false, os.NewSyscallError("kevent", err)
}
if n != 1 || (ev.Flags&syscall.EV_ERROR) == 0 || int(ev.Ident) != fd || int(ev.Filter) != kmode {
return false, errors.New("kqueue phase error")
}
if ev.Data != 0 {
- return false, os.Errno(int(ev.Data))
+ return false, syscall.Errno(ev.Data)
}
return false, nil
}
@@ -96,11 +95,11 @@
nn, e := syscall.Kevent(p.kq, nil, p.eventbuf[0:], t)
s.Lock()
- if e != 0 {
+ if e != nil {
if e == syscall.EINTR {
continue
}
- return -1, 0, os.NewSyscallError("kevent", e)
+ return -1, 0, os.NewSyscallError("kevent", nil)
}
if nn == 0 {
return -1, 0, nil
diff --git a/src/pkg/net/fd_freebsd.go b/src/pkg/net/fd_freebsd.go
index f61008a..e52ac35 100644
--- a/src/pkg/net/fd_freebsd.go
+++ b/src/pkg/net/fd_freebsd.go
@@ -23,9 +23,8 @@
func newpollster() (p *pollster, err error) {
p = new(pollster)
- var e int
- if p.kq, e = syscall.Kqueue(); e != 0 {
- return nil, os.NewSyscallError("kqueue", e)
+ if p.kq, err = syscall.Kqueue(); err != nil {
+ return nil, os.NewSyscallError("kqueue", err)
}
p.events = p.eventbuf[0:0]
return p, nil
@@ -50,14 +49,14 @@
syscall.SetKevent(ev, fd, kmode, flags)
n, e := syscall.Kevent(p.kq, p.kbuf[:], nil, nil)
- if e != 0 {
+ if e != nil {
return false, os.NewSyscallError("kevent", e)
}
if n != 1 || (ev.Flags&syscall.EV_ERROR) == 0 || int(ev.Ident) != fd || int(ev.Filter) != kmode {
return false, os.NewSyscallError("kqueue phase error", e)
}
if ev.Data != 0 {
- return false, os.Errno(int(ev.Data))
+ return false, syscall.Errno(int(ev.Data))
}
return false, nil
}
@@ -91,7 +90,7 @@
nn, e := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
s.Lock()
- if e != 0 {
+ if e != nil {
if e == syscall.EINTR {
continue
}
diff --git a/src/pkg/net/fd_linux.go b/src/pkg/net/fd_linux.go
index cce74cd..8e07833 100644
--- a/src/pkg/net/fd_linux.go
+++ b/src/pkg/net/fd_linux.go
@@ -35,12 +35,12 @@
func newpollster() (p *pollster, err error) {
p = new(pollster)
- var e int
+ var e error
// The arg to epoll_create is a hint to the kernel
// about the number of FDs we will care about.
// We don't know, and since 2.6.8 the kernel ignores it anyhow.
- if p.epfd, e = syscall.EpollCreate(16); e != 0 {
+ if p.epfd, e = syscall.EpollCreate(16); e != nil {
return nil, os.NewSyscallError("epoll_create", e)
}
p.events = make(map[int]uint32)
@@ -68,7 +68,7 @@
} else {
op = syscall.EPOLL_CTL_ADD
}
- if e := syscall.EpollCtl(p.epfd, op, fd, &p.ctlEvent); e != 0 {
+ if e := syscall.EpollCtl(p.epfd, op, fd, &p.ctlEvent); e != nil {
return false, os.NewSyscallError("epoll_ctl", e)
}
p.events[fd] = p.ctlEvent.Events
@@ -97,13 +97,13 @@
if int32(events)&^syscall.EPOLLONESHOT != 0 {
p.ctlEvent.Fd = int32(fd)
p.ctlEvent.Events = events
- if e := syscall.EpollCtl(p.epfd, syscall.EPOLL_CTL_MOD, fd, &p.ctlEvent); e != 0 {
- print("Epoll modify fd=", fd, ": ", os.Errno(e).Error(), "\n")
+ if e := syscall.EpollCtl(p.epfd, syscall.EPOLL_CTL_MOD, fd, &p.ctlEvent); e != nil {
+ print("Epoll modify fd=", fd, ": ", e.Error(), "\n")
}
p.events[fd] = events
} else {
- if e := syscall.EpollCtl(p.epfd, syscall.EPOLL_CTL_DEL, fd, nil); e != 0 {
- print("Epoll delete fd=", fd, ": ", os.Errno(e).Error(), "\n")
+ if e := syscall.EpollCtl(p.epfd, syscall.EPOLL_CTL_DEL, fd, nil); e != nil {
+ print("Epoll delete fd=", fd, ": ", e.Error(), "\n")
}
delete(p.events, fd)
}
@@ -141,7 +141,7 @@
n, e := syscall.EpollWait(p.epfd, p.waitEventBuf[0:], msec)
s.Lock()
- if e != 0 {
+ if e != nil {
if e == syscall.EAGAIN || e == syscall.EINTR {
continue
}
diff --git a/src/pkg/net/fd_openbsd.go b/src/pkg/net/fd_openbsd.go
index f61008a..e52ac35 100644
--- a/src/pkg/net/fd_openbsd.go
+++ b/src/pkg/net/fd_openbsd.go
@@ -23,9 +23,8 @@
func newpollster() (p *pollster, err error) {
p = new(pollster)
- var e int
- if p.kq, e = syscall.Kqueue(); e != 0 {
- return nil, os.NewSyscallError("kqueue", e)
+ if p.kq, err = syscall.Kqueue(); err != nil {
+ return nil, os.NewSyscallError("kqueue", err)
}
p.events = p.eventbuf[0:0]
return p, nil
@@ -50,14 +49,14 @@
syscall.SetKevent(ev, fd, kmode, flags)
n, e := syscall.Kevent(p.kq, p.kbuf[:], nil, nil)
- if e != 0 {
+ if e != nil {
return false, os.NewSyscallError("kevent", e)
}
if n != 1 || (ev.Flags&syscall.EV_ERROR) == 0 || int(ev.Ident) != fd || int(ev.Filter) != kmode {
return false, os.NewSyscallError("kqueue phase error", e)
}
if ev.Data != 0 {
- return false, os.Errno(int(ev.Data))
+ return false, syscall.Errno(int(ev.Data))
}
return false, nil
}
@@ -91,7 +90,7 @@
nn, e := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
s.Lock()
- if e != 0 {
+ if e != nil {
if e == syscall.EINTR {
continue
}
diff --git a/src/pkg/net/fd_windows.go b/src/pkg/net/fd_windows.go
index ce228e9..7a16023 100644
--- a/src/pkg/net/fd_windows.go
+++ b/src/pkg/net/fd_windows.go
@@ -26,11 +26,11 @@
var d syscall.WSAData
e := syscall.WSAStartup(uint32(0x202), &d)
if e != 0 {
- initErr = os.NewSyscallError("WSAStartup", e)
+ initErr = os.NewSyscallError("WSAStartup", syscall.Errno(e))
}
}
-func closesocket(s syscall.Handle) (errno int) {
+func closesocket(s syscall.Handle) (err error) {
return syscall.Closesocket(s)
}
@@ -38,13 +38,13 @@
type anOpIface interface {
Op() *anOp
Name() string
- Submit() (errno int)
+ Submit() (err error)
}
// IO completion result parameters.
type ioResult struct {
qty uint32
- err int
+ err error
}
// anOp implements functionality common to all io operations.
@@ -54,7 +54,7 @@
o syscall.Overlapped
resultc chan ioResult
- errnoc chan int
+ errnoc chan error
fd *netFD
}
@@ -71,7 +71,7 @@
}
o.resultc = fd.resultc[i]
if fd.errnoc[i] == nil {
- fd.errnoc[i] = make(chan int)
+ fd.errnoc[i] = make(chan error)
}
o.errnoc = fd.errnoc[i]
}
@@ -111,14 +111,14 @@
for {
r.err = syscall.GetQueuedCompletionStatus(s.iocp, &(r.qty), &key, &o, syscall.INFINITE)
switch {
- case r.err == 0:
+ case r.err == nil:
// Dequeued successfully completed io packet.
- case r.err == syscall.WAIT_TIMEOUT && o == nil:
+ case r.err == syscall.Errno(syscall.WAIT_TIMEOUT) && o == nil:
// Wait has timed out (should not happen now, but might be used in the future).
panic("GetQueuedCompletionStatus timed out")
case o == nil:
// Failed to dequeue anything -> report the error.
- panic("GetQueuedCompletionStatus failed " + syscall.Errstr(r.err))
+ panic("GetQueuedCompletionStatus failed " + r.err.Error())
default:
// Dequeued failed io packet.
}
@@ -153,7 +153,7 @@
// inline, or, if timeouts are employed, passes the request onto
// a special goroutine and waits for completion or cancels request.
func (s *ioSrv) ExecIO(oi anOpIface, deadline_delta int64) (n int, err error) {
- var e int
+ var e error
o := oi.Op()
if deadline_delta > 0 {
// Send request to a special dedicated thread,
@@ -164,12 +164,12 @@
e = oi.Submit()
}
switch e {
- case 0:
+ case nil:
// IO completed immediately, but we need to get our completion message anyway.
case syscall.ERROR_IO_PENDING:
// IO started, and we have to wait for its completion.
default:
- return 0, &OpError{oi.Name(), o.fd.net, o.fd.laddr, os.Errno(e)}
+ return 0, &OpError{oi.Name(), o.fd.net, o.fd.laddr, e}
}
// Wait for our request to complete.
var r ioResult
@@ -187,8 +187,8 @@
} else {
r = <-o.resultc
}
- if r.err != 0 {
- err = &OpError{oi.Name(), o.fd.net, o.fd.laddr, os.Errno(r.err)}
+ if r.err != nil {
+ err = &OpError{oi.Name(), o.fd.net, o.fd.laddr, r.err}
}
return int(r.qty), err
}
@@ -200,10 +200,10 @@
func startServer() {
resultsrv = new(resultSrv)
- var errno int
- resultsrv.iocp, errno = syscall.CreateIoCompletionPort(syscall.InvalidHandle, 0, 0, 1)
- if errno != 0 {
- panic("CreateIoCompletionPort failed " + syscall.Errstr(errno))
+ var err error
+ resultsrv.iocp, err = syscall.CreateIoCompletionPort(syscall.InvalidHandle, 0, 0, 1)
+ if err != nil {
+ panic("CreateIoCompletionPort: " + err.Error())
}
go resultsrv.Run()
@@ -228,7 +228,7 @@
laddr Addr
raddr Addr
resultc [2]chan ioResult // read/write completion results
- errnoc [2]chan int // read/write submit or cancel operation errors
+ errnoc [2]chan error // read/write submit or cancel operation errors
// owned by client
rdeadline_delta int64
@@ -256,8 +256,8 @@
}
onceStartServer.Do(startServer)
// Associate our socket with resultsrv.iocp.
- if _, e := syscall.CreateIoCompletionPort(syscall.Handle(fd), resultsrv.iocp, 0, 0); e != 0 {
- return nil, os.Errno(e)
+ if _, e := syscall.CreateIoCompletionPort(syscall.Handle(fd), resultsrv.iocp, 0, 0); e != nil {
+ return nil, e
}
return allocFD(fd, family, proto, net), nil
}
@@ -268,11 +268,7 @@
}
func (fd *netFD) connect(ra syscall.Sockaddr) (err error) {
- e := syscall.Connect(fd.sysfd, ra)
- if e != 0 {
- return os.Errno(e)
- }
- return nil
+ return syscall.Connect(fd.sysfd, ra)
}
// Add a reference to this fd.
@@ -317,9 +313,9 @@
if fd == nil || fd.sysfd == syscall.InvalidHandle {
return os.EINVAL
}
- errno := syscall.Shutdown(fd.sysfd, how)
- if errno != 0 {
- return &OpError{"shutdown", fd.net, fd.laddr, os.Errno(errno)}
+ err := syscall.Shutdown(fd.sysfd, how)
+ if err != nil {
+ return &OpError{"shutdown", fd.net, fd.laddr, err}
}
return nil
}
@@ -338,7 +334,7 @@
bufOp
}
-func (o *readOp) Submit() (errno int) {
+func (o *readOp) Submit() (err error) {
var d, f uint32
return syscall.WSARecv(syscall.Handle(o.fd.sysfd), &o.buf, 1, &d, &f, &o.o, nil)
}
@@ -375,7 +371,7 @@
rsan int32
}
-func (o *readFromOp) Submit() (errno int) {
+func (o *readFromOp) Submit() (err error) {
var d, f uint32
return syscall.WSARecvFrom(o.fd.sysfd, &o.buf, 1, &d, &f, &o.rsa, &o.rsan, &o.o, nil)
}
@@ -415,7 +411,7 @@
bufOp
}
-func (o *writeOp) Submit() (errno int) {
+func (o *writeOp) Submit() (err error) {
var d uint32
return syscall.WSASend(o.fd.sysfd, &o.buf, 1, &d, 0, &o.o, nil)
}
@@ -447,7 +443,7 @@
sa syscall.Sockaddr
}
-func (o *writeToOp) Submit() (errno int) {
+func (o *writeToOp) Submit() (err error) {
var d uint32
return syscall.WSASendto(o.fd.sysfd, &o.buf, 1, &d, 0, o.sa, &o.o, nil)
}
@@ -484,7 +480,7 @@
attrs [2]syscall.RawSockaddrAny // space for local and remote address only
}
-func (o *acceptOp) Submit() (errno int) {
+func (o *acceptOp) Submit() (err error) {
var d uint32
l := uint32(unsafe.Sizeof(o.attrs[0]))
return syscall.AcceptEx(o.fd.sysfd, o.newsock,
@@ -506,17 +502,17 @@
// See ../syscall/exec.go for description of ForkLock.
syscall.ForkLock.RLock()
s, e := syscall.Socket(fd.family, fd.proto, 0)
- if e != 0 {
+ if e != nil {
syscall.ForkLock.RUnlock()
- return nil, os.Errno(e)
+ return nil, e
}
syscall.CloseOnExec(s)
syscall.ForkLock.RUnlock()
// Associate our new socket with IOCP.
onceStartServer.Do(startServer)
- if _, e = syscall.CreateIoCompletionPort(s, resultsrv.iocp, 0, 0); e != 0 {
- return nil, &OpError{"CreateIoCompletionPort", fd.net, fd.laddr, os.Errno(e)}
+ if _, e = syscall.CreateIoCompletionPort(s, resultsrv.iocp, 0, 0); e != nil {
+ return nil, &OpError{"CreateIoCompletionPort", fd.net, fd.laddr, e}
}
// Submit accept request.
@@ -531,9 +527,9 @@
// Inherit properties of the listening socket.
e = syscall.Setsockopt(s, syscall.SOL_SOCKET, syscall.SO_UPDATE_ACCEPT_CONTEXT, (*byte)(unsafe.Pointer(&fd.sysfd)), int32(unsafe.Sizeof(fd.sysfd)))
- if e != 0 {
+ if e != nil {
closesocket(s)
- return nil, err
+ return nil, e
}
// Get local and peer addr out of AcceptEx buffer.
diff --git a/src/pkg/net/file.go b/src/pkg/net/file.go
index 0ad869d..bf8cd9d 100644
--- a/src/pkg/net/file.go
+++ b/src/pkg/net/file.go
@@ -13,12 +13,12 @@
func newFileFD(f *os.File) (nfd *netFD, err error) {
fd, errno := syscall.Dup(f.Fd())
- if errno != 0 {
+ if errno != nil {
return nil, os.NewSyscallError("dup", errno)
}
proto, errno := syscall.GetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_TYPE)
- if errno != 0 {
+ if errno != nil {
return nil, os.NewSyscallError("getsockopt", errno)
}
diff --git a/src/pkg/net/http/serve_test.go b/src/pkg/net/http/serve_test.go
index ebee766..97a0b13 100644
--- a/src/pkg/net/http/serve_test.go
+++ b/src/pkg/net/http/serve_test.go
@@ -1145,7 +1145,7 @@
ln := &errorListener{[]error{
&net.OpError{
Op: "accept",
- Err: os.Errno(syscall.EMFILE),
+ Err: syscall.EMFILE,
}}}
err := Serve(ln, HandlerFunc(HandlerFunc(func(ResponseWriter, *Request) {})))
if err != io.EOF {
diff --git a/src/pkg/net/http/transport_windows.go b/src/pkg/net/http/transport_windows.go
index 2a20d22..c9ef2c2 100644
--- a/src/pkg/net/http/transport_windows.go
+++ b/src/pkg/net/http/transport_windows.go
@@ -6,14 +6,14 @@
import (
"net"
- "os"
+ "syscall"
)
func init() {
remoteSideClosedFunc = func(err error) (out bool) {
op, ok := err.(*net.OpError)
- if ok && op.Op == "WSARecv" && op.Net == "tcp" && op.Err == os.Errno(10058) {
- // TODO(bradfitz): find the symbol for 10058
+ if ok && op.Op == "WSARecv" && op.Net == "tcp" && op.Err == syscall.Errno(10058) {
+ // TODO(brainman,rsc): Fix whatever is generating this.
return true
}
return false
diff --git a/src/pkg/net/interface_bsd.go b/src/pkg/net/interface_bsd.go
index b026e01..e896d43 100644
--- a/src/pkg/net/interface_bsd.go
+++ b/src/pkg/net/interface_bsd.go
@@ -20,18 +20,18 @@
func interfaceTable(ifindex int) ([]Interface, error) {
var (
tab []byte
- e int
+ e error
msgs []syscall.RoutingMessage
ift []Interface
)
tab, e = syscall.RouteRIB(syscall.NET_RT_IFLIST, ifindex)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route rib", e)
}
msgs, e = syscall.ParseRoutingMessage(tab)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route message", e)
}
@@ -55,7 +55,7 @@
var ift []Interface
sas, e := syscall.ParseRoutingSockaddr(m)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route sockaddr", e)
}
@@ -110,18 +110,18 @@
func interfaceAddrTable(ifindex int) ([]Addr, error) {
var (
tab []byte
- e int
+ e error
msgs []syscall.RoutingMessage
ifat []Addr
)
tab, e = syscall.RouteRIB(syscall.NET_RT_IFLIST, ifindex)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route rib", e)
}
msgs, e = syscall.ParseRoutingMessage(tab)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route message", e)
}
@@ -145,7 +145,7 @@
var ifat []Addr
sas, e := syscall.ParseRoutingSockaddr(m)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route sockaddr", e)
}
diff --git a/src/pkg/net/interface_darwin.go b/src/pkg/net/interface_darwin.go
index 1472afb..2da447a 100644
--- a/src/pkg/net/interface_darwin.go
+++ b/src/pkg/net/interface_darwin.go
@@ -17,18 +17,18 @@
func interfaceMulticastAddrTable(ifindex int) ([]Addr, error) {
var (
tab []byte
- e int
+ e error
msgs []syscall.RoutingMessage
ifmat []Addr
)
tab, e = syscall.RouteRIB(syscall.NET_RT_IFLIST2, ifindex)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route rib", e)
}
msgs, e = syscall.ParseRoutingMessage(tab)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route message", e)
}
@@ -52,7 +52,7 @@
var ifmat []Addr
sas, e := syscall.ParseRoutingSockaddr(m)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route sockaddr", e)
}
diff --git a/src/pkg/net/interface_freebsd.go b/src/pkg/net/interface_freebsd.go
index b0274f6..a12877e 100644
--- a/src/pkg/net/interface_freebsd.go
+++ b/src/pkg/net/interface_freebsd.go
@@ -17,18 +17,18 @@
func interfaceMulticastAddrTable(ifindex int) ([]Addr, error) {
var (
tab []byte
- e int
+ e error
msgs []syscall.RoutingMessage
ifmat []Addr
)
tab, e = syscall.RouteRIB(syscall.NET_RT_IFMALIST, ifindex)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route rib", e)
}
msgs, e = syscall.ParseRoutingMessage(tab)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route message", e)
}
@@ -52,7 +52,7 @@
var ifmat []Addr
sas, e := syscall.ParseRoutingSockaddr(m)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("route sockaddr", e)
}
diff --git a/src/pkg/net/interface_linux.go b/src/pkg/net/interface_linux.go
index cd0339d..96db718 100644
--- a/src/pkg/net/interface_linux.go
+++ b/src/pkg/net/interface_linux.go
@@ -21,16 +21,16 @@
ift []Interface
tab []byte
msgs []syscall.NetlinkMessage
- e int
+ e error
)
tab, e = syscall.NetlinkRIB(syscall.RTM_GETLINK, syscall.AF_UNSPEC)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("netlink rib", e)
}
msgs, e = syscall.ParseNetlinkMessage(tab)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("netlink message", e)
}
@@ -42,7 +42,7 @@
ifim := (*syscall.IfInfomsg)(unsafe.Pointer(&m.Data[0]))
if ifindex == 0 || ifindex == int(ifim.Index) {
attrs, e := syscall.ParseNetlinkRouteAttr(&m)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("netlink routeattr", e)
}
ifi := newLink(attrs, ifim)
@@ -102,27 +102,19 @@
// for all network interfaces. Otherwise it returns addresses
// for a specific interface.
func interfaceAddrTable(ifindex int) ([]Addr, error) {
- var (
- tab []byte
- e int
- err error
- ifat []Addr
- msgs []syscall.NetlinkMessage
- )
-
- tab, e = syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC)
- if e != 0 {
+ tab, e := syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC)
+ if e != nil {
return nil, os.NewSyscallError("netlink rib", e)
}
- msgs, e = syscall.ParseNetlinkMessage(tab)
- if e != 0 {
+ msgs, e := syscall.ParseNetlinkMessage(tab)
+ if e != nil {
return nil, os.NewSyscallError("netlink message", e)
}
- ifat, err = addrTable(msgs, ifindex)
- if err != nil {
- return nil, err
+ ifat, e := addrTable(msgs, ifindex)
+ if e != nil {
+ return nil, e
}
return ifat, nil
@@ -139,7 +131,7 @@
ifam := (*syscall.IfAddrmsg)(unsafe.Pointer(&m.Data[0]))
if ifindex == 0 || ifindex == int(ifam.Index) {
attrs, e := syscall.ParseNetlinkRouteAttr(&m)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("netlink routeattr", e)
}
ifat = append(ifat, newAddr(attrs, int(ifam.Family))...)
diff --git a/src/pkg/net/interface_windows.go b/src/pkg/net/interface_windows.go
index a1c8d95..2ed66cd 100644
--- a/src/pkg/net/interface_windows.go
+++ b/src/pkg/net/interface_windows.go
@@ -39,7 +39,7 @@
func getInterfaceList() ([]syscall.InterfaceInfo, error) {
s, e := syscall.Socket(syscall.AF_INET, syscall.SOCK_DGRAM, syscall.IPPROTO_UDP)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("Socket", e)
}
defer syscall.Closesocket(s)
@@ -48,7 +48,7 @@
ret := uint32(0)
size := uint32(unsafe.Sizeof(ii))
e = syscall.WSAIoctl(s, syscall.SIO_GET_INTERFACE_LIST, nil, 0, (*byte)(unsafe.Pointer(&ii[0])), size, &ret, nil, 0)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("WSAIoctl", e)
}
c := ret / uint32(unsafe.Sizeof(ii[0]))
diff --git a/src/pkg/net/ipsock_posix.go b/src/pkg/net/ipsock_posix.go
index d5b8f21..f0ca7da 100644
--- a/src/pkg/net/ipsock_posix.go
+++ b/src/pkg/net/ipsock_posix.go
@@ -33,8 +33,8 @@
}
for i := range probes {
- s, errno := syscall.Socket(syscall.AF_INET6, syscall.SOCK_STREAM, syscall.IPPROTO_TCP)
- if errno != 0 {
+ s, err := syscall.Socket(syscall.AF_INET6, syscall.SOCK_STREAM, syscall.IPPROTO_TCP)
+ if err != nil {
continue
}
defer closesocket(s)
@@ -42,8 +42,8 @@
if err != nil {
continue
}
- errno = syscall.Bind(s, sa)
- if errno != 0 {
+ err = syscall.Bind(s, sa)
+ if err != nil {
continue
}
probes[i].ok = true
diff --git a/src/pkg/net/lookup_windows.go b/src/pkg/net/lookup_windows.go
index 61d8a88..020871b4 100644
--- a/src/pkg/net/lookup_windows.go
+++ b/src/pkg/net/lookup_windows.go
@@ -22,7 +22,7 @@
protoentLock.Lock()
defer protoentLock.Unlock()
p, e := syscall.GetProtoByName(name)
- if e != 0 {
+ if e != nil {
return 0, os.NewSyscallError("GetProtoByName", e)
}
return int(p.Proto), nil
@@ -44,7 +44,7 @@
hostentLock.Lock()
defer hostentLock.Unlock()
h, e := syscall.GetHostByName(name)
- if e != 0 {
+ if e != nil {
return nil, os.NewSyscallError("GetHostByName", e)
}
switch h.AddrType {
@@ -71,7 +71,7 @@
serventLock.Lock()
defer serventLock.Unlock()
s, e := syscall.GetServByName(service, network)
- if e != 0 {
+ if e != nil {
return 0, os.NewSyscallError("GetServByName", e)
}
return int(syscall.Ntohs(s.Port)), nil
@@ -81,7 +81,7 @@
var r *syscall.DNSRecord
e := syscall.DnsQuery(name, syscall.DNS_TYPE_CNAME, 0, nil, &r, nil)
if e != 0 {
- return "", os.NewSyscallError("LookupCNAME", int(e))
+ return "", os.NewSyscallError("LookupCNAME", e)
}
defer syscall.DnsRecordListFree(r, 1)
if r != nil && r.Type == syscall.DNS_TYPE_CNAME {
@@ -110,7 +110,7 @@
var r *syscall.DNSRecord
e := syscall.DnsQuery(target, syscall.DNS_TYPE_SRV, 0, nil, &r, nil)
if e != 0 {
- return "", nil, os.NewSyscallError("LookupSRV", int(e))
+ return "", nil, os.NewSyscallError("LookupSRV", e)
}
defer syscall.DnsRecordListFree(r, 1)
addrs = make([]*SRV, 0, 10)
@@ -126,7 +126,7 @@
var r *syscall.DNSRecord
e := syscall.DnsQuery(name, syscall.DNS_TYPE_MX, 0, nil, &r, nil)
if e != 0 {
- return nil, os.NewSyscallError("LookupMX", int(e))
+ return nil, os.NewSyscallError("LookupMX", e)
}
defer syscall.DnsRecordListFree(r, 1)
mx = make([]*MX, 0, 10)
@@ -142,7 +142,7 @@
var r *syscall.DNSRecord
e := syscall.DnsQuery(name, syscall.DNS_TYPE_TEXT, 0, nil, &r, nil)
if e != 0 {
- return nil, os.NewSyscallError("LookupTXT", int(e))
+ return nil, os.NewSyscallError("LookupTXT", e)
}
defer syscall.DnsRecordListFree(r, 1)
txt = make([]string, 0, 10)
@@ -164,7 +164,7 @@
var r *syscall.DNSRecord
e := syscall.DnsQuery(arpa, syscall.DNS_TYPE_PTR, 0, nil, &r, nil)
if e != 0 {
- return nil, os.NewSyscallError("LookupAddr", int(e))
+ return nil, os.NewSyscallError("LookupAddr", e)
}
defer syscall.DnsRecordListFree(r, 1)
name = make([]string, 0, 10)
diff --git a/src/pkg/net/newpollserver.go b/src/pkg/net/newpollserver.go
index 9ad6f7b..035df4a 100644
--- a/src/pkg/net/newpollserver.go
+++ b/src/pkg/net/newpollserver.go
@@ -18,11 +18,10 @@
if s.pr, s.pw, err = os.Pipe(); err != nil {
return nil, err
}
- var e int
- if e = syscall.SetNonblock(s.pr.Fd(), true); e != 0 {
+ if err = syscall.SetNonblock(s.pr.Fd(), true); err != nil {
goto Errno
}
- if e = syscall.SetNonblock(s.pw.Fd(), true); e != 0 {
+ if err = syscall.SetNonblock(s.pw.Fd(), true); err != nil {
goto Errno
}
if s.poll, err = newpollster(); err != nil {
@@ -37,7 +36,7 @@
return s, nil
Errno:
- err = &os.PathError{"setnonblock", s.pr.Name(), os.Errno(e)}
+ err = &os.PathError{"setnonblock", s.pr.Name(), err}
Error:
s.pr.Close()
s.pw.Close()
diff --git a/src/pkg/net/sendfile_linux.go b/src/pkg/net/sendfile_linux.go
index 36c7578..350abe4 100644
--- a/src/pkg/net/sendfile_linux.go
+++ b/src/pkg/net/sendfile_linux.go
@@ -62,18 +62,18 @@
written += int64(n)
remain -= int64(n)
}
- if n == 0 && errno == 0 {
+ if n == 0 && errno == nil {
break
}
if errno == syscall.EAGAIN && c.wdeadline >= 0 {
pollserver.WaitWrite(c)
continue
}
- if errno != 0 {
+ if errno != nil {
// This includes syscall.ENOSYS (no kernel
// support) and syscall.EINVAL (fd types which
// don't implement sendfile together)
- err = &OpError{"sendfile", c.net, c.raddr, os.Errno(errno)}
+ err = &OpError{"sendfile", c.net, c.raddr, errno}
break
}
}
diff --git a/src/pkg/net/sendfile_windows.go b/src/pkg/net/sendfile_windows.go
index 0b31572..ee7ff8b 100644
--- a/src/pkg/net/sendfile_windows.go
+++ b/src/pkg/net/sendfile_windows.go
@@ -16,7 +16,7 @@
n uint32
}
-func (o *sendfileOp) Submit() (errno int) {
+func (o *sendfileOp) Submit() (err error) {
return syscall.TransmitFile(o.fd.sysfd, o.src, o.n, 0, &o.o, nil, syscall.TF_WRITE_BEHIND)
}
diff --git a/src/pkg/net/sock.go b/src/pkg/net/sock.go
index d9df02c..33f11f2 100644
--- a/src/pkg/net/sock.go
+++ b/src/pkg/net/sock.go
@@ -28,9 +28,9 @@
// See ../syscall/exec.go for description of ForkLock.
syscall.ForkLock.RLock()
s, e := syscall.Socket(f, p, t)
- if e != 0 {
+ if err != nil {
syscall.ForkLock.RUnlock()
- return nil, os.Errno(e)
+ return nil, err
}
syscall.CloseOnExec(s)
syscall.ForkLock.RUnlock()
@@ -39,9 +39,9 @@
if la != nil {
e = syscall.Bind(s, la)
- if e != 0 {
+ if e != nil {
closesocket(s)
- return nil, os.Errno(e)
+ return nil, e
}
}
diff --git a/src/pkg/net/tcpsock_posix.go b/src/pkg/net/tcpsock_posix.go
index a726b45..44890ba 100644
--- a/src/pkg/net/tcpsock_posix.go
+++ b/src/pkg/net/tcpsock_posix.go
@@ -250,9 +250,9 @@
return nil, err
}
errno := syscall.Listen(fd.sysfd, listenBacklog())
- if errno != 0 {
+ if errno != nil {
closesocket(fd.sysfd)
- return nil, &OpError{"listen", "tcp", laddr, os.Errno(errno)}
+ return nil, &OpError{"listen", "tcp", laddr, errno}
}
l = new(TCPListener)
l.fd = fd
diff --git a/src/pkg/net/unixsock_posix.go b/src/pkg/net/unixsock_posix.go
index 6ba692e..929f640 100644
--- a/src/pkg/net/unixsock_posix.go
+++ b/src/pkg/net/unixsock_posix.go
@@ -327,9 +327,9 @@
return nil, err
}
e1 := syscall.Listen(fd.sysfd, 8) // listenBacklog());
- if e1 != 0 {
+ if e1 != nil {
closesocket(fd.sysfd)
- return nil, &OpError{Op: "listen", Net: "unix", Addr: laddr, Err: os.Errno(e1)}
+ return nil, &OpError{Op: "listen", Net: "unix", Addr: laddr, Err: e1}
}
return &UnixListener{fd, laddr.Name}, nil
}
diff --git a/src/pkg/os/dir_unix.go b/src/pkg/os/dir_unix.go
index a16bcf6..e4dff83 100644
--- a/src/pkg/os/dir_unix.go
+++ b/src/pkg/os/dir_unix.go
@@ -47,9 +47,9 @@
// Refill the buffer if necessary
if d.bufp >= d.nbuf {
d.bufp = 0
- var errno int
+ var errno error
d.nbuf, errno = syscall.ReadDirent(f.fd, d.buf)
- if errno != 0 {
+ if errno != nil {
return names, NewSyscallError("readdirent", errno)
}
if d.nbuf <= 0 {
diff --git a/src/pkg/os/env_plan9.go b/src/pkg/os/env_plan9.go
index 9757aa9..286a5fe 100644
--- a/src/pkg/os/env_plan9.go
+++ b/src/pkg/os/env_plan9.go
@@ -21,7 +21,7 @@
return "", EINVAL
}
f, e := Open("/env/" + key)
- if iserror(e) {
+ if e != nil {
return "", ENOENV
}
defer f.Close()
@@ -30,7 +30,7 @@
f.Seek(0, 0)
buf := make([]byte, l)
n, e := f.Read(buf)
- if iserror(e) {
+ if e != nil {
return "", ENOENV
}
@@ -55,7 +55,7 @@
}
f, e := Create("/env/" + key)
- if iserror(e) {
+ if e != nil {
return e
}
defer f.Close()
@@ -75,18 +75,18 @@
env := make([]string, 0, 100)
f, e := Open("/env")
- if iserror(e) {
+ if e != nil {
panic(e)
}
defer f.Close()
names, e := f.Readdirnames(-1)
- if iserror(e) {
+ if e != nil {
panic(e)
}
for _, k := range names {
- if v, e := Getenverror(k); !iserror(e) {
+ if v, e := Getenverror(k); e == nil {
env = append(env, k+"="+v)
}
}
diff --git a/src/pkg/os/env_windows.go b/src/pkg/os/env_windows.go
index 4e90385..88d6697 100644
--- a/src/pkg/os/env_windows.go
+++ b/src/pkg/os/env_windows.go
@@ -52,7 +52,7 @@
v = syscall.StringToUTF16Ptr(value)
}
e := syscall.SetEnvironmentVariable(syscall.StringToUTF16Ptr(key), v)
- if e != 0 {
+ if e != nil {
return NewSyscallError("SetEnvironmentVariable", e)
}
return nil
@@ -77,7 +77,7 @@
// in the form "key=value".
func Environ() []string {
s, e := syscall.GetEnvironmentStrings()
- if e != 0 {
+ if e != nil {
return nil
}
defer syscall.FreeEnvironmentStrings(s)
@@ -117,7 +117,7 @@
var argc int32
cmd := syscall.GetCommandLine()
argv, e := syscall.CommandLineToArgv(cmd, &argc)
- if e != 0 {
+ if e != nil {
return
}
defer syscall.LocalFree(syscall.Handle(uintptr(unsafe.Pointer(argv))))
diff --git a/src/pkg/os/error_plan9.go b/src/pkg/os/error_plan9.go
index e087070..aa52577 100644
--- a/src/pkg/os/error_plan9.go
+++ b/src/pkg/os/error_plan9.go
@@ -57,9 +57,3 @@
EPIPE = errors.New("Broken Pipe")
EPLAN9 = errors.New("not supported by plan 9")
)
-
-func iserror(err syscall.Error) bool {
- return err != nil
-}
-
-func Errno(e syscall.Error) syscall.Error { return e }
diff --git a/src/pkg/os/error_posix.go b/src/pkg/os/error_posix.go
index c3d7942..dbe1b9a 100644
--- a/src/pkg/os/error_posix.go
+++ b/src/pkg/os/error_posix.go
@@ -8,67 +8,53 @@
import syscall "syscall"
-// Errno is the Unix error number. Names such as EINVAL are simple
-// wrappers to convert the error number into an error.
-type Errno int64
-
-func (e Errno) Error() string { return syscall.Errstr(int(e)) }
-
-func (e Errno) Temporary() bool {
- return e == Errno(syscall.EINTR) || e == Errno(syscall.EMFILE) || e.Timeout()
-}
-
-func (e Errno) Timeout() bool {
- return e == Errno(syscall.EAGAIN) || e == Errno(syscall.EWOULDBLOCK) || e == Errno(syscall.ETIMEDOUT)
-}
-
// Commonly known Unix errors.
var (
- EPERM error = Errno(syscall.EPERM)
- ENOENT error = Errno(syscall.ENOENT)
- ESRCH error = Errno(syscall.ESRCH)
- EINTR error = Errno(syscall.EINTR)
- EIO error = Errno(syscall.EIO)
- ENXIO error = Errno(syscall.ENXIO)
- E2BIG error = Errno(syscall.E2BIG)
- ENOEXEC error = Errno(syscall.ENOEXEC)
- EBADF error = Errno(syscall.EBADF)
- ECHILD error = Errno(syscall.ECHILD)
- EDEADLK error = Errno(syscall.EDEADLK)
- ENOMEM error = Errno(syscall.ENOMEM)
- EACCES error = Errno(syscall.EACCES)
- EFAULT error = Errno(syscall.EFAULT)
- EBUSY error = Errno(syscall.EBUSY)
- EEXIST error = Errno(syscall.EEXIST)
- EXDEV error = Errno(syscall.EXDEV)
- ENODEV error = Errno(syscall.ENODEV)
- ENOTDIR error = Errno(syscall.ENOTDIR)
- EISDIR error = Errno(syscall.EISDIR)
- EINVAL error = Errno(syscall.EINVAL)
- ENFILE error = Errno(syscall.ENFILE)
- EMFILE error = Errno(syscall.EMFILE)
- ENOTTY error = Errno(syscall.ENOTTY)
- EFBIG error = Errno(syscall.EFBIG)
- ENOSPC error = Errno(syscall.ENOSPC)
- ESPIPE error = Errno(syscall.ESPIPE)
- EROFS error = Errno(syscall.EROFS)
- EMLINK error = Errno(syscall.EMLINK)
- EPIPE error = Errno(syscall.EPIPE)
- EAGAIN error = Errno(syscall.EAGAIN)
- EDOM error = Errno(syscall.EDOM)
- ERANGE error = Errno(syscall.ERANGE)
- EADDRINUSE error = Errno(syscall.EADDRINUSE)
- ECONNREFUSED error = Errno(syscall.ECONNREFUSED)
- ENAMETOOLONG error = Errno(syscall.ENAMETOOLONG)
- EAFNOSUPPORT error = Errno(syscall.EAFNOSUPPORT)
- ETIMEDOUT error = Errno(syscall.ETIMEDOUT)
- ENOTCONN error = Errno(syscall.ENOTCONN)
+ EPERM error = syscall.EPERM
+ ENOENT error = syscall.ENOENT
+ ESRCH error = syscall.ESRCH
+ EINTR error = syscall.EINTR
+ EIO error = syscall.EIO
+ ENXIO error = syscall.ENXIO
+ E2BIG error = syscall.E2BIG
+ ENOEXEC error = syscall.ENOEXEC
+ EBADF error = syscall.EBADF
+ ECHILD error = syscall.ECHILD
+ EDEADLK error = syscall.EDEADLK
+ ENOMEM error = syscall.ENOMEM
+ EACCES error = syscall.EACCES
+ EFAULT error = syscall.EFAULT
+ EBUSY error = syscall.EBUSY
+ EEXIST error = syscall.EEXIST
+ EXDEV error = syscall.EXDEV
+ ENODEV error = syscall.ENODEV
+ ENOTDIR error = syscall.ENOTDIR
+ EISDIR error = syscall.EISDIR
+ EINVAL error = syscall.EINVAL
+ ENFILE error = syscall.ENFILE
+ EMFILE error = syscall.EMFILE
+ ENOTTY error = syscall.ENOTTY
+ EFBIG error = syscall.EFBIG
+ ENOSPC error = syscall.ENOSPC
+ ESPIPE error = syscall.ESPIPE
+ EROFS error = syscall.EROFS
+ EMLINK error = syscall.EMLINK
+ EPIPE error = syscall.EPIPE
+ EAGAIN error = syscall.EAGAIN
+ EDOM error = syscall.EDOM
+ ERANGE error = syscall.ERANGE
+ EADDRINUSE error = syscall.EADDRINUSE
+ ECONNREFUSED error = syscall.ECONNREFUSED
+ ENAMETOOLONG error = syscall.ENAMETOOLONG
+ EAFNOSUPPORT error = syscall.EAFNOSUPPORT
+ ETIMEDOUT error = syscall.ETIMEDOUT
+ ENOTCONN error = syscall.ENOTCONN
)
// SyscallError records an error from a specific system call.
type SyscallError struct {
Syscall string
- Errno Errno
+ Errno error
}
func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Errno.Error() }
@@ -79,14 +65,10 @@
// NewSyscallError returns, as an error, a new SyscallError
// with the given system call name and error details.
-// As a convenience, if errno is 0, NewSyscallError returns nil.
-func NewSyscallError(syscall string, errno int) error {
- if errno == 0 {
+// As a convenience, if err is nil, NewSyscallError returns nil.
+func NewSyscallError(syscall string, err error) error {
+ if err == nil {
return nil
}
- return &SyscallError{syscall, Errno(errno)}
-}
-
-func iserror(errno int) bool {
- return errno != 0
+ return &SyscallError{syscall, err}
}
diff --git a/src/pkg/os/exec_plan9.go b/src/pkg/os/exec_plan9.go
index a1a3353..9a0db6d 100644
--- a/src/pkg/os/exec_plan9.go
+++ b/src/pkg/os/exec_plan9.go
@@ -32,7 +32,7 @@
sysattr.Files = intfd
pid, h, e := syscall.StartProcess(name, argv, sysattr)
- if iserror(e) {
+ if e != nil {
return nil, &PathError{"fork/exec", name, e}
}
@@ -52,7 +52,7 @@
}
f, e := OpenFile("/proc/"+itoa(p.Pid)+"/note", O_WRONLY, 0)
- if iserror(e) {
+ if e != nil {
return NewSyscallError("signal", e)
}
defer f.Close()
@@ -63,7 +63,7 @@
// Kill causes the Process to exit immediately.
func (p *Process) Kill() error {
f, e := OpenFile("/proc/"+itoa(p.Pid)+"/ctl", O_WRONLY, 0)
- if iserror(e) {
+ if e != nil {
return NewSyscallError("kill", e)
}
defer f.Close()
@@ -77,7 +77,7 @@
// ForkExec is almost always a better way to execute a program.
func Exec(name string, argv []string, envv []string) error {
e := syscall.Exec(name, argv, envv)
- if iserror(e) {
+ if e != nil {
return &PathError{"exec", name, e}
}
@@ -102,7 +102,7 @@
for true {
err = syscall.Await(&waitmsg)
- if iserror(err) {
+ if err != nil {
return nil, NewSyscallError("wait", err)
}
diff --git a/src/pkg/os/exec_posix.go b/src/pkg/os/exec_posix.go
index 12b44e5..8b08eeb 100644
--- a/src/pkg/os/exec_posix.go
+++ b/src/pkg/os/exec_posix.go
@@ -40,8 +40,8 @@
}
pid, h, e := syscall.StartProcess(name, argv, sysattr)
- if iserror(e) {
- return nil, &PathError{"fork/exec", name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"fork/exec", name, e}
}
return newProcess(pid, h), nil
}
@@ -62,8 +62,8 @@
envv = Environ()
}
e := syscall.Exec(name, argv, envv)
- if iserror(e) {
- return &PathError{"exec", name, Errno(e)}
+ if e != nil {
+ return &PathError{"exec", name, e}
}
return nil
}
diff --git a/src/pkg/os/exec_unix.go b/src/pkg/os/exec_unix.go
index 242bda7..3dcac41 100644
--- a/src/pkg/os/exec_unix.go
+++ b/src/pkg/os/exec_unix.go
@@ -38,7 +38,7 @@
options ^= WRUSAGE
}
pid1, e := syscall.Wait4(p.Pid, &status, options, rusage)
- if e != 0 {
+ if e != nil {
return nil, NewSyscallError("wait", e)
}
// With WNOHANG pid is 0 if child has not exited.
@@ -57,8 +57,8 @@
if p.done {
return errors.New("os: process already finished")
}
- if e := syscall.Kill(p.Pid, int(sig.(UnixSignal))); e != 0 {
- return Errno(e)
+ if e := syscall.Kill(p.Pid, int(sig.(UnixSignal))); e != nil {
+ return e
}
return nil
}
diff --git a/src/pkg/os/exec_windows.go b/src/pkg/os/exec_windows.go
index 866757e..f24580d 100644
--- a/src/pkg/os/exec_windows.go
+++ b/src/pkg/os/exec_windows.go
@@ -22,7 +22,7 @@
}
var ec uint32
e = syscall.GetExitCodeProcess(syscall.Handle(p.handle), &ec)
- if e != 0 {
+ if e != nil {
return nil, NewSyscallError("GetExitCodeProcess", e)
}
p.done = true
@@ -39,7 +39,7 @@
e := syscall.TerminateProcess(syscall.Handle(p.handle), 1)
return NewSyscallError("TerminateProcess", e)
}
- return Errno(syscall.EWINDOWS)
+ return syscall.Errno(syscall.EWINDOWS)
}
func (p *Process) Release() error {
@@ -47,7 +47,7 @@
return EINVAL
}
e := syscall.CloseHandle(syscall.Handle(p.handle))
- if e != 0 {
+ if e != nil {
return NewSyscallError("CloseHandle", e)
}
p.handle = -1
@@ -60,7 +60,7 @@
const da = syscall.STANDARD_RIGHTS_READ |
syscall.PROCESS_QUERY_INFORMATION | syscall.SYNCHRONIZE
h, e := syscall.OpenProcess(da, false, uint32(pid))
- if e != 0 {
+ if e != nil {
return nil, NewSyscallError("OpenProcess", e)
}
return newProcess(pid, int(h)), nil
diff --git a/src/pkg/os/file.go b/src/pkg/os/file.go
index 0f3b2db..386afb8 100644
--- a/src/pkg/os/file.go
+++ b/src/pkg/os/file.go
@@ -59,11 +59,11 @@
if n < 0 {
n = 0
}
- if n == 0 && len(b) > 0 && !iserror(e) {
+ if n == 0 && len(b) > 0 && e == nil {
return 0, io.EOF
}
- if iserror(e) {
- err = &PathError{"read", file.name, Errno(e)}
+ if e != nil {
+ err = &PathError{"read", file.name, e}
}
return n, err
}
@@ -78,11 +78,11 @@
}
for len(b) > 0 {
m, e := file.pread(b, off)
- if m == 0 && !iserror(e) {
+ if m == 0 && e == nil {
return n, io.EOF
}
- if iserror(e) {
- err = &PathError{"read", file.name, Errno(e)}
+ if e != nil {
+ err = &PathError{"read", file.name, e}
break
}
n += m
@@ -106,8 +106,8 @@
epipecheck(file, e)
- if iserror(e) {
- err = &PathError{"write", file.name, Errno(e)}
+ if e != nil {
+ err = &PathError{"write", file.name, e}
}
return n, err
}
@@ -121,8 +121,8 @@
}
for len(b) > 0 {
m, e := file.pwrite(b, off)
- if iserror(e) {
- err = &PathError{"write", file.name, Errno(e)}
+ if e != nil {
+ err = &PathError{"write", file.name, e}
break
}
n += m
@@ -138,11 +138,11 @@
// It returns the new offset and an error, if any.
func (file *File) Seek(offset int64, whence int) (ret int64, err error) {
r, e := file.seek(offset, whence)
- if !iserror(e) && file.dirinfo != nil && r != 0 {
+ if e == nil && file.dirinfo != nil && r != 0 {
e = syscall.EISDIR
}
- if iserror(e) {
- return 0, &PathError{"seek", file.name, Errno(e)}
+ if e != nil {
+ return 0, &PathError{"seek", file.name, e}
}
return r, nil
}
@@ -160,16 +160,16 @@
// It returns an error, if any.
func Mkdir(name string, perm uint32) error {
e := syscall.Mkdir(name, perm)
- if iserror(e) {
- return &PathError{"mkdir", name, Errno(e)}
+ if e != nil {
+ return &PathError{"mkdir", name, e}
}
return nil
}
// Chdir changes the current working directory to the named directory.
func Chdir(dir string) error {
- if e := syscall.Chdir(dir); iserror(e) {
- return &PathError{"chdir", dir, Errno(e)}
+ if e := syscall.Chdir(dir); e != nil {
+ return &PathError{"chdir", dir, e}
}
return nil
}
@@ -177,8 +177,8 @@
// Chdir changes the current working directory to the file,
// which must be a directory.
func (f *File) Chdir() error {
- if e := syscall.Fchdir(f.fd); iserror(e) {
- return &PathError{"chdir", f.name, Errno(e)}
+ if e := syscall.Fchdir(f.fd); e != nil {
+ return &PathError{"chdir", f.name, e}
}
return nil
}
diff --git a/src/pkg/os/file_plan9.go b/src/pkg/os/file_plan9.go
index 42332e1..ecdd5d5 100644
--- a/src/pkg/os/file_plan9.go
+++ b/src/pkg/os/file_plan9.go
@@ -41,7 +41,7 @@
bufp int // location of next record in buf.
}
-func epipecheck(file *File, e syscall.Error) {
+func epipecheck(file *File, e error) {
}
// DevNull is the name of the operating system's ``null device.''
@@ -130,7 +130,7 @@
// It returns the FileInfo and an error, if any.
func (f *File) Stat() (fi *FileInfo, err error) {
d, err := dirstat(f)
- if iserror(err) {
+ if err != nil {
return nil, err
}
return fileInfoFromStat(new(FileInfo), d), err
@@ -144,7 +144,7 @@
d.Length = uint64(size)
- if e := syscall.Fwstat(f.fd, pdir(nil, &d)); iserror(e) {
+ if e := syscall.Fwstat(f.fd, pdir(nil, &d)); e != nil {
return &PathError{"truncate", f.name, e}
}
return nil
@@ -157,12 +157,12 @@
d.Null()
odir, e := dirstat(f)
- if iserror(e) {
+ if e != nil {
return &PathError{"chmod", f.name, e}
}
d.Mode = (odir.Mode & mask) | (mode &^ mask)
- if e := syscall.Fwstat(f.fd, pdir(nil, &d)); iserror(e) {
+ if e := syscall.Fwstat(f.fd, pdir(nil, &d)); e != nil {
return &PathError{"chmod", f.name, e}
}
return nil
@@ -179,7 +179,7 @@
var d Dir
d.Null()
- if e := syscall.Fwstat(f.fd, pdir(nil, &d)); iserror(e) {
+ if e := syscall.Fwstat(f.fd, pdir(nil, &d)); e != nil {
return NewSyscallError("fsync", e)
}
return nil
@@ -226,7 +226,7 @@
d.Length = uint64(size)
- if e := syscall.Wstat(name, pdir(nil, &d)); iserror(e) {
+ if e := syscall.Wstat(name, pdir(nil, &d)); e != nil {
return &PathError{"truncate", name, e}
}
return nil
@@ -234,7 +234,7 @@
// Remove removes the named file or directory.
func Remove(name string) error {
- if e := syscall.Remove(name); iserror(e) {
+ if e := syscall.Remove(name); e != nil {
return &PathError{"remove", name, e}
}
return nil
@@ -247,7 +247,7 @@
d.Name = newname
- if e := syscall.Wstat(oldname, pdir(nil, &d)); iserror(e) {
+ if e := syscall.Wstat(oldname, pdir(nil, &d)); e != nil {
return &PathError{"rename", oldname, e}
}
return nil
@@ -260,12 +260,12 @@
d.Null()
odir, e := dirstat(name)
- if iserror(e) {
+ if e != nil {
return &PathError{"chmod", name, e}
}
d.Mode = (odir.Mode & mask) | (mode &^ mask)
- if e := syscall.Wstat(name, pdir(nil, &d)); iserror(e) {
+ if e := syscall.Wstat(name, pdir(nil, &d)); e != nil {
return &PathError{"chmod", name, e}
}
return nil
@@ -284,7 +284,7 @@
d.Atime = uint32(atimeNs / 1e9)
d.Mtime = uint32(mtimeNs / 1e9)
- if e := syscall.Wstat(name, pdir(nil, &d)); iserror(e) {
+ if e := syscall.Wstat(name, pdir(nil, &d)); e != nil {
return &PathError{"chtimes", name, e}
}
return nil
@@ -294,7 +294,7 @@
var p [2]int
syscall.ForkLock.RLock()
- if e := syscall.Pipe(p[0:]); iserror(e) {
+ if e := syscall.Pipe(p[0:]); e != nil {
syscall.ForkLock.RUnlock()
return nil, nil, NewSyscallError("pipe", e)
}
diff --git a/src/pkg/os/file_posix.go b/src/pkg/os/file_posix.go
index c937b6d..c80d3df 100644
--- a/src/pkg/os/file_posix.go
+++ b/src/pkg/os/file_posix.go
@@ -12,7 +12,7 @@
func sigpipe() // implemented in package runtime
-func epipecheck(file *File, e int) {
+func epipecheck(file *File, e error) {
if e == syscall.EPIPE {
file.nepipe++
if file.nepipe >= 10 {
@@ -30,11 +30,11 @@
// Try both: it is cheaper on average than
// doing a Stat plus the right one.
e := syscall.Unlink(name)
- if !iserror(e) {
+ if e == nil {
return nil
}
e1 := syscall.Rmdir(name)
- if !iserror(e1) {
+ if e1 == nil {
return nil
}
@@ -53,7 +53,7 @@
if e1 != syscall.ENOTDIR {
e = e1
}
- return &PathError{"remove", name, Errno(e)}
+ return &PathError{"remove", name, e}
}
// LinkError records an error during a link or symlink or rename
@@ -72,8 +72,8 @@
// Link creates a hard link.
func Link(oldname, newname string) error {
e := syscall.Link(oldname, newname)
- if iserror(e) {
- return &LinkError{"link", oldname, newname, Errno(e)}
+ if e != nil {
+ return &LinkError{"link", oldname, newname, e}
}
return nil
}
@@ -81,8 +81,8 @@
// Symlink creates a symbolic link.
func Symlink(oldname, newname string) error {
e := syscall.Symlink(oldname, newname)
- if iserror(e) {
- return &LinkError{"symlink", oldname, newname, Errno(e)}
+ if e != nil {
+ return &LinkError{"symlink", oldname, newname, e}
}
return nil
}
@@ -93,8 +93,8 @@
for len := 128; ; len *= 2 {
b := make([]byte, len)
n, e := syscall.Readlink(name, b)
- if iserror(e) {
- return "", &PathError{"readlink", name, Errno(e)}
+ if e != nil {
+ return "", &PathError{"readlink", name, e}
}
if n < len {
return string(b[0:n]), nil
@@ -107,8 +107,8 @@
// Rename renames a file.
func Rename(oldname, newname string) error {
e := syscall.Rename(oldname, newname)
- if iserror(e) {
- return &LinkError{"rename", oldname, newname, Errno(e)}
+ if e != nil {
+ return &LinkError{"rename", oldname, newname, e}
}
return nil
}
@@ -116,16 +116,16 @@
// Chmod changes the mode of the named file to mode.
// If the file is a symbolic link, it changes the mode of the link's target.
func Chmod(name string, mode uint32) error {
- if e := syscall.Chmod(name, mode); iserror(e) {
- return &PathError{"chmod", name, Errno(e)}
+ if e := syscall.Chmod(name, mode); e != nil {
+ return &PathError{"chmod", name, e}
}
return nil
}
// Chmod changes the mode of the file to mode.
func (f *File) Chmod(mode uint32) error {
- if e := syscall.Fchmod(f.fd, mode); iserror(e) {
- return &PathError{"chmod", f.name, Errno(e)}
+ if e := syscall.Fchmod(f.fd, mode); e != nil {
+ return &PathError{"chmod", f.name, e}
}
return nil
}
@@ -133,8 +133,8 @@
// Chown changes the numeric uid and gid of the named file.
// If the file is a symbolic link, it changes the uid and gid of the link's target.
func Chown(name string, uid, gid int) error {
- if e := syscall.Chown(name, uid, gid); iserror(e) {
- return &PathError{"chown", name, Errno(e)}
+ if e := syscall.Chown(name, uid, gid); e != nil {
+ return &PathError{"chown", name, e}
}
return nil
}
@@ -142,16 +142,16 @@
// Lchown changes the numeric uid and gid of the named file.
// If the file is a symbolic link, it changes the uid and gid of the link itself.
func Lchown(name string, uid, gid int) error {
- if e := syscall.Lchown(name, uid, gid); iserror(e) {
- return &PathError{"lchown", name, Errno(e)}
+ if e := syscall.Lchown(name, uid, gid); e != nil {
+ return &PathError{"lchown", name, e}
}
return nil
}
// Chown changes the numeric uid and gid of the named file.
func (f *File) Chown(uid, gid int) error {
- if e := syscall.Fchown(f.fd, uid, gid); iserror(e) {
- return &PathError{"chown", f.name, Errno(e)}
+ if e := syscall.Fchown(f.fd, uid, gid); e != nil {
+ return &PathError{"chown", f.name, e}
}
return nil
}
@@ -159,8 +159,8 @@
// Truncate changes the size of the file.
// It does not change the I/O offset.
func (f *File) Truncate(size int64) error {
- if e := syscall.Ftruncate(f.fd, size); iserror(e) {
- return &PathError{"truncate", f.name, Errno(e)}
+ if e := syscall.Ftruncate(f.fd, size); e != nil {
+ return &PathError{"truncate", f.name, e}
}
return nil
}
@@ -172,7 +172,7 @@
if file == nil {
return EINVAL
}
- if e := syscall.Fsync(file.fd); iserror(e) {
+ if e := syscall.Fsync(file.fd); e != nil {
return NewSyscallError("fsync", e)
}
return nil
@@ -188,8 +188,8 @@
var utimes [2]syscall.Timeval
utimes[0] = syscall.NsecToTimeval(atime_ns)
utimes[1] = syscall.NsecToTimeval(mtime_ns)
- if e := syscall.Utimes(name, utimes[0:]); iserror(e) {
- return &PathError{"chtimes", name, Errno(e)}
+ if e := syscall.Utimes(name, utimes[0:]); e != nil {
+ return &PathError{"chtimes", name, e}
}
return nil
}
diff --git a/src/pkg/os/file_unix.go b/src/pkg/os/file_unix.go
index 02ba316..140c93d 100644
--- a/src/pkg/os/file_unix.go
+++ b/src/pkg/os/file_unix.go
@@ -55,8 +55,8 @@
// It returns the File and an error, if any.
func OpenFile(name string, flag int, perm uint32) (file *File, err error) {
r, e := syscall.Open(name, flag|syscall.O_CLOEXEC, perm)
- if e != 0 {
- return nil, &PathError{"open", name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"open", name, e}
}
// There's a race here with fork/exec, which we are
@@ -75,8 +75,8 @@
return EINVAL
}
var err error
- if e := syscall.Close(file.fd); e != 0 {
- err = &PathError{"close", file.name, Errno(e)}
+ if e := syscall.Close(file.fd); e != nil {
+ err = &PathError{"close", file.name, e}
}
file.fd = -1 // so it can't be closed again
@@ -90,8 +90,8 @@
func (file *File) Stat() (fi *FileInfo, err error) {
var stat syscall.Stat_t
e := syscall.Fstat(file.fd, &stat)
- if e != 0 {
- return nil, &PathError{"stat", file.name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"stat", file.name, e}
}
return fileInfoFromStat(file.name, new(FileInfo), &stat, &stat), nil
}
@@ -104,13 +104,13 @@
func Stat(name string) (fi *FileInfo, err error) {
var lstat, stat syscall.Stat_t
e := syscall.Lstat(name, &lstat)
- if iserror(e) {
- return nil, &PathError{"stat", name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"stat", name, e}
}
statp := &lstat
if lstat.Mode&syscall.S_IFMT == syscall.S_IFLNK {
e := syscall.Stat(name, &stat)
- if !iserror(e) {
+ if e == nil {
statp = &stat
}
}
@@ -123,8 +123,8 @@
func Lstat(name string) (fi *FileInfo, err error) {
var stat syscall.Stat_t
e := syscall.Lstat(name, &stat)
- if iserror(e) {
- return nil, &PathError{"lstat", name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"lstat", name, e}
}
return fileInfoFromStat(name, new(FileInfo), &stat, &stat), nil
}
@@ -165,26 +165,26 @@
// read reads up to len(b) bytes from the File.
// It returns the number of bytes read and an error, if any.
-func (f *File) read(b []byte) (n int, err int) {
+func (f *File) read(b []byte) (n int, err error) {
return syscall.Read(f.fd, b)
}
// pread reads len(b) bytes from the File starting at byte offset off.
// It returns the number of bytes read and the error, if any.
// EOF is signaled by a zero count with err set to 0.
-func (f *File) pread(b []byte, off int64) (n int, err int) {
+func (f *File) pread(b []byte, off int64) (n int, err error) {
return syscall.Pread(f.fd, b, off)
}
// write writes len(b) bytes to the File.
// It returns the number of bytes written and an error, if any.
-func (f *File) write(b []byte) (n int, err int) {
+func (f *File) write(b []byte) (n int, err error) {
return syscall.Write(f.fd, b)
}
// pwrite writes len(b) bytes to the File starting at byte offset off.
// It returns the number of bytes written and an error, if any.
-func (f *File) pwrite(b []byte, off int64) (n int, err int) {
+func (f *File) pwrite(b []byte, off int64) (n int, err error) {
return syscall.Pwrite(f.fd, b, off)
}
@@ -192,15 +192,15 @@
// according to whence: 0 means relative to the origin of the file, 1 means
// relative to the current offset, and 2 means relative to the end.
// It returns the new offset and an error, if any.
-func (f *File) seek(offset int64, whence int) (ret int64, err int) {
+func (f *File) seek(offset int64, whence int) (ret int64, err error) {
return syscall.Seek(f.fd, offset, whence)
}
// Truncate changes the size of the named file.
// If the file is a symbolic link, it changes the size of the link's target.
func Truncate(name string, size int64) error {
- if e := syscall.Truncate(name, size); e != 0 {
- return &PathError{"truncate", name, Errno(e)}
+ if e := syscall.Truncate(name, size); e != nil {
+ return &PathError{"truncate", name, e}
}
return nil
}
@@ -231,7 +231,7 @@
// See ../syscall/exec.go for description of lock.
syscall.ForkLock.RLock()
e := syscall.Pipe(p[0:])
- if iserror(e) {
+ if e != nil {
syscall.ForkLock.RUnlock()
return nil, nil, NewSyscallError("pipe", e)
}
diff --git a/src/pkg/os/file_windows.go b/src/pkg/os/file_windows.go
index d6a065d..7dae46b 100644
--- a/src/pkg/os/file_windows.go
+++ b/src/pkg/os/file_windows.go
@@ -50,8 +50,8 @@
func openFile(name string, flag int, perm uint32) (file *File, err error) {
r, e := syscall.Open(name, flag|syscall.O_CLOEXEC, perm)
- if e != 0 {
- return nil, &PathError{"open", name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"open", name, e}
}
// There's a race here with fork/exec, which we are
@@ -66,8 +66,8 @@
func openDir(name string) (file *File, err error) {
d := new(dirInfo)
r, e := syscall.FindFirstFile(syscall.StringToUTF16Ptr(name+`\*`), &d.data)
- if e != 0 {
- return nil, &PathError{"open", name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"open", name, e}
}
f := NewFile(r, name)
f.dirinfo = d
@@ -102,15 +102,15 @@
if file == nil || file.fd < 0 {
return EINVAL
}
- var e int
+ var e error
if file.isdir() {
e = syscall.FindClose(syscall.Handle(file.fd))
} else {
e = syscall.CloseHandle(syscall.Handle(file.fd))
}
var err error
- if e != 0 {
- err = &PathError{"close", file.name, Errno(e)}
+ if e != nil {
+ err = &PathError{"close", file.name, e}
}
file.fd = syscall.InvalidHandle // so it can't be closed again
@@ -152,11 +152,11 @@
for n != 0 {
if file.dirinfo.needdata {
e := syscall.FindNextFile(syscall.Handle(file.fd), d)
- if e != 0 {
+ if e != nil {
if e == syscall.ERROR_NO_MORE_FILES {
break
} else {
- err = &PathError{"FindNextFile", file.name, Errno(e)}
+ err = &PathError{"FindNextFile", file.name, e}
if !wantAll {
fi = nil
}
@@ -181,7 +181,7 @@
// read reads up to len(b) bytes from the File.
// It returns the number of bytes read and an error, if any.
-func (f *File) read(b []byte) (n int, err int) {
+func (f *File) read(b []byte) (n int, err error) {
f.l.Lock()
defer f.l.Unlock()
return syscall.Read(f.fd, b)
@@ -190,11 +190,11 @@
// pread reads len(b) bytes from the File starting at byte offset off.
// It returns the number of bytes read and the error, if any.
// EOF is signaled by a zero count with err set to 0.
-func (f *File) pread(b []byte, off int64) (n int, err int) {
+func (f *File) pread(b []byte, off int64) (n int, err error) {
f.l.Lock()
defer f.l.Unlock()
curoffset, e := syscall.Seek(f.fd, 0, 1)
- if e != 0 {
+ if e != nil {
return 0, e
}
defer syscall.Seek(f.fd, curoffset, 0)
@@ -204,15 +204,15 @@
}
var done uint32
e = syscall.ReadFile(syscall.Handle(f.fd), b, &done, &o)
- if e != 0 {
+ if e != nil {
return 0, e
}
- return int(done), 0
+ return int(done), nil
}
// write writes len(b) bytes to the File.
// It returns the number of bytes written and an error, if any.
-func (f *File) write(b []byte) (n int, err int) {
+func (f *File) write(b []byte) (n int, err error) {
f.l.Lock()
defer f.l.Unlock()
return syscall.Write(f.fd, b)
@@ -220,11 +220,11 @@
// pwrite writes len(b) bytes to the File starting at byte offset off.
// It returns the number of bytes written and an error, if any.
-func (f *File) pwrite(b []byte, off int64) (n int, err int) {
+func (f *File) pwrite(b []byte, off int64) (n int, err error) {
f.l.Lock()
defer f.l.Unlock()
curoffset, e := syscall.Seek(f.fd, 0, 1)
- if e != 0 {
+ if e != nil {
return 0, e
}
defer syscall.Seek(f.fd, curoffset, 0)
@@ -234,17 +234,17 @@
}
var done uint32
e = syscall.WriteFile(syscall.Handle(f.fd), b, &done, &o)
- if e != 0 {
+ if e != nil {
return 0, e
}
- return int(done), 0
+ return int(done), nil
}
// seek sets the offset for the next Read or Write on file to offset, interpreted
// according to whence: 0 means relative to the origin of the file, 1 means
// relative to the current offset, and 2 means relative to the end.
// It returns the new offset and an error, if any.
-func (f *File) seek(offset int64, whence int) (ret int64, err int) {
+func (f *File) seek(offset int64, whence int) (ret int64, err error) {
f.l.Lock()
defer f.l.Unlock()
return syscall.Seek(f.fd, offset, whence)
@@ -273,7 +273,7 @@
// See ../syscall/exec.go for description of lock.
syscall.ForkLock.RLock()
e := syscall.Pipe(p[0:])
- if iserror(e) {
+ if e != nil {
syscall.ForkLock.RUnlock()
return nil, nil, NewSyscallError("pipe", e)
}
diff --git a/src/pkg/os/stat_plan9.go b/src/pkg/os/stat_plan9.go
index 8df9e58..76600bd 100644
--- a/src/pkg/os/stat_plan9.go
+++ b/src/pkg/os/stat_plan9.go
@@ -72,7 +72,7 @@
// Stat returns a FileInfo structure describing the named file and an error, if any.
func Stat(name string) (fi *FileInfo, err error) {
d, err := dirstat(name)
- if iserror(err) {
+ if err != nil {
return nil, err
}
return fileInfoFromStat(new(FileInfo), d), err
@@ -83,7 +83,7 @@
// the returned FileInfo describes the symbolic link. Lstat makes no attempt to follow the link.
func Lstat(name string) (fi *FileInfo, err error) {
d, err := dirstat(name)
- if iserror(err) {
+ if err != nil {
return nil, err
}
return fileInfoFromStat(new(FileInfo), d), err
diff --git a/src/pkg/os/stat_windows.go b/src/pkg/os/stat_windows.go
index 416aeea..a6f3723 100644
--- a/src/pkg/os/stat_windows.go
+++ b/src/pkg/os/stat_windows.go
@@ -21,8 +21,8 @@
}
var d syscall.ByHandleFileInformation
e := syscall.GetFileInformationByHandle(syscall.Handle(file.fd), &d)
- if e != 0 {
- return nil, &PathError{"GetFileInformationByHandle", file.name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"GetFileInformationByHandle", file.name, e}
}
return setFileInfo(new(FileInfo), basename(file.name), d.FileAttributes, d.FileSizeHigh, d.FileSizeLow, d.CreationTime, d.LastAccessTime, d.LastWriteTime), nil
}
@@ -34,12 +34,12 @@
// the link itself and has fi.FollowedSymlink set to false.
func Stat(name string) (fi *FileInfo, err error) {
if len(name) == 0 {
- return nil, &PathError{"Stat", name, Errno(syscall.ERROR_PATH_NOT_FOUND)}
+ return nil, &PathError{"Stat", name, syscall.Errno(syscall.ERROR_PATH_NOT_FOUND)}
}
var d syscall.Win32FileAttributeData
e := syscall.GetFileAttributesEx(syscall.StringToUTF16Ptr(name), syscall.GetFileExInfoStandard, (*byte)(unsafe.Pointer(&d)))
- if e != 0 {
- return nil, &PathError{"GetFileAttributesEx", name, Errno(e)}
+ if e != nil {
+ return nil, &PathError{"GetFileAttributesEx", name, e}
}
return setFileInfo(new(FileInfo), basename(name), d.FileAttributes, d.FileSizeHigh, d.FileSizeLow, d.CreationTime, d.LastAccessTime, d.LastWriteTime), nil
}
diff --git a/src/pkg/os/sys_bsd.go b/src/pkg/os/sys_bsd.go
index 67133a1..c6a6de5 100644
--- a/src/pkg/os/sys_bsd.go
+++ b/src/pkg/os/sys_bsd.go
@@ -12,10 +12,9 @@
import "syscall"
func Hostname() (name string, err error) {
- var errno int
- name, errno = syscall.Sysctl("kern.hostname")
- if errno != 0 {
- return "", NewSyscallError("sysctl kern.hostname", errno)
+ name, err = syscall.Sysctl("kern.hostname")
+ if err != nil {
+ return "", NewSyscallError("sysctl kern.hostname", err)
}
return name, nil
}
diff --git a/src/pkg/os/sys_windows.go b/src/pkg/os/sys_windows.go
index c1e97a2..368086d 100644
--- a/src/pkg/os/sys_windows.go
+++ b/src/pkg/os/sys_windows.go
@@ -8,7 +8,7 @@
func Hostname() (name string, err error) {
s, e := syscall.ComputerName()
- if e != 0 {
+ if e != nil {
return "", NewSyscallError("ComputerName", e)
}
return s, nil
diff --git a/src/pkg/os/time.go b/src/pkg/os/time.go
index a4678ee..eb564e5 100644
--- a/src/pkg/os/time.go
+++ b/src/pkg/os/time.go
@@ -12,7 +12,7 @@
// time is the Unix epoch.
func Time() (sec int64, nsec int64, err error) {
var tv syscall.Timeval
- if e := syscall.Gettimeofday(&tv); iserror(e) {
+ if e := syscall.Gettimeofday(&tv); e != nil {
return 0, 0, NewSyscallError("gettimeofday", e)
}
return int64(tv.Sec), int64(tv.Usec) * 1000, err
diff --git a/src/pkg/os/user/lookup_unix.go b/src/pkg/os/user/lookup_unix.go
index 87cd197..a77aeb7 100644
--- a/src/pkg/os/user/lookup_unix.go
+++ b/src/pkg/os/user/lookup_unix.go
@@ -8,9 +8,9 @@
import (
"fmt"
- "os"
"runtime"
"strings"
+ "syscall"
"unsafe"
)
@@ -71,7 +71,7 @@
C.size_t(bufSize),
&result)
if rv != 0 {
- return nil, fmt.Errorf("user: lookup username %s: %s", username, os.Errno(rv))
+ return nil, fmt.Errorf("user: lookup username %s: %s", username, syscall.Errno(rv))
}
if result == nil {
return nil, UnknownUserError(username)
@@ -86,7 +86,7 @@
C.size_t(bufSize),
&result)
if rv != 0 {
- return nil, fmt.Errorf("user: lookup userid %d: %s", uid, os.Errno(rv))
+ return nil, fmt.Errorf("user: lookup userid %d: %s", uid, syscall.Errno(rv))
}
if result == nil {
return nil, UnknownUserIdError(uid)
diff --git a/src/pkg/syscall/bpf_bsd.go b/src/pkg/syscall/bpf_bsd.go
index 06a2953..f94b723 100644
--- a/src/pkg/syscall/bpf_bsd.go
+++ b/src/pkg/syscall/bpf_bsd.go
@@ -20,54 +20,54 @@
return &BpfInsn{Code: uint16(code), Jt: uint8(jt), Jf: uint8(jf), K: uint32(k)}
}
-func BpfBuflen(fd int) (int, int) {
+func BpfBuflen(fd int) (int, error) {
var l int
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCGBLEN, uintptr(unsafe.Pointer(&l)))
- if e := int(ep); e != 0 {
- return 0, e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCGBLEN, uintptr(unsafe.Pointer(&l)))
+ if err != 0 {
+ return 0, Errno(err)
}
- return l, 0
+ return l, nil
}
-func SetBpfBuflen(fd, l int) (int, int) {
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCSBLEN, uintptr(unsafe.Pointer(&l)))
- if e := int(ep); e != 0 {
- return 0, e
+func SetBpfBuflen(fd, l int) (int, error) {
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCSBLEN, uintptr(unsafe.Pointer(&l)))
+ if err != 0 {
+ return 0, Errno(err)
}
- return l, 0
+ return l, nil
}
-func BpfDatalink(fd int) (int, int) {
+func BpfDatalink(fd int) (int, error) {
var t int
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCGDLT, uintptr(unsafe.Pointer(&t)))
- if e := int(ep); e != 0 {
- return 0, e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCGDLT, uintptr(unsafe.Pointer(&t)))
+ if err != 0 {
+ return 0, Errno(err)
}
- return t, 0
+ return t, nil
}
-func SetBpfDatalink(fd, t int) (int, int) {
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCSDLT, uintptr(unsafe.Pointer(&t)))
- if e := int(ep); e != 0 {
- return 0, e
+func SetBpfDatalink(fd, t int) (int, error) {
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCSDLT, uintptr(unsafe.Pointer(&t)))
+ if err != 0 {
+ return 0, Errno(err)
}
- return t, 0
+ return t, nil
}
-func SetBpfPromisc(fd, m int) int {
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCPROMISC, uintptr(unsafe.Pointer(&m)))
- if e := int(ep); e != 0 {
- return e
+func SetBpfPromisc(fd, m int) error {
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCPROMISC, uintptr(unsafe.Pointer(&m)))
+ if err != 0 {
+ return Errno(err)
}
- return 0
+ return nil
}
-func FlushBpf(fd int) int {
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCFLUSH, 0)
- if e := int(ep); e != 0 {
- return e
+func FlushBpf(fd int) error {
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCFLUSH, 0)
+ if err != 0 {
+ return Errno(err)
}
- return 0
+ return nil
}
type ivalue struct {
@@ -75,95 +75,95 @@
value int16
}
-func BpfInterface(fd int, name string) (string, int) {
+func BpfInterface(fd int, name string) (string, error) {
var iv ivalue
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCGETIF, uintptr(unsafe.Pointer(&iv)))
- if e := int(ep); e != 0 {
- return "", e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCGETIF, uintptr(unsafe.Pointer(&iv)))
+ if err != 0 {
+ return "", Errno(err)
}
- return name, 0
+ return name, nil
}
-func SetBpfInterface(fd int, name string) int {
+func SetBpfInterface(fd int, name string) error {
var iv ivalue
copy(iv.name[:], []byte(name))
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCSETIF, uintptr(unsafe.Pointer(&iv)))
- if e := int(ep); e != 0 {
- return e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCSETIF, uintptr(unsafe.Pointer(&iv)))
+ if err != 0 {
+ return Errno(err)
}
- return 0
+ return nil
}
-func BpfTimeout(fd int) (*Timeval, int) {
+func BpfTimeout(fd int) (*Timeval, error) {
var tv Timeval
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCGRTIMEOUT, uintptr(unsafe.Pointer(&tv)))
- if e := int(ep); e != 0 {
- return nil, e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCGRTIMEOUT, uintptr(unsafe.Pointer(&tv)))
+ if err != 0 {
+ return nil, Errno(err)
}
- return &tv, 0
+ return &tv, nil
}
-func SetBpfTimeout(fd int, tv *Timeval) int {
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCSRTIMEOUT, uintptr(unsafe.Pointer(tv)))
- if e := int(ep); e != 0 {
- return e
+func SetBpfTimeout(fd int, tv *Timeval) error {
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCSRTIMEOUT, uintptr(unsafe.Pointer(tv)))
+ if err != 0 {
+ return Errno(err)
}
- return 0
+ return nil
}
-func BpfStats(fd int) (*BpfStat, int) {
+func BpfStats(fd int) (*BpfStat, error) {
var s BpfStat
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCGSTATS, uintptr(unsafe.Pointer(&s)))
- if e := int(ep); e != 0 {
- return nil, e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCGSTATS, uintptr(unsafe.Pointer(&s)))
+ if err != 0 {
+ return nil, Errno(err)
}
- return &s, 0
+ return &s, nil
}
-func SetBpfImmediate(fd, m int) int {
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCIMMEDIATE, uintptr(unsafe.Pointer(&m)))
- if e := int(ep); e != 0 {
- return e
+func SetBpfImmediate(fd, m int) error {
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCIMMEDIATE, uintptr(unsafe.Pointer(&m)))
+ if err != 0 {
+ return Errno(err)
}
- return 0
+ return nil
}
-func SetBpf(fd int, i []BpfInsn) int {
+func SetBpf(fd int, i []BpfInsn) error {
var p BpfProgram
p.Len = uint32(len(i))
p.Insns = (*BpfInsn)(unsafe.Pointer(&i[0]))
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCSETF, uintptr(unsafe.Pointer(&p)))
- if e := int(ep); e != 0 {
- return e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCSETF, uintptr(unsafe.Pointer(&p)))
+ if err != 0 {
+ return Errno(err)
}
- return 0
+ return nil
}
-func CheckBpfVersion(fd int) int {
+func CheckBpfVersion(fd int) error {
var v BpfVersion
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCVERSION, uintptr(unsafe.Pointer(&v)))
- if e := int(ep); e != 0 {
- return e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCVERSION, uintptr(unsafe.Pointer(&v)))
+ if err != 0 {
+ return Errno(err)
}
if v.Major != BPF_MAJOR_VERSION || v.Minor != BPF_MINOR_VERSION {
return EINVAL
}
- return 0
+ return nil
}
-func BpfHeadercmpl(fd int) (int, int) {
+func BpfHeadercmpl(fd int) (int, error) {
var f int
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCGHDRCMPLT, uintptr(unsafe.Pointer(&f)))
- if e := int(ep); e != 0 {
- return 0, e
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCGHDRCMPLT, uintptr(unsafe.Pointer(&f)))
+ if err != 0 {
+ return 0, Errno(err)
}
- return f, 0
+ return f, nil
}
-func SetBpfHeadercmpl(fd, f int) int {
- _, _, ep := Syscall(SYS_IOCTL, uintptr(fd), BIOCSHDRCMPLT, uintptr(unsafe.Pointer(&f)))
- if e := int(ep); e != 0 {
- return e
+func SetBpfHeadercmpl(fd, f int) error {
+ _, _, err := Syscall(SYS_IOCTL, uintptr(fd), BIOCSHDRCMPLT, uintptr(unsafe.Pointer(&f)))
+ if err != 0 {
+ return Errno(err)
}
- return 0
+ return nil
}
diff --git a/src/pkg/syscall/dll_windows.go b/src/pkg/syscall/dll_windows.go
index 6815dee..461ce3f 100644
--- a/src/pkg/syscall/dll_windows.go
+++ b/src/pkg/syscall/dll_windows.go
@@ -9,13 +9,15 @@
)
// Errno is the Windows error number.
-type Errno uint64
+type Errno uintptr
-func (e Errno) Error() string { return Errstr(int(e)) }
+func (e Errno) Error() string {
+ return errstr(e)
+}
// DLLError describes reasons for DLL load failures.
type DLLError struct {
- Errno Errno
+ Err error
ObjName string
Msg string
}
@@ -23,12 +25,12 @@
func (e *DLLError) Error() string { return e.Msg }
// Implemented in ../runtime/windows/syscall.goc.
-func Syscall(trap, nargs, a1, a2, a3 uintptr) (r1, r2, err uintptr)
-func Syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
-func Syscall9(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr)
-func Syscall12(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 uintptr) (r1, r2, err uintptr)
-func loadlibrary(filename *uint16) (handle, err uintptr)
-func getprocaddress(handle uintptr, procname *uint8) (proc, err uintptr)
+func Syscall(trap, nargs, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
+func Syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+func Syscall9(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
+func Syscall12(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 uintptr) (r1, r2 uintptr, err Errno)
+func loadlibrary(filename *uint16) (handle, err Errno)
+func getprocaddress(handle uintptr, procname *uint8) (proc uintptr, err Errno)
// A DLL implements access to a single DLL.
type DLL struct {
@@ -41,9 +43,9 @@
h, e := loadlibrary(StringToUTF16Ptr(name))
if e != 0 {
return nil, &DLLError{
- Errno: Errno(e),
+ Err: e,
ObjName: name,
- Msg: "Failed to load " + name + ": " + Errstr(int(e)),
+ Msg: "Failed to load " + name + ": " + e.Error(),
}
}
d := &DLL{
@@ -68,9 +70,9 @@
a, e := getprocaddress(uintptr(d.Handle), StringBytePtr(name))
if e != 0 {
return nil, &DLLError{
- Errno: Errno(e),
+ Err: e,
ObjName: name,
- Msg: "Failed to find " + name + " procedure in " + d.Name + ": " + Errstr(int(e)),
+ Msg: "Failed to find " + name + " procedure in " + d.Name + ": " + e.Error(),
}
}
p := &Proc{
@@ -91,8 +93,8 @@
}
// Release unloads DLL d from memory.
-func (d *DLL) Release() (err Errno) {
- return Errno(FreeLibrary(d.Handle))
+func (d *DLL) Release() (err error) {
+ return FreeLibrary(d.Handle)
}
// A Proc implements access to a procedure inside a DLL.
@@ -109,7 +111,7 @@
}
// Call executes procedure p with arguments a.
-func (p *Proc) Call(a ...uintptr) (r1, r2, err uintptr) {
+func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, err error) {
switch len(a) {
case 0:
return Syscall(p.Addr(), uintptr(len(a)), 0, 0, 0)
@@ -241,7 +243,7 @@
}
// Call executes procedure p with arguments a.
-func (p *LazyProc) Call(a ...uintptr) (r1, r2, err uintptr) {
+func (p *LazyProc) Call(a ...uintptr) (r1, r2 uintptr, err error) {
p.mustFind()
return p.proc.Call(a...)
}
diff --git a/src/pkg/syscall/exec_unix.go b/src/pkg/syscall/exec_unix.go
index 2399c89..ef4bdc5 100644
--- a/src/pkg/syscall/exec_unix.go
+++ b/src/pkg/syscall/exec_unix.go
@@ -75,9 +75,9 @@
func CloseOnExec(fd int) { fcntl(fd, F_SETFD, FD_CLOEXEC) }
-func SetNonblock(fd int, nonblocking bool) (errno int) {
+func SetNonblock(fd int, nonblocking bool) (err error) {
flag, err := fcntl(fd, F_GETFL, 0)
- if err != 0 {
+ if err != nil {
return err
}
if nonblocking {
@@ -90,19 +90,22 @@
}
// Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child.
-// If a dup or exec fails, write the errno int to pipe.
+// If a dup or exec fails, write the errno error to pipe.
// (Pipe is close-on-exec so if exec succeeds, it will be closed.)
// In the child, this function must not acquire any locks, because
// they might have been locked at the time of the fork. This means
// no rescheduling, no malloc calls, and no new stack segments.
// The calls to RawSyscall are okay because they are assembly
// functions that do not grow the stack.
-func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err int) {
+func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) {
// Declare all variables at top in case any
// declarations require heap allocation (e.g., err1).
- var r1, r2, err1 uintptr
- var nextfd int
- var i int
+ var (
+ r1, r2 uintptr
+ err1 Errno
+ nextfd int
+ i int
+ )
// guard against side effects of shuffling fds below.
fd := append([]int(nil), attr.Files...)
@@ -113,7 +116,7 @@
// No more allocation or calls of non-assembly functions.
r1, r2, err1 = RawSyscall(SYS_FORK, 0, 0, 0)
if err1 != 0 {
- return 0, int(err1)
+ return 0, err1
}
// On Darwin:
@@ -315,10 +318,10 @@
var zeroProcAttr ProcAttr
var zeroSysProcAttr SysProcAttr
-func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) {
+func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error) {
var p [2]int
var n int
- var err1 uintptr
+ var err1 Errno
var wstatus WaitStatus
if attr == nil {
@@ -356,19 +359,20 @@
ForkLock.Lock()
// Allocate child status pipe close on exec.
- if err = Pipe(p[0:]); err != 0 {
+ if err = Pipe(p[0:]); err != nil {
goto error
}
- if _, err = fcntl(p[0], F_SETFD, FD_CLOEXEC); err != 0 {
+ if _, err = fcntl(p[0], F_SETFD, FD_CLOEXEC); err != nil {
goto error
}
- if _, err = fcntl(p[1], F_SETFD, FD_CLOEXEC); err != 0 {
+ if _, err = fcntl(p[1], F_SETFD, FD_CLOEXEC); err != nil {
goto error
}
// Kick off child.
- pid, err = forkAndExecInChild(argv0p, argvp, envvp, chroot, dir, attr, sys, p[1])
- if err != 0 {
+ pid, err1 = forkAndExecInChild(argv0p, argvp, envvp, chroot, dir, attr, sys, p[1])
+ if err1 != 0 {
+ err = Errno(err1)
goto error
}
ForkLock.Unlock()
@@ -377,11 +381,11 @@
Close(p[1])
n, err = read(p[0], (*byte)(unsafe.Pointer(&err1)), int(unsafe.Sizeof(err1)))
Close(p[0])
- if err != 0 || n != 0 {
+ if err != nil || n != 0 {
if n == int(unsafe.Sizeof(err1)) {
- err = int(err1)
+ err = Errno(err1)
}
- if err == 0 {
+ if err == nil {
err = EPIPE
}
@@ -395,7 +399,7 @@
}
// Read got EOF, so pipe closed on exec, so exec succeeded.
- return pid, 0
+ return pid, nil
error:
if p[0] >= 0 {
@@ -407,21 +411,21 @@
}
// Combination of fork and exec, careful to be thread safe.
-func ForkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) {
+func ForkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error) {
return forkExec(argv0, argv, attr)
}
// StartProcess wraps ForkExec for package os.
-func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err int) {
+func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err error) {
pid, err = forkExec(argv0, argv, attr)
return pid, 0, err
}
// Ordinary exec.
-func Exec(argv0 string, argv []string, envv []string) (err int) {
+func Exec(argv0 string, argv []string, envv []string) (err error) {
_, _, err1 := RawSyscall(SYS_EXECVE,
uintptr(unsafe.Pointer(StringBytePtr(argv0))),
uintptr(unsafe.Pointer(&StringSlicePtr(argv)[0])),
uintptr(unsafe.Pointer(&StringSlicePtr(envv)[0])))
- return int(err1)
+ return Errno(err1)
}
diff --git a/src/pkg/syscall/exec_windows.go b/src/pkg/syscall/exec_windows.go
index 56eeb52..2826e2f 100644
--- a/src/pkg/syscall/exec_windows.go
+++ b/src/pkg/syscall/exec_windows.go
@@ -125,47 +125,47 @@
SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0)
}
-func SetNonblock(fd Handle, nonblocking bool) (errno int) {
- return 0
+func SetNonblock(fd Handle, nonblocking bool) (err error) {
+ return nil
}
// getFullPath retrieves the full path of the specified file.
// Just a wrapper for Windows GetFullPathName api.
-func getFullPath(name string) (path string, err int) {
+func getFullPath(name string) (path string, err error) {
p := StringToUTF16Ptr(name)
buf := make([]uint16, 100)
n, err := GetFullPathName(p, uint32(len(buf)), &buf[0], nil)
- if err != 0 {
+ if err != nil {
return "", err
}
if n > uint32(len(buf)) {
// Windows is asking for bigger buffer.
buf = make([]uint16, n)
n, err = GetFullPathName(p, uint32(len(buf)), &buf[0], nil)
- if err != 0 {
+ if err != nil {
return "", err
}
if n > uint32(len(buf)) {
return "", EINVAL
}
}
- return UTF16ToString(buf[:n]), 0
+ return UTF16ToString(buf[:n]), nil
}
func isSlash(c uint8) bool {
return c == '\\' || c == '/'
}
-func normalizeDir(dir string) (name string, err int) {
+func normalizeDir(dir string) (name string, err error) {
ndir, err := getFullPath(dir)
- if err != 0 {
+ if err != nil {
return "", err
}
if len(ndir) > 2 && isSlash(ndir[0]) && isSlash(ndir[1]) {
// dir cannot have \\server\share\path form
return "", EINVAL
}
- return ndir, 0
+ return ndir, nil
}
func volToUpper(ch int) int {
@@ -175,13 +175,13 @@
return ch
}
-func joinExeDirAndFName(dir, p string) (name string, err int) {
+func joinExeDirAndFName(dir, p string) (name string, err error) {
if len(p) == 0 {
return "", EINVAL
}
if len(p) > 2 && isSlash(p[0]) && isSlash(p[1]) {
// \\server\share\path form
- return p, 0
+ return p, nil
}
if len(p) > 1 && p[1] == ':' {
// has drive letter
@@ -189,10 +189,10 @@
return "", EINVAL
}
if isSlash(p[2]) {
- return p, 0
+ return p, nil
} else {
d, err := normalizeDir(dir)
- if err != 0 {
+ if err != nil {
return "", err
}
if volToUpper(int(p[0])) == volToUpper(int(d[0])) {
@@ -204,7 +204,7 @@
} else {
// no drive letter
d, err := normalizeDir(dir)
- if err != 0 {
+ if err != nil {
return "", err
}
if isSlash(p[0]) {
@@ -232,7 +232,7 @@
var zeroProcAttr ProcAttr
var zeroSysProcAttr SysProcAttr
-func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err int) {
+func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err error) {
if len(argv0) == 0 {
return 0, 0, EWINDOWS
}
@@ -255,9 +255,9 @@
// argv0 relative to the current directory, and, only once the new
// process is started, it does Chdir(attr.Dir). We are adjusting
// for that difference here by making argv0 absolute.
- var err int
+ var err error
argv0, err = joinExeDirAndFName(attr.Dir, argv0)
- if err != 0 {
+ if err != nil {
return 0, 0, err
}
}
@@ -294,7 +294,7 @@
for i := range attr.Files {
if attr.Files[i] > 0 {
err := DuplicateHandle(p, Handle(attr.Files[i]), p, &fd[i], 0, true, DUPLICATE_SAME_ACCESS)
- if err != 0 {
+ if err != nil {
return 0, 0, err
}
defer CloseHandle(Handle(fd[i]))
@@ -314,14 +314,14 @@
pi := new(ProcessInformation)
err = CreateProcess(argv0p, argvp, nil, nil, true, CREATE_UNICODE_ENVIRONMENT, createEnvBlock(attr.Env), dirp, si, pi)
- if err != 0 {
+ if err != nil {
return 0, 0, err
}
defer CloseHandle(Handle(pi.Thread))
- return int(pi.ProcessId), int(pi.Process), 0
+ return int(pi.ProcessId), int(pi.Process), nil
}
-func Exec(argv0 string, argv []string, envv []string) (err int) {
+func Exec(argv0 string, argv []string, envv []string) (err error) {
return EWINDOWS
}
diff --git a/src/pkg/syscall/lsf_linux.go b/src/pkg/syscall/lsf_linux.go
index f2bd2b7..05d653b 100644
--- a/src/pkg/syscall/lsf_linux.go
+++ b/src/pkg/syscall/lsf_linux.go
@@ -18,10 +18,10 @@
return &SockFilter{Code: uint16(code), Jt: uint8(jt), Jf: uint8(jf), K: uint32(k)}
}
-func LsfSocket(ifindex, proto int) (int, int) {
+func LsfSocket(ifindex, proto int) (int, error) {
var lsall SockaddrLinklayer
s, e := Socket(AF_PACKET, SOCK_RAW, proto)
- if e != 0 {
+ if e != nil {
return 0, e
}
p := (*[2]byte)(unsafe.Pointer(&lsall.Protocol))
@@ -29,11 +29,11 @@
p[1] = byte(proto)
lsall.Ifindex = ifindex
e = Bind(s, &lsall)
- if e != 0 {
+ if e != nil {
Close(s)
return 0, e
}
- return s, 0
+ return s, nil
}
type iflags struct {
@@ -41,17 +41,17 @@
flags uint16
}
-func SetLsfPromisc(name string, m bool) int {
+func SetLsfPromisc(name string, m bool) error {
s, e := Socket(AF_INET, SOCK_DGRAM, 0)
- if e != 0 {
+ if e != nil {
return e
}
defer Close(s)
var ifl iflags
copy(ifl.name[:], []byte(name))
_, _, ep := Syscall(SYS_IOCTL, uintptr(s), SIOCGIFFLAGS, uintptr(unsafe.Pointer(&ifl)))
- if e := int(ep); e != 0 {
- return e
+ if ep != 0 {
+ return Errno(ep)
}
if m {
ifl.flags |= uint16(IFF_PROMISC)
@@ -59,20 +59,20 @@
ifl.flags &= ^uint16(IFF_PROMISC)
}
_, _, ep = Syscall(SYS_IOCTL, uintptr(s), SIOCSIFFLAGS, uintptr(unsafe.Pointer(&ifl)))
- if e := int(ep); e != 0 {
- return e
+ if ep != 0 {
+ return Errno(ep)
}
- return 0
+ return nil
}
-func AttachLsf(fd int, i []SockFilter) int {
+func AttachLsf(fd int, i []SockFilter) error {
var p SockFprog
p.Len = uint16(len(i))
p.Filter = (*SockFilter)(unsafe.Pointer(&i[0]))
return setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, uintptr(unsafe.Pointer(&p)), unsafe.Sizeof(p))
}
-func DetachLsf(fd int) int {
+func DetachLsf(fd int) error {
var dummy int
return setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, uintptr(unsafe.Pointer(&dummy)), unsafe.Sizeof(dummy))
}
diff --git a/src/pkg/syscall/mkerrors.sh b/src/pkg/syscall/mkerrors.sh
index 3ae11aa..81ed931 100755
--- a/src/pkg/syscall/mkerrors.sh
+++ b/src/pkg/syscall/mkerrors.sh
@@ -189,10 +189,21 @@
sort
)
+# Again, writing regexps to a file.
+echo '#include <errno.h>' | $GCC -x c - -E -dM $ccflags |
+ awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' |
+ sort >_error.grep
+
echo '// mkerrors.sh' "$@"
echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'
echo
-cgo -godefs -- "$@" _const.go
+cgo -godefs -- "$@" _const.go >_error.out
+cat _error.out | grep -vf _error.grep
+echo
+echo '// Errors'
+echo 'const ('
+cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= Errno(\1)/'
+echo ')'
# Run C program to print error strings.
(
@@ -250,4 +261,4 @@
'
) >_errors.c
-$GCC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go
+$GCC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _error.out
diff --git a/src/pkg/syscall/mksyscall.pl b/src/pkg/syscall/mksyscall.pl
index 213526ae..c0a61a9 100755
--- a/src/pkg/syscall/mksyscall.pl
+++ b/src/pkg/syscall/mksyscall.pl
@@ -78,7 +78,7 @@
next if !/^\/\/sys / && !$nonblock;
# Line must be of the form
- # func Open(path string, mode int, perm int) (fd int, errno int)
+ # func Open(path string, mode int, perm int) (fd int, errno error)
# Split into name, in params, out params.
if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(SYS_[A-Z0-9_]+))?$/) {
print STDERR "$ARGV:$.: malformed //sys declaration\n";
@@ -177,15 +177,17 @@
# Assign return values.
my $body = "";
my @ret = ("_", "_", "_");
+ my $do_errno = 0;
for(my $i=0; $i<@out; $i++) {
my $p = $out[$i];
my ($name, $type) = parseparam($p);
my $reg = "";
- if($name eq "errno" && !$plan9) {
+ if($name eq "err" && !$plan9) {
$reg = "e1";
$ret[2] = $reg;
- } elsif ($name eq "err" && $plan9) {
- $ret[0] = "r0";
+ $do_errno = 1;
+ } elsif($name eq "err" && $plan9) {
+ $ret[0] = "r0";
$ret[2] = "e1";
next;
} else {
@@ -208,7 +210,9 @@
$ret[$i] = sprintf("r%d", $i);
$ret[$i+1] = sprintf("r%d", $i+1);
}
- $body .= "\t$name = $type($reg)\n";
+ if($reg ne "e1" || $plan9) {
+ $body .= "\t$name = $type($reg)\n";
+ }
}
if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") {
$text .= "\t$call\n";
@@ -218,12 +222,14 @@
$text .= $body;
if ($plan9 && $ret[2] eq "e1") {
- $text .= "\terr = nil\n";
$text .= "\tif int(r0) == -1 {\n";
- $text .= "\t\terr = NewError(e1)\n";
+ $text .= "\t\terr = e1\n";
+ $text .= "\t}\n";
+ } elsif ($do_errno) {
+ $text .= "\tif e1 != 0 {\n";
+ $text .= "\t\terr = e1;\n";
$text .= "\t}\n";
}
-
$text .= "\treturn\n";
$text .= "}\n\n";
}
diff --git a/src/pkg/syscall/mksyscall_windows.pl b/src/pkg/syscall/mksyscall_windows.pl
index fa19fdc..7ea227e 100755
--- a/src/pkg/syscall/mksyscall_windows.pl
+++ b/src/pkg/syscall/mksyscall_windows.pl
@@ -11,16 +11,16 @@
# This includes return parameters.
# * The parameter lists must give a type for each argument:
# the (x, y, z int) shorthand is not allowed.
-# * If the return parameter is an error number, it must be named errno.
+# * If the return parameter is an error number, it must be named err.
# * If go func name needs to be different from it's winapi dll name,
# the winapi name could be specified at the end, after "=" sign, like
-# //sys LoadLibrary(libname string) (handle uint32, errno int) = LoadLibraryA
-# * Each function, that returns errno, needs to supply a condition,
+# //sys LoadLibrary(libname string) (handle uint32, err error) = LoadLibraryA
+# * Each function that returns err needs to supply a condition,
# that return value of winapi will be tested against to
-# detect failure. This would set errno to windows "last-error",
-# otherwise it will be 0. The value can be provided
+# detect failure. This would set err to windows "last-error",
+# otherwise it will be nil. The value can be provided
# at end of //sys declaration, like
-# //sys LoadLibrary(libname string) (handle uint32, errno int) [failretval==-1] = LoadLibraryA
+# //sys LoadLibrary(libname string) (handle uint32, err error) [failretval==-1] = LoadLibraryA
# and is [failretval==0] by default.
use strict;
@@ -81,7 +81,7 @@
$syscalldot = "syscall." if $package ne "syscall";
# Line must be of the form
- # func Open(path string, mode int, perm int) (fd int, errno int)
+ # func Open(path string, mode int, perm int) (fd int, err error)
# Split into name, in params, out params.
if(!/^\/\/sys (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:\[failretval(.*)\])?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) {
print STDERR "$ARGV:$.: malformed //sys declaration\n";
@@ -207,7 +207,7 @@
my $p = $out[$i];
my ($name, $type) = parseparam($p);
my $reg = "";
- if($name eq "errno") {
+ if($name eq "err") {
$reg = "e1";
$ret[2] = $reg;
} else {
@@ -238,7 +238,7 @@
if($i == 0) {
if($type eq "bool") {
$failexpr = "!$name";
- } elsif($name eq "errno") {
+ } elsif($name eq "err") {
$ret[$i] = "r1";
$failexpr = "int(r1) $failcond";
} else {
@@ -246,16 +246,14 @@
}
}
$failexpr =~ s/(=)([0-9A-Za-z\-+])/$1 $2/; # gofmt compatible
- if($name eq "errno") {
- # Set errno to "last error" only if returned value indicate failure
+ if($name eq "err") {
+ # Set err to "last error" only if returned value indicate failure
$body .= "\tif $failexpr {\n";
$body .= "\t\tif $reg != 0 {\n";
$body .= "\t\t\t$name = $type($reg)\n";
$body .= "\t\t} else {\n";
$body .= "\t\t\t$name = ${syscalldot}EINVAL\n";
$body .= "\t\t}\n";
- $body .= "\t} else {\n";
- $body .= "\t\t$name = 0\n";
$body .= "\t}\n";
} else {
$body .= "\t$name = $rettype($reg)\n";
diff --git a/src/pkg/syscall/netlink_linux.go b/src/pkg/syscall/netlink_linux.go
index 62d9e15..dc0f684 100644
--- a/src/pkg/syscall/netlink_linux.go
+++ b/src/pkg/syscall/netlink_linux.go
@@ -63,31 +63,28 @@
// NetlinkRIB returns routing information base, as known as RIB,
// which consists of network facility information, states and
// parameters.
-func NetlinkRIB(proto, family int) ([]byte, int) {
+func NetlinkRIB(proto, family int) ([]byte, error) {
var (
- s int
- e int
lsanl SockaddrNetlink
- seq int
tab []byte
)
- s, e = Socket(AF_NETLINK, SOCK_RAW, 0)
- if e != 0 {
+ s, e := Socket(AF_NETLINK, SOCK_RAW, 0)
+ if e != nil {
return nil, e
}
defer Close(s)
lsanl.Family = AF_NETLINK
e = Bind(s, &lsanl)
- if e != 0 {
+ if e != nil {
return nil, e
}
- seq++
+ seq := 1
wb := newNetlinkRouteRequest(proto, seq, family)
e = Sendto(s, wb, 0, &lsanl)
- if e != 0 {
+ if e != nil {
return nil, e
}
@@ -100,7 +97,7 @@
rb = make([]byte, Getpagesize())
nr, _, e = Recvfrom(s, rb, 0)
- if e != 0 {
+ if e != nil {
return nil, e
}
if nr < NLMSG_HDRLEN {
@@ -111,7 +108,7 @@
msgs, _ := ParseNetlinkMessage(rb)
for _, m := range msgs {
- if lsa, e = Getsockname(s); e != 0 {
+ if lsa, e = Getsockname(s); e != nil {
return nil, e
}
switch v := lsa.(type) {
@@ -132,7 +129,7 @@
}
done:
- return tab, 0
+ return tab, nil
}
// NetlinkMessage represents the netlink message.
@@ -143,18 +140,18 @@
// ParseNetlinkMessage parses buf as netlink messages and returns
// the slice containing the NetlinkMessage structs.
-func ParseNetlinkMessage(buf []byte) ([]NetlinkMessage, int) {
+func ParseNetlinkMessage(buf []byte) ([]NetlinkMessage, error) {
var (
h *NlMsghdr
dbuf []byte
dlen int
- e int
+ e error
msgs []NetlinkMessage
)
for len(buf) >= NLMSG_HDRLEN {
h, dbuf, dlen, e = netlinkMessageHeaderAndData(buf)
- if e != 0 {
+ if e != nil {
break
}
m := NetlinkMessage{}
@@ -167,12 +164,12 @@
return msgs, e
}
-func netlinkMessageHeaderAndData(buf []byte) (*NlMsghdr, []byte, int, int) {
+func netlinkMessageHeaderAndData(buf []byte) (*NlMsghdr, []byte, int, error) {
h := (*NlMsghdr)(unsafe.Pointer(&buf[0]))
if h.Len < NLMSG_HDRLEN || int(h.Len) > len(buf) {
return nil, nil, 0, EINVAL
}
- return h, buf[NLMSG_HDRLEN:], nlmAlignOf(int(h.Len)), 0
+ return h, buf[NLMSG_HDRLEN:], nlmAlignOf(int(h.Len)), nil
}
// NetlinkRouteAttr represents the netlink route attribute.
@@ -184,13 +181,13 @@
// ParseNetlinkRouteAttr parses msg's payload as netlink route
// attributes and returns the slice containing the NetlinkRouteAttr
// structs.
-func ParseNetlinkRouteAttr(msg *NetlinkMessage) ([]NetlinkRouteAttr, int) {
+func ParseNetlinkRouteAttr(msg *NetlinkMessage) ([]NetlinkRouteAttr, error) {
var (
buf []byte
a *RtAttr
alen int
vbuf []byte
- e int
+ e error
attrs []NetlinkRouteAttr
)
@@ -207,7 +204,7 @@
for len(buf) >= SizeofRtAttr {
a, vbuf, alen, e = netlinkRouteAttrAndValue(buf)
- if e != 0 {
+ if e != nil {
break
}
ra := NetlinkRouteAttr{}
@@ -217,13 +214,13 @@
buf = buf[alen:]
}
- return attrs, 0
+ return attrs, nil
}
-func netlinkRouteAttrAndValue(buf []byte) (*RtAttr, []byte, int, int) {
+func netlinkRouteAttrAndValue(buf []byte) (*RtAttr, []byte, int, error) {
h := (*RtAttr)(unsafe.Pointer(&buf[0]))
if h.Len < SizeofRtAttr || int(h.Len) > len(buf) {
return nil, nil, 0, EINVAL
}
- return h, buf[SizeofRtAttr:], rtaAlignOf(int(h.Len)), 0
+ return h, buf[SizeofRtAttr:], rtaAlignOf(int(h.Len)), nil
}
diff --git a/src/pkg/syscall/route_bsd.go b/src/pkg/syscall/route_bsd.go
index f6b124b..bc4c15e 100644
--- a/src/pkg/syscall/route_bsd.go
+++ b/src/pkg/syscall/route_bsd.go
@@ -29,29 +29,24 @@
// RouteRIB returns routing information base, as known as RIB,
// which consists of network facility information, states and
// parameters.
-func RouteRIB(facility, param int) ([]byte, int) {
- var (
- tab []byte
- e int
- )
-
+func RouteRIB(facility, param int) ([]byte, error) {
mib := []_C_int{CTL_NET, AF_ROUTE, 0, 0, _C_int(facility), _C_int(param)}
// Find size.
n := uintptr(0)
- if e = sysctl(mib, nil, &n, nil, 0); e != 0 {
- return nil, e
+ if err := sysctl(mib, nil, &n, nil, 0); err != nil {
+ return nil, err
}
if n == 0 {
- return nil, 0
+ return nil, nil
}
- tab = make([]byte, n)
- if e = sysctl(mib, &tab[0], &n, nil, 0); e != 0 {
- return nil, e
+ tab := make([]byte, n)
+ if err := sysctl(mib, &tab[0], &n, nil, 0); err != nil {
+ return nil, err
}
- return tab[:n], 0
+ return tab[:n], nil
}
// RoutingMessage represents a routing message.
@@ -91,7 +86,7 @@
switch i {
case RTAX_DST, RTAX_GATEWAY:
sa, e := anyToSockaddr((*RawSockaddrAny)(unsafe.Pointer(rsa)))
- if e != 0 {
+ if e != nil {
return nil
}
if i == RTAX_DST {
@@ -134,7 +129,7 @@
return nil
}
sa, e := anyToSockaddr((*RawSockaddrAny)(unsafe.Pointer(&m.Data[0])))
- if e != 0 {
+ if e != nil {
return nil
}
return append(sas, sa)
@@ -163,7 +158,7 @@
switch i {
case RTAX_IFA:
sa, e := anyToSockaddr((*RawSockaddrAny)(unsafe.Pointer(rsa)))
- if e != 0 {
+ if e != nil {
return nil
}
sas = append(sas, sa)
@@ -178,7 +173,7 @@
// ParseRoutingMessage parses buf as routing messages and returns
// the slice containing the RoutingMessage interfaces.
-func ParseRoutingMessage(buf []byte) (msgs []RoutingMessage, errno int) {
+func ParseRoutingMessage(buf []byte) (msgs []RoutingMessage, err error) {
for len(buf) >= anyMessageLen {
any := (*anyMessage)(unsafe.Pointer(&buf[0]))
if any.Version != RTM_VERSION {
@@ -187,11 +182,11 @@
msgs = append(msgs, any.toRoutingMessage(buf))
buf = buf[any.Msglen:]
}
- return msgs, 0
+ return msgs, nil
}
// ParseRoutingMessage parses msg's payload as raw sockaddrs and
// returns the slice containing the Sockaddr interfaces.
-func ParseRoutingSockaddr(msg RoutingMessage) (sas []Sockaddr, errno int) {
- return append(sas, msg.sockaddr()...), 0
+func ParseRoutingSockaddr(msg RoutingMessage) (sas []Sockaddr, err error) {
+ return append(sas, msg.sockaddr()...), nil
}
diff --git a/src/pkg/syscall/route_darwin.go b/src/pkg/syscall/route_darwin.go
index 9d3a701..410e70a 100644
--- a/src/pkg/syscall/route_darwin.go
+++ b/src/pkg/syscall/route_darwin.go
@@ -63,7 +63,7 @@
switch i {
case RTAX_IFA:
sa, e := anyToSockaddr((*RawSockaddrAny)(unsafe.Pointer(rsa)))
- if e != 0 {
+ if e != nil {
return nil
}
sas = append(sas, sa)
diff --git a/src/pkg/syscall/route_freebsd.go b/src/pkg/syscall/route_freebsd.go
index 0d61d08..094e170 100644
--- a/src/pkg/syscall/route_freebsd.go
+++ b/src/pkg/syscall/route_freebsd.go
@@ -63,7 +63,7 @@
switch i {
case RTAX_IFA:
sa, e := anyToSockaddr((*RawSockaddrAny)(unsafe.Pointer(rsa)))
- if e != 0 {
+ if e != nil {
return nil
}
sas = append(sas, sa)
diff --git a/src/pkg/syscall/sockcmsg_linux.go b/src/pkg/syscall/sockcmsg_linux.go
index b025ca5..0b4caa1 100644
--- a/src/pkg/syscall/sockcmsg_linux.go
+++ b/src/pkg/syscall/sockcmsg_linux.go
@@ -26,7 +26,7 @@
// ParseUnixCredentials decodes a socket control message that contains
// credentials in a Ucred structure. To receive such a message, the
// SO_PASSCRED option must be enabled on the socket.
-func ParseUnixCredentials(msg *SocketControlMessage) (*Ucred, int) {
+func ParseUnixCredentials(msg *SocketControlMessage) (*Ucred, error) {
if msg.Header.Level != SOL_SOCKET {
return nil, EINVAL
}
@@ -34,5 +34,5 @@
return nil, EINVAL
}
ucred := *(*Ucred)(unsafe.Pointer(&msg.Data[0]))
- return &ucred, 0
+ return &ucred, nil
}
diff --git a/src/pkg/syscall/sockcmsg_unix.go b/src/pkg/syscall/sockcmsg_unix.go
index c9872ae..84c1383 100644
--- a/src/pkg/syscall/sockcmsg_unix.go
+++ b/src/pkg/syscall/sockcmsg_unix.go
@@ -47,17 +47,17 @@
Data []byte
}
-func ParseSocketControlMessage(buf []byte) ([]SocketControlMessage, int) {
+func ParseSocketControlMessage(buf []byte) ([]SocketControlMessage, error) {
var (
h *Cmsghdr
dbuf []byte
- e int
+ e error
cmsgs []SocketControlMessage
)
for len(buf) >= CmsgLen(0) {
h, dbuf, e = socketControlMessageHeaderAndData(buf)
- if e != 0 {
+ if e != nil {
break
}
m := SocketControlMessage{}
@@ -70,12 +70,12 @@
return cmsgs, e
}
-func socketControlMessageHeaderAndData(buf []byte) (*Cmsghdr, []byte, int) {
+func socketControlMessageHeaderAndData(buf []byte) (*Cmsghdr, []byte, error) {
h := (*Cmsghdr)(unsafe.Pointer(&buf[0]))
if h.Len < SizeofCmsghdr || int(h.Len) > len(buf) {
return nil, nil, EINVAL
}
- return h, buf[cmsgAlignOf(SizeofCmsghdr):], 0
+ return h, buf[cmsgAlignOf(SizeofCmsghdr):], nil
}
// UnixRights encodes a set of open file descriptors into a socket
@@ -99,7 +99,7 @@
// ParseUnixRights decodes a socket control message that contains an
// integer array of open file descriptors from another process.
-func ParseUnixRights(msg *SocketControlMessage) ([]int, int) {
+func ParseUnixRights(msg *SocketControlMessage) ([]int, error) {
if msg.Header.Level != SOL_SOCKET {
return nil, EINVAL
}
@@ -111,5 +111,5 @@
fds[j] = int(*(*int32)(unsafe.Pointer(&msg.Data[i])))
j++
}
- return fds, 0
+ return fds, nil
}
diff --git a/src/pkg/syscall/syscall.go b/src/pkg/syscall/syscall.go
index 5fef440..f82c6c5 100644
--- a/src/pkg/syscall/syscall.go
+++ b/src/pkg/syscall/syscall.go
@@ -9,8 +9,9 @@
// packages rather than this one if you can.
// For details of the functions and data types in this package consult
// the manuals for the appropriate operating system.
-// These calls return errno == 0 to indicate success; otherwise
-// errno is an operating system error number describing the failure.
+// These calls return err == nil to indicate success; otherwise
+// err is an operating system error describing the failure.
+// On most systems, that error has type syscall.Errno.
package syscall
// StringByteSlice returns a NUL-terminated slice of bytes
diff --git a/src/pkg/syscall/syscall_bsd.go b/src/pkg/syscall/syscall_bsd.go
index a90a417..9d02d12 100644
--- a/src/pkg/syscall/syscall_bsd.go
+++ b/src/pkg/syscall/syscall_bsd.go
@@ -22,22 +22,22 @@
// even linking this function into the binary. See ../os/getwd.go.
const ImplementsGetwd = false
-func Getwd() (string, int) { return "", ENOTSUP }
+func Getwd() (string, error) { return "", ENOTSUP }
/*
* Wrapped
*/
-//sysnb getgroups(ngid int, gid *_Gid_t) (n int, errno int)
-//sysnb setgroups(ngid int, gid *_Gid_t) (errno int)
+//sysnb getgroups(ngid int, gid *_Gid_t) (n int, err error)
+//sysnb setgroups(ngid int, gid *_Gid_t) (err error)
-func Getgroups() (gids []int, errno int) {
+func Getgroups() (gids []int, err error) {
n, err := getgroups(0, nil)
- if err != 0 {
- return nil, errno
+ if err != nil {
+ return nil, err
}
if n == 0 {
- return nil, 0
+ return nil, nil
}
// Sanity check group count. Max is 16 on BSD.
@@ -47,8 +47,8 @@
a := make([]_Gid_t, n)
n, err = getgroups(n, &a[0])
- if err != 0 {
- return nil, errno
+ if err != nil {
+ return nil, err
}
gids = make([]int, n)
for i, v := range a[0:n] {
@@ -57,7 +57,7 @@
return
}
-func Setgroups(gids []int) (errno int) {
+func Setgroups(gids []int) (err error) {
if len(gids) == 0 {
return setgroups(0, nil)
}
@@ -69,7 +69,7 @@
return setgroups(len(a), &a[0])
}
-func ReadDirent(fd int, buf []byte) (n int, errno int) {
+func ReadDirent(fd int, buf []byte) (n int, err error) {
// Final argument is (basep *uintptr) and the syscall doesn't take nil.
// TODO(rsc): Can we use a single global basep for all calls?
return Getdirentries(fd, buf, new(uintptr))
@@ -126,38 +126,38 @@
func (w WaitStatus) TrapCause() int { return -1 }
-//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int)
+//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)
-func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) {
+func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
var status _C_int
- wpid, errno = wait4(pid, &status, options, rusage)
+ wpid, err = wait4(pid, &status, options, rusage)
if wstatus != nil {
*wstatus = WaitStatus(status)
}
return
}
-func Sleep(ns int64) (errno int) {
+func Sleep(ns int64) (err error) {
tv := NsecToTimeval(ns)
return Select(0, nil, nil, nil, &tv)
}
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int)
-//sys bind(s int, addr uintptr, addrlen _Socklen) (errno int)
-//sys connect(s int, addr uintptr, addrlen _Socklen) (errno int)
-//sysnb socket(domain int, typ int, proto int) (fd int, errno int)
-//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int)
-//sys setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
-//sys Shutdown(s int, how int) (errno int)
+//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
+//sys bind(s int, addr uintptr, addrlen _Socklen) (err error)
+//sys connect(s int, addr uintptr, addrlen _Socklen) (err error)
+//sysnb socket(domain int, typ int, proto int) (fd int, err error)
+//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error)
+//sys setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error)
+//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
+//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
+//sys Shutdown(s int, how int) (err error)
// For testing: clients can set this flag to force
// creation of IPv6 sockets to return EAFNOSUPPORT.
var SocketDisableIPv6 bool
type Sockaddr interface {
- sockaddr() (ptr uintptr, len _Socklen, errno int) // lowercase; only we can define Sockaddrs
+ sockaddr() (ptr uintptr, len _Socklen, err error) // lowercase; only we can define Sockaddrs
}
type SockaddrInet4 struct {
@@ -166,7 +166,7 @@
raw RawSockaddrInet4
}
-func (sa *SockaddrInet4) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrInet4) sockaddr() (uintptr, _Socklen, error) {
if sa.Port < 0 || sa.Port > 0xFFFF {
return 0, 0, EINVAL
}
@@ -178,7 +178,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.raw.Addr[i] = sa.Addr[i]
}
- return uintptr(unsafe.Pointer(&sa.raw)), _Socklen(sa.raw.Len), 0
+ return uintptr(unsafe.Pointer(&sa.raw)), _Socklen(sa.raw.Len), nil
}
type SockaddrInet6 struct {
@@ -188,7 +188,7 @@
raw RawSockaddrInet6
}
-func (sa *SockaddrInet6) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrInet6) sockaddr() (uintptr, _Socklen, error) {
if sa.Port < 0 || sa.Port > 0xFFFF {
return 0, 0, EINVAL
}
@@ -201,7 +201,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.raw.Addr[i] = sa.Addr[i]
}
- return uintptr(unsafe.Pointer(&sa.raw)), _Socklen(sa.raw.Len), 0
+ return uintptr(unsafe.Pointer(&sa.raw)), _Socklen(sa.raw.Len), nil
}
type SockaddrUnix struct {
@@ -209,7 +209,7 @@
raw RawSockaddrUnix
}
-func (sa *SockaddrUnix) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrUnix) sockaddr() (uintptr, _Socklen, error) {
name := sa.Name
n := len(name)
if n >= len(sa.raw.Path) || n == 0 {
@@ -220,10 +220,10 @@
for i := 0; i < n; i++ {
sa.raw.Path[i] = int8(name[i])
}
- return uintptr(unsafe.Pointer(&sa.raw)), _Socklen(sa.raw.Len), 0
+ return uintptr(unsafe.Pointer(&sa.raw)), _Socklen(sa.raw.Len), nil
}
-func (sa *SockaddrDatalink) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrDatalink) sockaddr() (uintptr, _Socklen, error) {
if sa.Index == 0 {
return 0, 0, EINVAL
}
@@ -237,10 +237,10 @@
for i := 0; i < len(sa.raw.Data); i++ {
sa.raw.Data[i] = sa.Data[i]
}
- return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrDatalink, 0
+ return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrDatalink, nil
}
-func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, int) {
+func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {
switch rsa.Addr.Family {
case AF_LINK:
pp := (*RawSockaddrDatalink)(unsafe.Pointer(rsa))
@@ -255,7 +255,7 @@
for i := 0; i < len(sa.Data); i++ {
sa.Data[i] = pp.Data[i]
}
- return sa, 0
+ return sa, nil
case AF_UNIX:
pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
@@ -273,7 +273,7 @@
}
bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
sa.Name = string(bytes)
- return sa, 0
+ return sa, nil
case AF_INET:
pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
@@ -283,7 +283,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
- return sa, 0
+ return sa, nil
case AF_INET6:
pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
@@ -294,168 +294,168 @@
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
- return sa, 0
+ return sa, nil
}
return nil, EAFNOSUPPORT
}
-func Accept(fd int) (nfd int, sa Sockaddr, errno int) {
+func Accept(fd int) (nfd int, sa Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- nfd, errno = accept(fd, &rsa, &len)
- if errno != 0 {
+ nfd, err = accept(fd, &rsa, &len)
+ if err != nil {
return
}
- sa, errno = anyToSockaddr(&rsa)
- if errno != 0 {
+ sa, err = anyToSockaddr(&rsa)
+ if err != nil {
Close(nfd)
nfd = 0
}
return
}
-func Getsockname(fd int) (sa Sockaddr, errno int) {
+func Getsockname(fd int) (sa Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- if errno = getsockname(fd, &rsa, &len); errno != 0 {
+ if err = getsockname(fd, &rsa, &len); err != nil {
return
}
return anyToSockaddr(&rsa)
}
-func Getpeername(fd int) (sa Sockaddr, errno int) {
+func Getpeername(fd int) (sa Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- if errno = getpeername(fd, &rsa, &len); errno != 0 {
+ if err = getpeername(fd, &rsa, &len); err != nil {
return
}
return anyToSockaddr(&rsa)
}
-func Bind(fd int, sa Sockaddr) (errno int) {
+func Bind(fd int, sa Sockaddr) (err error) {
ptr, n, err := sa.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
return bind(fd, ptr, n)
}
-func Connect(fd int, sa Sockaddr) (errno int) {
+func Connect(fd int, sa Sockaddr) (err error) {
ptr, n, err := sa.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
return connect(fd, ptr, n)
}
-func Socket(domain, typ, proto int) (fd, errno int) {
+func Socket(domain, typ, proto int) (fd int, err error) {
if domain == AF_INET6 && SocketDisableIPv6 {
return -1, EAFNOSUPPORT
}
- fd, errno = socket(domain, typ, proto)
+ fd, err = socket(domain, typ, proto)
return
}
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int) (errno int)
+//sysnb socketpair(domain int, typ int, proto int, fd *[2]int) (err error)
-func Socketpair(domain, typ, proto int) (fd [2]int, errno int) {
- errno = socketpair(domain, typ, proto, &fd)
+func Socketpair(domain, typ, proto int) (fd [2]int, err error) {
+ err = socketpair(domain, typ, proto, &fd)
return
}
-func GetsockoptByte(fd, level, opt int) (value byte, errno int) {
+func GetsockoptByte(fd, level, opt int) (value byte, err error) {
var n byte
vallen := _Socklen(1)
- errno = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen)
- return n, errno
+ err = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen)
+ return n, err
}
-func GetsockoptInt(fd, level, opt int) (value, errno int) {
+func GetsockoptInt(fd, level, opt int) (value int, err error) {
var n int32
vallen := _Socklen(4)
- errno = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen)
- return int(n), errno
+ err = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen)
+ return int(n), err
}
-func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, errno int) {
+func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {
vallen := _Socklen(4)
- errno = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value[0])), &vallen)
- return value, errno
+ err = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value[0])), &vallen)
+ return value, err
}
-func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, int) {
+func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {
var value IPMreq
vallen := _Socklen(SizeofIPMreq)
- errno := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
- return &value, errno
+ err := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
+ return &value, err
}
-func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, int) {
+func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {
var value IPv6Mreq
vallen := _Socklen(SizeofIPv6Mreq)
- errno := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
- return &value, errno
+ err := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
+ return &value, err
}
-func SetsockoptByte(fd, level, opt int, value byte) (errno int) {
+func SetsockoptByte(fd, level, opt int, value byte) (err error) {
var n = byte(value)
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), 1)
}
-func SetsockoptInt(fd, level, opt int, value int) (errno int) {
+func SetsockoptInt(fd, level, opt int, value int) (err error) {
var n = int32(value)
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), 4)
}
-func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (errno int) {
+func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value[0])), 4)
}
-func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (errno int) {
+func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(tv)), unsafe.Sizeof(*tv))
}
-func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int) {
+func SetsockoptLinger(fd, level, opt int, l *Linger) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l))
}
-func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (errno int) {
+func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(mreq)), unsafe.Sizeof(*mreq))
}
-func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (errno int) {
+func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(mreq)), unsafe.Sizeof(*mreq))
}
-func SetsockoptString(fd, level, opt int, s string) (errno int) {
+func SetsockoptString(fd, level, opt int, s string) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&[]byte(s)[0])), uintptr(len(s)))
}
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int)
+//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
-func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, errno int) {
+func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- if n, errno = recvfrom(fd, p, flags, &rsa, &len); errno != 0 {
+ if n, err = recvfrom(fd, p, flags, &rsa, &len); err != nil {
return
}
- from, errno = anyToSockaddr(&rsa)
+ from, err = anyToSockaddr(&rsa)
return
}
-//sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int)
+//sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error)
-func Sendto(fd int, p []byte, flags int, to Sockaddr) (errno int) {
+func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) {
ptr, n, err := to.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
return sendto(fd, p, flags, ptr, n)
}
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, errno int)
+//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, errno int) {
+func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
var msg Msghdr
var rsa RawSockaddrAny
msg.Name = (*byte)(unsafe.Pointer(&rsa))
@@ -477,27 +477,27 @@
}
msg.Iov = &iov
msg.Iovlen = 1
- if n, errno = recvmsg(fd, &msg, flags); errno != 0 {
+ if n, err = recvmsg(fd, &msg, flags); err != nil {
return
}
oobn = int(msg.Controllen)
recvflags = int(msg.Flags)
// source address is only specified if the socket is unconnected
if rsa.Addr.Family != AF_UNSPEC {
- from, errno = anyToSockaddr(&rsa)
+ from, err = anyToSockaddr(&rsa)
}
return
}
-//sys sendmsg(s int, msg *Msghdr, flags int) (errno int)
+//sys sendmsg(s int, msg *Msghdr, flags int) (err error)
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (errno int) {
+func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
var ptr uintptr
var salen _Socklen
if to != nil {
- var err int
+ var err error
ptr, salen, err = to.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
}
@@ -521,7 +521,7 @@
}
msg.Iov = &iov
msg.Iovlen = 1
- if errno = sendmsg(fd, &msg, flags); errno != 0 {
+ if err = sendmsg(fd, &msg, flags); err != nil {
return
}
return
@@ -532,13 +532,13 @@
// http://developer.apple.com/mac/library/samplecode/BSDLLCTest/index.html
// BindToDevice binds the socket associated with fd to device.
-func BindToDevice(fd int, device string) (errno int) {
+func BindToDevice(fd int, device string) (err error) {
return ENOSYS
}
-//sys kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int)
+//sys kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error)
-func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, errno int) {
+func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err error) {
var change, event uintptr
if len(changes) > 0 {
change = uintptr(unsafe.Pointer(&changes[0]))
@@ -549,10 +549,10 @@
return kevent(kq, change, len(changes), event, len(events), timeout)
}
-//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) = SYS___SYSCTL
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
// Translate "kern.hostname" to []_C_int{0,1,2,3}.
-func nametomib(name string) (mib []_C_int, errno int) {
+func nametomib(name string) (mib []_C_int, err error) {
const siz = unsafe.Sizeof(mib[0])
// NOTE(rsc): It seems strange to set the buffer to have
@@ -570,85 +570,85 @@
// Magic sysctl: "setting" 0.3 to a string name
// lets you read back the array of integers form.
- if errno = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); errno != 0 {
- return nil, errno
+ if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
+ return nil, err
}
- return buf[0 : n/siz], 0
+ return buf[0 : n/siz], nil
}
-func Sysctl(name string) (value string, errno int) {
+func Sysctl(name string) (value string, err error) {
// Translate name to mib number.
- mib, errno := nametomib(name)
- if errno != 0 {
- return "", errno
+ mib, err := nametomib(name)
+ if err != nil {
+ return "", err
}
// Find size.
n := uintptr(0)
- if errno = sysctl(mib, nil, &n, nil, 0); errno != 0 {
- return "", errno
+ if err = sysctl(mib, nil, &n, nil, 0); err != nil {
+ return "", err
}
if n == 0 {
- return "", 0
+ return "", nil
}
// Read into buffer of that size.
buf := make([]byte, n)
- if errno = sysctl(mib, &buf[0], &n, nil, 0); errno != 0 {
- return "", errno
+ if err = sysctl(mib, &buf[0], &n, nil, 0); err != nil {
+ return "", err
}
// Throw away terminating NUL.
if n > 0 && buf[n-1] == '\x00' {
n--
}
- return string(buf[0:n]), 0
+ return string(buf[0:n]), nil
}
-func SysctlUint32(name string) (value uint32, errno int) {
+func SysctlUint32(name string) (value uint32, err error) {
// Translate name to mib number.
- mib, errno := nametomib(name)
- if errno != 0 {
- return 0, errno
+ mib, err := nametomib(name)
+ if err != nil {
+ return 0, err
}
// Read into buffer of that size.
n := uintptr(4)
buf := make([]byte, 4)
- if errno = sysctl(mib, &buf[0], &n, nil, 0); errno != 0 {
- return 0, errno
+ if err = sysctl(mib, &buf[0], &n, nil, 0); err != nil {
+ return 0, err
}
if n != 4 {
return 0, EIO
}
- return *(*uint32)(unsafe.Pointer(&buf[0])), 0
+ return *(*uint32)(unsafe.Pointer(&buf[0])), nil
}
-//sys utimes(path string, timeval *[2]Timeval) (errno int)
-func Utimes(path string, tv []Timeval) (errno int) {
+//sys utimes(path string, timeval *[2]Timeval) (err error)
+func Utimes(path string, tv []Timeval) (err error) {
if len(tv) != 2 {
return EINVAL
}
return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
}
-//sys futimes(fd int, timeval *[2]Timeval) (errno int)
-func Futimes(fd int, tv []Timeval) (errno int) {
+//sys futimes(fd int, timeval *[2]Timeval) (err error)
+func Futimes(fd int, tv []Timeval) (err error) {
if len(tv) != 2 {
return EINVAL
}
return futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
}
-//sys fcntl(fd int, cmd int, arg int) (val int, errno int)
+//sys fcntl(fd int, cmd int, arg int) (val int, err error)
// TODO: wrap
-// Acct(name nil-string) (errno int)
-// Gethostuuid(uuid *byte, timeout *Timespec) (errno int)
-// Madvise(addr *byte, len int, behav int) (errno int)
-// Mprotect(addr *byte, len int, prot int) (errno int)
-// Msync(addr *byte, len int, flags int) (errno int)
-// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, errno int)
+// Acct(name nil-string) (err error)
+// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
+// Madvise(addr *byte, len int, behav int) (err error)
+// Mprotect(addr *byte, len int, prot int) (err error)
+// Msync(addr *byte, len int, flags int) (err error)
+// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
var mapper = &mmapper{
active: make(map[*byte][]byte),
@@ -656,10 +656,10 @@
munmap: munmap,
}
-func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, errno int) {
+func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
return mapper.Mmap(fd, offset, length, prot, flags)
}
-func Munmap(b []byte) (errno int) {
+func Munmap(b []byte) (err error) {
return mapper.Munmap(b)
}
diff --git a/src/pkg/syscall/syscall_darwin.go b/src/pkg/syscall/syscall_darwin.go
index 1bbf1b1..20f9231 100644
--- a/src/pkg/syscall/syscall_darwin.go
+++ b/src/pkg/syscall/syscall_darwin.go
@@ -56,22 +56,22 @@
return origlen - len(buf), count, names
}
-//sys ptrace(request int, pid int, addr uintptr, data uintptr) (errno int)
-func PtraceAttach(pid int) (errno int) { return ptrace(PT_ATTACH, pid, 0, 0) }
-func PtraceDetach(pid int) (errno int) { return ptrace(PT_DETACH, pid, 0, 0) }
+//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
+func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
+func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
-//sysnb pipe() (r int, w int, errno int)
+//sysnb pipe() (r int, w int, err error)
-func Pipe(p []int) (errno int) {
+func Pipe(p []int) (err error) {
if len(p) != 2 {
return EINVAL
}
- p[0], p[1], errno = pipe()
+ p[0], p[1], err = pipe()
return
}
// TODO
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
return -1, ENOSYS
}
@@ -79,97 +79,97 @@
* Wrapped
*/
-//sys kill(pid int, signum int, posix int) (errno int)
+//sys kill(pid int, signum int, posix int) (err error)
-func Kill(pid int, signum int) (errno int) { return kill(pid, signum, 1) }
+func Kill(pid int, signum int) (err error) { return kill(pid, signum, 1) }
/*
* Exposed directly
*/
-//sys Access(path string, mode uint32) (errno int)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (errno int)
-//sys Chdir(path string) (errno int)
-//sys Chflags(path string, flags int) (errno int)
-//sys Chmod(path string, mode uint32) (errno int)
-//sys Chown(path string, uid int, gid int) (errno int)
-//sys Chroot(path string) (errno int)
-//sys Close(fd int) (errno int)
-//sysnb Dup(fd int) (nfd int, errno int)
-//sysnb Dup2(from int, to int) (errno int)
-//sys Exchangedata(path1 string, path2 string, options int) (errno int)
+//sys Access(path string, mode uint32) (err error)
+//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
+//sys Chdir(path string) (err error)
+//sys Chflags(path string, flags int) (err error)
+//sys Chmod(path string, mode uint32) (err error)
+//sys Chown(path string, uid int, gid int) (err error)
+//sys Chroot(path string) (err error)
+//sys Close(fd int) (err error)
+//sysnb Dup(fd int) (nfd int, err error)
+//sysnb Dup2(from int, to int) (err error)
+//sys Exchangedata(path1 string, path2 string, options int) (err error)
//sys Exit(code int)
-//sys Fchdir(fd int) (errno int)
-//sys Fchflags(path string, flags int) (errno int)
-//sys Fchmod(fd int, mode uint32) (errno int)
-//sys Fchown(fd int, uid int, gid int) (errno int)
-//sys Flock(fd int, how int) (errno int)
-//sys Fpathconf(fd int, name int) (val int, errno int)
-//sys Fstat(fd int, stat *Stat_t) (errno int) = SYS_FSTAT64
-//sys Fstatfs(fd int, stat *Statfs_t) (errno int) = SYS_FSTATFS64
-//sys Fsync(fd int) (errno int)
-//sys Ftruncate(fd int, length int64) (errno int)
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) = SYS_GETDIRENTRIES64
+//sys Fchdir(fd int) (err error)
+//sys Fchflags(path string, flags int) (err error)
+//sys Fchmod(fd int, mode uint32) (err error)
+//sys Fchown(fd int, uid int, gid int) (err error)
+//sys Flock(fd int, how int) (err error)
+//sys Fpathconf(fd int, name int) (val int, err error)
+//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
+//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
+//sys Fsync(fd int) (err error)
+//sys Ftruncate(fd int, length int64) (err error)
+//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
//sys Getdtablesize() (size int)
//sysnb Getegid() (egid int)
//sysnb Geteuid() (uid int)
-//sys Getfsstat(buf []Statfs_t, flags int) (n int, errno int) = SYS_GETFSSTAT64
+//sys Getfsstat(buf []Statfs_t, flags int) (n int, err error) = SYS_GETFSSTAT64
//sysnb Getgid() (gid int)
-//sysnb Getpgid(pid int) (pgid int, errno int)
+//sysnb Getpgid(pid int) (pgid int, err error)
//sysnb Getpgrp() (pgrp int)
//sysnb Getpid() (pid int)
//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, errno int)
-//sysnb Getrlimit(which int, lim *Rlimit) (errno int)
-//sysnb Getrusage(who int, rusage *Rusage) (errno int)
-//sysnb Getsid(pid int) (sid int, errno int)
+//sys Getpriority(which int, who int) (prio int, err error)
+//sysnb Getrlimit(which int, lim *Rlimit) (err error)
+//sysnb Getrusage(who int, rusage *Rusage) (err error)
+//sysnb Getsid(pid int) (sid int, err error)
//sysnb Getuid() (uid int)
//sysnb Issetugid() (tainted bool)
-//sys Kqueue() (fd int, errno int)
-//sys Lchown(path string, uid int, gid int) (errno int)
-//sys Link(path string, link string) (errno int)
-//sys Listen(s int, backlog int) (errno int)
-//sys Lstat(path string, stat *Stat_t) (errno int) = SYS_LSTAT64
-//sys Mkdir(path string, mode uint32) (errno int)
-//sys Mkfifo(path string, mode uint32) (errno int)
-//sys Mknod(path string, mode uint32, dev int) (errno int)
-//sys Open(path string, mode int, perm uint32) (fd int, errno int)
-//sys Pathconf(path string, name int) (val int, errno int)
-//sys Pread(fd int, p []byte, offset int64) (n int, errno int)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, errno int)
-//sys Read(fd int, p []byte) (n int, errno int)
-//sys Readlink(path string, buf []byte) (n int, errno int)
-//sys Rename(from string, to string) (errno int)
-//sys Revoke(path string) (errno int)
-//sys Rmdir(path string) (errno int)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, errno int) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int)
-//sys Setegid(egid int) (errno int)
-//sysnb Seteuid(euid int) (errno int)
-//sysnb Setgid(gid int) (errno int)
-//sys Setlogin(name string) (errno int)
-//sysnb Setpgid(pid int, pgid int) (errno int)
-//sys Setpriority(which int, who int, prio int) (errno int)
-//sys Setprivexec(flag int) (errno int)
-//sysnb Setregid(rgid int, egid int) (errno int)
-//sysnb Setreuid(ruid int, euid int) (errno int)
-//sysnb Setrlimit(which int, lim *Rlimit) (errno int)
-//sysnb Setsid() (pid int, errno int)
-//sysnb Settimeofday(tp *Timeval) (errno int)
-//sysnb Setuid(uid int) (errno int)
-//sys Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64
-//sys Statfs(path string, stat *Statfs_t) (errno int) = SYS_STATFS64
-//sys Symlink(path string, link string) (errno int)
-//sys Sync() (errno int)
-//sys Truncate(path string, length int64) (errno int)
+//sys Kqueue() (fd int, err error)
+//sys Lchown(path string, uid int, gid int) (err error)
+//sys Link(path string, link string) (err error)
+//sys Listen(s int, backlog int) (err error)
+//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
+//sys Mkdir(path string, mode uint32) (err error)
+//sys Mkfifo(path string, mode uint32) (err error)
+//sys Mknod(path string, mode uint32, dev int) (err error)
+//sys Open(path string, mode int, perm uint32) (fd int, err error)
+//sys Pathconf(path string, name int) (val int, err error)
+//sys Pread(fd int, p []byte, offset int64) (n int, err error)
+//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
+//sys Read(fd int, p []byte) (n int, err error)
+//sys Readlink(path string, buf []byte) (n int, err error)
+//sys Rename(from string, to string) (err error)
+//sys Revoke(path string) (err error)
+//sys Rmdir(path string) (err error)
+//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
+//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sys Setegid(egid int) (err error)
+//sysnb Seteuid(euid int) (err error)
+//sysnb Setgid(gid int) (err error)
+//sys Setlogin(name string) (err error)
+//sysnb Setpgid(pid int, pgid int) (err error)
+//sys Setpriority(which int, who int, prio int) (err error)
+//sys Setprivexec(flag int) (err error)
+//sysnb Setregid(rgid int, egid int) (err error)
+//sysnb Setreuid(ruid int, euid int) (err error)
+//sysnb Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb Setsid() (pid int, err error)
+//sysnb Settimeofday(tp *Timeval) (err error)
+//sysnb Setuid(uid int) (err error)
+//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
+//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
+//sys Symlink(path string, link string) (err error)
+//sys Sync() (err error)
+//sys Truncate(path string, length int64) (err error)
//sys Umask(newmask int) (oldmask int)
-//sys Undelete(path string) (errno int)
-//sys Unlink(path string) (errno int)
-//sys Unmount(path string, flags int) (errno int)
-//sys Write(fd int, p []byte) (n int, errno int)
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int)
-//sys munmap(addr uintptr, length uintptr) (errno int)
-//sys read(fd int, buf *byte, nbuf int) (n int, errno int)
-//sys write(fd int, buf *byte, nbuf int) (n int, errno int)
+//sys Undelete(path string) (err error)
+//sys Unlink(path string) (err error)
+//sys Unmount(path string, flags int) (err error)
+//sys Write(fd int, p []byte) (n int, err error)
+//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
+//sys munmap(addr uintptr, length uintptr) (err error)
+//sys read(fd int, buf *byte, nbuf int) (n int, err error)
+//sys write(fd int, buf *byte, nbuf int) (n int, err error)
/*
* Unimplemented
diff --git a/src/pkg/syscall/syscall_darwin_386.go b/src/pkg/syscall/syscall_darwin_386.go
index d76b228..9a8a97d 100644
--- a/src/pkg/syscall/syscall_darwin_386.go
+++ b/src/pkg/syscall/syscall_darwin_386.go
@@ -23,8 +23,8 @@
return
}
-//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, errno int)
-func Gettimeofday(tv *Timeval) (errno int) {
+//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
+func Gettimeofday(tv *Timeval) (err error) {
// The tv passed to gettimeofday must be non-nil
// but is otherwise unused. The answers come back
// in the two registers.
@@ -52,4 +52,4 @@
cmsg.Len = uint32(length)
}
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr) // sic
+func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic
diff --git a/src/pkg/syscall/syscall_darwin_amd64.go b/src/pkg/syscall/syscall_darwin_amd64.go
index ed43723..2d25e59 100644
--- a/src/pkg/syscall/syscall_darwin_amd64.go
+++ b/src/pkg/syscall/syscall_darwin_amd64.go
@@ -23,8 +23,8 @@
return
}
-//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, errno int)
-func Gettimeofday(tv *Timeval) (errno int) {
+//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
+func Gettimeofday(tv *Timeval) (err error) {
// The tv passed to gettimeofday must be non-nil
// but is otherwise unused. The answers come back
// in the two registers.
diff --git a/src/pkg/syscall/syscall_freebsd.go b/src/pkg/syscall/syscall_freebsd.go
index aa12560..b041357 100644
--- a/src/pkg/syscall/syscall_freebsd.go
+++ b/src/pkg/syscall/syscall_freebsd.go
@@ -56,120 +56,120 @@
return origlen - len(buf), count, names
}
-//sysnb pipe() (r int, w int, errno int)
+//sysnb pipe() (r int, w int, err error)
-func Pipe(p []int) (errno int) {
+func Pipe(p []int) (err error) {
if len(p) != 2 {
return EINVAL
}
- p[0], p[1], errno = pipe()
+ p[0], p[1], err = pipe()
return
}
// TODO
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
return -1, ENOSYS
}
-func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, int) {
+func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
var value IPMreqn
vallen := _Socklen(SizeofIPMreqn)
errno := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
return &value, errno
}
-func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (errno int) {
+func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(mreq)), unsafe.Sizeof(*mreq))
}
/*
* Exposed directly
*/
-//sys Access(path string, mode uint32) (errno int)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (errno int)
-//sys Chdir(path string) (errno int)
-//sys Chflags(path string, flags int) (errno int)
-//sys Chmod(path string, mode uint32) (errno int)
-//sys Chown(path string, uid int, gid int) (errno int)
-//sys Chroot(path string) (errno int)
-//sys Close(fd int) (errno int)
-//sysnb Dup(fd int) (nfd int, errno int)
-//sysnb Dup2(from int, to int) (errno int)
+//sys Access(path string, mode uint32) (err error)
+//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
+//sys Chdir(path string) (err error)
+//sys Chflags(path string, flags int) (err error)
+//sys Chmod(path string, mode uint32) (err error)
+//sys Chown(path string, uid int, gid int) (err error)
+//sys Chroot(path string) (err error)
+//sys Close(fd int) (err error)
+//sysnb Dup(fd int) (nfd int, err error)
+//sysnb Dup2(from int, to int) (err error)
//sys Exit(code int)
-//sys Fchdir(fd int) (errno int)
-//sys Fchflags(path string, flags int) (errno int)
-//sys Fchmod(fd int, mode uint32) (errno int)
-//sys Fchown(fd int, uid int, gid int) (errno int)
-//sys Flock(fd int, how int) (errno int)
-//sys Fpathconf(fd int, name int) (val int, errno int)
-//sys Fstat(fd int, stat *Stat_t) (errno int)
-//sys Fstatfs(fd int, stat *Statfs_t) (errno int)
-//sys Fsync(fd int) (errno int)
-//sys Ftruncate(fd int, length int64) (errno int)
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int)
+//sys Fchdir(fd int) (err error)
+//sys Fchflags(path string, flags int) (err error)
+//sys Fchmod(fd int, mode uint32) (err error)
+//sys Fchown(fd int, uid int, gid int) (err error)
+//sys Flock(fd int, how int) (err error)
+//sys Fpathconf(fd int, name int) (val int, err error)
+//sys Fstat(fd int, stat *Stat_t) (err error)
+//sys Fstatfs(fd int, stat *Statfs_t) (err error)
+//sys Fsync(fd int) (err error)
+//sys Ftruncate(fd int, length int64) (err error)
+//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
//sys Getdtablesize() (size int)
//sysnb Getegid() (egid int)
//sysnb Geteuid() (uid int)
-//sys Getfsstat(buf []Statfs_t, flags int) (n int, errno int)
+//sys Getfsstat(buf []Statfs_t, flags int) (n int, err error)
//sysnb Getgid() (gid int)
-//sysnb Getpgid(pid int) (pgid int, errno int)
+//sysnb Getpgid(pid int) (pgid int, err error)
//sysnb Getpgrp() (pgrp int)
//sysnb Getpid() (pid int)
//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, errno int)
-//sysnb Getrlimit(which int, lim *Rlimit) (errno int)
-//sysnb Getrusage(who int, rusage *Rusage) (errno int)
-//sysnb Getsid(pid int) (sid int, errno int)
-//sysnb Gettimeofday(tv *Timeval) (errno int)
+//sys Getpriority(which int, who int) (prio int, err error)
+//sysnb Getrlimit(which int, lim *Rlimit) (err error)
+//sysnb Getrusage(who int, rusage *Rusage) (err error)
+//sysnb Getsid(pid int) (sid int, err error)
+//sysnb Gettimeofday(tv *Timeval) (err error)
//sysnb Getuid() (uid int)
//sys Issetugid() (tainted bool)
-//sys Kill(pid int, signum int) (errno int)
-//sys Kqueue() (fd int, errno int)
-//sys Lchown(path string, uid int, gid int) (errno int)
-//sys Link(path string, link string) (errno int)
-//sys Listen(s int, backlog int) (errno int)
-//sys Lstat(path string, stat *Stat_t) (errno int)
-//sys Mkdir(path string, mode uint32) (errno int)
-//sys Mkfifo(path string, mode uint32) (errno int)
-//sys Mknod(path string, mode uint32, dev int) (errno int)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (errno int)
-//sys Open(path string, mode int, perm uint32) (fd int, errno int)
-//sys Pathconf(path string, name int) (val int, errno int)
-//sys Pread(fd int, p []byte, offset int64) (n int, errno int)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, errno int)
-//sys Read(fd int, p []byte) (n int, errno int)
-//sys Readlink(path string, buf []byte) (n int, errno int)
-//sys Rename(from string, to string) (errno int)
-//sys Revoke(path string) (errno int)
-//sys Rmdir(path string) (errno int)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, errno int) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int)
-//sysnb Setegid(egid int) (errno int)
-//sysnb Seteuid(euid int) (errno int)
-//sysnb Setgid(gid int) (errno int)
-//sys Setlogin(name string) (errno int)
-//sysnb Setpgid(pid int, pgid int) (errno int)
-//sys Setpriority(which int, who int, prio int) (errno int)
-//sysnb Setregid(rgid int, egid int) (errno int)
-//sysnb Setreuid(ruid int, euid int) (errno int)
-//sysnb Setrlimit(which int, lim *Rlimit) (errno int)
-//sysnb Setsid() (pid int, errno int)
-//sysnb Settimeofday(tp *Timeval) (errno int)
-//sysnb Setuid(uid int) (errno int)
-//sys Stat(path string, stat *Stat_t) (errno int)
-//sys Statfs(path string, stat *Statfs_t) (errno int)
-//sys Symlink(path string, link string) (errno int)
-//sys Sync() (errno int)
-//sys Truncate(path string, length int64) (errno int)
+//sys Kill(pid int, signum int) (err error)
+//sys Kqueue() (fd int, err error)
+//sys Lchown(path string, uid int, gid int) (err error)
+//sys Link(path string, link string) (err error)
+//sys Listen(s int, backlog int) (err error)
+//sys Lstat(path string, stat *Stat_t) (err error)
+//sys Mkdir(path string, mode uint32) (err error)
+//sys Mkfifo(path string, mode uint32) (err error)
+//sys Mknod(path string, mode uint32, dev int) (err error)
+//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
+//sys Open(path string, mode int, perm uint32) (fd int, err error)
+//sys Pathconf(path string, name int) (val int, err error)
+//sys Pread(fd int, p []byte, offset int64) (n int, err error)
+//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
+//sys Read(fd int, p []byte) (n int, err error)
+//sys Readlink(path string, buf []byte) (n int, err error)
+//sys Rename(from string, to string) (err error)
+//sys Revoke(path string) (err error)
+//sys Rmdir(path string) (err error)
+//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
+//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sysnb Setegid(egid int) (err error)
+//sysnb Seteuid(euid int) (err error)
+//sysnb Setgid(gid int) (err error)
+//sys Setlogin(name string) (err error)
+//sysnb Setpgid(pid int, pgid int) (err error)
+//sys Setpriority(which int, who int, prio int) (err error)
+//sysnb Setregid(rgid int, egid int) (err error)
+//sysnb Setreuid(ruid int, euid int) (err error)
+//sysnb Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb Setsid() (pid int, err error)
+//sysnb Settimeofday(tp *Timeval) (err error)
+//sysnb Setuid(uid int) (err error)
+//sys Stat(path string, stat *Stat_t) (err error)
+//sys Statfs(path string, stat *Statfs_t) (err error)
+//sys Symlink(path string, link string) (err error)
+//sys Sync() (err error)
+//sys Truncate(path string, length int64) (err error)
//sys Umask(newmask int) (oldmask int)
-//sys Undelete(path string) (errno int)
-//sys Unlink(path string) (errno int)
-//sys Unmount(path string, flags int) (errno int)
-//sys Write(fd int, p []byte) (n int, errno int)
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int)
-//sys munmap(addr uintptr, length uintptr) (errno int)
-//sys read(fd int, buf *byte, nbuf int) (n int, errno int)
-//sys write(fd int, buf *byte, nbuf int) (n int, errno int)
+//sys Undelete(path string) (err error)
+//sys Unlink(path string) (err error)
+//sys Unmount(path string, flags int) (err error)
+//sys Write(fd int, p []byte) (n int, err error)
+//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
+//sys munmap(addr uintptr, length uintptr) (err error)
+//sys read(fd int, buf *byte, nbuf int) (n int, err error)
+//sys write(fd int, buf *byte, nbuf int) (n int, err error)
/*
* Unimplemented
diff --git a/src/pkg/syscall/syscall_freebsd_386.go b/src/pkg/syscall/syscall_freebsd_386.go
index d3b5a1b..fa322c5 100644
--- a/src/pkg/syscall/syscall_freebsd_386.go
+++ b/src/pkg/syscall/syscall_freebsd_386.go
@@ -41,4 +41,4 @@
cmsg.Len = uint32(length)
}
-func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr) // sic
+func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic
diff --git a/src/pkg/syscall/syscall_linux.go b/src/pkg/syscall/syscall_linux.go
index e4a6561..52a7dc2 100644
--- a/src/pkg/syscall/syscall_linux.go
+++ b/src/pkg/syscall/syscall_linux.go
@@ -19,45 +19,45 @@
* Wrapped
*/
-//sys open(path string, mode int, perm uint32) (fd int, errno int)
-func Open(path string, mode int, perm uint32) (fd int, errno int) {
+//sys open(path string, mode int, perm uint32) (fd int, err error)
+func Open(path string, mode int, perm uint32) (fd int, err error) {
return open(path, mode|O_LARGEFILE, perm)
}
-//sys openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int)
-func Openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int) {
+//sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
+func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
return openat(dirfd, path, flags|O_LARGEFILE, mode)
}
-//sysnb pipe(p *[2]_C_int) (errno int)
-func Pipe(p []int) (errno int) {
+//sysnb pipe(p *[2]_C_int) (err error)
+func Pipe(p []int) (err error) {
if len(p) != 2 {
return EINVAL
}
var pp [2]_C_int
- errno = pipe(&pp)
+ err = pipe(&pp)
p[0] = int(pp[0])
p[1] = int(pp[1])
return
}
-//sys utimes(path string, times *[2]Timeval) (errno int)
-func Utimes(path string, tv []Timeval) (errno int) {
+//sys utimes(path string, times *[2]Timeval) (err error)
+func Utimes(path string, tv []Timeval) (err error) {
if len(tv) != 2 {
return EINVAL
}
return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
}
-//sys futimesat(dirfd int, path *byte, times *[2]Timeval) (errno int)
-func Futimesat(dirfd int, path string, tv []Timeval) (errno int) {
+//sys futimesat(dirfd int, path *byte, times *[2]Timeval) (err error)
+func Futimesat(dirfd int, path string, tv []Timeval) (err error) {
if len(tv) != 2 {
return EINVAL
}
return futimesat(dirfd, StringBytePtr(path), (*[2]Timeval)(unsafe.Pointer(&tv[0])))
}
-func Futimes(fd int, tv []Timeval) (errno int) {
+func Futimes(fd int, tv []Timeval) (err error) {
// Believe it or not, this is the best we can do on Linux
// (and is what glibc does).
return Utimes("/proc/self/fd/"+itoa(fd), tv)
@@ -65,27 +65,27 @@
const ImplementsGetwd = true
-//sys Getcwd(buf []byte) (n int, errno int)
-func Getwd() (wd string, errno int) {
+//sys Getcwd(buf []byte) (n int, err error)
+func Getwd() (wd string, err error) {
var buf [PathMax]byte
n, err := Getcwd(buf[0:])
- if err != 0 {
+ if err != nil {
return "", err
}
// Getcwd returns the number of bytes written to buf, including the NUL.
if n < 1 || n > len(buf) || buf[n-1] != 0 {
return "", EINVAL
}
- return string(buf[0 : n-1]), 0
+ return string(buf[0 : n-1]), nil
}
-func Getgroups() (gids []int, errno int) {
+func Getgroups() (gids []int, err error) {
n, err := getgroups(0, nil)
- if err != 0 {
- return nil, errno
+ if err != nil {
+ return nil, err
}
if n == 0 {
- return nil, 0
+ return nil, nil
}
// Sanity check group count. Max is 1<<16 on Linux.
@@ -95,8 +95,8 @@
a := make([]_Gid_t, n)
n, err = getgroups(n, &a[0])
- if err != 0 {
- return nil, errno
+ if err != nil {
+ return nil, err
}
gids = make([]int, n)
for i, v := range a[0:n] {
@@ -105,7 +105,7 @@
return
}
-func Setgroups(gids []int) (errno int) {
+func Setgroups(gids []int) (err error) {
if len(gids) == 0 {
return setgroups(0, nil)
}
@@ -174,23 +174,23 @@
return int(w>>shift) >> 8
}
-//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int)
-func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) {
+//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)
+func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
var status _C_int
- wpid, errno = wait4(pid, &status, options, rusage)
+ wpid, err = wait4(pid, &status, options, rusage)
if wstatus != nil {
*wstatus = WaitStatus(status)
}
return
}
-func Sleep(nsec int64) (errno int) {
+func Sleep(nsec int64) (err error) {
tv := NsecToTimeval(nsec)
- _, err := Select(0, nil, nil, nil, &tv)
+ _, err = Select(0, nil, nil, nil, &tv)
return err
}
-func Mkfifo(path string, mode uint32) (errno int) {
+func Mkfifo(path string, mode uint32) (err error) {
return Mknod(path, mode|S_IFIFO, 0)
}
@@ -199,7 +199,7 @@
var SocketDisableIPv6 bool
type Sockaddr interface {
- sockaddr() (ptr uintptr, len _Socklen, errno int) // lowercase; only we can define Sockaddrs
+ sockaddr() (ptr uintptr, len _Socklen, err error) // lowercase; only we can define Sockaddrs
}
type SockaddrInet4 struct {
@@ -208,7 +208,7 @@
raw RawSockaddrInet4
}
-func (sa *SockaddrInet4) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrInet4) sockaddr() (uintptr, _Socklen, error) {
if sa.Port < 0 || sa.Port > 0xFFFF {
return 0, 0, EINVAL
}
@@ -219,7 +219,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.raw.Addr[i] = sa.Addr[i]
}
- return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrInet4, 0
+ return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrInet4, nil
}
type SockaddrInet6 struct {
@@ -229,7 +229,7 @@
raw RawSockaddrInet6
}
-func (sa *SockaddrInet6) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrInet6) sockaddr() (uintptr, _Socklen, error) {
if sa.Port < 0 || sa.Port > 0xFFFF {
return 0, 0, EINVAL
}
@@ -241,7 +241,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.raw.Addr[i] = sa.Addr[i]
}
- return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrInet6, 0
+ return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrInet6, nil
}
type SockaddrUnix struct {
@@ -249,7 +249,7 @@
raw RawSockaddrUnix
}
-func (sa *SockaddrUnix) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrUnix) sockaddr() (uintptr, _Socklen, error) {
name := sa.Name
n := len(name)
if n >= len(sa.raw.Path) || n == 0 {
@@ -267,7 +267,7 @@
sl--
}
- return uintptr(unsafe.Pointer(&sa.raw)), sl, 0
+ return uintptr(unsafe.Pointer(&sa.raw)), sl, nil
}
type SockaddrLinklayer struct {
@@ -280,7 +280,7 @@
raw RawSockaddrLinklayer
}
-func (sa *SockaddrLinklayer) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrLinklayer) sockaddr() (uintptr, _Socklen, error) {
if sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff {
return 0, 0, EINVAL
}
@@ -293,7 +293,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.raw.Addr[i] = sa.Addr[i]
}
- return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrLinklayer, 0
+ return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrLinklayer, nil
}
type SockaddrNetlink struct {
@@ -304,15 +304,15 @@
raw RawSockaddrNetlink
}
-func (sa *SockaddrNetlink) sockaddr() (uintptr, _Socklen, int) {
+func (sa *SockaddrNetlink) sockaddr() (uintptr, _Socklen, error) {
sa.raw.Family = AF_NETLINK
sa.raw.Pad = sa.Pad
sa.raw.Pid = sa.Pid
sa.raw.Groups = sa.Groups
- return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrNetlink, 0
+ return uintptr(unsafe.Pointer(&sa.raw)), SizeofSockaddrNetlink, nil
}
-func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, int) {
+func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {
switch rsa.Addr.Family {
case AF_NETLINK:
pp := (*RawSockaddrNetlink)(unsafe.Pointer(rsa))
@@ -321,7 +321,7 @@
sa.Pad = pp.Pad
sa.Pid = pp.Pid
sa.Groups = pp.Groups
- return sa, 0
+ return sa, nil
case AF_PACKET:
pp := (*RawSockaddrLinklayer)(unsafe.Pointer(rsa))
@@ -334,7 +334,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
- return sa, 0
+ return sa, nil
case AF_UNIX:
pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
@@ -359,7 +359,7 @@
}
bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
sa.Name = string(bytes)
- return sa, 0
+ return sa, nil
case AF_INET:
pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
@@ -369,7 +369,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
- return sa, 0
+ return sa, nil
case AF_INET6:
pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
@@ -380,159 +380,159 @@
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
- return sa, 0
+ return sa, nil
}
return nil, EAFNOSUPPORT
}
-func Accept(fd int) (nfd int, sa Sockaddr, errno int) {
+func Accept(fd int) (nfd int, sa Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- nfd, errno = accept(fd, &rsa, &len)
- if errno != 0 {
+ nfd, err = accept(fd, &rsa, &len)
+ if err != nil {
return
}
- sa, errno = anyToSockaddr(&rsa)
- if errno != 0 {
+ sa, err = anyToSockaddr(&rsa)
+ if err != nil {
Close(nfd)
nfd = 0
}
return
}
-func Getsockname(fd int) (sa Sockaddr, errno int) {
+func Getsockname(fd int) (sa Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- if errno = getsockname(fd, &rsa, &len); errno != 0 {
+ if err = getsockname(fd, &rsa, &len); err != nil {
return
}
return anyToSockaddr(&rsa)
}
-func Getpeername(fd int) (sa Sockaddr, errno int) {
+func Getpeername(fd int) (sa Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- if errno = getpeername(fd, &rsa, &len); errno != 0 {
+ if err = getpeername(fd, &rsa, &len); err != nil {
return
}
return anyToSockaddr(&rsa)
}
-func Bind(fd int, sa Sockaddr) (errno int) {
+func Bind(fd int, sa Sockaddr) (err error) {
ptr, n, err := sa.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
return bind(fd, ptr, n)
}
-func Connect(fd int, sa Sockaddr) (errno int) {
+func Connect(fd int, sa Sockaddr) (err error) {
ptr, n, err := sa.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
return connect(fd, ptr, n)
}
-func Socket(domain, typ, proto int) (fd, errno int) {
+func Socket(domain, typ, proto int) (fd int, err error) {
if domain == AF_INET6 && SocketDisableIPv6 {
return -1, EAFNOSUPPORT
}
- fd, errno = socket(domain, typ, proto)
+ fd, err = socket(domain, typ, proto)
return
}
-func Socketpair(domain, typ, proto int) (fd [2]int, errno int) {
- errno = socketpair(domain, typ, proto, &fd)
+func Socketpair(domain, typ, proto int) (fd [2]int, err error) {
+ err = socketpair(domain, typ, proto, &fd)
return
}
-func GetsockoptInt(fd, level, opt int) (value, errno int) {
+func GetsockoptInt(fd, level, opt int) (value int, err error) {
var n int32
vallen := _Socklen(4)
- errno = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen)
- return int(n), errno
+ err = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen)
+ return int(n), err
}
-func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, errno int) {
+func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {
vallen := _Socklen(4)
- errno = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value[0])), &vallen)
- return value, errno
+ err = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value[0])), &vallen)
+ return value, err
}
-func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, int) {
+func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {
var value IPMreq
vallen := _Socklen(SizeofIPMreq)
- errno := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
- return &value, errno
+ err := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
+ return &value, err
}
-func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, int) {
+func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
var value IPMreqn
vallen := _Socklen(SizeofIPMreqn)
- errno := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
- return &value, errno
+ err := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
+ return &value, err
}
-func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, int) {
+func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {
var value IPv6Mreq
vallen := _Socklen(SizeofIPv6Mreq)
- errno := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
- return &value, errno
+ err := getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value)), &vallen)
+ return &value, err
}
-func SetsockoptInt(fd, level, opt int, value int) (errno int) {
+func SetsockoptInt(fd, level, opt int, value int) (err error) {
var n = int32(value)
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), 4)
}
-func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (errno int) {
+func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&value[0])), 4)
}
-func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (errno int) {
+func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(tv)), unsafe.Sizeof(*tv))
}
-func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int) {
+func SetsockoptLinger(fd, level, opt int, l *Linger) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l))
}
-func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (errno int) {
+func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(mreq)), unsafe.Sizeof(*mreq))
}
-func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (errno int) {
+func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(mreq)), unsafe.Sizeof(*mreq))
}
-func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (errno int) {
+func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(mreq)), unsafe.Sizeof(*mreq))
}
-func SetsockoptString(fd, level, opt int, s string) (errno int) {
+func SetsockoptString(fd, level, opt int, s string) (err error) {
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&[]byte(s)[0])), uintptr(len(s)))
}
-func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, errno int) {
+func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
- if n, errno = recvfrom(fd, p, flags, &rsa, &len); errno != 0 {
+ if n, err = recvfrom(fd, p, flags, &rsa, &len); err != nil {
return
}
- from, errno = anyToSockaddr(&rsa)
+ from, err = anyToSockaddr(&rsa)
return
}
-func Sendto(fd int, p []byte, flags int, to Sockaddr) (errno int) {
+func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) {
ptr, n, err := to.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
return sendto(fd, p, flags, ptr, n)
}
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, errno int) {
+func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
var msg Msghdr
var rsa RawSockaddrAny
msg.Name = (*byte)(unsafe.Pointer(&rsa))
@@ -554,25 +554,25 @@
}
msg.Iov = &iov
msg.Iovlen = 1
- if n, errno = recvmsg(fd, &msg, flags); errno != 0 {
+ if n, err = recvmsg(fd, &msg, flags); err != nil {
return
}
oobn = int(msg.Controllen)
recvflags = int(msg.Flags)
// source address is only specified if the socket is unconnected
if rsa.Addr.Family != AF_UNSPEC {
- from, errno = anyToSockaddr(&rsa)
+ from, err = anyToSockaddr(&rsa)
}
return
}
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (errno int) {
+func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
var ptr uintptr
var salen _Socklen
if to != nil {
- var err int
+ var err error
ptr, salen, err = to.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
}
@@ -596,20 +596,20 @@
}
msg.Iov = &iov
msg.Iovlen = 1
- if errno = sendmsg(fd, &msg, flags); errno != 0 {
+ if err = sendmsg(fd, &msg, flags); err != nil {
return
}
return
}
// BindToDevice binds the socket associated with fd to device.
-func BindToDevice(fd int, device string) (errno int) {
+func BindToDevice(fd int, device string) (err error) {
return SetsockoptString(fd, SOL_SOCKET, SO_BINDTODEVICE, device)
}
-//sys ptrace(request int, pid int, addr uintptr, data uintptr) (errno int)
+//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
-func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, errno int) {
+func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err error) {
// The peek requests are machine-size oriented, so we wrap it
// to retrieve arbitrary-length data.
@@ -625,9 +625,9 @@
// boundary.
n := 0
if addr%sizeofPtr != 0 {
- errno = ptrace(req, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0])))
- if errno != 0 {
- return 0, errno
+ err = ptrace(req, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0])))
+ if err != nil {
+ return 0, err
}
n += copy(out, buf[addr%sizeofPtr:])
out = out[n:]
@@ -637,27 +637,27 @@
for len(out) > 0 {
// We use an internal buffer to gaurantee alignment.
// It's not documented if this is necessary, but we're paranoid.
- errno = ptrace(req, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))
- if errno != 0 {
- return n, errno
+ err = ptrace(req, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))
+ if err != nil {
+ return n, err
}
copied := copy(out, buf[0:])
n += copied
out = out[copied:]
}
- return n, 0
+ return n, nil
}
-func PtracePeekText(pid int, addr uintptr, out []byte) (count int, errno int) {
+func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) {
return ptracePeek(PTRACE_PEEKTEXT, pid, addr, out)
}
-func PtracePeekData(pid int, addr uintptr, out []byte) (count int, errno int) {
+func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) {
return ptracePeek(PTRACE_PEEKDATA, pid, addr, out)
}
-func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, errno int) {
+func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, err error) {
// As for ptracePeek, we need to align our accesses to deal
// with the possibility of straddling an invalid page.
@@ -665,15 +665,15 @@
n := 0
if addr%sizeofPtr != 0 {
var buf [sizeofPtr]byte
- errno = ptrace(peekReq, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0])))
- if errno != 0 {
- return 0, errno
+ err = ptrace(peekReq, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0])))
+ if err != nil {
+ return 0, err
}
n += copy(buf[addr%sizeofPtr:], data)
word := *((*uintptr)(unsafe.Pointer(&buf[0])))
- errno = ptrace(pokeReq, pid, addr-addr%sizeofPtr, word)
- if errno != 0 {
- return 0, errno
+ err = ptrace(pokeReq, pid, addr-addr%sizeofPtr, word)
+ if err != nil {
+ return 0, err
}
data = data[n:]
}
@@ -681,9 +681,9 @@
// Interior.
for len(data) > sizeofPtr {
word := *((*uintptr)(unsafe.Pointer(&data[0])))
- errno = ptrace(pokeReq, pid, addr+uintptr(n), word)
- if errno != 0 {
- return n, errno
+ err = ptrace(pokeReq, pid, addr+uintptr(n), word)
+ if err != nil {
+ return n, err
}
n += sizeofPtr
data = data[sizeofPtr:]
@@ -692,61 +692,61 @@
// Trailing edge.
if len(data) > 0 {
var buf [sizeofPtr]byte
- errno = ptrace(peekReq, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))
- if errno != 0 {
- return n, errno
+ err = ptrace(peekReq, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))
+ if err != nil {
+ return n, err
}
copy(buf[0:], data)
word := *((*uintptr)(unsafe.Pointer(&buf[0])))
- errno = ptrace(pokeReq, pid, addr+uintptr(n), word)
- if errno != 0 {
- return n, errno
+ err = ptrace(pokeReq, pid, addr+uintptr(n), word)
+ if err != nil {
+ return n, err
}
n += len(data)
}
- return n, 0
+ return n, nil
}
-func PtracePokeText(pid int, addr uintptr, data []byte) (count int, errno int) {
+func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) {
return ptracePoke(PTRACE_POKETEXT, PTRACE_PEEKTEXT, pid, addr, data)
}
-func PtracePokeData(pid int, addr uintptr, data []byte) (count int, errno int) {
+func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) {
return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)
}
-func PtraceGetRegs(pid int, regsout *PtraceRegs) (errno int) {
+func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
}
-func PtraceSetRegs(pid int, regs *PtraceRegs) (errno int) {
+func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
}
-func PtraceSetOptions(pid int, options int) (errno int) {
+func PtraceSetOptions(pid int, options int) (err error) {
return ptrace(PTRACE_SETOPTIONS, pid, 0, uintptr(options))
}
-func PtraceGetEventMsg(pid int) (msg uint, errno int) {
+func PtraceGetEventMsg(pid int) (msg uint, err error) {
var data _C_long
- errno = ptrace(PTRACE_GETEVENTMSG, pid, 0, uintptr(unsafe.Pointer(&data)))
+ err = ptrace(PTRACE_GETEVENTMSG, pid, 0, uintptr(unsafe.Pointer(&data)))
msg = uint(data)
return
}
-func PtraceCont(pid int, signal int) (errno int) {
+func PtraceCont(pid int, signal int) (err error) {
return ptrace(PTRACE_CONT, pid, 0, uintptr(signal))
}
-func PtraceSingleStep(pid int) (errno int) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) }
+func PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) }
-func PtraceAttach(pid int) (errno int) { return ptrace(PTRACE_ATTACH, pid, 0, 0) }
+func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) }
-func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0) }
+func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0) }
-//sys reboot(magic1 uint, magic2 uint, cmd int, arg string) (errno int)
-func Reboot(cmd int) (errno int) {
+//sys reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error)
+func Reboot(cmd int) (err error) {
return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "")
}
@@ -759,7 +759,7 @@
return len(n)
}
-func ReadDirent(fd int, buf []byte) (n int, errno int) {
+func ReadDirent(fd int, buf []byte) (n int, err error) {
return Getdents(fd, buf)
}
@@ -784,8 +784,8 @@
return origlen - len(buf), count, names
}
-//sys mount(source string, target string, fstype string, flags uintptr, data *byte) (errno int)
-func Mount(source string, target string, fstype string, flags uintptr, data string) (errno int) {
+//sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error)
+func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
// Certain file systems get rather angry and EINVAL if you give
// them an empty string of data, rather than NULL.
if data == "" {
@@ -801,85 +801,85 @@
/*
* Direct access
*/
-//sys Access(path string, mode uint32) (errno int)
-//sys Acct(path string) (errno int)
-//sys Adjtimex(buf *Timex) (state int, errno int)
-//sys Chdir(path string) (errno int)
-//sys Chmod(path string, mode uint32) (errno int)
-//sys Chroot(path string) (errno int)
-//sys Close(fd int) (errno int)
-//sys Creat(path string, mode uint32) (fd int, errno int)
-//sysnb Dup(oldfd int) (fd int, errno int)
-//sysnb Dup2(oldfd int, newfd int) (fd int, errno int)
-//sysnb EpollCreate(size int) (fd int, errno int)
-//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int)
-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int)
+//sys Access(path string, mode uint32) (err error)
+//sys Acct(path string) (err error)
+//sys Adjtimex(buf *Timex) (state int, err error)
+//sys Chdir(path string) (err error)
+//sys Chmod(path string, mode uint32) (err error)
+//sys Chroot(path string) (err error)
+//sys Close(fd int) (err error)
+//sys Creat(path string, mode uint32) (fd int, err error)
+//sysnb Dup(oldfd int) (fd int, err error)
+//sysnb Dup2(oldfd int, newfd int) (fd int, err error)
+//sysnb EpollCreate(size int) (fd int, err error)
+//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
+//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
//sys Exit(code int) = SYS_EXIT_GROUP
-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (errno int)
-//sys Fallocate(fd int, mode uint32, off int64, len int64) (errno int)
-//sys Fchdir(fd int) (errno int)
-//sys Fchmod(fd int, mode uint32) (errno int)
-//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (errno int)
-//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (errno int)
-//sys fcntl(fd int, cmd int, arg int) (val int, errno int)
-//sys Fdatasync(fd int) (errno int)
-//sys Flock(fd int, how int) (errno int)
-//sys Fsync(fd int) (errno int)
-//sys Getdents(fd int, buf []byte) (n int, errno int) = SYS_GETDENTS64
-//sysnb Getpgid(pid int) (pgid int, errno int)
+//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
+//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
+//sys Fchdir(fd int) (err error)
+//sys Fchmod(fd int, mode uint32) (err error)
+//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
+//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
+//sys fcntl(fd int, cmd int, arg int) (val int, err error)
+//sys Fdatasync(fd int) (err error)
+//sys Flock(fd int, how int) (err error)
+//sys Fsync(fd int) (err error)
+//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
+//sysnb Getpgid(pid int) (pgid int, err error)
//sysnb Getpgrp() (pid int)
//sysnb Getpid() (pid int)
//sysnb Getppid() (ppid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (errno int)
-//sysnb Getrusage(who int, rusage *Rusage) (errno int)
+//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb Getrusage(who int, rusage *Rusage) (err error)
//sysnb Gettid() (tid int)
-//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int)
-//sysnb InotifyInit() (fd int, errno int)
-//sysnb InotifyInit1(flags int) (fd int, errno int)
-//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int)
-//sysnb Kill(pid int, sig int) (errno int)
-//sys Klogctl(typ int, buf []byte) (n int, errno int) = SYS_SYSLOG
-//sys Link(oldpath string, newpath string) (errno int)
-//sys Mkdir(path string, mode uint32) (errno int)
-//sys Mkdirat(dirfd int, path string, mode uint32) (errno int)
-//sys Mknod(path string, mode uint32, dev int) (errno int)
-//sys Mknodat(dirfd int, path string, mode uint32, dev int) (errno int)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (errno int)
-//sys Pause() (errno int)
-//sys PivotRoot(newroot string, putold string) (errno int) = SYS_PIVOT_ROOT
-//sys Read(fd int, p []byte) (n int, errno int)
-//sys Readlink(path string, buf []byte) (n int, errno int)
-//sys Rename(oldpath string, newpath string) (errno int)
-//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (errno int)
-//sys Rmdir(path string) (errno int)
-//sys Setdomainname(p []byte) (errno int)
-//sys Sethostname(p []byte) (errno int)
-//sysnb Setpgid(pid int, pgid int) (errno int)
-//sysnb Setrlimit(resource int, rlim *Rlimit) (errno int)
-//sysnb Setsid() (pid int, errno int)
-//sysnb Settimeofday(tv *Timeval) (errno int)
-//sysnb Setuid(uid int) (errno int)
-//sys Symlink(oldpath string, newpath string) (errno int)
+//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)
+//sysnb InotifyInit() (fd int, err error)
+//sysnb InotifyInit1(flags int) (fd int, err error)
+//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)
+//sysnb Kill(pid int, sig int) (err error)
+//sys Klogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG
+//sys Link(oldpath string, newpath string) (err error)
+//sys Mkdir(path string, mode uint32) (err error)
+//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
+//sys Mknod(path string, mode uint32, dev int) (err error)
+//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
+//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
+//sys Pause() (err error)
+//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
+//sys Read(fd int, p []byte) (n int, err error)
+//sys Readlink(path string, buf []byte) (n int, err error)
+//sys Rename(oldpath string, newpath string) (err error)
+//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
+//sys Rmdir(path string) (err error)
+//sys Setdomainname(p []byte) (err error)
+//sys Sethostname(p []byte) (err error)
+//sysnb Setpgid(pid int, pgid int) (err error)
+//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb Setsid() (pid int, err error)
+//sysnb Settimeofday(tv *Timeval) (err error)
+//sysnb Setuid(uid int) (err error)
+//sys Symlink(oldpath string, newpath string) (err error)
//sys Sync()
-//sysnb Sysinfo(info *Sysinfo_t) (errno int)
-//sys Tee(rfd int, wfd int, len int, flags int) (n int64, errno int)
-//sysnb Tgkill(tgid int, tid int, sig int) (errno int)
-//sysnb Times(tms *Tms) (ticks uintptr, errno int)
+//sysnb Sysinfo(info *Sysinfo_t) (err error)
+//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
+//sysnb Tgkill(tgid int, tid int, sig int) (err error)
+//sysnb Times(tms *Tms) (ticks uintptr, err error)
//sysnb Umask(mask int) (oldmask int)
-//sysnb Uname(buf *Utsname) (errno int)
-//sys Unlink(path string) (errno int)
-//sys Unlinkat(dirfd int, path string) (errno int)
-//sys Unmount(target string, flags int) (errno int) = SYS_UMOUNT2
-//sys Unshare(flags int) (errno int)
-//sys Ustat(dev int, ubuf *Ustat_t) (errno int)
-//sys Utime(path string, buf *Utimbuf) (errno int)
-//sys Write(fd int, p []byte) (n int, errno int)
-//sys exitThread(code int) (errno int) = SYS_EXIT
-//sys read(fd int, p *byte, np int) (n int, errno int)
-//sys write(fd int, p *byte, np int) (n int, errno int)
+//sysnb Uname(buf *Utsname) (err error)
+//sys Unlink(path string) (err error)
+//sys Unlinkat(dirfd int, path string) (err error)
+//sys Unmount(target string, flags int) (err error) = SYS_UMOUNT2
+//sys Unshare(flags int) (err error)
+//sys Ustat(dev int, ubuf *Ustat_t) (err error)
+//sys Utime(path string, buf *Utimbuf) (err error)
+//sys Write(fd int, p []byte) (n int, err error)
+//sys exitThread(code int) (err error) = SYS_EXIT
+//sys read(fd int, p *byte, np int) (n int, err error)
+//sys write(fd int, p *byte, np int) (n int, err error)
// mmap varies by architecture; see syscall_linux_*.go.
-//sys munmap(addr uintptr, length uintptr) (errno int)
+//sys munmap(addr uintptr, length uintptr) (err error)
var mapper = &mmapper{
active: make(map[*byte][]byte),
@@ -887,20 +887,20 @@
munmap: munmap,
}
-func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, errno int) {
+func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
return mapper.Mmap(fd, offset, length, prot, flags)
}
-func Munmap(b []byte) (errno int) {
+func Munmap(b []byte) (err error) {
return mapper.Munmap(b)
}
-//sys Madvise(b []byte, advice int) (errno int)
-//sys Mprotect(b []byte, prot int) (errno int)
-//sys Mlock(b []byte) (errno int)
-//sys Munlock(b []byte) (errno int)
-//sys Mlockall(flags int) (errno int)
-//sys Munlockall() (errno int)
+//sys Madvise(b []byte, advice int) (err error)
+//sys Mprotect(b []byte, prot int) (err error)
+//sys Mlock(b []byte) (err error)
+//sys Munlock(b []byte) (err error)
+//sys Mlockall(flags int) (err error)
+//sys Munlockall() (err error)
/*
* Unimplemented
diff --git a/src/pkg/syscall/syscall_linux_386.go b/src/pkg/syscall/syscall_linux_386.go
index 44891de..b833db8 100644
--- a/src/pkg/syscall/syscall_linux_386.go
+++ b/src/pkg/syscall/syscall_linux_386.go
@@ -27,39 +27,39 @@
// 64-bit file system and 32-bit uid calls
// (386 default is 32-bit file system and 16-bit uid).
-//sys Chown(path string, uid int, gid int) (errno int) = SYS_CHOWN32
-//sys Fchown(fd int, uid int, gid int) (errno int) = SYS_FCHOWN32
-//sys Fstat(fd int, stat *Stat_t) (errno int) = SYS_FSTAT64
-//sys Ftruncate(fd int, length int64) (errno int) = SYS_FTRUNCATE64
+//sys Chown(path string, uid int, gid int) (err error) = SYS_CHOWN32
+//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
+//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
+//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
//sysnb Getegid() (egid int) = SYS_GETEGID32
//sysnb Geteuid() (euid int) = SYS_GETEUID32
//sysnb Getgid() (gid int) = SYS_GETGID32
//sysnb Getuid() (uid int) = SYS_GETUID32
-//sys Ioperm(from int, num int, on int) (errno int)
-//sys Iopl(level int) (errno int)
-//sys Lchown(path string, uid int, gid int) (errno int) = SYS_LCHOWN32
-//sys Lstat(path string, stat *Stat_t) (errno int) = SYS_LSTAT64
-//sys Pread(fd int, p []byte, offset int64) (n int, errno int) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, errno int) = SYS_PWRITE64
-//sys Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) = SYS_SENDFILE64
-//sys Setfsgid(gid int) (errno int) = SYS_SETFSGID32
-//sys Setfsuid(uid int) (errno int) = SYS_SETFSUID32
-//sysnb Setgid(gid int) (errno int) = SYS_SETGID32
-//sysnb Setregid(rgid int, egid int) (errno int) = SYS_SETREGID32
-//sysnb Setresgid(rgid int, egid int, sgid int) (errno int) = SYS_SETRESGID32
-//sysnb Setresuid(ruid int, euid int, suid int) (errno int) = SYS_SETRESUID32
-//sysnb Setreuid(ruid int, euid int) (errno int) = SYS_SETREUID32
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int)
-//sys Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int)
-//sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64
-//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32
-//sysnb setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) = SYS__NEWSELECT
+//sys Ioperm(from int, num int, on int) (err error)
+//sys Iopl(level int) (err error)
+//sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32
+//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
+//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
+//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
+//sys Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
+//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32
+//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32
+//sysnb Setgid(gid int) (err error) = SYS_SETGID32
+//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
+//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
+//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
+//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32
+//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
+//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
+//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
+//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
+//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32
+//sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
-//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, errno int)
+//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)
-func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
page := uintptr(offset / 4096)
if offset != int64(page)*4096 {
return 0, EINVAL
@@ -69,11 +69,11 @@
// Underlying system call writes to newoffset via pointer.
// Implemented in assembly to avoid allocation.
-func Seek(fd int, offset int64, whence int) (newoffset int64, errno int)
+func Seek(fd int, offset int64, whence int) (newoffset int64, err error)
// Vsyscalls on amd64.
-//sysnb Gettimeofday(tv *Timeval) (errno int)
-//sysnb Time(t *Time_t) (tt Time_t, errno int)
+//sysnb Gettimeofday(tv *Timeval) (err error)
+//sysnb Time(t *Time_t) (tt Time_t, err error)
// On x86 Linux, all the socket calls go through an extra indirection,
// I think because the 5-register system call interface can't handle
@@ -103,101 +103,150 @@
_RECVMSG = 17
)
-func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int)
-func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int)
+func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err Errno)
+func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err Errno)
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
- fd, errno = socketcall(_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
+ fd, e := socketcall(_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
- _, errno = rawsocketcall(_GETSOCKNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
+func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
+ _, e := rawsocketcall(_GETSOCKNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
- _, errno = rawsocketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
+func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
+ _, e := rawsocketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func socketpair(domain int, typ int, flags int, fd *[2]int) (errno int) {
- _, errno = rawsocketcall(_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)
+func socketpair(domain int, typ int, flags int, fd *[2]int) (err error) {
+ _, e := rawsocketcall(_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
- _, errno = socketcall(_BIND, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
+func bind(s int, addr uintptr, addrlen _Socklen) (err error) {
+ _, e := socketcall(_BIND, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
- _, errno = socketcall(_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
+func connect(s int, addr uintptr, addrlen _Socklen) (err error) {
+ _, e := socketcall(_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func socket(domain int, typ int, proto int) (fd int, errno int) {
- fd, errno = rawsocketcall(_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
+func socket(domain int, typ int, proto int) (fd int, err error) {
+ fd, e := rawsocketcall(_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) {
- _, errno = socketcall(_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
+func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) {
+ _, e := socketcall(_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
- _, errno = socketcall(_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), val, vallen, 0)
+func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) {
+ _, e := socketcall(_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), val, vallen, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
+func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var base uintptr
if len(p) > 0 {
base = uintptr(unsafe.Pointer(&p[0]))
}
- n, errno = socketcall(_RECVFROM, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
+ n, e := socketcall(_RECVFROM, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
+ if e != 0 {
+ err = e
+ }
return
}
-func sendto(s int, p []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
+func sendto(s int, p []byte, flags int, to uintptr, addrlen _Socklen) (err error) {
var base uintptr
if len(p) > 0 {
base = uintptr(unsafe.Pointer(&p[0]))
}
- _, errno = socketcall(_SENDTO, uintptr(s), base, uintptr(len(p)), uintptr(flags), to, uintptr(addrlen))
+ _, e := socketcall(_SENDTO, uintptr(s), base, uintptr(len(p)), uintptr(flags), to, uintptr(addrlen))
+ if e != 0 {
+ err = e
+ }
return
}
-func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
- n, errno = socketcall(_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
+func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
+ n, e := socketcall(_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
- _, errno = socketcall(_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
+func sendmsg(s int, msg *Msghdr, flags int) (err error) {
+ _, e := socketcall(_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func Listen(s int, n int) (errno int) {
- _, errno = socketcall(_LISTEN, uintptr(s), uintptr(n), 0, 0, 0, 0)
+func Listen(s int, n int) (err error) {
+ _, e := socketcall(_LISTEN, uintptr(s), uintptr(n), 0, 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func Shutdown(s, how int) (errno int) {
- _, errno = socketcall(_SHUTDOWN, uintptr(s), uintptr(how), 0, 0, 0, 0)
+func Shutdown(s, how int) (err error) {
+ _, e := socketcall(_SHUTDOWN, uintptr(s), uintptr(how), 0, 0, 0, 0)
+ if e != 0 {
+ err = e
+ }
return
}
-func Fstatfs(fd int, buf *Statfs_t) (errno int) {
- _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- errno = int(e1)
+func Fstatfs(fd int, buf *Statfs_t) (err error) {
+ _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
+ if e != 0 {
+ err = e
+ }
return
}
-func Statfs(path string, buf *Statfs_t) (errno int) {
- _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(StringBytePtr(path))), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
- errno = int(e1)
+func Statfs(path string, buf *Statfs_t) (err error) {
+ _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(StringBytePtr(path))), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
+ if e != 0 {
+ err = e
+ }
return
}
diff --git a/src/pkg/syscall/syscall_linux_amd64.go b/src/pkg/syscall/syscall_linux_amd64.go
index 8b206ad..18b36b7 100644
--- a/src/pkg/syscall/syscall_linux_amd64.go
+++ b/src/pkg/syscall/syscall_linux_amd64.go
@@ -4,59 +4,59 @@
package syscall
-//sys Chown(path string, uid int, gid int) (errno int)
-//sys Fchown(fd int, uid int, gid int) (errno int)
-//sys Fstat(fd int, stat *Stat_t) (errno int)
-//sys Fstatfs(fd int, buf *Statfs_t) (errno int)
-//sys Ftruncate(fd int, length int64) (errno int)
+//sys Chown(path string, uid int, gid int) (err error)
+//sys Fchown(fd int, uid int, gid int) (err error)
+//sys Fstat(fd int, stat *Stat_t) (err error)
+//sys Fstatfs(fd int, buf *Statfs_t) (err error)
+//sys Ftruncate(fd int, length int64) (err error)
//sysnb Getegid() (egid int)
//sysnb Geteuid() (euid int)
//sysnb Getgid() (gid int)
//sysnb Getuid() (uid int)
-//sys Ioperm(from int, num int, on int) (errno int)
-//sys Iopl(level int) (errno int)
-//sys Lchown(path string, uid int, gid int) (errno int)
-//sys Listen(s int, n int) (errno int)
-//sys Lstat(path string, stat *Stat_t) (errno int)
-//sys Pread(fd int, p []byte, offset int64) (n int, errno int) = SYS_PREAD64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, errno int) = SYS_PWRITE64
-//sys Seek(fd int, offset int64, whence int) (off int64, errno int) = SYS_LSEEK
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int)
-//sys Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int)
-//sys Setfsgid(gid int) (errno int)
-//sys Setfsuid(uid int) (errno int)
-//sysnb Setgid(gid int) (errno int)
-//sysnb Setregid(rgid int, egid int) (errno int)
-//sysnb Setresgid(rgid int, egid int, sgid int) (errno int)
-//sysnb Setresuid(ruid int, euid int, suid int) (errno int)
-//sysnb Setreuid(ruid int, euid int) (errno int)
-//sys Shutdown(fd int, how int) (errno int)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int)
-//sys Stat(path string, stat *Stat_t) (errno int)
-//sys Statfs(path string, buf *Statfs_t) (errno int)
-//sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int)
-//sys Truncate(path string, length int64) (errno int)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int)
-//sys bind(s int, addr uintptr, addrlen _Socklen) (errno int)
-//sys connect(s int, addr uintptr, addrlen _Socklen) (errno int)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int)
-//sysnb setgroups(n int, list *_Gid_t) (errno int)
-//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int)
-//sys setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int)
-//sysnb socket(domain int, typ int, proto int) (fd int, errno int)
-//sysnb socketpair(domain int, typ int, proto int, fd *[2]int) (errno int)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int)
-//sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, errno int)
-//sys sendmsg(s int, msg *Msghdr, flags int) (errno int)
-//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, errno int)
+//sys Ioperm(from int, num int, on int) (err error)
+//sys Iopl(level int) (err error)
+//sys Lchown(path string, uid int, gid int) (err error)
+//sys Listen(s int, n int) (err error)
+//sys Lstat(path string, stat *Stat_t) (err error)
+//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
+//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
+//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
+//sys Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
+//sys Setfsgid(gid int) (err error)
+//sys Setfsuid(uid int) (err error)
+//sysnb Setgid(gid int) (err error)
+//sysnb Setregid(rgid int, egid int) (err error)
+//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
+//sysnb Setresuid(ruid int, euid int, suid int) (err error)
+//sysnb Setreuid(ruid int, euid int) (err error)
+//sys Shutdown(fd int, how int) (err error)
+//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
+//sys Stat(path string, stat *Stat_t) (err error)
+//sys Statfs(path string, buf *Statfs_t) (err error)
+//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
+//sys Truncate(path string, length int64) (err error)
+//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
+//sys bind(s int, addr uintptr, addrlen _Socklen) (err error)
+//sys connect(s int, addr uintptr, addrlen _Socklen) (err error)
+//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
+//sysnb setgroups(n int, list *_Gid_t) (err error)
+//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error)
+//sys setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error)
+//sysnb socket(domain int, typ int, proto int) (fd int, err error)
+//sysnb socketpair(domain int, typ int, proto int, fd *[2]int) (err error)
+//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
+//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
+//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
+//sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error)
+//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
+//sys sendmsg(s int, msg *Msghdr, flags int) (err error)
+//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
func Getpagesize() int { return 4096 }
-func Gettimeofday(tv *Timeval) (errno int)
-func Time(t *Time_t) (tt Time_t, errno int)
+func Gettimeofday(tv *Timeval) (err error)
+func Time(t *Time_t) (tt Time_t, err error)
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
diff --git a/src/pkg/syscall/syscall_linux_arm.go b/src/pkg/syscall/syscall_linux_arm.go
index 8c03c76..50281582 100644
--- a/src/pkg/syscall/syscall_linux_arm.go
+++ b/src/pkg/syscall/syscall_linux_arm.go
@@ -25,7 +25,7 @@
// Pread and Pwrite are special: they insert padding before the int64.
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -36,7 +36,7 @@
return
}
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -47,7 +47,7 @@
return
}
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
// ARM EABI requires 64-bit arguments should be put in a pair
// of registers from an even register number.
_, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
@@ -55,7 +55,7 @@
return
}
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, uintptr(length), uintptr(length>>32), 0, 0)
errno = int(e1)
return
@@ -63,56 +63,56 @@
// Seek is defined in assembly.
-func Seek(fd int, offset int64, whence int) (newoffset int64, errno int)
+func Seek(fd int, offset int64, whence int) (newoffset int64, err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int)
-//sys bind(s int, addr uintptr, addrlen _Socklen) (errno int)
-//sys connect(s int, addr uintptr, addrlen _Socklen) (errno int)
-//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32
-//sysnb setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32
-//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int)
-//sys setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int)
-//sysnb socket(domain int, typ int, proto int) (fd int, errno int)
-//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
-//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
-//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int)
-//sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int)
-//sysnb socketpair(domain int, typ int, flags int, fd *[2]int) (errno int)
-//sys recvmsg(s int, msg *Msghdr, flags int) (n int, errno int)
-//sys sendmsg(s int, msg *Msghdr, flags int) (errno int)
+//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
+//sys bind(s int, addr uintptr, addrlen _Socklen) (err error)
+//sys connect(s int, addr uintptr, addrlen _Socklen) (err error)
+//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32
+//sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32
+//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error)
+//sys setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error)
+//sysnb socket(domain int, typ int, proto int) (fd int, err error)
+//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
+//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
+//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
+//sys sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error)
+//sysnb socketpair(domain int, typ int, flags int, fd *[2]int) (err error)
+//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
+//sys sendmsg(s int, msg *Msghdr, flags int) (err error)
-//sys Chown(path string, uid int, gid int) (errno int)
-//sys Fchown(fd int, uid int, gid int) (errno int)
-//sys Fstat(fd int, stat *Stat_t) (errno int) = SYS_FSTAT64
-//sys Fstatfs(fd int, buf *Statfs_t) (errno int) = SYS_FSTATFS64
+//sys Chown(path string, uid int, gid int) (err error)
+//sys Fchown(fd int, uid int, gid int) (err error)
+//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
+//sys Fstatfs(fd int, buf *Statfs_t) (err error) = SYS_FSTATFS64
//sysnb Getegid() (egid int)
//sysnb Geteuid() (euid int)
//sysnb Getgid() (gid int)
//sysnb Getuid() (uid int)
-//sys Lchown(path string, uid int, gid int) (errno int)
-//sys Listen(s int, n int) (errno int)
-//sys Lstat(path string, stat *Stat_t) (errno int) = SYS_LSTAT64
-//sys Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) = SYS_SENDFILE64
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) = SYS__NEWSELECT
-//sys Setfsgid(gid int) (errno int)
-//sys Setfsuid(uid int) (errno int)
-//sysnb Setgid(gid int) (errno int)
-//sysnb Setregid(rgid int, egid int) (errno int)
-//sysnb Setresgid(rgid int, egid int, sgid int) (errno int)
-//sysnb Setresuid(ruid int, euid int, suid int) (errno int)
-//sysnb Setreuid(ruid int, euid int) (errno int)
-//sys Shutdown(fd int, how int) (errno int)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int)
-//sys Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64
-//sys Statfs(path string, buf *Statfs_t) (errno int) = SYS_STATFS64
+//sys Lchown(path string, uid int, gid int) (err error)
+//sys Listen(s int, n int) (err error)
+//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
+//sys Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
+//sys Setfsgid(gid int) (err error)
+//sys Setfsuid(uid int) (err error)
+//sysnb Setgid(gid int) (err error)
+//sysnb Setregid(rgid int, egid int) (err error)
+//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
+//sysnb Setresuid(ruid int, euid int, suid int) (err error)
+//sysnb Setreuid(ruid int, euid int) (err error)
+//sys Shutdown(fd int, how int) (err error)
+//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
+//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
+//sys Statfs(path string, buf *Statfs_t) (err error) = SYS_STATFS64
// Vsyscalls on amd64.
-//sysnb Gettimeofday(tv *Timeval) (errno int)
-//sysnb Time(t *Time_t) (tt Time_t, errno int)
+//sysnb Gettimeofday(tv *Timeval) (err error)
+//sysnb Time(t *Time_t) (tt Time_t, err error)
-//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, errno int)
+//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)
-func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
page := uintptr(offset / 4096)
if offset != int64(page)*4096 {
return 0, EINVAL
diff --git a/src/pkg/syscall/syscall_openbsd.go b/src/pkg/syscall/syscall_openbsd.go
index da1bd4d..805fbe1 100644
--- a/src/pkg/syscall/syscall_openbsd.go
+++ b/src/pkg/syscall/syscall_openbsd.go
@@ -28,7 +28,7 @@
raw RawSockaddrDatalink
}
-func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr)
+func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
// ParseDirent parses up to max directory entries in buf,
// appending the names to names. It returns the number
@@ -58,109 +58,109 @@
return origlen - len(buf), count, names
}
-//sysnb pipe(p *[2]_C_int) (errno int)
-func Pipe(p []int) (errno int) {
+//sysnb pipe(p *[2]_C_int) (err error)
+func Pipe(p []int) (err error) {
if len(p) != 2 {
return EINVAL
}
var pp [2]_C_int
- errno = pipe(&pp)
+ err = pipe(&pp)
p[0] = int(pp[0])
p[1] = int(pp[1])
return
}
// TODO
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
return -1, ENOSYS
}
/*
* Exposed directly
*/
-//sys Access(path string, mode uint32) (errno int)
-//sys Adjtime(delta *Timeval, olddelta *Timeval) (errno int)
-//sys Chdir(path string) (errno int)
-//sys Chflags(path string, flags int) (errno int)
-//sys Chmod(path string, mode uint32) (errno int)
-//sys Chown(path string, uid int, gid int) (errno int)
-//sys Chroot(path string) (errno int)
-//sys Close(fd int) (errno int)
-//sysnb Dup(fd int) (nfd int, errno int)
-//sysnb Dup2(from int, to int) (errno int)
+//sys Access(path string, mode uint32) (err error)
+//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
+//sys Chdir(path string) (err error)
+//sys Chflags(path string, flags int) (err error)
+//sys Chmod(path string, mode uint32) (err error)
+//sys Chown(path string, uid int, gid int) (err error)
+//sys Chroot(path string) (err error)
+//sys Close(fd int) (err error)
+//sysnb Dup(fd int) (nfd int, err error)
+//sysnb Dup2(from int, to int) (err error)
//sys Exit(code int)
-//sys Fchdir(fd int) (errno int)
-//sys Fchflags(path string, flags int) (errno int)
-//sys Fchmod(fd int, mode uint32) (errno int)
-//sys Fchown(fd int, uid int, gid int) (errno int)
-//sys Flock(fd int, how int) (errno int)
-//sys Fpathconf(fd int, name int) (val int, errno int)
-//sys Fstat(fd int, stat *Stat_t) (errno int)
-//sys Fstatfs(fd int, stat *Statfs_t) (errno int)
-//sys Fsync(fd int) (errno int)
-//sys Ftruncate(fd int, length int64) (errno int)
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int)
+//sys Fchdir(fd int) (err error)
+//sys Fchflags(path string, flags int) (err error)
+//sys Fchmod(fd int, mode uint32) (err error)
+//sys Fchown(fd int, uid int, gid int) (err error)
+//sys Flock(fd int, how int) (err error)
+//sys Fpathconf(fd int, name int) (val int, err error)
+//sys Fstat(fd int, stat *Stat_t) (err error)
+//sys Fstatfs(fd int, stat *Statfs_t) (err error)
+//sys Fsync(fd int) (err error)
+//sys Ftruncate(fd int, length int64) (err error)
+//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
//sysnb Getegid() (egid int)
//sysnb Geteuid() (uid int)
-//sys Getfsstat(buf []Statfs_t, flags int) (n int, errno int)
+//sys Getfsstat(buf []Statfs_t, flags int) (n int, err error)
//sysnb Getgid() (gid int)
-//sysnb Getpgid(pid int) (pgid int, errno int)
+//sysnb Getpgid(pid int) (pgid int, err error)
//sysnb Getpgrp() (pgrp int)
//sysnb Getpid() (pid int)
//sysnb Getppid() (ppid int)
-//sys Getpriority(which int, who int) (prio int, errno int)
-//sysnb Getrlimit(which int, lim *Rlimit) (errno int)
-//sysnb Getrusage(who int, rusage *Rusage) (errno int)
-//sysnb Getsid(pid int) (sid int, errno int)
-//sysnb Gettimeofday(tv *Timeval) (errno int)
+//sys Getpriority(which int, who int) (prio int, err error)
+//sysnb Getrlimit(which int, lim *Rlimit) (err error)
+//sysnb Getrusage(who int, rusage *Rusage) (err error)
+//sysnb Getsid(pid int) (sid int, err error)
+//sysnb Gettimeofday(tv *Timeval) (err error)
//sysnb Getuid() (uid int)
//sys Issetugid() (tainted bool)
-//sys Kill(pid int, signum int) (errno int)
-//sys Kqueue() (fd int, errno int)
-//sys Lchown(path string, uid int, gid int) (errno int)
-//sys Link(path string, link string) (errno int)
-//sys Listen(s int, backlog int) (errno int)
-//sys Lstat(path string, stat *Stat_t) (errno int)
-//sys Mkdir(path string, mode uint32) (errno int)
-//sys Mkfifo(path string, mode uint32) (errno int)
-//sys Mknod(path string, mode uint32, dev int) (errno int)
-//sys Nanosleep(time *Timespec, leftover *Timespec) (errno int)
-//sys Open(path string, mode int, perm uint32) (fd int, errno int)
-//sys Pathconf(path string, name int) (val int, errno int)
-//sys Pread(fd int, p []byte, offset int64) (n int, errno int)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, errno int)
-//sys Read(fd int, p []byte) (n int, errno int)
-//sys Readlink(path string, buf []byte) (n int, errno int)
-//sys Rename(from string, to string) (errno int)
-//sys Revoke(path string) (errno int)
-//sys Rmdir(path string) (errno int)
-//sys Seek(fd int, offset int64, whence int) (newoffset int64, errno int) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int)
-//sysnb Setegid(egid int) (errno int)
-//sysnb Seteuid(euid int) (errno int)
-//sysnb Setgid(gid int) (errno int)
-//sys Setlogin(name string) (errno int)
-//sysnb Setpgid(pid int, pgid int) (errno int)
-//sys Setpriority(which int, who int, prio int) (errno int)
-//sysnb Setregid(rgid int, egid int) (errno int)
-//sysnb Setreuid(ruid int, euid int) (errno int)
-//sysnb Setrlimit(which int, lim *Rlimit) (errno int)
-//sysnb Setsid() (pid int, errno int)
-//sysnb Settimeofday(tp *Timeval) (errno int)
-//sysnb Setuid(uid int) (errno int)
-//sys Stat(path string, stat *Stat_t) (errno int)
-//sys Statfs(path string, stat *Statfs_t) (errno int)
-//sys Symlink(path string, link string) (errno int)
-//sys Sync() (errno int)
-//sys Truncate(path string, length int64) (errno int)
+//sys Kill(pid int, signum int) (err error)
+//sys Kqueue() (fd int, err error)
+//sys Lchown(path string, uid int, gid int) (err error)
+//sys Link(path string, link string) (err error)
+//sys Listen(s int, backlog int) (err error)
+//sys Lstat(path string, stat *Stat_t) (err error)
+//sys Mkdir(path string, mode uint32) (err error)
+//sys Mkfifo(path string, mode uint32) (err error)
+//sys Mknod(path string, mode uint32, dev int) (err error)
+//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
+//sys Open(path string, mode int, perm uint32) (fd int, err error)
+//sys Pathconf(path string, name int) (val int, err error)
+//sys Pread(fd int, p []byte, offset int64) (n int, err error)
+//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
+//sys Read(fd int, p []byte) (n int, err error)
+//sys Readlink(path string, buf []byte) (n int, err error)
+//sys Rename(from string, to string) (err error)
+//sys Revoke(path string) (err error)
+//sys Rmdir(path string) (err error)
+//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
+//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sysnb Setegid(egid int) (err error)
+//sysnb Seteuid(euid int) (err error)
+//sysnb Setgid(gid int) (err error)
+//sys Setlogin(name string) (err error)
+//sysnb Setpgid(pid int, pgid int) (err error)
+//sys Setpriority(which int, who int, prio int) (err error)
+//sysnb Setregid(rgid int, egid int) (err error)
+//sysnb Setreuid(ruid int, euid int) (err error)
+//sysnb Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb Setsid() (pid int, err error)
+//sysnb Settimeofday(tp *Timeval) (err error)
+//sysnb Setuid(uid int) (err error)
+//sys Stat(path string, stat *Stat_t) (err error)
+//sys Statfs(path string, stat *Statfs_t) (err error)
+//sys Symlink(path string, link string) (err error)
+//sys Sync() (err error)
+//sys Truncate(path string, length int64) (err error)
//sys Umask(newmask int) (oldmask int)
-//sys Unlink(path string) (errno int)
-//sys Unmount(path string, flags int) (errno int)
-//sys Write(fd int, p []byte) (n int, errno int)
-//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int)
-//sys munmap(addr uintptr, length uintptr) (errno int)
-//sys read(fd int, buf *byte, nbuf int) (n int, errno int)
-//sys write(fd int, buf *byte, nbuf int) (n int, errno int)
+//sys Unlink(path string) (err error)
+//sys Unmount(path string, flags int) (err error)
+//sys Write(fd int, p []byte) (n int, err error)
+//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
+//sys munmap(addr uintptr, length uintptr) (err error)
+//sys read(fd int, buf *byte, nbuf int) (n int, err error)
+//sys write(fd int, buf *byte, nbuf int) (n int, err error)
/*
* Unimplemented
diff --git a/src/pkg/syscall/syscall_plan9.go b/src/pkg/syscall/syscall_plan9.go
index 0cc8ee95..0409a04 100644
--- a/src/pkg/syscall/syscall_plan9.go
+++ b/src/pkg/syscall/syscall_plan9.go
@@ -17,11 +17,6 @@
const ImplementsGetwd = true
-// An Error can represent any printable error condition.
-type Error interface {
- error
-}
-
// ErrorString implements Error's String method by returning itself.
type ErrorString string
diff --git a/src/pkg/syscall/syscall_unix.go b/src/pkg/syscall/syscall_unix.go
index 70ea3bd..36376ab 100644
--- a/src/pkg/syscall/syscall_unix.go
+++ b/src/pkg/syscall/syscall_unix.go
@@ -19,35 +19,28 @@
const darwinAMD64 = OS == "darwin" && ARCH == "amd64"
-func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
-func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
-func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
-func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
-
-func Errstr(errno int) string {
- if errno < 0 || errno >= int(len(errors)) {
- return "error " + itoa(errno)
- }
- return errors[errno]
-}
+func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
+func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
+func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
// Mmap manager, for use by operating system-specific implementations.
type mmapper struct {
sync.Mutex
active map[*byte][]byte // active mappings; key is last byte in mapping
- mmap func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, int)
- munmap func(addr uintptr, length uintptr) int
+ mmap func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, error)
+ munmap func(addr uintptr, length uintptr) error
}
-func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, errno int) {
+func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
if length <= 0 {
return nil, EINVAL
}
// Map the requested memory.
addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset)
- if errno != 0 {
+ if errno != nil {
return nil, errno
}
@@ -66,10 +59,10 @@
m.Lock()
defer m.Unlock()
m.active[p] = b
- return b, 0
+ return b, nil
}
-func (m *mmapper) Munmap(data []byte) (errno int) {
+func (m *mmapper) Munmap(data []byte) (err error) {
if len(data) == 0 || len(data) != cap(data) {
return EINVAL
}
@@ -84,9 +77,36 @@
}
// Unmap the memory and update m.
- if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != 0 {
+ if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil {
return errno
}
delete(m.active, p)
- return 0
+ return nil
+}
+
+// An Errno is an unsigned number describing an error condition.
+// It implements the error interface. The zero Errno is by convention
+// a non-error, so code to convert from Errno to error should use:
+// err = nil
+// if errno != 0 {
+// err = errno
+// }
+type Errno uintptr
+
+func (e Errno) Error() string {
+ if 0 <= e && int(e) < len(errors) {
+ s := errors[e]
+ if s != "" {
+ return s
+ }
+ }
+ return "errno " + itoa(int(e))
+}
+
+func (e Errno) Temporary() bool {
+ return e == EINTR || e == EMFILE || e.Timeout()
+}
+
+func (e Errno) Timeout() bool {
+ return e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT
}
diff --git a/src/pkg/syscall/syscall_windows.go b/src/pkg/syscall/syscall_windows.go
index 124cdf9..db8d3bc 100644
--- a/src/pkg/syscall/syscall_windows.go
+++ b/src/pkg/syscall/syscall_windows.go
@@ -40,12 +40,12 @@
func main() {
h, err := syscall.LoadLibrary("kernel32.dll")
- if err != 0 {
+ if err != nil {
abort("LoadLibrary", err)
}
defer syscall.FreeLibrary(h)
proc, err := syscall.GetProcAddress(h, "GetVersion")
- if err != 0 {
+ if err != nil {
abort("GetProcAddress", err)
}
r, _, _ := syscall.Syscall(uintptr(proc), 0, 0, 0, 0)
@@ -84,83 +84,84 @@
// windows api calls
-//sys GetLastError() (lasterrno int)
-//sys LoadLibrary(libname string) (handle Handle, errno int) = LoadLibraryW
-//sys FreeLibrary(handle Handle) (errno int)
-//sys GetProcAddress(module Handle, procname string) (proc uintptr, errno int)
-//sys GetVersion() (ver uint32, errno int)
-//sys FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, errno int) = FormatMessageW
+//sys GetLastError() (lasterr uintptr)
+//sys LoadLibrary(libname string) (handle Handle, err error) = LoadLibraryW
+//sys FreeLibrary(handle Handle) (err error)
+//sys GetProcAddress(module Handle, procname string) (proc uintptr, err error)
+//sys GetVersion() (ver uint32, err error)
+//sys FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) = FormatMessageW
//sys ExitProcess(exitcode uint32)
-//sys CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, errno int) [failretval==InvalidHandle] = CreateFileW
-//sys ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (errno int)
-//sys WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (errno int)
-//sys SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, errno int) [failretval==0xffffffff]
-//sys CloseHandle(handle Handle) (errno int)
-//sys GetStdHandle(stdhandle int) (handle Handle, errno int) [failretval==InvalidHandle]
-//sys FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, errno int) [failretval==InvalidHandle] = FindFirstFileW
-//sys FindNextFile(handle Handle, data *Win32finddata) (errno int) = FindNextFileW
-//sys FindClose(handle Handle) (errno int)
-//sys GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (errno int)
-//sys GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, errno int) = GetCurrentDirectoryW
-//sys SetCurrentDirectory(path *uint16) (errno int) = SetCurrentDirectoryW
-//sys CreateDirectory(path *uint16, sa *SecurityAttributes) (errno int) = CreateDirectoryW
-//sys RemoveDirectory(path *uint16) (errno int) = RemoveDirectoryW
-//sys DeleteFile(path *uint16) (errno int) = DeleteFileW
-//sys MoveFile(from *uint16, to *uint16) (errno int) = MoveFileW
-//sys GetComputerName(buf *uint16, n *uint32) (errno int) = GetComputerNameW
-//sys SetEndOfFile(handle Handle) (errno int)
+//sys CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW
+//sys ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error)
+//sys WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error)
+//sys SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) [failretval==0xffffffff]
+//sys CloseHandle(handle Handle) (err error)
+//sys GetStdHandle(stdhandle int) (handle Handle, err error) [failretval==InvalidHandle]
+//sys FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) [failretval==InvalidHandle] = FindFirstFileW
+//sys FindNextFile(handle Handle, data *Win32finddata) (err error) = FindNextFileW
+//sys FindClose(handle Handle) (err error)
+//sys GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error)
+//sys GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) = GetCurrentDirectoryW
+//sys SetCurrentDirectory(path *uint16) (err error) = SetCurrentDirectoryW
+//sys CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) = CreateDirectoryW
+//sys RemoveDirectory(path *uint16) (err error) = RemoveDirectoryW
+//sys DeleteFile(path *uint16) (err error) = DeleteFileW
+//sys MoveFile(from *uint16, to *uint16) (err error) = MoveFileW
+//sys GetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW
+//sys SetEndOfFile(handle Handle) (err error)
//sys GetSystemTimeAsFileTime(time *Filetime)
//sys sleep(msec uint32) = Sleep
-//sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, errno int) [failretval==0xffffffff]
-//sys CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, errno int)
-//sys GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (errno int)
-//sys PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (errno int)
-//sys CancelIo(s Handle) (errno int)
-//sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (errno int) = CreateProcessW
-//sys OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, errno int)
-//sys TerminateProcess(handle Handle, exitcode uint32) (errno int)
-//sys GetExitCodeProcess(handle Handle, exitcode *uint32) (errno int)
-//sys GetStartupInfo(startupInfo *StartupInfo) (errno int) = GetStartupInfoW
-//sys GetCurrentProcess() (pseudoHandle Handle, errno int)
-//sys DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (errno int)
-//sys WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, errno int) [failretval==0xffffffff]
-//sys GetTempPath(buflen uint32, buf *uint16) (n uint32, errno int) = GetTempPathW
-//sys CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (errno int)
-//sys GetFileType(filehandle Handle) (n uint32, errno int)
-//sys CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (errno int) = advapi32.CryptAcquireContextW
-//sys CryptReleaseContext(provhandle Handle, flags uint32) (errno int) = advapi32.CryptReleaseContext
-//sys CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (errno int) = advapi32.CryptGenRandom
-//sys GetEnvironmentStrings() (envs *uint16, errno int) [failretval==nil] = kernel32.GetEnvironmentStringsW
-//sys FreeEnvironmentStrings(envs *uint16) (errno int) = kernel32.FreeEnvironmentStringsW
-//sys GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, errno int) = kernel32.GetEnvironmentVariableW
-//sys SetEnvironmentVariable(name *uint16, value *uint16) (errno int) = kernel32.SetEnvironmentVariableW
-//sys SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (errno int)
-//sys GetFileAttributes(name *uint16) (attrs uint32, errno int) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW
-//sys SetFileAttributes(name *uint16, attrs uint32) (errno int) = kernel32.SetFileAttributesW
-//sys GetFileAttributesEx(name *uint16, level uint32, info *byte) (errno int) = kernel32.GetFileAttributesExW
+//sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff]
+//sys CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error)
+//sys GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error)
+//sys PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error)
+//sys CancelIo(s Handle) (err error)
+//sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW
+//sys OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error)
+//sys TerminateProcess(handle Handle, exitcode uint32) (err error)
+//sys GetExitCodeProcess(handle Handle, exitcode *uint32) (err error)
+//sys GetStartupInfo(startupInfo *StartupInfo) (err error) = GetStartupInfoW
+//sys GetCurrentProcess() (pseudoHandle Handle, err error)
+//sys DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error)
+//sys WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff]
+//sys GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) = GetTempPathW
+//sys CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error)
+//sys GetFileType(filehandle Handle) (n uint32, err error)
+//sys CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) = advapi32.CryptAcquireContextW
+//sys CryptReleaseContext(provhandle Handle, flags uint32) (err error) = advapi32.CryptReleaseContext
+//sys CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) = advapi32.CryptGenRandom
+//sys GetEnvironmentStrings() (envs *uint16, err error) [failretval==nil] = kernel32.GetEnvironmentStringsW
+//sys FreeEnvironmentStrings(envs *uint16) (err error) = kernel32.FreeEnvironmentStringsW
+//sys GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) = kernel32.GetEnvironmentVariableW
+//sys SetEnvironmentVariable(name *uint16, value *uint16) (err error) = kernel32.SetEnvironmentVariableW
+//sys SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error)
+//sys GetFileAttributes(name *uint16) (attrs uint32, err error) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW
+//sys SetFileAttributes(name *uint16, attrs uint32) (err error) = kernel32.SetFileAttributesW
+//sys GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) = kernel32.GetFileAttributesExW
//sys GetCommandLine() (cmd *uint16) = kernel32.GetCommandLineW
-//sys CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, errno int) [failretval==nil] = shell32.CommandLineToArgvW
-//sys LocalFree(hmem Handle) (handle Handle, errno int) [failretval!=0]
-//sys SetHandleInformation(handle Handle, mask uint32, flags uint32) (errno int)
-//sys FlushFileBuffers(handle Handle) (errno int)
-//sys GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, errno int) = kernel32.GetFullPathNameW
-//sys CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, errno int) = kernel32.CreateFileMappingW
-//sys MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, errno int)
-//sys UnmapViewOfFile(addr uintptr) (errno int)
-//sys FlushViewOfFile(addr uintptr, length uintptr) (errno int)
-//sys VirtualLock(addr uintptr, length uintptr) (errno int)
-//sys VirtualUnlock(addr uintptr, length uintptr) (errno int)
-//sys TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (errno int) = mswsock.TransmitFile
-//sys ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (errno int) = kernel32.ReadDirectoryChangesW
-//sys CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, errno int) = crypt32.CertOpenSystemStoreW
+//sys CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) [failretval==nil] = shell32.CommandLineToArgvW
+//sys LocalFree(hmem Handle) (handle Handle, err error) [failretval!=0]
+//sys SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error)
+//sys FlushFileBuffers(handle Handle) (err error)
+//sys GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) = kernel32.GetFullPathNameW
+//sys CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) = kernel32.CreateFileMappingW
+//sys MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error)
+//sys UnmapViewOfFile(addr uintptr) (err error)
+//sys FlushViewOfFile(addr uintptr, length uintptr) (err error)
+//sys VirtualLock(addr uintptr, length uintptr) (err error)
+//sys VirtualUnlock(addr uintptr, length uintptr) (err error)
+//sys TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) = mswsock.TransmitFile
+//sys ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) = kernel32.ReadDirectoryChangesW
+//sys CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) = crypt32.CertOpenSystemStoreW
//sys CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext) = crypt32.CertEnumCertificatesInStore
-//sys CertCloseStore(store Handle, flags uint32) (errno int) = crypt32.CertCloseStore
+//sys CertCloseStore(store Handle, flags uint32) (err error) = crypt32.CertCloseStore
// syscall interface implementation for other packages
-func Errstr(errno int) string {
+
+func errstr(errno Errno) string {
// deal with special go errors
- e := errno - APPLICATION_ERROR
+ e := int(errno - APPLICATION_ERROR)
if 0 <= e && e < len(errors) {
return errors[e]
}
@@ -168,8 +169,8 @@
var flags uint32 = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_IGNORE_INSERTS
b := make([]uint16, 300)
n, err := FormatMessage(flags, 0, uint32(errno), 0, b, nil)
- if err != 0 {
- return "error " + itoa(errno) + " (FormatMessage failed with err=" + itoa(err) + ")"
+ if err != nil {
+ return "error " + itoa(int(errno)) + " (FormatMessage failed with err=" + itoa(int(err.(Errno))) + ")"
}
// trim terminating \r and \n
for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- {
@@ -186,7 +187,7 @@
return &sa
}
-func Open(path string, mode int, perm uint32) (fd Handle, errno int) {
+func Open(path string, mode int, perm uint32) (fd Handle, err error) {
if len(path) == 0 {
return InvalidHandle, ERROR_FILE_NOT_FOUND
}
@@ -225,32 +226,32 @@
createmode = OPEN_EXISTING
}
h, e := CreateFile(StringToUTF16Ptr(path), access, sharemode, sa, createmode, FILE_ATTRIBUTE_NORMAL, 0)
- return h, int(e)
+ return h, e
}
-func Read(fd Handle, p []byte) (n int, errno int) {
+func Read(fd Handle, p []byte) (n int, err error) {
var done uint32
e := ReadFile(fd, p, &done, nil)
- if e != 0 {
+ if e != nil {
if e == ERROR_BROKEN_PIPE {
// NOTE(brainman): work around ERROR_BROKEN_PIPE is returned on reading EOF from stdin
- return 0, 0
+ return 0, nil
}
return 0, e
}
- return int(done), 0
+ return int(done), nil
}
-func Write(fd Handle, p []byte) (n int, errno int) {
+func Write(fd Handle, p []byte) (n int, err error) {
var done uint32
e := WriteFile(fd, p, &done, nil)
- if e != 0 {
+ if e != nil {
return 0, e
}
- return int(done), 0
+ return int(done), nil
}
-func Seek(fd Handle, offset int64, whence int) (newoffset int64, errno int) {
+func Seek(fd Handle, offset int64, whence int) (newoffset int64, err error) {
var w uint32
switch whence {
case 0:
@@ -268,13 +269,13 @@
return 0, EPIPE
}
rlo, e := SetFilePointer(fd, lo, &hi, w)
- if e != 0 {
+ if e != nil {
return 0, e
}
- return int64(hi)<<32 + int64(rlo), 0
+ return int64(hi)<<32 + int64(rlo), nil
}
-func Close(fd Handle) (errno int) {
+func Close(fd Handle) (err error) {
return CloseHandle(fd)
}
@@ -292,98 +293,98 @@
const ImplementsGetwd = true
-func Getwd() (wd string, errno int) {
+func Getwd() (wd string, err error) {
b := make([]uint16, 300)
n, e := GetCurrentDirectory(uint32(len(b)), &b[0])
- if e != 0 {
+ if e != nil {
return "", e
}
- return string(utf16.Decode(b[0:n])), 0
+ return string(utf16.Decode(b[0:n])), nil
}
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
return SetCurrentDirectory(&StringToUTF16(path)[0])
}
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
return CreateDirectory(&StringToUTF16(path)[0], nil)
}
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
return RemoveDirectory(&StringToUTF16(path)[0])
}
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
return DeleteFile(&StringToUTF16(path)[0])
}
-func Rename(oldpath, newpath string) (errno int) {
+func Rename(oldpath, newpath string) (err error) {
from := &StringToUTF16(oldpath)[0]
to := &StringToUTF16(newpath)[0]
return MoveFile(from, to)
}
-func ComputerName() (name string, errno int) {
+func ComputerName() (name string, err error) {
var n uint32 = MAX_COMPUTERNAME_LENGTH + 1
b := make([]uint16, n)
e := GetComputerName(&b[0], &n)
- if e != 0 {
+ if e != nil {
return "", e
}
- return string(utf16.Decode(b[0:n])), 0
+ return string(utf16.Decode(b[0:n])), nil
}
-func Ftruncate(fd Handle, length int64) (errno int) {
+func Ftruncate(fd Handle, length int64) (err error) {
curoffset, e := Seek(fd, 0, 1)
- if e != 0 {
+ if e != nil {
return e
}
defer Seek(fd, curoffset, 0)
_, e = Seek(fd, length, 0)
- if e != 0 {
+ if e != nil {
return e
}
e = SetEndOfFile(fd)
- if e != 0 {
+ if e != nil {
return e
}
- return 0
+ return nil
}
-func Gettimeofday(tv *Timeval) (errno int) {
+func Gettimeofday(tv *Timeval) (err error) {
var ft Filetime
GetSystemTimeAsFileTime(&ft)
*tv = NsecToTimeval(ft.Nanoseconds())
- return 0
+ return nil
}
-func Sleep(nsec int64) (errno int) {
+func Sleep(nsec int64) (err error) {
sleep(uint32((nsec + 1e6 - 1) / 1e6)) // round up to milliseconds
- return 0
+ return nil
}
-func Pipe(p []Handle) (errno int) {
+func Pipe(p []Handle) (err error) {
if len(p) != 2 {
return EINVAL
}
var r, w Handle
e := CreatePipe(&r, &w, makeInheritSa(), 0)
- if e != 0 {
+ if e != nil {
return e
}
p[0] = r
p[1] = w
- return 0
+ return nil
}
-func Utimes(path string, tv []Timeval) (errno int) {
+func Utimes(path string, tv []Timeval) (err error) {
if len(tv) != 2 {
return EINVAL
}
h, e := CreateFile(StringToUTF16Ptr(path),
FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
- if e != 0 {
+ if e != nil {
return e
}
defer Close(h)
@@ -392,17 +393,17 @@
return SetFileTime(h, nil, &a, &w)
}
-func Fsync(fd Handle) (errno int) {
+func Fsync(fd Handle) (err error) {
return FlushFileBuffers(fd)
}
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
if mode == 0 {
return EINVAL
}
p := StringToUTF16Ptr(path)
attrs, e := GetFileAttributes(p)
- if e != 0 {
+ if e != nil {
return e
}
if mode&S_IWRITE != 0 {
@@ -415,32 +416,32 @@
// net api calls
-//sys WSAStartup(verreq uint32, data *WSAData) (sockerrno int) = ws2_32.WSAStartup
-//sys WSACleanup() (errno int) [failretval==-1] = ws2_32.WSACleanup
-//sys WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (errno int) [failretval==-1] = ws2_32.WSAIoctl
-//sys socket(af int32, typ int32, protocol int32) (handle Handle, errno int) [failretval==InvalidHandle] = ws2_32.socket
-//sys Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (errno int) [failretval==-1] = ws2_32.setsockopt
-//sys bind(s Handle, name uintptr, namelen int32) (errno int) [failretval==-1] = ws2_32.bind
-//sys connect(s Handle, name uintptr, namelen int32) (errno int) [failretval==-1] = ws2_32.connect
-//sys getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (errno int) [failretval==-1] = ws2_32.getsockname
-//sys getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (errno int) [failretval==-1] = ws2_32.getpeername
-//sys listen(s Handle, backlog int32) (errno int) [failretval==-1] = ws2_32.listen
-//sys shutdown(s Handle, how int32) (errno int) [failretval==-1] = ws2_32.shutdown
-//sys Closesocket(s Handle) (errno int) [failretval==-1] = ws2_32.closesocket
-//sys AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (errno int) = mswsock.AcceptEx
+//sys WSAStartup(verreq uint32, data *WSAData) (sockerr uintptr) = ws2_32.WSAStartup
+//sys WSACleanup() (err error) [failretval==-1] = ws2_32.WSACleanup
+//sys WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) [failretval==-1] = ws2_32.WSAIoctl
+//sys socket(af int32, typ int32, protocol int32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.socket
+//sys Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) [failretval==-1] = ws2_32.setsockopt
+//sys bind(s Handle, name uintptr, namelen int32) (err error) [failretval==-1] = ws2_32.bind
+//sys connect(s Handle, name uintptr, namelen int32) (err error) [failretval==-1] = ws2_32.connect
+//sys getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) [failretval==-1] = ws2_32.getsockname
+//sys getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) [failretval==-1] = ws2_32.getpeername
+//sys listen(s Handle, backlog int32) (err error) [failretval==-1] = ws2_32.listen
+//sys shutdown(s Handle, how int32) (err error) [failretval==-1] = ws2_32.shutdown
+//sys Closesocket(s Handle) (err error) [failretval==-1] = ws2_32.closesocket
+//sys AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) = mswsock.AcceptEx
//sys GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) = mswsock.GetAcceptExSockaddrs
-//sys WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (errno int) [failretval==-1] = ws2_32.WSARecv
-//sys WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (errno int) [failretval==-1] = ws2_32.WSASend
-//sys WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (errno int) [failretval==-1] = ws2_32.WSARecvFrom
-//sys WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (errno int) [failretval==-1] = ws2_32.WSASendTo
-//sys GetHostByName(name string) (h *Hostent, errno int) [failretval==nil] = ws2_32.gethostbyname
-//sys GetServByName(name string, proto string) (s *Servent, errno int) [failretval==nil] = ws2_32.getservbyname
+//sys WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==-1] = ws2_32.WSARecv
+//sys WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==-1] = ws2_32.WSASend
+//sys WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==-1] = ws2_32.WSARecvFrom
+//sys WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==-1] = ws2_32.WSASendTo
+//sys GetHostByName(name string) (h *Hostent, err error) [failretval==nil] = ws2_32.gethostbyname
+//sys GetServByName(name string, proto string) (s *Servent, err error) [failretval==nil] = ws2_32.getservbyname
//sys Ntohs(netshort uint16) (u uint16) = ws2_32.ntohs
-//sys GetProtoByName(name string) (p *Protoent, errno int) [failretval==nil] = ws2_32.getprotobyname
-//sys DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status uint32) = dnsapi.DnsQuery_W
+//sys GetProtoByName(name string) (p *Protoent, err error) [failretval==nil] = ws2_32.getprotobyname
+//sys DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status Errno) = dnsapi.DnsQuery_W
//sys DnsRecordListFree(rl *DNSRecord, freetype uint32) = dnsapi.DnsRecordListFree
-//sys GetIfEntry(pIfRow *MibIfRow) (errcode int) = iphlpapi.GetIfEntry
-//sys GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode int) = iphlpapi.GetAdaptersInfo
+//sys GetIfEntry(pIfRow *MibIfRow) (errcode Errno) = iphlpapi.GetIfEntry
+//sys GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode Errno) = iphlpapi.GetAdaptersInfo
// For testing: clients can set this flag to force
// creation of IPv6 sockets to return EAFNOSUPPORT.
@@ -464,7 +465,7 @@
}
type Sockaddr interface {
- sockaddr() (ptr uintptr, len int32, errno int) // lowercase; only we can define Sockaddrs
+ sockaddr() (ptr uintptr, len int32, err error) // lowercase; only we can define Sockaddrs
}
type SockaddrInet4 struct {
@@ -473,7 +474,7 @@
raw RawSockaddrInet4
}
-func (sa *SockaddrInet4) sockaddr() (uintptr, int32, int) {
+func (sa *SockaddrInet4) sockaddr() (uintptr, int32, error) {
if sa.Port < 0 || sa.Port > 0xFFFF {
return 0, 0, EINVAL
}
@@ -484,7 +485,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.raw.Addr[i] = sa.Addr[i]
}
- return uintptr(unsafe.Pointer(&sa.raw)), int32(unsafe.Sizeof(sa.raw)), 0
+ return uintptr(unsafe.Pointer(&sa.raw)), int32(unsafe.Sizeof(sa.raw)), nil
}
type SockaddrInet6 struct {
@@ -493,7 +494,7 @@
Addr [16]byte
}
-func (sa *SockaddrInet6) sockaddr() (uintptr, int32, int) {
+func (sa *SockaddrInet6) sockaddr() (uintptr, int32, error) {
// TODO(brainman): implement SockaddrInet6.sockaddr()
return 0, 0, EWINDOWS
}
@@ -502,12 +503,12 @@
Name string
}
-func (sa *SockaddrUnix) sockaddr() (uintptr, int32, int) {
+func (sa *SockaddrUnix) sockaddr() (uintptr, int32, error) {
// TODO(brainman): implement SockaddrUnix.sockaddr()
return 0, 0, EWINDOWS
}
-func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, int) {
+func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error) {
switch rsa.Addr.Family {
case AF_UNIX:
return nil, EWINDOWS
@@ -520,7 +521,7 @@
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
- return sa, 0
+ return sa, nil
case AF_INET6:
return nil, EWINDOWS
@@ -528,68 +529,66 @@
return nil, EAFNOSUPPORT
}
-func Socket(domain, typ, proto int) (fd Handle, errno int) {
+func Socket(domain, typ, proto int) (fd Handle, err error) {
if domain == AF_INET6 && SocketDisableIPv6 {
return InvalidHandle, EAFNOSUPPORT
}
- h, e := socket(int32(domain), int32(typ), int32(proto))
- return h, int(e)
+ return socket(int32(domain), int32(typ), int32(proto))
}
-func SetsockoptInt(fd Handle, level, opt int, value int) (errno int) {
+func SetsockoptInt(fd Handle, level, opt int, value int) (err error) {
v := int32(value)
- return int(Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), int32(unsafe.Sizeof(v))))
+ return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), int32(unsafe.Sizeof(v)))
}
-func Bind(fd Handle, sa Sockaddr) (errno int) {
+func Bind(fd Handle, sa Sockaddr) (err error) {
ptr, n, err := sa.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
return bind(fd, ptr, n)
}
-func Connect(fd Handle, sa Sockaddr) (errno int) {
+func Connect(fd Handle, sa Sockaddr) (err error) {
ptr, n, err := sa.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
return connect(fd, ptr, n)
}
-func Getsockname(fd Handle) (sa Sockaddr, errno int) {
+func Getsockname(fd Handle) (sa Sockaddr, err error) {
var rsa RawSockaddrAny
l := int32(unsafe.Sizeof(rsa))
- if errno = getsockname(fd, &rsa, &l); errno != 0 {
+ if err = getsockname(fd, &rsa, &l); err != nil {
return
}
return rsa.Sockaddr()
}
-func Getpeername(fd Handle) (sa Sockaddr, errno int) {
+func Getpeername(fd Handle) (sa Sockaddr, err error) {
var rsa RawSockaddrAny
l := int32(unsafe.Sizeof(rsa))
- if errno = getpeername(fd, &rsa, &l); errno != 0 {
+ if err = getpeername(fd, &rsa, &l); err != nil {
return
}
return rsa.Sockaddr()
}
-func Listen(s Handle, n int) (errno int) {
- return int(listen(s, int32(n)))
+func Listen(s Handle, n int) (err error) {
+ return listen(s, int32(n))
}
-func Shutdown(fd Handle, how int) (errno int) {
- return int(shutdown(fd, int32(how)))
+func Shutdown(fd Handle, how int) (err error) {
+ return shutdown(fd, int32(how))
}
-func WSASendto(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to Sockaddr, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSASendto(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to Sockaddr, overlapped *Overlapped, croutine *byte) (err error) {
rsa, l, err := to.sockaddr()
- if err != 0 {
+ if err != nil {
return err
}
- errno = WSASendTo(s, bufs, bufcnt, sent, flags, (*RawSockaddrAny)(unsafe.Pointer(rsa)), l, overlapped, croutine)
- return
+ return WSASendTo(s, bufs, bufcnt, sent, flags, (*RawSockaddrAny)(unsafe.Pointer(rsa)), l, overlapped, croutine)
}
// Invented structures to support what package os expects.
@@ -620,12 +619,12 @@
// TODO(brainman): fix all needed for net
-func Accept(fd Handle) (nfd Handle, sa Sockaddr, errno int) { return 0, nil, EWINDOWS }
-func Recvfrom(fd Handle, p []byte, flags int) (n int, from Sockaddr, errno int) {
+func Accept(fd Handle) (nfd Handle, sa Sockaddr, err error) { return 0, nil, EWINDOWS }
+func Recvfrom(fd Handle, p []byte, flags int) (n int, from Sockaddr, err error) {
return 0, nil, EWINDOWS
}
-func Sendto(fd Handle, p []byte, flags int, to Sockaddr) (errno int) { return EWINDOWS }
-func SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (errno int) { return EWINDOWS }
+func Sendto(fd Handle, p []byte, flags int, to Sockaddr) (err error) { return EWINDOWS }
+func SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (err error) { return EWINDOWS }
type Linger struct {
Onoff int32
@@ -647,30 +646,30 @@
Interface uint32
}
-func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (errno int) { return EWINDOWS }
-func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (errno int) {
+func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { return EWINDOWS }
+func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) {
return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq)))
}
-func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (errno int) { return EWINDOWS }
-func BindToDevice(fd Handle, device string) (errno int) { return EWINDOWS }
+func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return EWINDOWS }
+func BindToDevice(fd Handle, device string) (err error) { return EWINDOWS }
// TODO(brainman): fix all needed for os
func Getpid() (pid int) { return -1 }
func Getppid() (ppid int) { return -1 }
-func Fchdir(fd Handle) (errno int) { return EWINDOWS }
-func Link(oldpath, newpath string) (errno int) { return EWINDOWS }
-func Symlink(path, link string) (errno int) { return EWINDOWS }
-func Readlink(path string, buf []byte) (n int, errno int) { return 0, EWINDOWS }
+func Fchdir(fd Handle) (err error) { return EWINDOWS }
+func Link(oldpath, newpath string) (err error) { return EWINDOWS }
+func Symlink(path, link string) (err error) { return EWINDOWS }
+func Readlink(path string, buf []byte) (n int, err error) { return 0, EWINDOWS }
-func Fchmod(fd Handle, mode uint32) (errno int) { return EWINDOWS }
-func Chown(path string, uid int, gid int) (errno int) { return EWINDOWS }
-func Lchown(path string, uid int, gid int) (errno int) { return EWINDOWS }
-func Fchown(fd Handle, uid int, gid int) (errno int) { return EWINDOWS }
+func Fchmod(fd Handle, mode uint32) (err error) { return EWINDOWS }
+func Chown(path string, uid int, gid int) (err error) { return EWINDOWS }
+func Lchown(path string, uid int, gid int) (err error) { return EWINDOWS }
+func Fchown(fd Handle, uid int, gid int) (err error) { return EWINDOWS }
func Getuid() (uid int) { return -1 }
func Geteuid() (euid int) { return -1 }
func Getgid() (gid int) { return -1 }
func Getegid() (egid int) { return -1 }
-func Getgroups() (gids []int, errno int) { return nil, EWINDOWS }
+func Getgroups() (gids []int, err error) { return nil, EWINDOWS }
diff --git a/src/pkg/syscall/types_darwin.go b/src/pkg/syscall/types_darwin.go
index 006d320..424f94e 100644
--- a/src/pkg/syscall/types_darwin.go
+++ b/src/pkg/syscall/types_darwin.go
@@ -103,10 +103,6 @@
// Files
-const (
- O_CLOEXEC = 0 // not supported
-)
-
type Stat_t C.struct_stat64
type Statfs_t C.struct_statfs64
diff --git a/src/pkg/syscall/zerrors_darwin_386.go b/src/pkg/syscall/zerrors_darwin_386.go
index 57b5222..5d6fb01 100644
--- a/src/pkg/syscall/zerrors_darwin_386.go
+++ b/src/pkg/syscall/zerrors_darwin_386.go
@@ -146,23 +146,6 @@
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
DT_WHT = 0xe
- E2BIG = 0x7
- EACCES = 0xd
- EADDRINUSE = 0x30
- EADDRNOTAVAIL = 0x31
- EAFNOSUPPORT = 0x2f
- EAGAIN = 0x23
- EALREADY = 0x25
- EAUTH = 0x50
- EBADARCH = 0x56
- EBADEXEC = 0x55
- EBADF = 0x9
- EBADMACHO = 0x58
- EBADMSG = 0x5e
- EBADRPC = 0x48
- EBUSY = 0x10
- ECANCELED = 0x59
- ECHILD = 0xa
ECHO = 0x8
ECHOCTL = 0x40
ECHOE = 0x2
@@ -170,103 +153,17 @@
ECHOKE = 0x1
ECHONL = 0x10
ECHOPRT = 0x20
- ECONNABORTED = 0x35
- ECONNREFUSED = 0x3d
- ECONNRESET = 0x36
- EDEADLK = 0xb
- EDESTADDRREQ = 0x27
- EDEVERR = 0x53
- EDOM = 0x21
- EDQUOT = 0x45
- EEXIST = 0x11
- EFAULT = 0xe
- EFBIG = 0x1b
- EFTYPE = 0x4f
- EHOSTDOWN = 0x40
- EHOSTUNREACH = 0x41
- EIDRM = 0x5a
- EILSEQ = 0x5c
- EINPROGRESS = 0x24
- EINTR = 0x4
- EINVAL = 0x16
- EIO = 0x5
- EISCONN = 0x38
- EISDIR = 0x15
- ELAST = 0x67
- ELOOP = 0x3e
- EMFILE = 0x18
- EMLINK = 0x1f
- EMSGSIZE = 0x28
- EMULTIHOP = 0x5f
- ENAMETOOLONG = 0x3f
- ENEEDAUTH = 0x51
- ENETDOWN = 0x32
- ENETRESET = 0x34
- ENETUNREACH = 0x33
- ENFILE = 0x17
- ENOATTR = 0x5d
- ENOBUFS = 0x37
- ENODATA = 0x60
- ENODEV = 0x13
- ENOENT = 0x2
- ENOEXEC = 0x8
- ENOLCK = 0x4d
- ENOLINK = 0x61
- ENOMEM = 0xc
- ENOMSG = 0x5b
- ENOPOLICY = 0x67
- ENOPROTOOPT = 0x2a
- ENOSPC = 0x1c
- ENOSR = 0x62
- ENOSTR = 0x63
- ENOSYS = 0x4e
- ENOTBLK = 0xf
- ENOTCONN = 0x39
- ENOTDIR = 0x14
- ENOTEMPTY = 0x42
- ENOTSOCK = 0x26
- ENOTSUP = 0x2d
- ENOTTY = 0x19
- ENXIO = 0x6
- EOPNOTSUPP = 0x66
- EOVERFLOW = 0x54
- EPERM = 0x1
- EPFNOSUPPORT = 0x2e
- EPIPE = 0x20
- EPROCLIM = 0x43
- EPROCUNAVAIL = 0x4c
- EPROGMISMATCH = 0x4b
- EPROGUNAVAIL = 0x4a
- EPROTO = 0x64
- EPROTONOSUPPORT = 0x2b
- EPROTOTYPE = 0x29
- EPWROFF = 0x52
- ERANGE = 0x22
- EREMOTE = 0x47
- EROFS = 0x1e
- ERPCMISMATCH = 0x49
- ESHLIBVERS = 0x57
- ESHUTDOWN = 0x3a
- ESOCKTNOSUPPORT = 0x2c
- ESPIPE = 0x1d
- ESRCH = 0x3
- ESTALE = 0x46
- ETIME = 0x65
- ETIMEDOUT = 0x3c
- ETOOMANYREFS = 0x3b
- ETXTBSY = 0x1a
- EUSERS = 0x44
EVFILT_AIO = -0x3
EVFILT_FS = -0x9
EVFILT_MACHPORT = -0x8
EVFILT_PROC = -0x5
EVFILT_READ = -0x1
- EVFILT_SESSION = -0xb
EVFILT_SIGNAL = -0x6
- EVFILT_SYSCOUNT = 0xb
- EVFILT_THREADMARKER = 0xb
+ EVFILT_SYSCOUNT = 0xc
+ EVFILT_THREADMARKER = 0xc
EVFILT_TIMER = -0x7
EVFILT_USER = -0xa
+ EVFILT_VM = -0xc
EVFILT_VNODE = -0x4
EVFILT_WRITE = -0x2
EV_ADD = 0x1
@@ -284,9 +181,6 @@
EV_POLL = 0x1000
EV_RECEIPT = 0x40
EV_SYSFLAGS = 0xf000
- EV_TRIGGER = 0x100
- EWOULDBLOCK = 0x23
- EXDEV = 0x12
EXTA = 0x4b00
EXTB = 0x9600
EXTPROC = 0x800
@@ -298,18 +192,25 @@
F_ALLOCATECONTIG = 0x2
F_CHKCLEAN = 0x29
F_DUPFD = 0x0
+ F_DUPFD_CLOEXEC = 0x43
+ F_FLUSH_DATA = 0x28
F_FREEZE_FS = 0x35
F_FULLFSYNC = 0x33
F_GETFD = 0x1
F_GETFL = 0x3
F_GETLK = 0x7
+ F_GETLKPID = 0x42
+ F_GETNOSIGPIPE = 0x4a
F_GETOWN = 0x5
F_GETPATH = 0x32
- F_GETPROTECTIONCLASS = 0x3e
+ F_GETPATH_MTMINFO = 0x47
+ F_GETPROTECTIONCLASS = 0x3f
F_GLOBAL_NOCACHE = 0x37
F_LOG2PHYS = 0x31
+ F_LOG2PHYS_EXT = 0x41
F_MARKDEPENDENCY = 0x3c
F_NOCACHE = 0x30
+ F_NODIRECT = 0x3e
F_PATHPKG_CHECK = 0x34
F_PEOFPOSMODE = 0x3
F_PREALLOCATE = 0x2a
@@ -317,12 +218,14 @@
F_RDAHEAD = 0x2d
F_RDLCK = 0x1
F_READBOOTSTRAP = 0x2e
+ F_SETBACKINGSTORE = 0x46
F_SETFD = 0x2
F_SETFL = 0x4
F_SETLK = 0x8
F_SETLKW = 0x9
+ F_SETNOSIGPIPE = 0x49
F_SETOWN = 0x6
- F_SETPROTECTIONCLASS = 0x3f
+ F_SETPROTECTIONCLASS = 0x40
F_SETSIZE = 0x2b
F_THAW_FS = 0x36
F_UNLCK = 0x2
@@ -354,6 +257,7 @@
IFT_ATM = 0x25
IFT_BRIDGE = 0xd1
IFT_CARP = 0xf8
+ IFT_CELLULAR = 0xff
IFT_CEPT = 0x13
IFT_DS3 = 0x1e
IFT_ENC = 0xf4
@@ -514,6 +418,7 @@
IPPROTO_SATEXPAK = 0x40
IPPROTO_SATMON = 0x45
IPPROTO_SCCSP = 0x60
+ IPPROTO_SCTP = 0x84
IPPROTO_SDRP = 0x2a
IPPROTO_SEP = 0x21
IPPROTO_SRPC = 0x5a
@@ -536,12 +441,19 @@
IPPROTO_WSN = 0x4a
IPPROTO_XNET = 0xf
IPPROTO_XTP = 0x24
+ IPV6_2292DSTOPTS = 0x17
+ IPV6_2292HOPLIMIT = 0x14
+ IPV6_2292HOPOPTS = 0x16
+ IPV6_2292NEXTHOP = 0x15
+ IPV6_2292PKTINFO = 0x13
+ IPV6_2292PKTOPTIONS = 0x19
+ IPV6_2292RTHDR = 0x18
IPV6_BINDV6ONLY = 0x1b
+ IPV6_BOUND_IF = 0x7d
IPV6_CHECKSUM = 0x1a
IPV6_DEFAULT_MULTICAST_HOPS = 0x1
IPV6_DEFAULT_MULTICAST_LOOP = 0x1
IPV6_DEFHLIM = 0x40
- IPV6_DSTOPTS = 0x17
IPV6_FAITH = 0x1d
IPV6_FLOWINFO_MASK = 0xffffff0f
IPV6_FLOWLABEL_MASK = 0xffff0f00
@@ -552,26 +464,25 @@
IPV6_FW_GET = 0x22
IPV6_FW_ZERO = 0x21
IPV6_HLIMDEC = 0x1
- IPV6_HOPLIMIT = 0x14
- IPV6_HOPOPTS = 0x16
IPV6_IPSEC_POLICY = 0x1c
IPV6_JOIN_GROUP = 0xc
IPV6_LEAVE_GROUP = 0xd
IPV6_MAXHLIM = 0xff
+ IPV6_MAXOPTHDR = 0x800
IPV6_MAXPACKET = 0xffff
+ IPV6_MAX_GROUP_SRC_FILTER = 0x200
+ IPV6_MAX_MEMBERSHIPS = 0xfff
+ IPV6_MAX_SOCK_SRC_FILTER = 0x80
+ IPV6_MIN_MEMBERSHIPS = 0x1f
IPV6_MMTU = 0x500
IPV6_MULTICAST_HOPS = 0xa
IPV6_MULTICAST_IF = 0x9
IPV6_MULTICAST_LOOP = 0xb
- IPV6_NEXTHOP = 0x15
- IPV6_PKTINFO = 0x13
- IPV6_PKTOPTIONS = 0x19
IPV6_PORTRANGE = 0xe
IPV6_PORTRANGE_DEFAULT = 0x0
IPV6_PORTRANGE_HIGH = 0x1
IPV6_PORTRANGE_LOW = 0x2
IPV6_RECVTCLASS = 0x23
- IPV6_RTHDR = 0x18
IPV6_RTHDR_LOOSE = 0x0
IPV6_RTHDR_STRICT = 0x1
IPV6_RTHDR_TYPE_0 = 0x0
@@ -582,11 +493,14 @@
IPV6_VERSION = 0x60
IPV6_VERSION_MASK = 0xf0
IP_ADD_MEMBERSHIP = 0xc
+ IP_ADD_SOURCE_MEMBERSHIP = 0x46
+ IP_BLOCK_SOURCE = 0x48
IP_BOUND_IF = 0x19
IP_DEFAULT_MULTICAST_LOOP = 0x1
IP_DEFAULT_MULTICAST_TTL = 0x1
IP_DF = 0x4000
IP_DROP_MEMBERSHIP = 0xd
+ IP_DROP_SOURCE_MEMBERSHIP = 0x47
IP_DUMMYNET_CONFIGURE = 0x3c
IP_DUMMYNET_DEL = 0x3d
IP_DUMMYNET_FLUSH = 0x3e
@@ -601,10 +515,16 @@
IP_HDRINCL = 0x2
IP_IPSEC_POLICY = 0x15
IP_MAXPACKET = 0xffff
- IP_MAX_MEMBERSHIPS = 0x14
+ IP_MAX_GROUP_SRC_FILTER = 0x200
+ IP_MAX_MEMBERSHIPS = 0xfff
+ IP_MAX_SOCK_MUTE_FILTER = 0x80
+ IP_MAX_SOCK_SRC_FILTER = 0x80
IP_MF = 0x2000
+ IP_MIN_MEMBERSHIPS = 0x1f
+ IP_MSFILTER = 0x4a
IP_MSS = 0x240
IP_MULTICAST_IF = 0x9
+ IP_MULTICAST_IFINDEX = 0x42
IP_MULTICAST_LOOP = 0xb
IP_MULTICAST_TTL = 0xa
IP_MULTICAST_VIF = 0xe
@@ -617,6 +537,7 @@
IP_OLD_FW_RESETLOG = 0x38
IP_OLD_FW_ZERO = 0x35
IP_OPTIONS = 0x1
+ IP_PKTINFO = 0x1a
IP_PORTRANGE = 0x13
IP_PORTRANGE_DEFAULT = 0x0
IP_PORTRANGE_HIGH = 0x1
@@ -624,6 +545,7 @@
IP_RECVDSTADDR = 0x7
IP_RECVIF = 0x14
IP_RECVOPTS = 0x5
+ IP_RECVPKTINFO = 0x1a
IP_RECVRETOPTS = 0x6
IP_RECVTTL = 0x18
IP_RETOPTS = 0x8
@@ -636,6 +558,7 @@
IP_TOS = 0x3
IP_TRAFFIC_MGT_BACKGROUND = 0x41
IP_TTL = 0x4
+ IP_UNBLOCK_SOURCE = 0x49
MADV_CAN_REUSE = 0x9
MADV_DONTNEED = 0x4
MADV_FREE = 0x5
@@ -651,6 +574,7 @@
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_HASSEMAPHORE = 0x200
+ MAP_JIT = 0x800
MAP_NOCACHE = 0x400
MAP_NOEXTEND = 0x100
MAP_NORESERVE = 0x40
@@ -687,13 +611,14 @@
NET_RT_FLAGS = 0x2
NET_RT_IFLIST = 0x3
NET_RT_IFLIST2 = 0x6
- NET_RT_MAXID = 0x8
+ NET_RT_MAXID = 0xa
NET_RT_STAT = 0x4
NET_RT_TRASH = 0x5
O_ACCMODE = 0x3
O_ALERT = 0x20000000
O_APPEND = 0x8
O_ASYNC = 0x40
+ O_CLOEXEC = 0x1000000
O_CREAT = 0x200
O_DIRECTORY = 0x100000
O_DSYNC = 0x400000
@@ -809,6 +734,7 @@
SCM_CREDS = 0x3
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
+ SCM_TIMESTAMP_MONOTONIC = 0x4
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -865,6 +791,7 @@
SIOCGIFASYNCMAP = 0xc020697c
SIOCGIFBOND = 0xc0206947
SIOCGIFBRDADDR = 0xc0206923
+ SIOCGIFCAP = 0xc020695b
SIOCGIFCONF = 0xc0086924
SIOCGIFDEVMTU = 0xc0206944
SIOCGIFDSTADDR = 0xc0206922
@@ -898,6 +825,7 @@
SIOCSIFASYNCMAP = 0x8020697d
SIOCSIFBOND = 0x80206946
SIOCSIFBRDADDR = 0x80206913
+ SIOCSIFCAP = 0x8020695a
SIOCSIFDSTADDR = 0x8020690e
SIOCSIFFLAGS = 0x80206910
SIOCSIFGENERIC = 0x80206939
@@ -956,6 +884,7 @@
SO_SNDLOWAT = 0x1003
SO_SNDTIMEO = 0x1005
SO_TIMESTAMP = 0x400
+ SO_TIMESTAMP_MONOTONIC = 0x800
SO_TYPE = 0x1008
SO_UPCALLCLOSEWAIT = 0x1027
SO_USELOOPBACK = 0x40
@@ -991,7 +920,6 @@
S_IXUSR = 0x40
TCP_CONNECTIONTIMEOUT = 0x20
TCP_KEEPALIVE = 0x10
- TCP_MAXBURST = 0x4
TCP_MAXHLEN = 0x3c
TCP_MAXOLEN = 0x28
TCP_MAXSEG = 0x2
@@ -1004,6 +932,8 @@
TCP_NODELAY = 0x1
TCP_NOOPT = 0x8
TCP_NOPUSH = 0x4
+ TCP_RXT_CONNDROPTIME = 0x80
+ TCP_RXT_FINDROP = 0x100
TIOCCBRK = 0x2000747a
TIOCCDTR = 0x20007478
TIOCCONS = 0x80047462
@@ -1083,6 +1013,117 @@
WUNTRACED = 0x2
)
+// Errors
+const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x30)
+ EADDRNOTAVAIL = Errno(0x31)
+ EAFNOSUPPORT = Errno(0x2f)
+ EAGAIN = Errno(0x23)
+ EALREADY = Errno(0x25)
+ EAUTH = Errno(0x50)
+ EBADARCH = Errno(0x56)
+ EBADEXEC = Errno(0x55)
+ EBADF = Errno(0x9)
+ EBADMACHO = Errno(0x58)
+ EBADMSG = Errno(0x5e)
+ EBADRPC = Errno(0x48)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x59)
+ ECHILD = Errno(0xa)
+ ECONNABORTED = Errno(0x35)
+ ECONNREFUSED = Errno(0x3d)
+ ECONNRESET = Errno(0x36)
+ EDEADLK = Errno(0xb)
+ EDESTADDRREQ = Errno(0x27)
+ EDEVERR = Errno(0x53)
+ EDOM = Errno(0x21)
+ EDQUOT = Errno(0x45)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EFTYPE = Errno(0x4f)
+ EHOSTDOWN = Errno(0x40)
+ EHOSTUNREACH = Errno(0x41)
+ EIDRM = Errno(0x5a)
+ EILSEQ = Errno(0x5c)
+ EINPROGRESS = Errno(0x24)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EISCONN = Errno(0x38)
+ EISDIR = Errno(0x15)
+ ELAST = Errno(0x69)
+ ELOOP = Errno(0x3e)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x28)
+ EMULTIHOP = Errno(0x5f)
+ ENAMETOOLONG = Errno(0x3f)
+ ENEEDAUTH = Errno(0x51)
+ ENETDOWN = Errno(0x32)
+ ENETRESET = Errno(0x34)
+ ENETUNREACH = Errno(0x33)
+ ENFILE = Errno(0x17)
+ ENOATTR = Errno(0x5d)
+ ENOBUFS = Errno(0x37)
+ ENODATA = Errno(0x60)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOLCK = Errno(0x4d)
+ ENOLINK = Errno(0x61)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x5b)
+ ENOPOLICY = Errno(0x67)
+ ENOPROTOOPT = Errno(0x2a)
+ ENOSPC = Errno(0x1c)
+ ENOSR = Errno(0x62)
+ ENOSTR = Errno(0x63)
+ ENOSYS = Errno(0x4e)
+ ENOTBLK = Errno(0xf)
+ ENOTCONN = Errno(0x39)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x42)
+ ENOTRECOVERABLE = Errno(0x68)
+ ENOTSOCK = Errno(0x26)
+ ENOTSUP = Errno(0x2d)
+ ENOTTY = Errno(0x19)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x66)
+ EOVERFLOW = Errno(0x54)
+ EOWNERDEAD = Errno(0x69)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x2e)
+ EPIPE = Errno(0x20)
+ EPROCLIM = Errno(0x43)
+ EPROCUNAVAIL = Errno(0x4c)
+ EPROGMISMATCH = Errno(0x4b)
+ EPROGUNAVAIL = Errno(0x4a)
+ EPROTO = Errno(0x64)
+ EPROTONOSUPPORT = Errno(0x2b)
+ EPROTOTYPE = Errno(0x29)
+ EPWROFF = Errno(0x52)
+ ERANGE = Errno(0x22)
+ EREMOTE = Errno(0x47)
+ EROFS = Errno(0x1e)
+ ERPCMISMATCH = Errno(0x49)
+ ESHLIBVERS = Errno(0x57)
+ ESHUTDOWN = Errno(0x3a)
+ ESOCKTNOSUPPORT = Errno(0x2c)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESTALE = Errno(0x46)
+ ETIME = Errno(0x65)
+ ETIMEDOUT = Errno(0x3c)
+ ETOOMANYREFS = Errno(0x3b)
+ ETXTBSY = Errno(0x1a)
+ EUSERS = Errno(0x44)
+ EWOULDBLOCK = Errno(0x23)
+ EXDEV = Errno(0x12)
+)
+
// Error table
var errors = [...]string{
1: "operation not permitted",
@@ -1188,4 +1229,6 @@
101: "STREAM ioctl timeout",
102: "operation not supported on socket",
103: "policy not found",
+ 104: "state not recoverable",
+ 105: "previous owner died",
}
diff --git a/src/pkg/syscall/zerrors_darwin_amd64.go b/src/pkg/syscall/zerrors_darwin_amd64.go
index 4976c32..108d60a 100644
--- a/src/pkg/syscall/zerrors_darwin_amd64.go
+++ b/src/pkg/syscall/zerrors_darwin_amd64.go
@@ -50,7 +50,7 @@
BIOCGETIF = 0x4020426b
BIOCGHDRCMPLT = 0x40044274
BIOCGRSIG = 0x40044272
- BIOCGRTIMEOUT = 0x4008426e
+ BIOCGRTIMEOUT = 0x4010426e
BIOCGSEESENT = 0x40044276
BIOCGSTATS = 0x4008426f
BIOCIMMEDIATE = 0x80044270
@@ -61,7 +61,7 @@
BIOCSETIF = 0x8020426c
BIOCSHDRCMPLT = 0x80044275
BIOCSRSIG = 0x80044273
- BIOCSRTIMEOUT = 0x8008426d
+ BIOCSRTIMEOUT = 0x8010426d
BIOCSSEESENT = 0x80044277
BIOCVERSION = 0x40044271
BPF_A = 0x10
@@ -146,23 +146,6 @@
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
DT_WHT = 0xe
- E2BIG = 0x7
- EACCES = 0xd
- EADDRINUSE = 0x30
- EADDRNOTAVAIL = 0x31
- EAFNOSUPPORT = 0x2f
- EAGAIN = 0x23
- EALREADY = 0x25
- EAUTH = 0x50
- EBADARCH = 0x56
- EBADEXEC = 0x55
- EBADF = 0x9
- EBADMACHO = 0x58
- EBADMSG = 0x5e
- EBADRPC = 0x48
- EBUSY = 0x10
- ECANCELED = 0x59
- ECHILD = 0xa
ECHO = 0x8
ECHOCTL = 0x40
ECHOE = 0x2
@@ -170,103 +153,17 @@
ECHOKE = 0x1
ECHONL = 0x10
ECHOPRT = 0x20
- ECONNABORTED = 0x35
- ECONNREFUSED = 0x3d
- ECONNRESET = 0x36
- EDEADLK = 0xb
- EDESTADDRREQ = 0x27
- EDEVERR = 0x53
- EDOM = 0x21
- EDQUOT = 0x45
- EEXIST = 0x11
- EFAULT = 0xe
- EFBIG = 0x1b
- EFTYPE = 0x4f
- EHOSTDOWN = 0x40
- EHOSTUNREACH = 0x41
- EIDRM = 0x5a
- EILSEQ = 0x5c
- EINPROGRESS = 0x24
- EINTR = 0x4
- EINVAL = 0x16
- EIO = 0x5
- EISCONN = 0x38
- EISDIR = 0x15
- ELAST = 0x67
- ELOOP = 0x3e
- EMFILE = 0x18
- EMLINK = 0x1f
- EMSGSIZE = 0x28
- EMULTIHOP = 0x5f
- ENAMETOOLONG = 0x3f
- ENEEDAUTH = 0x51
- ENETDOWN = 0x32
- ENETRESET = 0x34
- ENETUNREACH = 0x33
- ENFILE = 0x17
- ENOATTR = 0x5d
- ENOBUFS = 0x37
- ENODATA = 0x60
- ENODEV = 0x13
- ENOENT = 0x2
- ENOEXEC = 0x8
- ENOLCK = 0x4d
- ENOLINK = 0x61
- ENOMEM = 0xc
- ENOMSG = 0x5b
- ENOPOLICY = 0x67
- ENOPROTOOPT = 0x2a
- ENOSPC = 0x1c
- ENOSR = 0x62
- ENOSTR = 0x63
- ENOSYS = 0x4e
- ENOTBLK = 0xf
- ENOTCONN = 0x39
- ENOTDIR = 0x14
- ENOTEMPTY = 0x42
- ENOTSOCK = 0x26
- ENOTSUP = 0x2d
- ENOTTY = 0x19
- ENXIO = 0x6
- EOPNOTSUPP = 0x66
- EOVERFLOW = 0x54
- EPERM = 0x1
- EPFNOSUPPORT = 0x2e
- EPIPE = 0x20
- EPROCLIM = 0x43
- EPROCUNAVAIL = 0x4c
- EPROGMISMATCH = 0x4b
- EPROGUNAVAIL = 0x4a
- EPROTO = 0x64
- EPROTONOSUPPORT = 0x2b
- EPROTOTYPE = 0x29
- EPWROFF = 0x52
- ERANGE = 0x22
- EREMOTE = 0x47
- EROFS = 0x1e
- ERPCMISMATCH = 0x49
- ESHLIBVERS = 0x57
- ESHUTDOWN = 0x3a
- ESOCKTNOSUPPORT = 0x2c
- ESPIPE = 0x1d
- ESRCH = 0x3
- ESTALE = 0x46
- ETIME = 0x65
- ETIMEDOUT = 0x3c
- ETOOMANYREFS = 0x3b
- ETXTBSY = 0x1a
- EUSERS = 0x44
EVFILT_AIO = -0x3
EVFILT_FS = -0x9
EVFILT_MACHPORT = -0x8
EVFILT_PROC = -0x5
EVFILT_READ = -0x1
- EVFILT_SESSION = -0xb
EVFILT_SIGNAL = -0x6
- EVFILT_SYSCOUNT = 0xb
- EVFILT_THREADMARKER = 0xb
+ EVFILT_SYSCOUNT = 0xc
+ EVFILT_THREADMARKER = 0xc
EVFILT_TIMER = -0x7
EVFILT_USER = -0xa
+ EVFILT_VM = -0xc
EVFILT_VNODE = -0x4
EVFILT_WRITE = -0x2
EV_ADD = 0x1
@@ -284,9 +181,6 @@
EV_POLL = 0x1000
EV_RECEIPT = 0x40
EV_SYSFLAGS = 0xf000
- EV_TRIGGER = 0x100
- EWOULDBLOCK = 0x23
- EXDEV = 0x12
EXTA = 0x4b00
EXTB = 0x9600
EXTPROC = 0x800
@@ -298,18 +192,25 @@
F_ALLOCATECONTIG = 0x2
F_CHKCLEAN = 0x29
F_DUPFD = 0x0
+ F_DUPFD_CLOEXEC = 0x43
+ F_FLUSH_DATA = 0x28
F_FREEZE_FS = 0x35
F_FULLFSYNC = 0x33
F_GETFD = 0x1
F_GETFL = 0x3
F_GETLK = 0x7
+ F_GETLKPID = 0x42
+ F_GETNOSIGPIPE = 0x4a
F_GETOWN = 0x5
F_GETPATH = 0x32
- F_GETPROTECTIONCLASS = 0x3e
+ F_GETPATH_MTMINFO = 0x47
+ F_GETPROTECTIONCLASS = 0x3f
F_GLOBAL_NOCACHE = 0x37
F_LOG2PHYS = 0x31
+ F_LOG2PHYS_EXT = 0x41
F_MARKDEPENDENCY = 0x3c
F_NOCACHE = 0x30
+ F_NODIRECT = 0x3e
F_PATHPKG_CHECK = 0x34
F_PEOFPOSMODE = 0x3
F_PREALLOCATE = 0x2a
@@ -317,12 +218,14 @@
F_RDAHEAD = 0x2d
F_RDLCK = 0x1
F_READBOOTSTRAP = 0x2e
+ F_SETBACKINGSTORE = 0x46
F_SETFD = 0x2
F_SETFL = 0x4
F_SETLK = 0x8
F_SETLKW = 0x9
+ F_SETNOSIGPIPE = 0x49
F_SETOWN = 0x6
- F_SETPROTECTIONCLASS = 0x3f
+ F_SETPROTECTIONCLASS = 0x40
F_SETSIZE = 0x2b
F_THAW_FS = 0x36
F_UNLCK = 0x2
@@ -354,6 +257,7 @@
IFT_ATM = 0x25
IFT_BRIDGE = 0xd1
IFT_CARP = 0xf8
+ IFT_CELLULAR = 0xff
IFT_CEPT = 0x13
IFT_DS3 = 0x1e
IFT_ENC = 0xf4
@@ -514,6 +418,7 @@
IPPROTO_SATEXPAK = 0x40
IPPROTO_SATMON = 0x45
IPPROTO_SCCSP = 0x60
+ IPPROTO_SCTP = 0x84
IPPROTO_SDRP = 0x2a
IPPROTO_SEP = 0x21
IPPROTO_SRPC = 0x5a
@@ -536,12 +441,19 @@
IPPROTO_WSN = 0x4a
IPPROTO_XNET = 0xf
IPPROTO_XTP = 0x24
+ IPV6_2292DSTOPTS = 0x17
+ IPV6_2292HOPLIMIT = 0x14
+ IPV6_2292HOPOPTS = 0x16
+ IPV6_2292NEXTHOP = 0x15
+ IPV6_2292PKTINFO = 0x13
+ IPV6_2292PKTOPTIONS = 0x19
+ IPV6_2292RTHDR = 0x18
IPV6_BINDV6ONLY = 0x1b
+ IPV6_BOUND_IF = 0x7d
IPV6_CHECKSUM = 0x1a
IPV6_DEFAULT_MULTICAST_HOPS = 0x1
IPV6_DEFAULT_MULTICAST_LOOP = 0x1
IPV6_DEFHLIM = 0x40
- IPV6_DSTOPTS = 0x17
IPV6_FAITH = 0x1d
IPV6_FLOWINFO_MASK = 0xffffff0f
IPV6_FLOWLABEL_MASK = 0xffff0f00
@@ -552,26 +464,25 @@
IPV6_FW_GET = 0x22
IPV6_FW_ZERO = 0x21
IPV6_HLIMDEC = 0x1
- IPV6_HOPLIMIT = 0x14
- IPV6_HOPOPTS = 0x16
IPV6_IPSEC_POLICY = 0x1c
IPV6_JOIN_GROUP = 0xc
IPV6_LEAVE_GROUP = 0xd
IPV6_MAXHLIM = 0xff
+ IPV6_MAXOPTHDR = 0x800
IPV6_MAXPACKET = 0xffff
+ IPV6_MAX_GROUP_SRC_FILTER = 0x200
+ IPV6_MAX_MEMBERSHIPS = 0xfff
+ IPV6_MAX_SOCK_SRC_FILTER = 0x80
+ IPV6_MIN_MEMBERSHIPS = 0x1f
IPV6_MMTU = 0x500
IPV6_MULTICAST_HOPS = 0xa
IPV6_MULTICAST_IF = 0x9
IPV6_MULTICAST_LOOP = 0xb
- IPV6_NEXTHOP = 0x15
- IPV6_PKTINFO = 0x13
- IPV6_PKTOPTIONS = 0x19
IPV6_PORTRANGE = 0xe
IPV6_PORTRANGE_DEFAULT = 0x0
IPV6_PORTRANGE_HIGH = 0x1
IPV6_PORTRANGE_LOW = 0x2
IPV6_RECVTCLASS = 0x23
- IPV6_RTHDR = 0x18
IPV6_RTHDR_LOOSE = 0x0
IPV6_RTHDR_STRICT = 0x1
IPV6_RTHDR_TYPE_0 = 0x0
@@ -582,11 +493,14 @@
IPV6_VERSION = 0x60
IPV6_VERSION_MASK = 0xf0
IP_ADD_MEMBERSHIP = 0xc
+ IP_ADD_SOURCE_MEMBERSHIP = 0x46
+ IP_BLOCK_SOURCE = 0x48
IP_BOUND_IF = 0x19
IP_DEFAULT_MULTICAST_LOOP = 0x1
IP_DEFAULT_MULTICAST_TTL = 0x1
IP_DF = 0x4000
IP_DROP_MEMBERSHIP = 0xd
+ IP_DROP_SOURCE_MEMBERSHIP = 0x47
IP_DUMMYNET_CONFIGURE = 0x3c
IP_DUMMYNET_DEL = 0x3d
IP_DUMMYNET_FLUSH = 0x3e
@@ -601,10 +515,16 @@
IP_HDRINCL = 0x2
IP_IPSEC_POLICY = 0x15
IP_MAXPACKET = 0xffff
- IP_MAX_MEMBERSHIPS = 0x14
+ IP_MAX_GROUP_SRC_FILTER = 0x200
+ IP_MAX_MEMBERSHIPS = 0xfff
+ IP_MAX_SOCK_MUTE_FILTER = 0x80
+ IP_MAX_SOCK_SRC_FILTER = 0x80
IP_MF = 0x2000
+ IP_MIN_MEMBERSHIPS = 0x1f
+ IP_MSFILTER = 0x4a
IP_MSS = 0x240
IP_MULTICAST_IF = 0x9
+ IP_MULTICAST_IFINDEX = 0x42
IP_MULTICAST_LOOP = 0xb
IP_MULTICAST_TTL = 0xa
IP_MULTICAST_VIF = 0xe
@@ -617,6 +537,7 @@
IP_OLD_FW_RESETLOG = 0x38
IP_OLD_FW_ZERO = 0x35
IP_OPTIONS = 0x1
+ IP_PKTINFO = 0x1a
IP_PORTRANGE = 0x13
IP_PORTRANGE_DEFAULT = 0x0
IP_PORTRANGE_HIGH = 0x1
@@ -624,6 +545,7 @@
IP_RECVDSTADDR = 0x7
IP_RECVIF = 0x14
IP_RECVOPTS = 0x5
+ IP_RECVPKTINFO = 0x1a
IP_RECVRETOPTS = 0x6
IP_RECVTTL = 0x18
IP_RETOPTS = 0x8
@@ -636,6 +558,7 @@
IP_TOS = 0x3
IP_TRAFFIC_MGT_BACKGROUND = 0x41
IP_TTL = 0x4
+ IP_UNBLOCK_SOURCE = 0x49
MADV_CAN_REUSE = 0x9
MADV_DONTNEED = 0x4
MADV_FREE = 0x5
@@ -651,6 +574,7 @@
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_HASSEMAPHORE = 0x200
+ MAP_JIT = 0x800
MAP_NOCACHE = 0x400
MAP_NOEXTEND = 0x100
MAP_NORESERVE = 0x40
@@ -687,13 +611,14 @@
NET_RT_FLAGS = 0x2
NET_RT_IFLIST = 0x3
NET_RT_IFLIST2 = 0x6
- NET_RT_MAXID = 0x8
+ NET_RT_MAXID = 0xa
NET_RT_STAT = 0x4
NET_RT_TRASH = 0x5
O_ACCMODE = 0x3
O_ALERT = 0x20000000
O_APPEND = 0x8
O_ASYNC = 0x40
+ O_CLOEXEC = 0x1000000
O_CREAT = 0x200
O_DIRECTORY = 0x100000
O_DSYNC = 0x400000
@@ -809,6 +734,7 @@
SCM_CREDS = 0x3
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
+ SCM_TIMESTAMP_MONOTONIC = 0x4
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -865,6 +791,7 @@
SIOCGIFASYNCMAP = 0xc020697c
SIOCGIFBOND = 0xc0206947
SIOCGIFBRDADDR = 0xc0206923
+ SIOCGIFCAP = 0xc020695b
SIOCGIFCONF = 0xc00c6924
SIOCGIFDEVMTU = 0xc0206944
SIOCGIFDSTADDR = 0xc0206922
@@ -898,6 +825,7 @@
SIOCSIFASYNCMAP = 0x8020697d
SIOCSIFBOND = 0x80206946
SIOCSIFBRDADDR = 0x80206913
+ SIOCSIFCAP = 0x8020695a
SIOCSIFDSTADDR = 0x8020690e
SIOCSIFFLAGS = 0x80206910
SIOCSIFGENERIC = 0x80206939
@@ -956,6 +884,7 @@
SO_SNDLOWAT = 0x1003
SO_SNDTIMEO = 0x1005
SO_TIMESTAMP = 0x400
+ SO_TIMESTAMP_MONOTONIC = 0x800
SO_TYPE = 0x1008
SO_UPCALLCLOSEWAIT = 0x1027
SO_USELOOPBACK = 0x40
@@ -991,7 +920,6 @@
S_IXUSR = 0x40
TCP_CONNECTIONTIMEOUT = 0x20
TCP_KEEPALIVE = 0x10
- TCP_MAXBURST = 0x4
TCP_MAXHLEN = 0x3c
TCP_MAXOLEN = 0x28
TCP_MAXSEG = 0x2
@@ -1004,6 +932,8 @@
TCP_NODELAY = 0x1
TCP_NOOPT = 0x8
TCP_NOPUSH = 0x4
+ TCP_RXT_CONNDROPTIME = 0x80
+ TCP_RXT_FINDROP = 0x100
TIOCCBRK = 0x2000747a
TIOCCDTR = 0x20007478
TIOCCONS = 0x80047462
@@ -1083,6 +1013,117 @@
WUNTRACED = 0x2
)
+// Errors
+const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x30)
+ EADDRNOTAVAIL = Errno(0x31)
+ EAFNOSUPPORT = Errno(0x2f)
+ EAGAIN = Errno(0x23)
+ EALREADY = Errno(0x25)
+ EAUTH = Errno(0x50)
+ EBADARCH = Errno(0x56)
+ EBADEXEC = Errno(0x55)
+ EBADF = Errno(0x9)
+ EBADMACHO = Errno(0x58)
+ EBADMSG = Errno(0x5e)
+ EBADRPC = Errno(0x48)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x59)
+ ECHILD = Errno(0xa)
+ ECONNABORTED = Errno(0x35)
+ ECONNREFUSED = Errno(0x3d)
+ ECONNRESET = Errno(0x36)
+ EDEADLK = Errno(0xb)
+ EDESTADDRREQ = Errno(0x27)
+ EDEVERR = Errno(0x53)
+ EDOM = Errno(0x21)
+ EDQUOT = Errno(0x45)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EFTYPE = Errno(0x4f)
+ EHOSTDOWN = Errno(0x40)
+ EHOSTUNREACH = Errno(0x41)
+ EIDRM = Errno(0x5a)
+ EILSEQ = Errno(0x5c)
+ EINPROGRESS = Errno(0x24)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EISCONN = Errno(0x38)
+ EISDIR = Errno(0x15)
+ ELAST = Errno(0x69)
+ ELOOP = Errno(0x3e)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x28)
+ EMULTIHOP = Errno(0x5f)
+ ENAMETOOLONG = Errno(0x3f)
+ ENEEDAUTH = Errno(0x51)
+ ENETDOWN = Errno(0x32)
+ ENETRESET = Errno(0x34)
+ ENETUNREACH = Errno(0x33)
+ ENFILE = Errno(0x17)
+ ENOATTR = Errno(0x5d)
+ ENOBUFS = Errno(0x37)
+ ENODATA = Errno(0x60)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOLCK = Errno(0x4d)
+ ENOLINK = Errno(0x61)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x5b)
+ ENOPOLICY = Errno(0x67)
+ ENOPROTOOPT = Errno(0x2a)
+ ENOSPC = Errno(0x1c)
+ ENOSR = Errno(0x62)
+ ENOSTR = Errno(0x63)
+ ENOSYS = Errno(0x4e)
+ ENOTBLK = Errno(0xf)
+ ENOTCONN = Errno(0x39)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x42)
+ ENOTRECOVERABLE = Errno(0x68)
+ ENOTSOCK = Errno(0x26)
+ ENOTSUP = Errno(0x2d)
+ ENOTTY = Errno(0x19)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x66)
+ EOVERFLOW = Errno(0x54)
+ EOWNERDEAD = Errno(0x69)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x2e)
+ EPIPE = Errno(0x20)
+ EPROCLIM = Errno(0x43)
+ EPROCUNAVAIL = Errno(0x4c)
+ EPROGMISMATCH = Errno(0x4b)
+ EPROGUNAVAIL = Errno(0x4a)
+ EPROTO = Errno(0x64)
+ EPROTONOSUPPORT = Errno(0x2b)
+ EPROTOTYPE = Errno(0x29)
+ EPWROFF = Errno(0x52)
+ ERANGE = Errno(0x22)
+ EREMOTE = Errno(0x47)
+ EROFS = Errno(0x1e)
+ ERPCMISMATCH = Errno(0x49)
+ ESHLIBVERS = Errno(0x57)
+ ESHUTDOWN = Errno(0x3a)
+ ESOCKTNOSUPPORT = Errno(0x2c)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESTALE = Errno(0x46)
+ ETIME = Errno(0x65)
+ ETIMEDOUT = Errno(0x3c)
+ ETOOMANYREFS = Errno(0x3b)
+ ETXTBSY = Errno(0x1a)
+ EUSERS = Errno(0x44)
+ EWOULDBLOCK = Errno(0x23)
+ EXDEV = Errno(0x12)
+)
+
// Error table
var errors = [...]string{
1: "operation not permitted",
@@ -1188,4 +1229,6 @@
101: "STREAM ioctl timeout",
102: "operation not supported on socket",
103: "policy not found",
+ 104: "state not recoverable",
+ 105: "previous owner died",
}
diff --git a/src/pkg/syscall/zerrors_freebsd_386.go b/src/pkg/syscall/zerrors_freebsd_386.go
index 7c7a0e4..f3171e3 100644
--- a/src/pkg/syscall/zerrors_freebsd_386.go
+++ b/src/pkg/syscall/zerrors_freebsd_386.go
@@ -311,107 +311,6 @@
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
DT_WHT = 0xe
- E2BIG = 0x7
- EACCES = 0xd
- EADDRINUSE = 0x30
- EADDRNOTAVAIL = 0x31
- EAFNOSUPPORT = 0x2f
- EAGAIN = 0x23
- EALREADY = 0x25
- EAUTH = 0x50
- EBADF = 0x9
- EBADMSG = 0x59
- EBADRPC = 0x48
- EBUSY = 0x10
- ECANCELED = 0x55
- ECHILD = 0xa
- ECHO = 0x8
- ECHOCTL = 0x40
- ECHOE = 0x2
- ECHOK = 0x4
- ECHOKE = 0x1
- ECHONL = 0x10
- ECHOPRT = 0x20
- ECONNABORTED = 0x35
- ECONNREFUSED = 0x3d
- ECONNRESET = 0x36
- EDEADLK = 0xb
- EDESTADDRREQ = 0x27
- EDOM = 0x21
- EDOOFUS = 0x58
- EDQUOT = 0x45
- EEXIST = 0x11
- EFAULT = 0xe
- EFBIG = 0x1b
- EFTYPE = 0x4f
- EHOSTDOWN = 0x40
- EHOSTUNREACH = 0x41
- EIDRM = 0x52
- EILSEQ = 0x56
- EINPROGRESS = 0x24
- EINTR = 0x4
- EINVAL = 0x16
- EIO = 0x5
- EISCONN = 0x38
- EISDIR = 0x15
- ELAST = 0x5d
- ELOOP = 0x3e
- EMFILE = 0x18
- EMLINK = 0x1f
- EMSGSIZE = 0x28
- EMULTIHOP = 0x5a
- ENAMETOOLONG = 0x3f
- ENEEDAUTH = 0x51
- ENETDOWN = 0x32
- ENETRESET = 0x34
- ENETUNREACH = 0x33
- ENFILE = 0x17
- ENOATTR = 0x57
- ENOBUFS = 0x37
- ENODEV = 0x13
- ENOENT = 0x2
- ENOEXEC = 0x8
- ENOLCK = 0x4d
- ENOLINK = 0x5b
- ENOMEM = 0xc
- ENOMSG = 0x53
- ENOPROTOOPT = 0x2a
- ENOSPC = 0x1c
- ENOSYS = 0x4e
- ENOTBLK = 0xf
- ENOTCAPABLE = 0x5d
- ENOTCONN = 0x39
- ENOTDIR = 0x14
- ENOTEMPTY = 0x42
- ENOTSOCK = 0x26
- ENOTSUP = 0x2d
- ENOTTY = 0x19
- ENXIO = 0x6
- EOPNOTSUPP = 0x2d
- EOVERFLOW = 0x54
- EPERM = 0x1
- EPFNOSUPPORT = 0x2e
- EPIPE = 0x20
- EPROCLIM = 0x43
- EPROCUNAVAIL = 0x4c
- EPROGMISMATCH = 0x4b
- EPROGUNAVAIL = 0x4a
- EPROTO = 0x5c
- EPROTONOSUPPORT = 0x2b
- EPROTOTYPE = 0x29
- ERANGE = 0x22
- EREMOTE = 0x47
- EROFS = 0x1e
- ERPCMISMATCH = 0x49
- ESHUTDOWN = 0x3a
- ESOCKTNOSUPPORT = 0x2c
- ESPIPE = 0x1d
- ESRCH = 0x3
- ESTALE = 0x46
- ETIMEDOUT = 0x3c
- ETOOMANYREFS = 0x3b
- ETXTBSY = 0x1a
- EUSERS = 0x44
EVFILT_AIO = -0x3
EVFILT_FS = -0x9
EVFILT_LIO = -0xa
@@ -435,8 +334,6 @@
EV_ONESHOT = 0x10
EV_RECEIPT = 0x40
EV_SYSFLAGS = 0xf000
- EWOULDBLOCK = 0x23
- EXDEV = 0x12
EXTA = 0x4b00
EXTB = 0x9600
EXTPROC = 0x800
@@ -1303,6 +1200,113 @@
WUNTRACED = 0x2
)
+// Errors
+const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x30)
+ EADDRNOTAVAIL = Errno(0x31)
+ EAFNOSUPPORT = Errno(0x2f)
+ EAGAIN = Errno(0x23)
+ EALREADY = Errno(0x25)
+ EAUTH = Errno(0x50)
+ EBADF = Errno(0x9)
+ EBADMSG = Errno(0x59)
+ EBADRPC = Errno(0x48)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x55)
+ ECHILD = Errno(0xa)
+ ECHO = Errno(0x8)
+ ECHOCTL = Errno(0x40)
+ ECHOE = Errno(0x2)
+ ECHOK = Errno(0x4)
+ ECHOKE = Errno(0x1)
+ ECHONL = Errno(0x10)
+ ECHOPRT = Errno(0x20)
+ ECONNABORTED = Errno(0x35)
+ ECONNREFUSED = Errno(0x3d)
+ ECONNRESET = Errno(0x36)
+ EDEADLK = Errno(0xb)
+ EDESTADDRREQ = Errno(0x27)
+ EDOM = Errno(0x21)
+ EDOOFUS = Errno(0x58)
+ EDQUOT = Errno(0x45)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EFTYPE = Errno(0x4f)
+ EHOSTDOWN = Errno(0x40)
+ EHOSTUNREACH = Errno(0x41)
+ EIDRM = Errno(0x52)
+ EILSEQ = Errno(0x56)
+ EINPROGRESS = Errno(0x24)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EISCONN = Errno(0x38)
+ EISDIR = Errno(0x15)
+ ELAST = Errno(0x5d)
+ ELOOP = Errno(0x3e)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x28)
+ EMULTIHOP = Errno(0x5a)
+ ENAMETOOLONG = Errno(0x3f)
+ ENEEDAUTH = Errno(0x51)
+ ENETDOWN = Errno(0x32)
+ ENETRESET = Errno(0x34)
+ ENETUNREACH = Errno(0x33)
+ ENFILE = Errno(0x17)
+ ENOATTR = Errno(0x57)
+ ENOBUFS = Errno(0x37)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOLCK = Errno(0x4d)
+ ENOLINK = Errno(0x5b)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x53)
+ ENOPROTOOPT = Errno(0x2a)
+ ENOSPC = Errno(0x1c)
+ ENOSYS = Errno(0x4e)
+ ENOTBLK = Errno(0xf)
+ ENOTCAPABLE = Errno(0x5d)
+ ENOTCONN = Errno(0x39)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x42)
+ ENOTSOCK = Errno(0x26)
+ ENOTSUP = Errno(0x2d)
+ ENOTTY = Errno(0x19)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x2d)
+ EOVERFLOW = Errno(0x54)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x2e)
+ EPIPE = Errno(0x20)
+ EPROCLIM = Errno(0x43)
+ EPROCUNAVAIL = Errno(0x4c)
+ EPROGMISMATCH = Errno(0x4b)
+ EPROGUNAVAIL = Errno(0x4a)
+ EPROTO = Errno(0x5c)
+ EPROTONOSUPPORT = Errno(0x2b)
+ EPROTOTYPE = Errno(0x29)
+ ERANGE = Errno(0x22)
+ EREMOTE = Errno(0x47)
+ EROFS = Errno(0x1e)
+ ERPCMISMATCH = Errno(0x49)
+ ESHUTDOWN = Errno(0x3a)
+ ESOCKTNOSUPPORT = Errno(0x2c)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESTALE = Errno(0x46)
+ ETIMEDOUT = Errno(0x3c)
+ ETOOMANYREFS = Errno(0x3b)
+ ETXTBSY = Errno(0x1a)
+ EUSERS = Errno(0x44)
+ EWOULDBLOCK = Errno(0x23)
+ EXDEV = Errno(0x12)
+)
+
// Error table
var errors = [...]string{
1: "operation not permitted",
diff --git a/src/pkg/syscall/zerrors_freebsd_amd64.go b/src/pkg/syscall/zerrors_freebsd_amd64.go
index 380ee98..3fb225d 100644
--- a/src/pkg/syscall/zerrors_freebsd_amd64.go
+++ b/src/pkg/syscall/zerrors_freebsd_amd64.go
@@ -311,107 +311,6 @@
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
DT_WHT = 0xe
- E2BIG = 0x7
- EACCES = 0xd
- EADDRINUSE = 0x30
- EADDRNOTAVAIL = 0x31
- EAFNOSUPPORT = 0x2f
- EAGAIN = 0x23
- EALREADY = 0x25
- EAUTH = 0x50
- EBADF = 0x9
- EBADMSG = 0x59
- EBADRPC = 0x48
- EBUSY = 0x10
- ECANCELED = 0x55
- ECHILD = 0xa
- ECHO = 0x8
- ECHOCTL = 0x40
- ECHOE = 0x2
- ECHOK = 0x4
- ECHOKE = 0x1
- ECHONL = 0x10
- ECHOPRT = 0x20
- ECONNABORTED = 0x35
- ECONNREFUSED = 0x3d
- ECONNRESET = 0x36
- EDEADLK = 0xb
- EDESTADDRREQ = 0x27
- EDOM = 0x21
- EDOOFUS = 0x58
- EDQUOT = 0x45
- EEXIST = 0x11
- EFAULT = 0xe
- EFBIG = 0x1b
- EFTYPE = 0x4f
- EHOSTDOWN = 0x40
- EHOSTUNREACH = 0x41
- EIDRM = 0x52
- EILSEQ = 0x56
- EINPROGRESS = 0x24
- EINTR = 0x4
- EINVAL = 0x16
- EIO = 0x5
- EISCONN = 0x38
- EISDIR = 0x15
- ELAST = 0x5d
- ELOOP = 0x3e
- EMFILE = 0x18
- EMLINK = 0x1f
- EMSGSIZE = 0x28
- EMULTIHOP = 0x5a
- ENAMETOOLONG = 0x3f
- ENEEDAUTH = 0x51
- ENETDOWN = 0x32
- ENETRESET = 0x34
- ENETUNREACH = 0x33
- ENFILE = 0x17
- ENOATTR = 0x57
- ENOBUFS = 0x37
- ENODEV = 0x13
- ENOENT = 0x2
- ENOEXEC = 0x8
- ENOLCK = 0x4d
- ENOLINK = 0x5b
- ENOMEM = 0xc
- ENOMSG = 0x53
- ENOPROTOOPT = 0x2a
- ENOSPC = 0x1c
- ENOSYS = 0x4e
- ENOTBLK = 0xf
- ENOTCAPABLE = 0x5d
- ENOTCONN = 0x39
- ENOTDIR = 0x14
- ENOTEMPTY = 0x42
- ENOTSOCK = 0x26
- ENOTSUP = 0x2d
- ENOTTY = 0x19
- ENXIO = 0x6
- EOPNOTSUPP = 0x2d
- EOVERFLOW = 0x54
- EPERM = 0x1
- EPFNOSUPPORT = 0x2e
- EPIPE = 0x20
- EPROCLIM = 0x43
- EPROCUNAVAIL = 0x4c
- EPROGMISMATCH = 0x4b
- EPROGUNAVAIL = 0x4a
- EPROTO = 0x5c
- EPROTONOSUPPORT = 0x2b
- EPROTOTYPE = 0x29
- ERANGE = 0x22
- EREMOTE = 0x47
- EROFS = 0x1e
- ERPCMISMATCH = 0x49
- ESHUTDOWN = 0x3a
- ESOCKTNOSUPPORT = 0x2c
- ESPIPE = 0x1d
- ESRCH = 0x3
- ESTALE = 0x46
- ETIMEDOUT = 0x3c
- ETOOMANYREFS = 0x3b
- ETXTBSY = 0x1a
- EUSERS = 0x44
EVFILT_AIO = -0x3
EVFILT_FS = -0x9
EVFILT_LIO = -0xa
@@ -435,8 +334,6 @@
EV_ONESHOT = 0x10
EV_RECEIPT = 0x40
EV_SYSFLAGS = 0xf000
- EWOULDBLOCK = 0x23
- EXDEV = 0x12
EXTA = 0x4b00
EXTB = 0x9600
EXTPROC = 0x800
@@ -1303,6 +1200,113 @@
WUNTRACED = 0x2
)
+// Errors
+const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x30)
+ EADDRNOTAVAIL = Errno(0x31)
+ EAFNOSUPPORT = Errno(0x2f)
+ EAGAIN = Errno(0x23)
+ EALREADY = Errno(0x25)
+ EAUTH = Errno(0x50)
+ EBADF = Errno(0x9)
+ EBADMSG = Errno(0x59)
+ EBADRPC = Errno(0x48)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x55)
+ ECHILD = Errno(0xa)
+ ECHO = Errno(0x8)
+ ECHOCTL = Errno(0x40)
+ ECHOE = Errno(0x2)
+ ECHOK = Errno(0x4)
+ ECHOKE = Errno(0x1)
+ ECHONL = Errno(0x10)
+ ECHOPRT = Errno(0x20)
+ ECONNABORTED = Errno(0x35)
+ ECONNREFUSED = Errno(0x3d)
+ ECONNRESET = Errno(0x36)
+ EDEADLK = Errno(0xb)
+ EDESTADDRREQ = Errno(0x27)
+ EDOM = Errno(0x21)
+ EDOOFUS = Errno(0x58)
+ EDQUOT = Errno(0x45)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EFTYPE = Errno(0x4f)
+ EHOSTDOWN = Errno(0x40)
+ EHOSTUNREACH = Errno(0x41)
+ EIDRM = Errno(0x52)
+ EILSEQ = Errno(0x56)
+ EINPROGRESS = Errno(0x24)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EISCONN = Errno(0x38)
+ EISDIR = Errno(0x15)
+ ELAST = Errno(0x5d)
+ ELOOP = Errno(0x3e)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x28)
+ EMULTIHOP = Errno(0x5a)
+ ENAMETOOLONG = Errno(0x3f)
+ ENEEDAUTH = Errno(0x51)
+ ENETDOWN = Errno(0x32)
+ ENETRESET = Errno(0x34)
+ ENETUNREACH = Errno(0x33)
+ ENFILE = Errno(0x17)
+ ENOATTR = Errno(0x57)
+ ENOBUFS = Errno(0x37)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOLCK = Errno(0x4d)
+ ENOLINK = Errno(0x5b)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x53)
+ ENOPROTOOPT = Errno(0x2a)
+ ENOSPC = Errno(0x1c)
+ ENOSYS = Errno(0x4e)
+ ENOTBLK = Errno(0xf)
+ ENOTCAPABLE = Errno(0x5d)
+ ENOTCONN = Errno(0x39)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x42)
+ ENOTSOCK = Errno(0x26)
+ ENOTSUP = Errno(0x2d)
+ ENOTTY = Errno(0x19)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x2d)
+ EOVERFLOW = Errno(0x54)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x2e)
+ EPIPE = Errno(0x20)
+ EPROCLIM = Errno(0x43)
+ EPROCUNAVAIL = Errno(0x4c)
+ EPROGMISMATCH = Errno(0x4b)
+ EPROGUNAVAIL = Errno(0x4a)
+ EPROTO = Errno(0x5c)
+ EPROTONOSUPPORT = Errno(0x2b)
+ EPROTOTYPE = Errno(0x29)
+ ERANGE = Errno(0x22)
+ EREMOTE = Errno(0x47)
+ EROFS = Errno(0x1e)
+ ERPCMISMATCH = Errno(0x49)
+ ESHUTDOWN = Errno(0x3a)
+ ESOCKTNOSUPPORT = Errno(0x2c)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESTALE = Errno(0x46)
+ ETIMEDOUT = Errno(0x3c)
+ ETOOMANYREFS = Errno(0x3b)
+ ETXTBSY = Errno(0x1a)
+ EUSERS = Errno(0x44)
+ EWOULDBLOCK = Errno(0x23)
+ EXDEV = Errno(0x12)
+)
+
// Error table
var errors = [...]string{
1: "operation not permitted",
diff --git a/src/pkg/syscall/zerrors_linux_386.go b/src/pkg/syscall/zerrors_linux_386.go
index a206672..a75dfb8 100644
--- a/src/pkg/syscall/zerrors_linux_386.go
+++ b/src/pkg/syscall/zerrors_linux_386.go
@@ -155,112 +155,6 @@
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
DT_WHT = 0xe
- E2BIG = 0x7
- EACCES = 0xd
- EADDRINUSE = 0x62
- EADDRNOTAVAIL = 0x63
- EADV = 0x44
- EAFNOSUPPORT = 0x61
- EAGAIN = 0xb
- EALREADY = 0x72
- EBADE = 0x34
- EBADF = 0x9
- EBADFD = 0x4d
- EBADMSG = 0x4a
- EBADR = 0x35
- EBADRQC = 0x38
- EBADSLT = 0x39
- EBFONT = 0x3b
- EBUSY = 0x10
- ECANCELED = 0x7d
- ECHILD = 0xa
- ECHRNG = 0x2c
- ECOMM = 0x46
- ECONNABORTED = 0x67
- ECONNREFUSED = 0x6f
- ECONNRESET = 0x68
- EDEADLK = 0x23
- EDEADLOCK = 0x23
- EDESTADDRREQ = 0x59
- EDOM = 0x21
- EDOTDOT = 0x49
- EDQUOT = 0x7a
- EEXIST = 0x11
- EFAULT = 0xe
- EFBIG = 0x1b
- EHOSTDOWN = 0x70
- EHOSTUNREACH = 0x71
- EIDRM = 0x2b
- EILSEQ = 0x54
- EINPROGRESS = 0x73
- EINTR = 0x4
- EINVAL = 0x16
- EIO = 0x5
- EISCONN = 0x6a
- EISDIR = 0x15
- EISNAM = 0x78
- EKEYEXPIRED = 0x7f
- EKEYREJECTED = 0x81
- EKEYREVOKED = 0x80
- EL2HLT = 0x33
- EL2NSYNC = 0x2d
- EL3HLT = 0x2e
- EL3RST = 0x2f
- ELIBACC = 0x4f
- ELIBBAD = 0x50
- ELIBEXEC = 0x53
- ELIBMAX = 0x52
- ELIBSCN = 0x51
- ELNRNG = 0x30
- ELOOP = 0x28
- EMEDIUMTYPE = 0x7c
- EMFILE = 0x18
- EMLINK = 0x1f
- EMSGSIZE = 0x5a
- EMULTIHOP = 0x48
- ENAMETOOLONG = 0x24
- ENAVAIL = 0x77
- ENETDOWN = 0x64
- ENETRESET = 0x66
- ENETUNREACH = 0x65
- ENFILE = 0x17
- ENOANO = 0x37
- ENOBUFS = 0x69
- ENOCSI = 0x32
- ENODATA = 0x3d
- ENODEV = 0x13
- ENOENT = 0x2
- ENOEXEC = 0x8
- ENOKEY = 0x7e
- ENOLCK = 0x25
- ENOLINK = 0x43
- ENOMEDIUM = 0x7b
- ENOMEM = 0xc
- ENOMSG = 0x2a
- ENONET = 0x40
- ENOPKG = 0x41
- ENOPROTOOPT = 0x5c
- ENOSPC = 0x1c
- ENOSR = 0x3f
- ENOSTR = 0x3c
- ENOSYS = 0x26
- ENOTBLK = 0xf
- ENOTCONN = 0x6b
- ENOTDIR = 0x14
- ENOTEMPTY = 0x27
- ENOTNAM = 0x76
- ENOTRECOVERABLE = 0x83
- ENOTSOCK = 0x58
- ENOTSUP = 0x5f
- ENOTTY = 0x19
- ENOTUNIQ = 0x4c
- ENXIO = 0x6
- EOPNOTSUPP = 0x5f
- EOVERFLOW = 0x4b
- EOWNERDEAD = 0x82
- EPERM = 0x1
- EPFNOSUPPORT = 0x60
- EPIPE = 0x20
EPOLLERR = 0x8
EPOLLET = -0x80000000
EPOLLHUP = 0x10
@@ -279,23 +173,6 @@
EPOLL_CTL_DEL = 0x2
EPOLL_CTL_MOD = 0x3
EPOLL_NONBLOCK = 0x800
- EPROTO = 0x47
- EPROTONOSUPPORT = 0x5d
- EPROTOTYPE = 0x5b
- ERANGE = 0x22
- EREMCHG = 0x4e
- EREMOTE = 0x42
- EREMOTEIO = 0x79
- ERESTART = 0x55
- ERFKILL = 0x84
- EROFS = 0x1e
- ESHUTDOWN = 0x6c
- ESOCKTNOSUPPORT = 0x5e
- ESPIPE = 0x1d
- ESRCH = 0x3
- ESRMNT = 0x45
- ESTALE = 0x74
- ESTRPIPE = 0x56
ETH_P_1588 = 0x88f7
ETH_P_8021Q = 0x8100
ETH_P_802_2 = 0x4
@@ -360,16 +237,6 @@
ETH_P_WAN_PPP = 0x7
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
- ETIME = 0x3e
- ETIMEDOUT = 0x6e
- ETOOMANYREFS = 0x6d
- ETXTBSY = 0x1a
- EUCLEAN = 0x75
- EUNATCH = 0x31
- EUSERS = 0x57
- EWOULDBLOCK = 0xb
- EXDEV = 0x12
- EXFULL = 0x36
FD_CLOEXEC = 0x1
FD_SETSIZE = 0x400
F_DUPFD = 0x0
@@ -1262,6 +1129,143 @@
WUNTRACED = 0x2
)
+// Errors
+const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x62)
+ EADDRNOTAVAIL = Errno(0x63)
+ EADV = Errno(0x44)
+ EAFNOSUPPORT = Errno(0x61)
+ EAGAIN = Errno(0xb)
+ EALREADY = Errno(0x72)
+ EBADE = Errno(0x34)
+ EBADF = Errno(0x9)
+ EBADFD = Errno(0x4d)
+ EBADMSG = Errno(0x4a)
+ EBADR = Errno(0x35)
+ EBADRQC = Errno(0x38)
+ EBADSLT = Errno(0x39)
+ EBFONT = Errno(0x3b)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x7d)
+ ECHILD = Errno(0xa)
+ ECHRNG = Errno(0x2c)
+ ECOMM = Errno(0x46)
+ ECONNABORTED = Errno(0x67)
+ ECONNREFUSED = Errno(0x6f)
+ ECONNRESET = Errno(0x68)
+ EDEADLK = Errno(0x23)
+ EDEADLOCK = Errno(0x23)
+ EDESTADDRREQ = Errno(0x59)
+ EDOM = Errno(0x21)
+ EDOTDOT = Errno(0x49)
+ EDQUOT = Errno(0x7a)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EHOSTDOWN = Errno(0x70)
+ EHOSTUNREACH = Errno(0x71)
+ EIDRM = Errno(0x2b)
+ EILSEQ = Errno(0x54)
+ EINPROGRESS = Errno(0x73)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EISCONN = Errno(0x6a)
+ EISDIR = Errno(0x15)
+ EISNAM = Errno(0x78)
+ EKEYEXPIRED = Errno(0x7f)
+ EKEYREJECTED = Errno(0x81)
+ EKEYREVOKED = Errno(0x80)
+ EL2HLT = Errno(0x33)
+ EL2NSYNC = Errno(0x2d)
+ EL3HLT = Errno(0x2e)
+ EL3RST = Errno(0x2f)
+ ELIBACC = Errno(0x4f)
+ ELIBBAD = Errno(0x50)
+ ELIBEXEC = Errno(0x53)
+ ELIBMAX = Errno(0x52)
+ ELIBSCN = Errno(0x51)
+ ELNRNG = Errno(0x30)
+ ELOOP = Errno(0x28)
+ EMEDIUMTYPE = Errno(0x7c)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x5a)
+ EMULTIHOP = Errno(0x48)
+ ENAMETOOLONG = Errno(0x24)
+ ENAVAIL = Errno(0x77)
+ ENETDOWN = Errno(0x64)
+ ENETRESET = Errno(0x66)
+ ENETUNREACH = Errno(0x65)
+ ENFILE = Errno(0x17)
+ ENOANO = Errno(0x37)
+ ENOBUFS = Errno(0x69)
+ ENOCSI = Errno(0x32)
+ ENODATA = Errno(0x3d)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOKEY = Errno(0x7e)
+ ENOLCK = Errno(0x25)
+ ENOLINK = Errno(0x43)
+ ENOMEDIUM = Errno(0x7b)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x2a)
+ ENONET = Errno(0x40)
+ ENOPKG = Errno(0x41)
+ ENOPROTOOPT = Errno(0x5c)
+ ENOSPC = Errno(0x1c)
+ ENOSR = Errno(0x3f)
+ ENOSTR = Errno(0x3c)
+ ENOSYS = Errno(0x26)
+ ENOTBLK = Errno(0xf)
+ ENOTCONN = Errno(0x6b)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x27)
+ ENOTNAM = Errno(0x76)
+ ENOTRECOVERABLE = Errno(0x83)
+ ENOTSOCK = Errno(0x58)
+ ENOTSUP = Errno(0x5f)
+ ENOTTY = Errno(0x19)
+ ENOTUNIQ = Errno(0x4c)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x5f)
+ EOVERFLOW = Errno(0x4b)
+ EOWNERDEAD = Errno(0x82)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x60)
+ EPIPE = Errno(0x20)
+ EPROTO = Errno(0x47)
+ EPROTONOSUPPORT = Errno(0x5d)
+ EPROTOTYPE = Errno(0x5b)
+ ERANGE = Errno(0x22)
+ EREMCHG = Errno(0x4e)
+ EREMOTE = Errno(0x42)
+ EREMOTEIO = Errno(0x79)
+ ERESTART = Errno(0x55)
+ ERFKILL = Errno(0x84)
+ EROFS = Errno(0x1e)
+ ESHUTDOWN = Errno(0x6c)
+ ESOCKTNOSUPPORT = Errno(0x5e)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESRMNT = Errno(0x45)
+ ESTALE = Errno(0x74)
+ ESTRPIPE = Errno(0x56)
+ ETIME = Errno(0x3e)
+ ETIMEDOUT = Errno(0x6e)
+ ETOOMANYREFS = Errno(0x6d)
+ ETXTBSY = Errno(0x1a)
+ EUCLEAN = Errno(0x75)
+ EUNATCH = Errno(0x31)
+ EUSERS = Errno(0x57)
+ EWOULDBLOCK = Errno(0xb)
+ EXDEV = Errno(0x12)
+ EXFULL = Errno(0x36)
+)
+
// Error table
var errors = [...]string{
1: "operation not permitted",
diff --git a/src/pkg/syscall/zerrors_linux_amd64.go b/src/pkg/syscall/zerrors_linux_amd64.go
index 0624690..acac444 100644
--- a/src/pkg/syscall/zerrors_linux_amd64.go
+++ b/src/pkg/syscall/zerrors_linux_amd64.go
@@ -155,112 +155,6 @@
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
DT_WHT = 0xe
- E2BIG = 0x7
- EACCES = 0xd
- EADDRINUSE = 0x62
- EADDRNOTAVAIL = 0x63
- EADV = 0x44
- EAFNOSUPPORT = 0x61
- EAGAIN = 0xb
- EALREADY = 0x72
- EBADE = 0x34
- EBADF = 0x9
- EBADFD = 0x4d
- EBADMSG = 0x4a
- EBADR = 0x35
- EBADRQC = 0x38
- EBADSLT = 0x39
- EBFONT = 0x3b
- EBUSY = 0x10
- ECANCELED = 0x7d
- ECHILD = 0xa
- ECHRNG = 0x2c
- ECOMM = 0x46
- ECONNABORTED = 0x67
- ECONNREFUSED = 0x6f
- ECONNRESET = 0x68
- EDEADLK = 0x23
- EDEADLOCK = 0x23
- EDESTADDRREQ = 0x59
- EDOM = 0x21
- EDOTDOT = 0x49
- EDQUOT = 0x7a
- EEXIST = 0x11
- EFAULT = 0xe
- EFBIG = 0x1b
- EHOSTDOWN = 0x70
- EHOSTUNREACH = 0x71
- EIDRM = 0x2b
- EILSEQ = 0x54
- EINPROGRESS = 0x73
- EINTR = 0x4
- EINVAL = 0x16
- EIO = 0x5
- EISCONN = 0x6a
- EISDIR = 0x15
- EISNAM = 0x78
- EKEYEXPIRED = 0x7f
- EKEYREJECTED = 0x81
- EKEYREVOKED = 0x80
- EL2HLT = 0x33
- EL2NSYNC = 0x2d
- EL3HLT = 0x2e
- EL3RST = 0x2f
- ELIBACC = 0x4f
- ELIBBAD = 0x50
- ELIBEXEC = 0x53
- ELIBMAX = 0x52
- ELIBSCN = 0x51
- ELNRNG = 0x30
- ELOOP = 0x28
- EMEDIUMTYPE = 0x7c
- EMFILE = 0x18
- EMLINK = 0x1f
- EMSGSIZE = 0x5a
- EMULTIHOP = 0x48
- ENAMETOOLONG = 0x24
- ENAVAIL = 0x77
- ENETDOWN = 0x64
- ENETRESET = 0x66
- ENETUNREACH = 0x65
- ENFILE = 0x17
- ENOANO = 0x37
- ENOBUFS = 0x69
- ENOCSI = 0x32
- ENODATA = 0x3d
- ENODEV = 0x13
- ENOENT = 0x2
- ENOEXEC = 0x8
- ENOKEY = 0x7e
- ENOLCK = 0x25
- ENOLINK = 0x43
- ENOMEDIUM = 0x7b
- ENOMEM = 0xc
- ENOMSG = 0x2a
- ENONET = 0x40
- ENOPKG = 0x41
- ENOPROTOOPT = 0x5c
- ENOSPC = 0x1c
- ENOSR = 0x3f
- ENOSTR = 0x3c
- ENOSYS = 0x26
- ENOTBLK = 0xf
- ENOTCONN = 0x6b
- ENOTDIR = 0x14
- ENOTEMPTY = 0x27
- ENOTNAM = 0x76
- ENOTRECOVERABLE = 0x83
- ENOTSOCK = 0x58
- ENOTSUP = 0x5f
- ENOTTY = 0x19
- ENOTUNIQ = 0x4c
- ENXIO = 0x6
- EOPNOTSUPP = 0x5f
- EOVERFLOW = 0x4b
- EOWNERDEAD = 0x82
- EPERM = 0x1
- EPFNOSUPPORT = 0x60
- EPIPE = 0x20
EPOLLERR = 0x8
EPOLLET = -0x80000000
EPOLLHUP = 0x10
@@ -279,23 +173,6 @@
EPOLL_CTL_DEL = 0x2
EPOLL_CTL_MOD = 0x3
EPOLL_NONBLOCK = 0x800
- EPROTO = 0x47
- EPROTONOSUPPORT = 0x5d
- EPROTOTYPE = 0x5b
- ERANGE = 0x22
- EREMCHG = 0x4e
- EREMOTE = 0x42
- EREMOTEIO = 0x79
- ERESTART = 0x55
- ERFKILL = 0x84
- EROFS = 0x1e
- ESHUTDOWN = 0x6c
- ESOCKTNOSUPPORT = 0x5e
- ESPIPE = 0x1d
- ESRCH = 0x3
- ESRMNT = 0x45
- ESTALE = 0x74
- ESTRPIPE = 0x56
ETH_P_1588 = 0x88f7
ETH_P_8021Q = 0x8100
ETH_P_802_2 = 0x4
@@ -360,16 +237,6 @@
ETH_P_WAN_PPP = 0x7
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
- ETIME = 0x3e
- ETIMEDOUT = 0x6e
- ETOOMANYREFS = 0x6d
- ETXTBSY = 0x1a
- EUCLEAN = 0x75
- EUNATCH = 0x31
- EUSERS = 0x57
- EWOULDBLOCK = 0xb
- EXDEV = 0x12
- EXFULL = 0x36
FD_CLOEXEC = 0x1
FD_SETSIZE = 0x400
F_DUPFD = 0x0
@@ -1263,6 +1130,143 @@
WUNTRACED = 0x2
)
+// Errors
+const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x62)
+ EADDRNOTAVAIL = Errno(0x63)
+ EADV = Errno(0x44)
+ EAFNOSUPPORT = Errno(0x61)
+ EAGAIN = Errno(0xb)
+ EALREADY = Errno(0x72)
+ EBADE = Errno(0x34)
+ EBADF = Errno(0x9)
+ EBADFD = Errno(0x4d)
+ EBADMSG = Errno(0x4a)
+ EBADR = Errno(0x35)
+ EBADRQC = Errno(0x38)
+ EBADSLT = Errno(0x39)
+ EBFONT = Errno(0x3b)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x7d)
+ ECHILD = Errno(0xa)
+ ECHRNG = Errno(0x2c)
+ ECOMM = Errno(0x46)
+ ECONNABORTED = Errno(0x67)
+ ECONNREFUSED = Errno(0x6f)
+ ECONNRESET = Errno(0x68)
+ EDEADLK = Errno(0x23)
+ EDEADLOCK = Errno(0x23)
+ EDESTADDRREQ = Errno(0x59)
+ EDOM = Errno(0x21)
+ EDOTDOT = Errno(0x49)
+ EDQUOT = Errno(0x7a)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EHOSTDOWN = Errno(0x70)
+ EHOSTUNREACH = Errno(0x71)
+ EIDRM = Errno(0x2b)
+ EILSEQ = Errno(0x54)
+ EINPROGRESS = Errno(0x73)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EISCONN = Errno(0x6a)
+ EISDIR = Errno(0x15)
+ EISNAM = Errno(0x78)
+ EKEYEXPIRED = Errno(0x7f)
+ EKEYREJECTED = Errno(0x81)
+ EKEYREVOKED = Errno(0x80)
+ EL2HLT = Errno(0x33)
+ EL2NSYNC = Errno(0x2d)
+ EL3HLT = Errno(0x2e)
+ EL3RST = Errno(0x2f)
+ ELIBACC = Errno(0x4f)
+ ELIBBAD = Errno(0x50)
+ ELIBEXEC = Errno(0x53)
+ ELIBMAX = Errno(0x52)
+ ELIBSCN = Errno(0x51)
+ ELNRNG = Errno(0x30)
+ ELOOP = Errno(0x28)
+ EMEDIUMTYPE = Errno(0x7c)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x5a)
+ EMULTIHOP = Errno(0x48)
+ ENAMETOOLONG = Errno(0x24)
+ ENAVAIL = Errno(0x77)
+ ENETDOWN = Errno(0x64)
+ ENETRESET = Errno(0x66)
+ ENETUNREACH = Errno(0x65)
+ ENFILE = Errno(0x17)
+ ENOANO = Errno(0x37)
+ ENOBUFS = Errno(0x69)
+ ENOCSI = Errno(0x32)
+ ENODATA = Errno(0x3d)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOKEY = Errno(0x7e)
+ ENOLCK = Errno(0x25)
+ ENOLINK = Errno(0x43)
+ ENOMEDIUM = Errno(0x7b)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x2a)
+ ENONET = Errno(0x40)
+ ENOPKG = Errno(0x41)
+ ENOPROTOOPT = Errno(0x5c)
+ ENOSPC = Errno(0x1c)
+ ENOSR = Errno(0x3f)
+ ENOSTR = Errno(0x3c)
+ ENOSYS = Errno(0x26)
+ ENOTBLK = Errno(0xf)
+ ENOTCONN = Errno(0x6b)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x27)
+ ENOTNAM = Errno(0x76)
+ ENOTRECOVERABLE = Errno(0x83)
+ ENOTSOCK = Errno(0x58)
+ ENOTSUP = Errno(0x5f)
+ ENOTTY = Errno(0x19)
+ ENOTUNIQ = Errno(0x4c)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x5f)
+ EOVERFLOW = Errno(0x4b)
+ EOWNERDEAD = Errno(0x82)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x60)
+ EPIPE = Errno(0x20)
+ EPROTO = Errno(0x47)
+ EPROTONOSUPPORT = Errno(0x5d)
+ EPROTOTYPE = Errno(0x5b)
+ ERANGE = Errno(0x22)
+ EREMCHG = Errno(0x4e)
+ EREMOTE = Errno(0x42)
+ EREMOTEIO = Errno(0x79)
+ ERESTART = Errno(0x55)
+ ERFKILL = Errno(0x84)
+ EROFS = Errno(0x1e)
+ ESHUTDOWN = Errno(0x6c)
+ ESOCKTNOSUPPORT = Errno(0x5e)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESRMNT = Errno(0x45)
+ ESTALE = Errno(0x74)
+ ESTRPIPE = Errno(0x56)
+ ETIME = Errno(0x3e)
+ ETIMEDOUT = Errno(0x6e)
+ ETOOMANYREFS = Errno(0x6d)
+ ETXTBSY = Errno(0x1a)
+ EUCLEAN = Errno(0x75)
+ EUNATCH = Errno(0x31)
+ EUSERS = Errno(0x57)
+ EWOULDBLOCK = Errno(0xb)
+ EXDEV = Errno(0x12)
+ EXFULL = Errno(0x36)
+)
+
// Error table
var errors = [...]string{
1: "operation not permitted",
diff --git a/src/pkg/syscall/zerrors_openbsd_386.go b/src/pkg/syscall/zerrors_openbsd_386.go
index 826e479..52dc69a 100644
--- a/src/pkg/syscall/zerrors_openbsd_386.go
+++ b/src/pkg/syscall/zerrors_openbsd_386.go
@@ -149,108 +149,13 @@
DT_REG = 0x8
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
- E2BIG = 0x7
- EACCES = 0xd
- EADDRINUSE = 0x30
- EADDRNOTAVAIL = 0x31
- EAFNOSUPPORT = 0x2f
- EAGAIN = 0x23
- EALREADY = 0x25
- EAUTH = 0x50
- EBADF = 0x9
- EBADRPC = 0x48
- EBUSY = 0x10
- ECANCELED = 0x58
- ECHILD = 0xa
- ECHO = 0x8
- ECHOCTL = 0x40
- ECHOE = 0x2
- ECHOK = 0x4
- ECHOKE = 0x1
- ECHONL = 0x10
- ECHOPRT = 0x20
- ECONNABORTED = 0x35
- ECONNREFUSED = 0x3d
- ECONNRESET = 0x36
- EDEADLK = 0xb
- EDESTADDRREQ = 0x27
- EDOM = 0x21
- EDQUOT = 0x45
- EEXIST = 0x11
- EFAULT = 0xe
- EFBIG = 0x1b
EFER_LMA = 0x400
EFER_LME = 0x100
EFER_NXE = 0x800
EFER_SCE = 0x1
- EFTYPE = 0x4f
- EHOSTDOWN = 0x40
- EHOSTUNREACH = 0x41
- EIDRM = 0x59
- EILSEQ = 0x54
- EINPROGRESS = 0x24
- EINTR = 0x4
- EINVAL = 0x16
- EIO = 0x5
- EIPSEC = 0x52
- EISCONN = 0x38
- EISDIR = 0x15
- ELAST = 0x5b
- ELOOP = 0x3e
- EMEDIUMTYPE = 0x56
- EMFILE = 0x18
- EMLINK = 0x1f
- EMSGSIZE = 0x28
EMT_TAGOVF = 0x1
EMUL_ENABLED = 0x1
EMUL_NATIVE = 0x2
- ENAMETOOLONG = 0x3f
- ENDRUNDISC = 0x9
- ENEEDAUTH = 0x51
- ENETDOWN = 0x32
- ENETRESET = 0x34
- ENETUNREACH = 0x33
- ENFILE = 0x17
- ENOATTR = 0x53
- ENOBUFS = 0x37
- ENODEV = 0x13
- ENOENT = 0x2
- ENOEXEC = 0x8
- ENOLCK = 0x4d
- ENOMEDIUM = 0x55
- ENOMEM = 0xc
- ENOMSG = 0x5a
- ENOPROTOOPT = 0x2a
- ENOSPC = 0x1c
- ENOSYS = 0x4e
- ENOTBLK = 0xf
- ENOTCONN = 0x39
- ENOTDIR = 0x14
- ENOTEMPTY = 0x42
- ENOTSOCK = 0x26
- ENOTSUP = 0x5b
- ENOTTY = 0x19
- ENXIO = 0x6
- EOPNOTSUPP = 0x2d
- EOVERFLOW = 0x57
- EPERM = 0x1
- EPFNOSUPPORT = 0x2e
- EPIPE = 0x20
- EPROCLIM = 0x43
- EPROCUNAVAIL = 0x4c
- EPROGMISMATCH = 0x4b
- EPROGUNAVAIL = 0x4a
- EPROTONOSUPPORT = 0x2b
- EPROTOTYPE = 0x29
- ERANGE = 0x22
- EREMOTE = 0x47
- EROFS = 0x1e
- ERPCMISMATCH = 0x49
- ESHUTDOWN = 0x3a
- ESOCKTNOSUPPORT = 0x2c
- ESPIPE = 0x1d
- ESRCH = 0x3
- ESTALE = 0x46
ETHERMIN = 0x2e
ETHERMTU = 0x5dc
ETHERTYPE_8023 = 0x4
@@ -449,10 +354,6 @@
ETHER_MIN_LEN = 0x40
ETHER_TYPE_LEN = 0x2
ETHER_VLAN_ENCAP_LEN = 0x4
- ETIMEDOUT = 0x3c
- ETOOMANYREFS = 0x3b
- ETXTBSY = 0x1a
- EUSERS = 0x44
EVFILT_AIO = -0x3
EVFILT_PROC = -0x5
EVFILT_READ = -0x1
@@ -471,8 +372,6 @@
EV_FLAG1 = 0x2000
EV_ONESHOT = 0x10
EV_SYSFLAGS = 0xf000
- EWOULDBLOCK = 0x23
- EXDEV = 0x12
EXTA = 0x4b00
EXTB = 0x9600
EXTPROC = 0x800
@@ -1268,6 +1167,111 @@
WUNTRACED = 0x2
)
+// Errors
+const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x30)
+ EADDRNOTAVAIL = Errno(0x31)
+ EAFNOSUPPORT = Errno(0x2f)
+ EAGAIN = Errno(0x23)
+ EALREADY = Errno(0x25)
+ EAUTH = Errno(0x50)
+ EBADF = Errno(0x9)
+ EBADRPC = Errno(0x48)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x58)
+ ECHILD = Errno(0xa)
+ ECHO = Errno(0x8)
+ ECHOCTL = Errno(0x40)
+ ECHOE = Errno(0x2)
+ ECHOK = Errno(0x4)
+ ECHOKE = Errno(0x1)
+ ECHONL = Errno(0x10)
+ ECHOPRT = Errno(0x20)
+ ECONNABORTED = Errno(0x35)
+ ECONNREFUSED = Errno(0x3d)
+ ECONNRESET = Errno(0x36)
+ EDEADLK = Errno(0xb)
+ EDESTADDRREQ = Errno(0x27)
+ EDOM = Errno(0x21)
+ EDQUOT = Errno(0x45)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EFTYPE = Errno(0x4f)
+ EHOSTDOWN = Errno(0x40)
+ EHOSTUNREACH = Errno(0x41)
+ EIDRM = Errno(0x59)
+ EILSEQ = Errno(0x54)
+ EINPROGRESS = Errno(0x24)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EIPSEC = Errno(0x52)
+ EISCONN = Errno(0x38)
+ EISDIR = Errno(0x15)
+ ELAST = Errno(0x5b)
+ ELOOP = Errno(0x3e)
+ EMEDIUMTYPE = Errno(0x56)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x28)
+ ENAMETOOLONG = Errno(0x3f)
+ ENDRUNDISC = Errno(0x9)
+ ENEEDAUTH = Errno(0x51)
+ ENETDOWN = Errno(0x32)
+ ENETRESET = Errno(0x34)
+ ENETUNREACH = Errno(0x33)
+ ENFILE = Errno(0x17)
+ ENOATTR = Errno(0x53)
+ ENOBUFS = Errno(0x37)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOLCK = Errno(0x4d)
+ ENOMEDIUM = Errno(0x55)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x5a)
+ ENOPROTOOPT = Errno(0x2a)
+ ENOSPC = Errno(0x1c)
+ ENOSYS = Errno(0x4e)
+ ENOTBLK = Errno(0xf)
+ ENOTCONN = Errno(0x39)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x42)
+ ENOTSOCK = Errno(0x26)
+ ENOTSUP = Errno(0x5b)
+ ENOTTY = Errno(0x19)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x2d)
+ EOVERFLOW = Errno(0x57)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x2e)
+ EPIPE = Errno(0x20)
+ EPROCLIM = Errno(0x43)
+ EPROCUNAVAIL = Errno(0x4c)
+ EPROGMISMATCH = Errno(0x4b)
+ EPROGUNAVAIL = Errno(0x4a)
+ EPROTONOSUPPORT = Errno(0x2b)
+ EPROTOTYPE = Errno(0x29)
+ ERANGE = Errno(0x22)
+ EREMOTE = Errno(0x47)
+ EROFS = Errno(0x1e)
+ ERPCMISMATCH = Errno(0x49)
+ ESHUTDOWN = Errno(0x3a)
+ ESOCKTNOSUPPORT = Errno(0x2c)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESTALE = Errno(0x46)
+ ETIMEDOUT = Errno(0x3c)
+ ETOOMANYREFS = Errno(0x3b)
+ ETXTBSY = Errno(0x1a)
+ EUSERS = Errno(0x44)
+ EWOULDBLOCK = Errno(0x23)
+ EXDEV = Errno(0x12)
+)
+
// Error table
var errors = [...]string{
1: "operation not permitted",
diff --git a/src/pkg/syscall/zerrors_openbsd_amd64.go b/src/pkg/syscall/zerrors_openbsd_amd64.go
index e625741..c6367fb 100644
--- a/src/pkg/syscall/zerrors_openbsd_amd64.go
+++ b/src/pkg/syscall/zerrors_openbsd_amd64.go
@@ -149,108 +149,13 @@
DT_REG = 0x8
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
- E2BIG = 0x7
- EACCES = 0xd
- EADDRINUSE = 0x30
- EADDRNOTAVAIL = 0x31
- EAFNOSUPPORT = 0x2f
- EAGAIN = 0x23
- EALREADY = 0x25
- EAUTH = 0x50
- EBADF = 0x9
- EBADRPC = 0x48
- EBUSY = 0x10
- ECANCELED = 0x58
- ECHILD = 0xa
- ECHO = 0x8
- ECHOCTL = 0x40
- ECHOE = 0x2
- ECHOK = 0x4
- ECHOKE = 0x1
- ECHONL = 0x10
- ECHOPRT = 0x20
- ECONNABORTED = 0x35
- ECONNREFUSED = 0x3d
- ECONNRESET = 0x36
- EDEADLK = 0xb
- EDESTADDRREQ = 0x27
- EDOM = 0x21
- EDQUOT = 0x45
- EEXIST = 0x11
- EFAULT = 0xe
- EFBIG = 0x1b
EFER_LMA = 0x400
EFER_LME = 0x100
EFER_NXE = 0x800
EFER_SCE = 0x1
- EFTYPE = 0x4f
- EHOSTDOWN = 0x40
- EHOSTUNREACH = 0x41
- EIDRM = 0x59
- EILSEQ = 0x54
- EINPROGRESS = 0x24
- EINTR = 0x4
- EINVAL = 0x16
- EIO = 0x5
- EIPSEC = 0x52
- EISCONN = 0x38
- EISDIR = 0x15
- ELAST = 0x5b
- ELOOP = 0x3e
- EMEDIUMTYPE = 0x56
- EMFILE = 0x18
- EMLINK = 0x1f
- EMSGSIZE = 0x28
EMT_TAGOVF = 0x1
EMUL_ENABLED = 0x1
EMUL_NATIVE = 0x2
- ENAMETOOLONG = 0x3f
- ENDRUNDISC = 0x9
- ENEEDAUTH = 0x51
- ENETDOWN = 0x32
- ENETRESET = 0x34
- ENETUNREACH = 0x33
- ENFILE = 0x17
- ENOATTR = 0x53
- ENOBUFS = 0x37
- ENODEV = 0x13
- ENOENT = 0x2
- ENOEXEC = 0x8
- ENOLCK = 0x4d
- ENOMEDIUM = 0x55
- ENOMEM = 0xc
- ENOMSG = 0x5a
- ENOPROTOOPT = 0x2a
- ENOSPC = 0x1c
- ENOSYS = 0x4e
- ENOTBLK = 0xf
- ENOTCONN = 0x39
- ENOTDIR = 0x14
- ENOTEMPTY = 0x42
- ENOTSOCK = 0x26
- ENOTSUP = 0x5b
- ENOTTY = 0x19
- ENXIO = 0x6
- EOPNOTSUPP = 0x2d
- EOVERFLOW = 0x57
- EPERM = 0x1
- EPFNOSUPPORT = 0x2e
- EPIPE = 0x20
- EPROCLIM = 0x43
- EPROCUNAVAIL = 0x4c
- EPROGMISMATCH = 0x4b
- EPROGUNAVAIL = 0x4a
- EPROTONOSUPPORT = 0x2b
- EPROTOTYPE = 0x29
- ERANGE = 0x22
- EREMOTE = 0x47
- EROFS = 0x1e
- ERPCMISMATCH = 0x49
- ESHUTDOWN = 0x3a
- ESOCKTNOSUPPORT = 0x2c
- ESPIPE = 0x1d
- ESRCH = 0x3
- ESTALE = 0x46
ETHERMIN = 0x2e
ETHERMTU = 0x5dc
ETHERTYPE_8023 = 0x4
@@ -449,10 +354,6 @@
ETHER_MIN_LEN = 0x40
ETHER_TYPE_LEN = 0x2
ETHER_VLAN_ENCAP_LEN = 0x4
- ETIMEDOUT = 0x3c
- ETOOMANYREFS = 0x3b
- ETXTBSY = 0x1a
- EUSERS = 0x44
EVFILT_AIO = -0x3
EVFILT_PROC = -0x5
EVFILT_READ = -0x1
@@ -471,8 +372,6 @@
EV_FLAG1 = 0x2000
EV_ONESHOT = 0x10
EV_SYSFLAGS = 0xf000
- EWOULDBLOCK = 0x23
- EXDEV = 0x12
EXTA = 0x4b00
EXTB = 0x9600
EXTPROC = 0x800
@@ -1268,6 +1167,111 @@
WUNTRACED = 0x2
)
+// Errors
+const (
+ E2BIG = Errno(0x7)
+ EACCES = Errno(0xd)
+ EADDRINUSE = Errno(0x30)
+ EADDRNOTAVAIL = Errno(0x31)
+ EAFNOSUPPORT = Errno(0x2f)
+ EAGAIN = Errno(0x23)
+ EALREADY = Errno(0x25)
+ EAUTH = Errno(0x50)
+ EBADF = Errno(0x9)
+ EBADRPC = Errno(0x48)
+ EBUSY = Errno(0x10)
+ ECANCELED = Errno(0x58)
+ ECHILD = Errno(0xa)
+ ECHO = Errno(0x8)
+ ECHOCTL = Errno(0x40)
+ ECHOE = Errno(0x2)
+ ECHOK = Errno(0x4)
+ ECHOKE = Errno(0x1)
+ ECHONL = Errno(0x10)
+ ECHOPRT = Errno(0x20)
+ ECONNABORTED = Errno(0x35)
+ ECONNREFUSED = Errno(0x3d)
+ ECONNRESET = Errno(0x36)
+ EDEADLK = Errno(0xb)
+ EDESTADDRREQ = Errno(0x27)
+ EDOM = Errno(0x21)
+ EDQUOT = Errno(0x45)
+ EEXIST = Errno(0x11)
+ EFAULT = Errno(0xe)
+ EFBIG = Errno(0x1b)
+ EFTYPE = Errno(0x4f)
+ EHOSTDOWN = Errno(0x40)
+ EHOSTUNREACH = Errno(0x41)
+ EIDRM = Errno(0x59)
+ EILSEQ = Errno(0x54)
+ EINPROGRESS = Errno(0x24)
+ EINTR = Errno(0x4)
+ EINVAL = Errno(0x16)
+ EIO = Errno(0x5)
+ EIPSEC = Errno(0x52)
+ EISCONN = Errno(0x38)
+ EISDIR = Errno(0x15)
+ ELAST = Errno(0x5b)
+ ELOOP = Errno(0x3e)
+ EMEDIUMTYPE = Errno(0x56)
+ EMFILE = Errno(0x18)
+ EMLINK = Errno(0x1f)
+ EMSGSIZE = Errno(0x28)
+ ENAMETOOLONG = Errno(0x3f)
+ ENDRUNDISC = Errno(0x9)
+ ENEEDAUTH = Errno(0x51)
+ ENETDOWN = Errno(0x32)
+ ENETRESET = Errno(0x34)
+ ENETUNREACH = Errno(0x33)
+ ENFILE = Errno(0x17)
+ ENOATTR = Errno(0x53)
+ ENOBUFS = Errno(0x37)
+ ENODEV = Errno(0x13)
+ ENOENT = Errno(0x2)
+ ENOEXEC = Errno(0x8)
+ ENOLCK = Errno(0x4d)
+ ENOMEDIUM = Errno(0x55)
+ ENOMEM = Errno(0xc)
+ ENOMSG = Errno(0x5a)
+ ENOPROTOOPT = Errno(0x2a)
+ ENOSPC = Errno(0x1c)
+ ENOSYS = Errno(0x4e)
+ ENOTBLK = Errno(0xf)
+ ENOTCONN = Errno(0x39)
+ ENOTDIR = Errno(0x14)
+ ENOTEMPTY = Errno(0x42)
+ ENOTSOCK = Errno(0x26)
+ ENOTSUP = Errno(0x5b)
+ ENOTTY = Errno(0x19)
+ ENXIO = Errno(0x6)
+ EOPNOTSUPP = Errno(0x2d)
+ EOVERFLOW = Errno(0x57)
+ EPERM = Errno(0x1)
+ EPFNOSUPPORT = Errno(0x2e)
+ EPIPE = Errno(0x20)
+ EPROCLIM = Errno(0x43)
+ EPROCUNAVAIL = Errno(0x4c)
+ EPROGMISMATCH = Errno(0x4b)
+ EPROGUNAVAIL = Errno(0x4a)
+ EPROTONOSUPPORT = Errno(0x2b)
+ EPROTOTYPE = Errno(0x29)
+ ERANGE = Errno(0x22)
+ EREMOTE = Errno(0x47)
+ EROFS = Errno(0x1e)
+ ERPCMISMATCH = Errno(0x49)
+ ESHUTDOWN = Errno(0x3a)
+ ESOCKTNOSUPPORT = Errno(0x2c)
+ ESPIPE = Errno(0x1d)
+ ESRCH = Errno(0x3)
+ ESTALE = Errno(0x46)
+ ETIMEDOUT = Errno(0x3c)
+ ETOOMANYREFS = Errno(0x3b)
+ ETXTBSY = Errno(0x1a)
+ EUSERS = Errno(0x44)
+ EWOULDBLOCK = Errno(0x23)
+ EXDEV = Errno(0x12)
+)
+
// Error table
var errors = [...]string{
1: "operation not permitted",
diff --git a/src/pkg/syscall/zerrors_windows.go b/src/pkg/syscall/zerrors_windows.go
index 799ed49..24d862f 100644
--- a/src/pkg/syscall/zerrors_windows.go
+++ b/src/pkg/syscall/zerrors_windows.go
@@ -5,8 +5,8 @@
// Go names for Windows errors.
const (
- ENOENT = ERROR_FILE_NOT_FOUND
- ENOTDIR = ERROR_PATH_NOT_FOUND
+ ENOENT Errno = ERROR_FILE_NOT_FOUND
+ ENOTDIR Errno = ERROR_PATH_NOT_FOUND
)
// Windows reserves errors >= 1<<29 for application use.
@@ -14,7 +14,7 @@
// Invented values to support what package os and others expects.
const (
- E2BIG = APPLICATION_ERROR + iota
+ E2BIG Errno = APPLICATION_ERROR + iota
EACCES
EADDRINUSE
EADDRNOTAVAIL
diff --git a/src/pkg/syscall/zsyscall_darwin_386.go b/src/pkg/syscall/zsyscall_darwin_386.go
index 6d611e8..b952ac4 100644
--- a/src/pkg/syscall/zsyscall_darwin_386.go
+++ b/src/pkg/syscall/zsyscall_darwin_386.go
@@ -7,115 +7,141 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getgroups(ngid int, gid *_Gid_t) (n int, errno int) {
+func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setgroups(ngid int, gid *_Gid_t) (errno int) {
+func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
+func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func bind(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func connect(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socket(domain int, typ int, proto int) (fd int, errno int) {
+func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) {
+func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
+func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Shutdown(s int, how int) (errno int) {
+func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) {
+func socketpair(domain int, typ int, proto int, fd *[2]int) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
+func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -124,13 +150,15 @@
}
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
+func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -138,39 +166,47 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
+func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
+func sendmsg(s int, msg *Msghdr, flags int) (err error) {
_, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
+func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
@@ -178,147 +214,183 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func utimes(path string, timeval *[2]Timeval) (errno int) {
+func utimes(path string, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func futimes(fd int, timeval *[2]Timeval) (errno int) {
+func futimes(fd int, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func fcntl(fd int, cmd int, arg int) (val int, errno int) {
+func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe() (r int, w int, errno int) {
+func pipe() (r int, w int, err error) {
r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
r = int(r0)
w = int(r1)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func kill(pid int, signum int, posix int) (errno int) {
+func kill(pid int, signum int, posix int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Access(path string, mode uint32) (errno int) {
+func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) {
+func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chflags(path string, flags int) (errno int) {
+func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chown(path string, uid int, gid int) (errno int) {
+func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chroot(path string) (errno int) {
+func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Close(fd int) (errno int) {
+func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup(fd int) (nfd int, errno int) {
+func Dup(fd int) (nfd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup2(from int, to int) (errno int) {
+func Dup2(from int, to int) (err error) {
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Exchangedata(path1 string, path2 string, options int) (errno int) {
+func Exchangedata(path1 string, path2 string, options int) (err error) {
_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(StringBytePtr(path1))), uintptr(unsafe.Pointer(StringBytePtr(path2))), uintptr(options))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -331,88 +403,108 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchdir(fd int) (errno int) {
+func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchflags(path string, flags int) (errno int) {
+func Fchflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmod(fd int, mode uint32) (errno int) {
+func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchown(fd int, uid int, gid int) (errno int) {
+func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Flock(fd int, how int) (errno int) {
+func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fpathconf(fd int, name int) (val int, errno int) {
+func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstat(fd int, stat *Stat_t) (errno int) {
+func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstatfs(fd int, stat *Statfs_t) (errno int) {
+func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fsync(fd int) (errno int) {
+func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -421,7 +513,9 @@
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -451,7 +545,7 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
+func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -460,7 +554,9 @@
}
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -474,10 +570,12 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpgid(pid int) (pgid int, errno int) {
+func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -507,35 +605,43 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpriority(which int, who int) (prio int, errno int) {
+func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrlimit(which int, lim *Rlimit) (errno int) {
+func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrusage(who int, rusage *Rusage) (errno int) {
+func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getsid(pid int) (sid int, errno int) {
+func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -557,90 +663,110 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kqueue() (fd int, errno int) {
+func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lchown(path string, uid int, gid int) (errno int) {
+func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Link(path string, link string) (errno int) {
+func Link(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Listen(s int, backlog int) (errno int) {
+func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lstat(path string, stat *Stat_t) (errno int) {
+func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkfifo(path string, mode uint32) (errno int) {
+func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknod(path string, mode uint32, dev int) (errno int) {
+func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Open(path string, mode int, perm uint32) (fd int, errno int) {
+func Open(path string, mode int, perm uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pathconf(path string, name int) (val int, errno int) {
+func Pathconf(path string, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -649,13 +775,15 @@
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -664,13 +792,15 @@
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Read(fd int, p []byte) (n int, errno int) {
+func Read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -679,13 +809,15 @@
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Readlink(path string, buf []byte) (n int, errno int) {
+func Readlink(path string, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -694,193 +826,241 @@
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rename(from string, to string) (errno int) {
+func Rename(from string, to string) (err error) {
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Revoke(path string) (errno int) {
+func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
+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)
newoffset = int64(int64(r1)<<32 | int64(r0))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setegid(egid int) (errno int) {
+func Setegid(egid int) (err error) {
_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seteuid(euid int) (errno int) {
+func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setgid(gid int) (errno int) {
+func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setlogin(name string) (errno int) {
+func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpgid(pid int, pgid int) (errno int) {
+func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpriority(which int, who int, prio int) (errno int) {
+func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setprivexec(flag int) (errno int) {
+func Setprivexec(flag int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setregid(rgid int, egid int) (errno int) {
+func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setreuid(ruid int, euid int) (errno int) {
+func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setrlimit(which int, lim *Rlimit) (errno int) {
+func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setsid() (pid int, errno int) {
+func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Settimeofday(tp *Timeval) (errno int) {
+func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setuid(uid int) (errno int) {
+func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (errno int) {
+func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Statfs(path string, stat *Statfs_t) (errno int) {
+func Statfs(path string, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Symlink(path string, link string) (errno int) {
+func Symlink(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sync() (errno int) {
+func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -894,31 +1074,37 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Undelete(path string) (errno int) {
+func Undelete(path string) (err error) {
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(path string, flags int) (errno int) {
+func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Write(fd int, p []byte) (n int, errno int) {
+func Write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -927,51 +1113,63 @@
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func munmap(addr uintptr, length uintptr) (errno int) {
+func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func read(fd int, buf *byte, nbuf int) (n int, errno int) {
+func read(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func write(fd int, buf *byte, nbuf int) (n int, errno int) {
+func write(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func gettimeofday(tp *Timeval) (sec int32, usec int32, errno int) {
+func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) {
r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
sec = int32(r0)
usec = int32(r1)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
diff --git a/src/pkg/syscall/zsyscall_darwin_amd64.go b/src/pkg/syscall/zsyscall_darwin_amd64.go
index e26fed4..104ee55 100644
--- a/src/pkg/syscall/zsyscall_darwin_amd64.go
+++ b/src/pkg/syscall/zsyscall_darwin_amd64.go
@@ -7,115 +7,141 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getgroups(ngid int, gid *_Gid_t) (n int, errno int) {
+func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setgroups(ngid int, gid *_Gid_t) (errno int) {
+func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
+func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func bind(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func connect(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socket(domain int, typ int, proto int) (fd int, errno int) {
+func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) {
+func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
+func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Shutdown(s int, how int) (errno int) {
+func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) {
+func socketpair(domain int, typ int, proto int, fd *[2]int) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
+func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -124,13 +150,15 @@
}
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
+func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -138,39 +166,47 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
+func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
+func sendmsg(s int, msg *Msghdr, flags int) (err error) {
_, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
+func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
@@ -178,147 +214,183 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func utimes(path string, timeval *[2]Timeval) (errno int) {
+func utimes(path string, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func futimes(fd int, timeval *[2]Timeval) (errno int) {
+func futimes(fd int, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func fcntl(fd int, cmd int, arg int) (val int, errno int) {
+func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe() (r int, w int, errno int) {
+func pipe() (r int, w int, err error) {
r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
r = int(r0)
w = int(r1)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func kill(pid int, signum int, posix int) (errno int) {
+func kill(pid int, signum int, posix int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Access(path string, mode uint32) (errno int) {
+func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) {
+func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chflags(path string, flags int) (errno int) {
+func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chown(path string, uid int, gid int) (errno int) {
+func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chroot(path string) (errno int) {
+func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Close(fd int) (errno int) {
+func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup(fd int) (nfd int, errno int) {
+func Dup(fd int) (nfd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup2(from int, to int) (errno int) {
+func Dup2(from int, to int) (err error) {
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Exchangedata(path1 string, path2 string, options int) (errno int) {
+func Exchangedata(path1 string, path2 string, options int) (err error) {
_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(StringBytePtr(path1))), uintptr(unsafe.Pointer(StringBytePtr(path2))), uintptr(options))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -331,88 +403,108 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchdir(fd int) (errno int) {
+func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchflags(path string, flags int) (errno int) {
+func Fchflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmod(fd int, mode uint32) (errno int) {
+func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchown(fd int, uid int, gid int) (errno int) {
+func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Flock(fd int, how int) (errno int) {
+func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fpathconf(fd int, name int) (val int, errno int) {
+func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstat(fd int, stat *Stat_t) (errno int) {
+func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstatfs(fd int, stat *Statfs_t) (errno int) {
+func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fsync(fd int) (errno int) {
+func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -421,7 +513,9 @@
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -451,7 +545,7 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
+func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -460,7 +554,9 @@
}
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -474,10 +570,12 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpgid(pid int) (pgid int, errno int) {
+func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -507,35 +605,43 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpriority(which int, who int) (prio int, errno int) {
+func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrlimit(which int, lim *Rlimit) (errno int) {
+func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrusage(who int, rusage *Rusage) (errno int) {
+func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getsid(pid int) (sid int, errno int) {
+func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -557,90 +663,110 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kqueue() (fd int, errno int) {
+func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lchown(path string, uid int, gid int) (errno int) {
+func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Link(path string, link string) (errno int) {
+func Link(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Listen(s int, backlog int) (errno int) {
+func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lstat(path string, stat *Stat_t) (errno int) {
+func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkfifo(path string, mode uint32) (errno int) {
+func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknod(path string, mode uint32, dev int) (errno int) {
+func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Open(path string, mode int, perm uint32) (fd int, errno int) {
+func Open(path string, mode int, perm uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pathconf(path string, name int) (val int, errno int) {
+func Pathconf(path string, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -649,13 +775,15 @@
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -664,13 +792,15 @@
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Read(fd int, p []byte) (n int, errno int) {
+func Read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -679,13 +809,15 @@
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Readlink(path string, buf []byte) (n int, errno int) {
+func Readlink(path string, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -694,193 +826,241 @@
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rename(from string, to string) (errno int) {
+func Rename(from string, to string) (err error) {
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Revoke(path string) (errno int) {
+func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
+func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
newoffset = int64(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setegid(egid int) (errno int) {
+func Setegid(egid int) (err error) {
_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seteuid(euid int) (errno int) {
+func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setgid(gid int) (errno int) {
+func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setlogin(name string) (errno int) {
+func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpgid(pid int, pgid int) (errno int) {
+func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpriority(which int, who int, prio int) (errno int) {
+func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setprivexec(flag int) (errno int) {
+func Setprivexec(flag int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setregid(rgid int, egid int) (errno int) {
+func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setreuid(ruid int, euid int) (errno int) {
+func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setrlimit(which int, lim *Rlimit) (errno int) {
+func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setsid() (pid int, errno int) {
+func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Settimeofday(tp *Timeval) (errno int) {
+func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setuid(uid int) (errno int) {
+func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (errno int) {
+func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Statfs(path string, stat *Statfs_t) (errno int) {
+func Statfs(path string, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Symlink(path string, link string) (errno int) {
+func Symlink(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sync() (errno int) {
+func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -894,31 +1074,37 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Undelete(path string) (errno int) {
+func Undelete(path string) (err error) {
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(path string, flags int) (errno int) {
+func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Write(fd int, p []byte) (n int, errno int) {
+func Write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -927,51 +1113,63 @@
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
ret = uintptr(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func munmap(addr uintptr, length uintptr) (errno int) {
+func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func read(fd int, buf *byte, nbuf int) (n int, errno int) {
+func read(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func write(fd int, buf *byte, nbuf int) (n int, errno int) {
+func write(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func gettimeofday(tp *Timeval) (sec int64, usec int32, errno int) {
+func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {
r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
sec = int64(r0)
usec = int32(r1)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
diff --git a/src/pkg/syscall/zsyscall_freebsd_386.go b/src/pkg/syscall/zsyscall_freebsd_386.go
index 2cf6cba..d219a8d 100644
--- a/src/pkg/syscall/zsyscall_freebsd_386.go
+++ b/src/pkg/syscall/zsyscall_freebsd_386.go
@@ -7,115 +7,141 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getgroups(ngid int, gid *_Gid_t) (n int, errno int) {
+func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setgroups(ngid int, gid *_Gid_t) (errno int) {
+func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
+func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func bind(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func connect(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socket(domain int, typ int, proto int) (fd int, errno int) {
+func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) {
+func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
+func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Shutdown(s int, how int) (errno int) {
+func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) {
+func socketpair(domain int, typ int, proto int, fd *[2]int) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
+func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -124,13 +150,15 @@
}
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
+func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -138,39 +166,47 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
+func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
+func sendmsg(s int, msg *Msghdr, flags int) (err error) {
_, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
+func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
@@ -178,123 +214,153 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func utimes(path string, timeval *[2]Timeval) (errno int) {
+func utimes(path string, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func futimes(fd int, timeval *[2]Timeval) (errno int) {
+func futimes(fd int, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func fcntl(fd int, cmd int, arg int) (val int, errno int) {
+func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe() (r int, w int, errno int) {
+func pipe() (r int, w int, err error) {
r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
r = int(r0)
w = int(r1)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Access(path string, mode uint32) (errno int) {
+func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) {
+func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chflags(path string, flags int) (errno int) {
+func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chown(path string, uid int, gid int) (errno int) {
+func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chroot(path string) (errno int) {
+func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Close(fd int) (errno int) {
+func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup(fd int) (nfd int, errno int) {
+func Dup(fd int) (nfd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup2(from int, to int) (errno int) {
+func Dup2(from int, to int) (err error) {
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -307,88 +373,108 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchdir(fd int) (errno int) {
+func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchflags(path string, flags int) (errno int) {
+func Fchflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmod(fd int, mode uint32) (errno int) {
+func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchown(fd int, uid int, gid int) (errno int) {
+func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Flock(fd int, how int) (errno int) {
+func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fpathconf(fd int, name int) (val int, errno int) {
+func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstat(fd int, stat *Stat_t) (errno int) {
+func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstatfs(fd int, stat *Statfs_t) (errno int) {
+func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fsync(fd int) (errno int) {
+func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -397,7 +483,9 @@
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -427,7 +515,7 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
+func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -436,7 +524,9 @@
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -450,10 +540,12 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpgid(pid int) (pgid int, errno int) {
+func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -483,43 +575,53 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpriority(which int, who int) (prio int, errno int) {
+func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrlimit(which int, lim *Rlimit) (errno int) {
+func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrusage(who int, rusage *Rusage) (errno int) {
+func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getsid(pid int) (sid int, errno int) {
+func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Gettimeofday(tv *Timeval) (errno int) {
+func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -541,106 +643,130 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kill(pid int, signum int) (errno int) {
+func Kill(pid int, signum int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kqueue() (fd int, errno int) {
+func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lchown(path string, uid int, gid int) (errno int) {
+func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Link(path string, link string) (errno int) {
+func Link(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Listen(s int, backlog int) (errno int) {
+func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lstat(path string, stat *Stat_t) (errno int) {
+func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkfifo(path string, mode uint32) (errno int) {
+func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknod(path string, mode uint32, dev int) (errno int) {
+func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
+func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Open(path string, mode int, perm uint32) (fd int, errno int) {
+func Open(path string, mode int, perm uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pathconf(path string, name int) (val int, errno int) {
+func Pathconf(path string, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -649,13 +775,15 @@
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -664,13 +792,15 @@
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Read(fd int, p []byte) (n int, errno int) {
+func Read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -679,13 +809,15 @@
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Readlink(path string, buf []byte) (n int, errno int) {
+func Readlink(path string, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -694,185 +826,231 @@
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rename(from string, to string) (errno int) {
+func Rename(from string, to string) (err error) {
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Revoke(path string) (errno int) {
+func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
+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)
newoffset = int64(int64(r1)<<32 | int64(r0))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setegid(egid int) (errno int) {
+func Setegid(egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seteuid(euid int) (errno int) {
+func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setgid(gid int) (errno int) {
+func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setlogin(name string) (errno int) {
+func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpgid(pid int, pgid int) (errno int) {
+func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpriority(which int, who int, prio int) (errno int) {
+func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setregid(rgid int, egid int) (errno int) {
+func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setreuid(ruid int, euid int) (errno int) {
+func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setrlimit(which int, lim *Rlimit) (errno int) {
+func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setsid() (pid int, errno int) {
+func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Settimeofday(tp *Timeval) (errno int) {
+func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setuid(uid int) (errno int) {
+func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (errno int) {
+func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Statfs(path string, stat *Statfs_t) (errno int) {
+func Statfs(path string, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Symlink(path string, link string) (errno int) {
+func Symlink(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sync() (errno int) {
+func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -886,31 +1064,37 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Undelete(path string) (errno int) {
+func Undelete(path string) (err error) {
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(path string, flags int) (errno int) {
+func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Write(fd int, p []byte) (n int, errno int) {
+func Write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -919,41 +1103,51 @@
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func munmap(addr uintptr, length uintptr) (errno int) {
+func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func read(fd int, buf *byte, nbuf int) (n int, errno int) {
+func read(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func write(fd int, buf *byte, nbuf int) (n int, errno int) {
+func write(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
diff --git a/src/pkg/syscall/zsyscall_freebsd_amd64.go b/src/pkg/syscall/zsyscall_freebsd_amd64.go
index bdbfae9..0e0feaf 100644
--- a/src/pkg/syscall/zsyscall_freebsd_amd64.go
+++ b/src/pkg/syscall/zsyscall_freebsd_amd64.go
@@ -7,115 +7,141 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getgroups(ngid int, gid *_Gid_t) (n int, errno int) {
+func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setgroups(ngid int, gid *_Gid_t) (errno int) {
+func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
+func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func bind(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func connect(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socket(domain int, typ int, proto int) (fd int, errno int) {
+func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) {
+func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
+func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Shutdown(s int, how int) (errno int) {
+func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) {
+func socketpair(domain int, typ int, proto int, fd *[2]int) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
+func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -124,13 +150,15 @@
}
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
+func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -138,39 +166,47 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
+func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
+func sendmsg(s int, msg *Msghdr, flags int) (err error) {
_, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
+func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
@@ -178,123 +214,153 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func utimes(path string, timeval *[2]Timeval) (errno int) {
+func utimes(path string, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func futimes(fd int, timeval *[2]Timeval) (errno int) {
+func futimes(fd int, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func fcntl(fd int, cmd int, arg int) (val int, errno int) {
+func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe() (r int, w int, errno int) {
+func pipe() (r int, w int, err error) {
r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
r = int(r0)
w = int(r1)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Access(path string, mode uint32) (errno int) {
+func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) {
+func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chflags(path string, flags int) (errno int) {
+func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chown(path string, uid int, gid int) (errno int) {
+func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chroot(path string) (errno int) {
+func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Close(fd int) (errno int) {
+func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup(fd int) (nfd int, errno int) {
+func Dup(fd int) (nfd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup2(from int, to int) (errno int) {
+func Dup2(from int, to int) (err error) {
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -307,88 +373,108 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchdir(fd int) (errno int) {
+func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchflags(path string, flags int) (errno int) {
+func Fchflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmod(fd int, mode uint32) (errno int) {
+func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchown(fd int, uid int, gid int) (errno int) {
+func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Flock(fd int, how int) (errno int) {
+func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fpathconf(fd int, name int) (val int, errno int) {
+func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstat(fd int, stat *Stat_t) (errno int) {
+func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstatfs(fd int, stat *Statfs_t) (errno int) {
+func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fsync(fd int) (errno int) {
+func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -397,7 +483,9 @@
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -427,7 +515,7 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
+func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -436,7 +524,9 @@
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -450,10 +540,12 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpgid(pid int) (pgid int, errno int) {
+func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -483,43 +575,53 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpriority(which int, who int) (prio int, errno int) {
+func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrlimit(which int, lim *Rlimit) (errno int) {
+func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrusage(who int, rusage *Rusage) (errno int) {
+func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getsid(pid int) (sid int, errno int) {
+func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Gettimeofday(tv *Timeval) (errno int) {
+func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -541,106 +643,130 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kill(pid int, signum int) (errno int) {
+func Kill(pid int, signum int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kqueue() (fd int, errno int) {
+func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lchown(path string, uid int, gid int) (errno int) {
+func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Link(path string, link string) (errno int) {
+func Link(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Listen(s int, backlog int) (errno int) {
+func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lstat(path string, stat *Stat_t) (errno int) {
+func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkfifo(path string, mode uint32) (errno int) {
+func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknod(path string, mode uint32, dev int) (errno int) {
+func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
+func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Open(path string, mode int, perm uint32) (fd int, errno int) {
+func Open(path string, mode int, perm uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pathconf(path string, name int) (val int, errno int) {
+func Pathconf(path string, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -649,13 +775,15 @@
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -664,13 +792,15 @@
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Read(fd int, p []byte) (n int, errno int) {
+func Read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -679,13 +809,15 @@
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Readlink(path string, buf []byte) (n int, errno int) {
+func Readlink(path string, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -694,185 +826,231 @@
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rename(from string, to string) (errno int) {
+func Rename(from string, to string) (err error) {
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Revoke(path string) (errno int) {
+func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
+func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
newoffset = int64(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setegid(egid int) (errno int) {
+func Setegid(egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seteuid(euid int) (errno int) {
+func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setgid(gid int) (errno int) {
+func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setlogin(name string) (errno int) {
+func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpgid(pid int, pgid int) (errno int) {
+func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpriority(which int, who int, prio int) (errno int) {
+func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setregid(rgid int, egid int) (errno int) {
+func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setreuid(ruid int, euid int) (errno int) {
+func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setrlimit(which int, lim *Rlimit) (errno int) {
+func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setsid() (pid int, errno int) {
+func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Settimeofday(tp *Timeval) (errno int) {
+func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setuid(uid int) (errno int) {
+func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (errno int) {
+func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Statfs(path string, stat *Statfs_t) (errno int) {
+func Statfs(path string, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Symlink(path string, link string) (errno int) {
+func Symlink(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sync() (errno int) {
+func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -886,31 +1064,37 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Undelete(path string) (errno int) {
+func Undelete(path string) (err error) {
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(path string, flags int) (errno int) {
+func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Write(fd int, p []byte) (n int, errno int) {
+func Write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -919,41 +1103,51 @@
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
ret = uintptr(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func munmap(addr uintptr, length uintptr) (errno int) {
+func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func read(fd int, buf *byte, nbuf int) (n int, errno int) {
+func read(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func write(fd int, buf *byte, nbuf int) (n int, errno int) {
+func write(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
diff --git a/src/pkg/syscall/zsyscall_linux_386.go b/src/pkg/syscall/zsyscall_linux_386.go
index aed9786..0566dce 100644
--- a/src/pkg/syscall/zsyscall_linux_386.go
+++ b/src/pkg/syscall/zsyscall_linux_386.go
@@ -7,49 +7,59 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func open(path string, mode int, perm uint32) (fd int, errno int) {
+func open(path string, mode int, perm uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int) {
+func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (errno int) {
+func pipe(p *[2]_C_int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func utimes(path string, times *[2]Timeval) (errno int) {
+func utimes(path string, times *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(times)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func futimesat(dirfd int, path *byte, times *[2]Timeval) (errno int) {
+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)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getcwd(buf []byte) (n int, errno int) {
+func Getcwd(buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -58,147 +68,181 @@
}
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
+func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func reboot(magic1 uint, magic2 uint, cmd int, arg string) (errno int) {
+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(StringBytePtr(arg))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mount(source string, target string, fstype string, flags uintptr, data *byte) (errno int) {
+func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {
_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(StringBytePtr(source))), uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(unsafe.Pointer(StringBytePtr(fstype))), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Access(path string, mode uint32) (errno int) {
+func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Acct(path string) (errno int) {
+func Acct(path string) (err error) {
_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Adjtimex(buf *Timex) (state int, errno int) {
+func Adjtimex(buf *Timex) (state int, err error) {
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
state = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chroot(path string) (errno int) {
+func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Close(fd int) (errno int) {
+func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Creat(path string, mode uint32) (fd int, errno int) {
+func Creat(path string, mode uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_CREAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup(oldfd int) (fd int, errno int) {
+func Dup(oldfd int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup2(oldfd int, newfd int) (fd int, errno int) {
+func Dup2(oldfd int, newfd int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func EpollCreate(size int) (fd int, errno int) {
+func EpollCreate(size int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int) {
+func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
_p0 = unsafe.Pointer(&events[0])
@@ -207,7 +251,9 @@
}
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -220,88 +266,108 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Faccessat(dirfd int, path string, mode uint32, flags int) (errno int) {
+func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(flags), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fallocate(fd int, mode uint32, off int64, len int64) (errno int) {
+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))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchdir(fd int) (errno int) {
+func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmod(fd int, mode uint32) (errno int) {
+func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmodat(dirfd int, path string, mode uint32, flags int) (errno int) {
+func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(flags), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchownat(dirfd int, path string, uid int, gid int, flags int) (errno int) {
+func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func fcntl(fd int, cmd int, arg int) (val int, errno int) {
+func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fdatasync(fd int) (errno int) {
+func Fdatasync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Flock(fd int, how int) (errno int) {
+func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fsync(fd int) (errno int) {
+func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getdents(fd int, buf []byte) (n int, errno int) {
+func Getdents(fd int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -310,16 +376,20 @@
}
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpgid(pid int) (pgid int, errno int) {
+func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -349,17 +419,21 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrlimit(resource int, rlim *Rlimit) (errno int) {
+func Getrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrusage(who int, rusage *Rusage) (errno int) {
+func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -373,51 +447,61 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int) {
+func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {
r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(StringBytePtr(pathname))), uintptr(mask))
watchdesc = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, errno int) {
+func InotifyInit() (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit1(flags int) (fd int, errno int) {
+func InotifyInit1(flags int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) {
+func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
success = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kill(pid int, sig int) (errno int) {
+func Kill(pid int, sig int) (err error) {
_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Klogctl(typ int, buf []byte) (n int, errno int) {
+func Klogctl(typ int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -426,77 +510,95 @@
}
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Link(oldpath string, newpath string) (errno int) {
+func Link(oldpath string, newpath string) (err error) {
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdirat(dirfd int, path string, mode uint32) (errno int) {
+func Mkdirat(dirfd int, path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknod(path string, mode uint32, dev int) (errno int) {
+func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknodat(dirfd int, path string, mode uint32, dev int) (errno int) {
+func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
+func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pause() (errno int) {
+func Pause() (err error) {
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func PivotRoot(newroot string, putold string) (errno int) {
+func PivotRoot(newroot string, putold string) (err error) {
_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(StringBytePtr(newroot))), uintptr(unsafe.Pointer(StringBytePtr(putold))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Read(fd int, p []byte) (n int, errno int) {
+func Read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -505,13 +607,15 @@
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Readlink(path string, buf []byte) (n int, errno int) {
+func Readlink(path string, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -520,37 +624,45 @@
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rename(oldpath string, newpath string) (errno int) {
+func Rename(oldpath string, newpath string) (err error) {
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (errno int) {
+func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(newdirfd), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setdomainname(p []byte) (errno int) {
+func Setdomainname(p []byte) (err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -558,13 +670,15 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sethostname(p []byte) (errno int) {
+func Sethostname(p []byte) (err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -572,56 +686,70 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpgid(pid int, pgid int) (errno int) {
+func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setrlimit(resource int, rlim *Rlimit) (errno int) {
+func Setrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setsid() (pid int, errno int) {
+func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Settimeofday(tv *Timeval) (errno int) {
+func Settimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setuid(uid int) (errno int) {
+func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Symlink(oldpath string, newpath string) (errno int) {
+func Symlink(oldpath string, newpath string) (err error) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -634,35 +762,43 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sysinfo(info *Sysinfo_t) (errno int) {
+func Sysinfo(info *Sysinfo_t) (err error) {
_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) {
+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)
n = int64(int64(r1)<<32 | int64(r0))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Tgkill(tgid int, tid int, sig int) (errno int) {
+func Tgkill(tgid int, tid int, sig int) (err error) {
_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Times(tms *Tms) (ticks uintptr, errno int) {
+func Times(tms *Tms) (ticks uintptr, err error) {
r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
ticks = uintptr(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -676,63 +812,77 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Uname(buf *Utsname) (errno int) {
+func Uname(buf *Utsname) (err error) {
_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlinkat(dirfd int, path string) (errno int) {
+func Unlinkat(dirfd int, path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(target string, flags int) (errno int) {
+func Unmount(target string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unshare(flags int) (errno int) {
+func Unshare(flags int) (err error) {
_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ustat(dev int, ubuf *Ustat_t) (errno int) {
+func Ustat(dev int, ubuf *Ustat_t) (err error) {
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Utime(path string, buf *Utimbuf) (errno int) {
+func Utime(path string, buf *Utimbuf) (err error) {
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(buf)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Write(fd int, p []byte) (n int, errno int) {
+func Write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -741,47 +891,57 @@
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func exitThread(code int) (errno int) {
+func exitThread(code int) (err error) {
_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func read(fd int, p *byte, np int) (n int, errno int) {
+func read(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func write(fd int, p *byte, np int) (n int, errno int) {
+func write(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func munmap(addr uintptr, length uintptr) (errno int) {
+func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Madvise(b []byte, advice int) (errno int) {
+func Madvise(b []byte, advice int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
@@ -789,13 +949,15 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mprotect(b []byte, prot int) (errno int) {
+func Mprotect(b []byte, prot int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
@@ -803,13 +965,15 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mlock(b []byte) (errno int) {
+func Mlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
@@ -817,13 +981,15 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Munlock(b []byte) (errno int) {
+func Munlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
@@ -831,55 +997,69 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mlockall(flags int) (errno int) {
+func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Munlockall() (errno int) {
+func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chown(path string, uid int, gid int) (errno int) {
+func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN32, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchown(fd int, uid int, gid int) (errno int) {
+func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstat(fd int, stat *Stat_t) (errno int) {
+func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -917,39 +1097,47 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ioperm(from int, num int, on int) (errno int) {
+func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Iopl(level int) (errno int) {
+func Iopl(level int) (err error) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lchown(path string, uid int, gid int) (errno int) {
+func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lstat(path string, stat *Stat_t) (errno int) {
+func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -958,13 +1146,15 @@
}
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -973,156 +1163,194 @@
}
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
written = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setfsgid(gid int) (errno int) {
+func Setfsgid(gid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setfsuid(uid int) (errno int) {
+func Setfsuid(uid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setgid(gid int) (errno int) {
+func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID32, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setregid(rgid int, egid int) (errno int) {
+func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setresgid(rgid int, egid int, sgid int) (errno int) {
+func Setresgid(rgid int, egid int, sgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setresuid(ruid int, euid int, suid int) (errno int) {
+func Setresuid(ruid int, euid int, suid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setreuid(ruid int, euid int) (errno int) {
+func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int) {
+func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (errno int) {
+func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func SyncFileRange(fd int, off int64, n int64, flags int) (errno int) {
+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))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getgroups(n int, list *_Gid_t) (nn int, errno int) {
+func getgroups(n int, list *_Gid_t) (nn int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
nn = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setgroups(n int, list *_Gid_t) (errno int) {
+func setgroups(n int, list *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) {
+func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, errno int) {
+func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {
r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))
xaddr = uintptr(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Gettimeofday(tv *Timeval) (errno int) {
+func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Time(t *Time_t) (tt Time_t, errno int) {
+func Time(t *Time_t) (tt Time_t, err error) {
r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)
tt = Time_t(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
diff --git a/src/pkg/syscall/zsyscall_linux_amd64.go b/src/pkg/syscall/zsyscall_linux_amd64.go
index 1115baa..0e0b9de 100644
--- a/src/pkg/syscall/zsyscall_linux_amd64.go
+++ b/src/pkg/syscall/zsyscall_linux_amd64.go
@@ -7,49 +7,59 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func open(path string, mode int, perm uint32) (fd int, errno int) {
+func open(path string, mode int, perm uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int) {
+func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (errno int) {
+func pipe(p *[2]_C_int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func utimes(path string, times *[2]Timeval) (errno int) {
+func utimes(path string, times *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(times)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func futimesat(dirfd int, path *byte, times *[2]Timeval) (errno int) {
+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)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getcwd(buf []byte) (n int, errno int) {
+func Getcwd(buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -58,147 +68,181 @@
}
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
+func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func reboot(magic1 uint, magic2 uint, cmd int, arg string) (errno int) {
+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(StringBytePtr(arg))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mount(source string, target string, fstype string, flags uintptr, data *byte) (errno int) {
+func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {
_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(StringBytePtr(source))), uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(unsafe.Pointer(StringBytePtr(fstype))), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Access(path string, mode uint32) (errno int) {
+func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Acct(path string) (errno int) {
+func Acct(path string) (err error) {
_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Adjtimex(buf *Timex) (state int, errno int) {
+func Adjtimex(buf *Timex) (state int, err error) {
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
state = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chroot(path string) (errno int) {
+func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Close(fd int) (errno int) {
+func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Creat(path string, mode uint32) (fd int, errno int) {
+func Creat(path string, mode uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_CREAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup(oldfd int) (fd int, errno int) {
+func Dup(oldfd int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup2(oldfd int, newfd int) (fd int, errno int) {
+func Dup2(oldfd int, newfd int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func EpollCreate(size int) (fd int, errno int) {
+func EpollCreate(size int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int) {
+func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
_p0 = unsafe.Pointer(&events[0])
@@ -207,7 +251,9 @@
}
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -220,88 +266,108 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Faccessat(dirfd int, path string, mode uint32, flags int) (errno int) {
+func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(flags), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fallocate(fd int, mode uint32, off int64, len int64) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchdir(fd int) (errno int) {
+func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmod(fd int, mode uint32) (errno int) {
+func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmodat(dirfd int, path string, mode uint32, flags int) (errno int) {
+func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(flags), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchownat(dirfd int, path string, uid int, gid int, flags int) (errno int) {
+func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func fcntl(fd int, cmd int, arg int) (val int, errno int) {
+func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fdatasync(fd int) (errno int) {
+func Fdatasync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Flock(fd int, how int) (errno int) {
+func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fsync(fd int) (errno int) {
+func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getdents(fd int, buf []byte) (n int, errno int) {
+func Getdents(fd int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -310,16 +376,20 @@
}
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpgid(pid int) (pgid int, errno int) {
+func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -349,17 +419,21 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrlimit(resource int, rlim *Rlimit) (errno int) {
+func Getrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrusage(who int, rusage *Rusage) (errno int) {
+func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -373,51 +447,61 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int) {
+func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {
r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(StringBytePtr(pathname))), uintptr(mask))
watchdesc = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit() (fd int, errno int) {
+func InotifyInit() (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyInit1(flags int) (fd int, errno int) {
+func InotifyInit1(flags int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) {
+func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
success = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kill(pid int, sig int) (errno int) {
+func Kill(pid int, sig int) (err error) {
_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Klogctl(typ int, buf []byte) (n int, errno int) {
+func Klogctl(typ int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -426,77 +510,95 @@
}
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Link(oldpath string, newpath string) (errno int) {
+func Link(oldpath string, newpath string) (err error) {
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdirat(dirfd int, path string, mode uint32) (errno int) {
+func Mkdirat(dirfd int, path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknod(path string, mode uint32, dev int) (errno int) {
+func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknodat(dirfd int, path string, mode uint32, dev int) (errno int) {
+func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
+func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pause() (errno int) {
+func Pause() (err error) {
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func PivotRoot(newroot string, putold string) (errno int) {
+func PivotRoot(newroot string, putold string) (err error) {
_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(StringBytePtr(newroot))), uintptr(unsafe.Pointer(StringBytePtr(putold))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Read(fd int, p []byte) (n int, errno int) {
+func Read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -505,13 +607,15 @@
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Readlink(path string, buf []byte) (n int, errno int) {
+func Readlink(path string, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -520,37 +624,45 @@
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rename(oldpath string, newpath string) (errno int) {
+func Rename(oldpath string, newpath string) (err error) {
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (errno int) {
+func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(newdirfd), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setdomainname(p []byte) (errno int) {
+func Setdomainname(p []byte) (err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -558,13 +670,15 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sethostname(p []byte) (errno int) {
+func Sethostname(p []byte) (err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -572,56 +686,70 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpgid(pid int, pgid int) (errno int) {
+func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setrlimit(resource int, rlim *Rlimit) (errno int) {
+func Setrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setsid() (pid int, errno int) {
+func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Settimeofday(tv *Timeval) (errno int) {
+func Settimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setuid(uid int) (errno int) {
+func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Symlink(oldpath string, newpath string) (errno int) {
+func Symlink(oldpath string, newpath string) (err error) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -634,35 +762,43 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sysinfo(info *Sysinfo_t) (errno int) {
+func Sysinfo(info *Sysinfo_t) (err error) {
_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) {
+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)
n = int64(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Tgkill(tgid int, tid int, sig int) (errno int) {
+func Tgkill(tgid int, tid int, sig int) (err error) {
_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Times(tms *Tms) (ticks uintptr, errno int) {
+func Times(tms *Tms) (ticks uintptr, err error) {
r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
ticks = uintptr(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -676,63 +812,77 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Uname(buf *Utsname) (errno int) {
+func Uname(buf *Utsname) (err error) {
_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlinkat(dirfd int, path string) (errno int) {
+func Unlinkat(dirfd int, path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(target string, flags int) (errno int) {
+func Unmount(target string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(StringBytePtr(target))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unshare(flags int) (errno int) {
+func Unshare(flags int) (err error) {
_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ustat(dev int, ubuf *Ustat_t) (errno int) {
+func Ustat(dev int, ubuf *Ustat_t) (err error) {
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Utime(path string, buf *Utimbuf) (errno int) {
+func Utime(path string, buf *Utimbuf) (err error) {
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(buf)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Write(fd int, p []byte) (n int, errno int) {
+func Write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -741,47 +891,57 @@
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func exitThread(code int) (errno int) {
+func exitThread(code int) (err error) {
_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func read(fd int, p *byte, np int) (n int, errno int) {
+func read(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func write(fd int, p *byte, np int) (n int, errno int) {
+func write(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func munmap(addr uintptr, length uintptr) (errno int) {
+func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Madvise(b []byte, advice int) (errno int) {
+func Madvise(b []byte, advice int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
@@ -789,13 +949,15 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mprotect(b []byte, prot int) (errno int) {
+func Mprotect(b []byte, prot int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
@@ -803,13 +965,15 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mlock(b []byte) (errno int) {
+func Mlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
@@ -817,13 +981,15 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Munlock(b []byte) (errno int) {
+func Munlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
@@ -831,63 +997,79 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mlockall(flags int) (errno int) {
+func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Munlockall() (errno int) {
+func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chown(path string, uid int, gid int) (errno int) {
+func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchown(fd int, uid int, gid int) (errno int) {
+func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstat(fd int, stat *Stat_t) (errno int) {
+func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstatfs(fd int, buf *Statfs_t) (errno int) {
+func Fstatfs(fd int, buf *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -925,47 +1107,57 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ioperm(from int, num int, on int) (errno int) {
+func Ioperm(from int, num int, on int) (err error) {
_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Iopl(level int) (errno int) {
+func Iopl(level int) (err error) {
_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lchown(path string, uid int, gid int) (errno int) {
+func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Listen(s int, n int) (errno int) {
+func Listen(s int, n int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lstat(path string, stat *Stat_t) (errno int) {
+func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -974,13 +1166,15 @@
}
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -989,236 +1183,292 @@
}
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seek(fd int, offset int64, whence int) (off int64, errno int) {
+func Seek(fd int, offset int64, whence int) (off int64, err error) {
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
off = int64(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) {
+func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
written = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setfsgid(gid int) (errno int) {
+func Setfsgid(gid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setfsuid(uid int) (errno int) {
+func Setfsuid(uid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setgid(gid int) (errno int) {
+func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setregid(rgid int, egid int) (errno int) {
+func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setresgid(rgid int, egid int, sgid int) (errno int) {
+func Setresgid(rgid int, egid int, sgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setresuid(ruid int, euid int, suid int) (errno int) {
+func Setresuid(ruid int, euid int, suid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setreuid(ruid int, euid int) (errno int) {
+func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Shutdown(fd int, how int) (errno int) {
+func Shutdown(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) {
+func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int64(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (errno int) {
+func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Statfs(path string, buf *Statfs_t) (errno int) {
+func Statfs(path string, buf *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(buf)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func SyncFileRange(fd int, off int64, n int64, flags int) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func bind(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func connect(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getgroups(n int, list *_Gid_t) (nn int, errno int) {
+func getgroups(n int, list *_Gid_t) (nn int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
nn = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setgroups(n int, list *_Gid_t) (errno int) {
+func setgroups(n int, list *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) {
+func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
+func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socket(domain int, typ int, proto int) (fd int, errno int) {
+func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) {
+func socketpair(domain int, typ int, proto int, fd *[2]int) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
+func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -1227,13 +1477,15 @@
}
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
+func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -1241,32 +1493,40 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
+func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
+func sendmsg(s int, msg *Msghdr, flags int) (err error) {
_, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))
xaddr = uintptr(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
diff --git a/src/pkg/syscall/zsyscall_openbsd_386.go b/src/pkg/syscall/zsyscall_openbsd_386.go
index ca390cc..7855c212 100644
--- a/src/pkg/syscall/zsyscall_openbsd_386.go
+++ b/src/pkg/syscall/zsyscall_openbsd_386.go
@@ -7,115 +7,141 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getgroups(ngid int, gid *_Gid_t) (n int, errno int) {
+func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setgroups(ngid int, gid *_Gid_t) (errno int) {
+func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
+func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func bind(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func connect(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socket(domain int, typ int, proto int) (fd int, errno int) {
+func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) {
+func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
+func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Shutdown(s int, how int) (errno int) {
+func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) {
+func socketpair(domain int, typ int, proto int, fd *[2]int) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
+func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -124,13 +150,15 @@
}
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
+func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -138,39 +166,47 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
+func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
+func sendmsg(s int, msg *Msghdr, flags int) (err error) {
_, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
+func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
@@ -178,121 +214,151 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func utimes(path string, timeval *[2]Timeval) (errno int) {
+func utimes(path string, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func futimes(fd int, timeval *[2]Timeval) (errno int) {
+func futimes(fd int, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func fcntl(fd int, cmd int, arg int) (val int, errno int) {
+func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (errno int) {
+func pipe(p *[2]_C_int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Access(path string, mode uint32) (errno int) {
+func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) {
+func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chflags(path string, flags int) (errno int) {
+func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chown(path string, uid int, gid int) (errno int) {
+func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chroot(path string) (errno int) {
+func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Close(fd int) (errno int) {
+func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup(fd int) (nfd int, errno int) {
+func Dup(fd int) (nfd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup2(from int, to int) (errno int) {
+func Dup2(from int, to int) (err error) {
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -305,88 +371,108 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchdir(fd int) (errno int) {
+func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchflags(path string, flags int) (errno int) {
+func Fchflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmod(fd int, mode uint32) (errno int) {
+func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchown(fd int, uid int, gid int) (errno int) {
+func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Flock(fd int, how int) (errno int) {
+func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fpathconf(fd int, name int) (val int, errno int) {
+func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstat(fd int, stat *Stat_t) (errno int) {
+func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstatfs(fd int, stat *Statfs_t) (errno int) {
+func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fsync(fd int) (errno int) {
+func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -395,7 +481,9 @@
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -417,7 +505,7 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
+func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -426,7 +514,9 @@
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -440,10 +530,12 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpgid(pid int) (pgid int, errno int) {
+func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -473,43 +565,53 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpriority(which int, who int) (prio int, errno int) {
+func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrlimit(which int, lim *Rlimit) (errno int) {
+func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrusage(who int, rusage *Rusage) (errno int) {
+func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getsid(pid int) (sid int, errno int) {
+func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Gettimeofday(tv *Timeval) (errno int) {
+func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -531,106 +633,130 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kill(pid int, signum int) (errno int) {
+func Kill(pid int, signum int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kqueue() (fd int, errno int) {
+func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lchown(path string, uid int, gid int) (errno int) {
+func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Link(path string, link string) (errno int) {
+func Link(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Listen(s int, backlog int) (errno int) {
+func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lstat(path string, stat *Stat_t) (errno int) {
+func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkfifo(path string, mode uint32) (errno int) {
+func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknod(path string, mode uint32, dev int) (errno int) {
+func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
+func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Open(path string, mode int, perm uint32) (fd int, errno int) {
+func Open(path string, mode int, perm uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pathconf(path string, name int) (val int, errno int) {
+func Pathconf(path string, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -639,13 +765,15 @@
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -654,13 +782,15 @@
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Read(fd int, p []byte) (n int, errno int) {
+func Read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -669,13 +799,15 @@
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Readlink(path string, buf []byte) (n int, errno int) {
+func Readlink(path string, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -684,185 +816,231 @@
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rename(from string, to string) (errno int) {
+func Rename(from string, to string) (err error) {
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Revoke(path string) (errno int) {
+func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
+func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)
newoffset = int64(int64(r1)<<32 | int64(r0))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setegid(egid int) (errno int) {
+func Setegid(egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seteuid(euid int) (errno int) {
+func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setgid(gid int) (errno int) {
+func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setlogin(name string) (errno int) {
+func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpgid(pid int, pgid int) (errno int) {
+func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpriority(which int, who int, prio int) (errno int) {
+func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setregid(rgid int, egid int) (errno int) {
+func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setreuid(ruid int, euid int) (errno int) {
+func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setrlimit(which int, lim *Rlimit) (errno int) {
+func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setsid() (pid int, errno int) {
+func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Settimeofday(tp *Timeval) (errno int) {
+func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setuid(uid int) (errno int) {
+func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (errno int) {
+func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Statfs(path string, stat *Statfs_t) (errno int) {
+func Statfs(path string, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Symlink(path string, link string) (errno int) {
+func Symlink(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sync() (errno int) {
+func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, uintptr(length), uintptr(length>>32), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -876,23 +1054,27 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(path string, flags int) (errno int) {
+func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Write(fd int, p []byte) (n int, errno int) {
+func Write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -901,41 +1083,51 @@
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)
ret = uintptr(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func munmap(addr uintptr, length uintptr) (errno int) {
+func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func read(fd int, buf *byte, nbuf int) (n int, errno int) {
+func read(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func write(fd int, buf *byte, nbuf int) (n int, errno int) {
+func write(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
diff --git a/src/pkg/syscall/zsyscall_openbsd_amd64.go b/src/pkg/syscall/zsyscall_openbsd_amd64.go
index 94ce290..8040750 100644
--- a/src/pkg/syscall/zsyscall_openbsd_amd64.go
+++ b/src/pkg/syscall/zsyscall_openbsd_amd64.go
@@ -7,115 +7,141 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getgroups(ngid int, gid *_Gid_t) (n int, errno int) {
+func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setgroups(ngid int, gid *_Gid_t) (errno int) {
+func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
+func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
+func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func bind(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
+func connect(s int, addr uintptr, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socket(domain int, typ int, proto int) (fd int, errno int) {
+func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int) {
+func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (errno int) {
+func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
+func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Shutdown(s int, how int) (errno int) {
+func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func socketpair(domain int, typ int, proto int, fd *[2]int) (errno int) {
+func socketpair(domain int, typ int, proto int, fd *[2]int) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
+func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -124,13 +150,15 @@
}
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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
+func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -138,39 +166,47 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func recvmsg(s int, msg *Msghdr, flags int) (n int, errno int) {
+func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sendmsg(s int, msg *Msghdr, flags int) (errno int) {
+func sendmsg(s int, msg *Msghdr, flags int) (err error) {
_, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
+func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
@@ -178,121 +214,151 @@
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func utimes(path string, timeval *[2]Timeval) (errno int) {
+func utimes(path string, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func futimes(fd int, timeval *[2]Timeval) (errno int) {
+func futimes(fd int, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func fcntl(fd int, cmd int, arg int) (val int, errno int) {
+func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func pipe(p *[2]_C_int) (errno int) {
+func pipe(p *[2]_C_int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Access(path string, mode uint32) (errno int) {
+func Access(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) {
+func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chdir(path string) (errno int) {
+func Chdir(path string) (err error) {
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chflags(path string, flags int) (errno int) {
+func Chflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chmod(path string, mode uint32) (errno int) {
+func Chmod(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chown(path string, uid int, gid int) (errno int) {
+func Chown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Chroot(path string) (errno int) {
+func Chroot(path string) (err error) {
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Close(fd int) (errno int) {
+func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup(fd int) (nfd int, errno int) {
+func Dup(fd int) (nfd int, err error) {
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Dup2(from int, to int) (errno int) {
+func Dup2(from int, to int) (err error) {
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -305,88 +371,108 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchdir(fd int) (errno int) {
+func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchflags(path string, flags int) (errno int) {
+func Fchflags(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchmod(fd int, mode uint32) (errno int) {
+func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fchown(fd int, uid int, gid int) (errno int) {
+func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Flock(fd int, how int) (errno int) {
+func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fpathconf(fd int, name int) (val int, errno int) {
+func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstat(fd int, stat *Stat_t) (errno int) {
+func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fstatfs(fd int, stat *Statfs_t) (errno int) {
+func Fstatfs(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Fsync(fd int) (errno int) {
+func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Ftruncate(fd int, length int64) (errno int) {
+func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -395,7 +481,9 @@
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -417,7 +505,7 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
+func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -426,7 +514,9 @@
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -440,10 +530,12 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpgid(pid int) (pgid int, errno int) {
+func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -473,43 +565,53 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getpriority(which int, who int) (prio int, errno int) {
+func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrlimit(which int, lim *Rlimit) (errno int) {
+func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrusage(who int, rusage *Rusage) (errno int) {
+func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getsid(pid int) (sid int, errno int) {
+func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Gettimeofday(tv *Timeval) (errno int) {
+func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -531,106 +633,130 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kill(pid int, signum int) (errno int) {
+func Kill(pid int, signum int) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Kqueue() (fd int, errno int) {
+func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lchown(path string, uid int, gid int) (errno int) {
+func Lchown(path string, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Link(path string, link string) (errno int) {
+func Link(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Listen(s int, backlog int) (errno int) {
+func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Lstat(path string, stat *Stat_t) (errno int) {
+func Lstat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkdir(path string, mode uint32) (errno int) {
+func Mkdir(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mkfifo(path string, mode uint32) (errno int) {
+func Mkfifo(path string, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Mknod(path string, mode uint32, dev int) (errno int) {
+func Mknod(path string, mode uint32, dev int) (err error) {
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
+func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Open(path string, mode int, perm uint32) (fd int, errno int) {
+func Open(path string, mode int, perm uint32) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pathconf(path string, name int) (val int, errno int) {
+func Pathconf(path string, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0)
val = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pread(fd int, p []byte, offset int64) (n int, errno int) {
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -639,13 +765,15 @@
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -654,13 +782,15 @@
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Read(fd int, p []byte) (n int, errno int) {
+func Read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -669,13 +799,15 @@
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Readlink(path string, buf []byte) (n int, errno int) {
+func Readlink(path string, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
@@ -684,185 +816,231 @@
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rename(from string, to string) (errno int) {
+func Rename(from string, to string) (err error) {
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Revoke(path string) (errno int) {
+func Revoke(path string) (err error) {
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Rmdir(path string) (errno int) {
+func Rmdir(path string) (err error) {
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
+func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
r0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0)
newoffset = int64(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
+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)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setegid(egid int) (errno int) {
+func Setegid(egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Seteuid(euid int) (errno int) {
+func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setgid(gid int) (errno int) {
+func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setlogin(name string) (errno int) {
+func Setlogin(name string) (err error) {
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpgid(pid int, pgid int) (errno int) {
+func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setpriority(which int, who int, prio int) (errno int) {
+func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setregid(rgid int, egid int) (errno int) {
+func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setreuid(ruid int, euid int) (errno int) {
+func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setrlimit(which int, lim *Rlimit) (errno int) {
+func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setsid() (pid int, errno int) {
+func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Settimeofday(tp *Timeval) (errno int) {
+func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Setuid(uid int) (errno int) {
+func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (errno int) {
+func Stat(path string, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Statfs(path string, stat *Statfs_t) (errno int) {
+func Statfs(path string, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Symlink(path string, link string) (errno int) {
+func Symlink(path string, link string) (err error) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Sync() (errno int) {
+func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Truncate(path string, length int64) (errno int) {
+func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, uintptr(length))
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
@@ -876,23 +1054,27 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unlink(path string) (errno int) {
+func Unlink(path string) (err error) {
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Unmount(path string, flags int) (errno int) {
+func Unmount(path string, flags int) (err error) {
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Write(fd int, p []byte) (n int, errno int) {
+func Write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
@@ -901,41 +1083,51 @@
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, errno int) {
+func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)
ret = uintptr(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func munmap(addr uintptr, length uintptr) (errno int) {
+func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func read(fd int, buf *byte, nbuf int) (n int, errno int) {
+func read(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func write(fd int, buf *byte, nbuf int) (n int, errno int) {
+func write(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
- errno = int(e1)
+ if e1 != 0 {
+ err = e1
+ }
return
}
diff --git a/src/pkg/syscall/zsyscall_windows_386.go b/src/pkg/syscall/zsyscall_windows_386.go
index e519fe3..5701024 100644
--- a/src/pkg/syscall/zsyscall_windows_386.go
+++ b/src/pkg/syscall/zsyscall_windows_386.go
@@ -114,72 +114,64 @@
procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo")
)
-func GetLastError() (lasterrno int) {
+func GetLastError() (lasterr uintptr) {
r0, _, _ := Syscall(procGetLastError.Addr(), 0, 0, 0, 0)
- lasterrno = int(r0)
+ lasterr = uintptr(r0)
return
}
-func LoadLibrary(libname string) (handle Handle, errno int) {
+func LoadLibrary(libname string) (handle Handle, err error) {
r0, _, e1 := Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(StringToUTF16Ptr(libname))), 0, 0)
handle = Handle(r0)
if handle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FreeLibrary(handle Handle) (errno int) {
+func FreeLibrary(handle Handle) (err error) {
r1, _, e1 := Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetProcAddress(module Handle, procname string) (proc uintptr, errno int) {
+func GetProcAddress(module Handle, procname string) (proc uintptr, err error) {
r0, _, e1 := Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(StringBytePtr(procname))), 0)
proc = uintptr(r0)
if proc == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetVersion() (ver uint32, errno int) {
+func GetVersion() (ver uint32, err error) {
r0, _, e1 := Syscall(procGetVersion.Addr(), 0, 0, 0, 0)
ver = uint32(r0)
if ver == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, errno int) {
+func FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) {
var _p0 *uint16
if len(buf) > 0 {
_p0 = &buf[0]
@@ -188,12 +180,10 @@
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -203,22 +193,20 @@
return
}
-func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, errno int) {
+func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) {
r0, _, e1 := Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)
handle = Handle(r0)
if handle == InvalidHandle {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (errno int) {
+func ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {
var _p0 *byte
if len(buf) > 0 {
_p0 = &buf[0]
@@ -226,17 +214,15 @@
r1, _, e1 := Syscall6(procReadFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (errno int) {
+func WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {
var _p0 *byte
if len(buf) > 0 {
_p0 = &buf[0]
@@ -244,226 +230,194 @@
r1, _, e1 := Syscall6(procWriteFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, errno int) {
+func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) {
r0, _, e1 := Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0)
newlowoffset = uint32(r0)
if newlowoffset == 0xffffffff {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CloseHandle(handle Handle) (errno int) {
+func CloseHandle(handle Handle) (err error) {
r1, _, e1 := Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetStdHandle(stdhandle int) (handle Handle, errno int) {
+func GetStdHandle(stdhandle int) (handle Handle, err error) {
r0, _, e1 := Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0)
handle = Handle(r0)
if handle == InvalidHandle {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, errno int) {
+func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) {
r0, _, e1 := Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0)
handle = Handle(r0)
if handle == InvalidHandle {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FindNextFile(handle Handle, data *Win32finddata) (errno int) {
+func FindNextFile(handle Handle, data *Win32finddata) (err error) {
r1, _, e1 := Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FindClose(handle Handle) (errno int) {
+func FindClose(handle Handle) (err error) {
r1, _, e1 := Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (errno int) {
+func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) {
r1, _, e1 := Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, errno int) {
+func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) {
r0, _, e1 := Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetCurrentDirectory(path *uint16) (errno int) {
+func SetCurrentDirectory(path *uint16) (err error) {
r1, _, e1 := Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreateDirectory(path *uint16, sa *SecurityAttributes) (errno int) {
+func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) {
r1, _, e1 := Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func RemoveDirectory(path *uint16) (errno int) {
+func RemoveDirectory(path *uint16) (err error) {
r1, _, e1 := Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func DeleteFile(path *uint16) (errno int) {
+func DeleteFile(path *uint16) (err error) {
r1, _, e1 := Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func MoveFile(from *uint16, to *uint16) (errno int) {
+func MoveFile(from *uint16, to *uint16) (err error) {
r1, _, e1 := Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetComputerName(buf *uint16, n *uint32) (errno int) {
+func GetComputerName(buf *uint16, n *uint32) (err error) {
r1, _, e1 := Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetEndOfFile(handle Handle) (errno int) {
+func SetEndOfFile(handle Handle) (err error) {
r1, _, e1 := Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -478,79 +432,69 @@
return
}
-func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, errno int) {
+func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) {
r0, _, e1 := Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0)
rc = uint32(r0)
if rc == 0xffffffff {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, errno int) {
+func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error) {
r0, _, e1 := Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0)
handle = Handle(r0)
if handle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (errno int) {
+func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error) {
r1, _, e1 := Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (errno int) {
+func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error) {
r1, _, e1 := Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CancelIo(s Handle) (errno int) {
+func CancelIo(s Handle) (err error) {
r1, _, e1 := Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (errno int) {
+func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) {
var _p0 uint32
if inheritHandles {
_p0 = 1
@@ -560,17 +504,15 @@
r1, _, e1 := Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, errno int) {
+func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) {
var _p0 uint32
if inheritHandle {
_p0 = 1
@@ -581,74 +523,64 @@
handle = Handle(r0)
if handle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func TerminateProcess(handle Handle, exitcode uint32) (errno int) {
+func TerminateProcess(handle Handle, exitcode uint32) (err error) {
r1, _, e1 := Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetExitCodeProcess(handle Handle, exitcode *uint32) (errno int) {
+func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) {
r1, _, e1 := Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetStartupInfo(startupInfo *StartupInfo) (errno int) {
+func GetStartupInfo(startupInfo *StartupInfo) (err error) {
r1, _, e1 := Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetCurrentProcess() (pseudoHandle Handle, errno int) {
+func GetCurrentProcess() (pseudoHandle Handle, err error) {
r0, _, e1 := Syscall(procGetCurrentProcess.Addr(), 0, 0, 0, 0)
pseudoHandle = Handle(r0)
if pseudoHandle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (errno int) {
+func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) {
var _p0 uint32
if bInheritHandle {
_p0 = 1
@@ -658,228 +590,196 @@
r1, _, e1 := Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, errno int) {
+func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) {
r0, _, e1 := Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0)
event = uint32(r0)
if event == 0xffffffff {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetTempPath(buflen uint32, buf *uint16) (n uint32, errno int) {
+func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) {
r0, _, e1 := Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (errno int) {
+func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) {
r1, _, e1 := Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFileType(filehandle Handle) (n uint32, errno int) {
+func GetFileType(filehandle Handle) (n uint32, err error) {
r0, _, e1 := Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0)
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (errno int) {
+func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) {
r1, _, e1 := Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CryptReleaseContext(provhandle Handle, flags uint32) (errno int) {
+func CryptReleaseContext(provhandle Handle, flags uint32) (err error) {
r1, _, e1 := Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (errno int) {
+func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) {
r1, _, e1 := Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf)))
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetEnvironmentStrings() (envs *uint16, errno int) {
+func GetEnvironmentStrings() (envs *uint16, err error) {
r0, _, e1 := Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0)
envs = (*uint16)(unsafe.Pointer(r0))
if envs == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FreeEnvironmentStrings(envs *uint16) (errno int) {
+func FreeEnvironmentStrings(envs *uint16) (err error) {
r1, _, e1 := Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, errno int) {
+func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) {
r0, _, e1 := Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size))
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetEnvironmentVariable(name *uint16, value *uint16) (errno int) {
+func SetEnvironmentVariable(name *uint16, value *uint16) (err error) {
r1, _, e1 := Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (errno int) {
+func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) {
r1, _, e1 := Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFileAttributes(name *uint16) (attrs uint32, errno int) {
+func GetFileAttributes(name *uint16) (attrs uint32, err error) {
r0, _, e1 := Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
attrs = uint32(r0)
if attrs == INVALID_FILE_ATTRIBUTES {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetFileAttributes(name *uint16, attrs uint32) (errno int) {
+func SetFileAttributes(name *uint16, attrs uint32) (err error) {
r1, _, e1 := Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFileAttributesEx(name *uint16, level uint32, info *byte) (errno int) {
+func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) {
r1, _, e1 := Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info)))
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -890,180 +790,156 @@
return
}
-func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, errno int) {
+func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) {
r0, _, e1 := Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0)
argv = (*[8192]*[8192]uint16)(unsafe.Pointer(r0))
if argv == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func LocalFree(hmem Handle) (handle Handle, errno int) {
+func LocalFree(hmem Handle) (handle Handle, err error) {
r0, _, e1 := Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0)
handle = Handle(r0)
if handle != 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetHandleInformation(handle Handle, mask uint32, flags uint32) (errno int) {
+func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) {
r1, _, e1 := Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags))
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FlushFileBuffers(handle Handle) (errno int) {
+func FlushFileBuffers(handle Handle) (err error) {
r1, _, e1 := Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, errno int) {
+func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) {
r0, _, e1 := Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0)
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, errno int) {
+func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) {
r0, _, e1 := Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name)))
handle = Handle(r0)
if handle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, errno int) {
+func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) {
r0, _, e1 := Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0)
addr = uintptr(r0)
if addr == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func UnmapViewOfFile(addr uintptr) (errno int) {
+func UnmapViewOfFile(addr uintptr) (err error) {
r1, _, e1 := Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FlushViewOfFile(addr uintptr, length uintptr) (errno int) {
+func FlushViewOfFile(addr uintptr, length uintptr) (err error) {
r1, _, e1 := Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func VirtualLock(addr uintptr, length uintptr) (errno int) {
+func VirtualLock(addr uintptr, length uintptr) (err error) {
r1, _, e1 := Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func VirtualUnlock(addr uintptr, length uintptr) (errno int) {
+func VirtualUnlock(addr uintptr, length uintptr) (err error) {
r1, _, e1 := Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (errno int) {
+func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) {
r1, _, e1 := Syscall9(procTransmitFile.Addr(), 7, uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (errno int) {
+func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
var _p0 uint32
if watchSubTree {
_p0 = 1
@@ -1073,27 +949,23 @@
r1, _, e1 := Syscall9(procReadDirectoryChangesW.Addr(), 8, uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, errno int) {
+func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) {
r0, _, e1 := Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0)
store = Handle(r0)
if store == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -1104,191 +976,165 @@
return
}
-func CertCloseStore(store Handle, flags uint32) (errno int) {
+func CertCloseStore(store Handle, flags uint32) (err error) {
r1, _, e1 := Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSAStartup(verreq uint32, data *WSAData) (sockerrno int) {
+func WSAStartup(verreq uint32, data *WSAData) (sockerr uintptr) {
r0, _, _ := Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0)
- sockerrno = int(r0)
+ sockerr = uintptr(r0)
return
}
-func WSACleanup() (errno int) {
+func WSACleanup() (err error) {
r1, _, e1 := Syscall(procWSACleanup.Addr(), 0, 0, 0, 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (errno int) {
+func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
r1, _, e1 := Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func socket(af int32, typ int32, protocol int32) (handle Handle, errno int) {
+func socket(af int32, typ int32, protocol int32) (handle Handle, err error) {
r0, _, e1 := Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol))
handle = Handle(r0)
if handle == InvalidHandle {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (errno int) {
+func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) {
r1, _, e1 := Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func bind(s Handle, name uintptr, namelen int32) (errno int) {
+func bind(s Handle, name uintptr, namelen int32) (err error) {
r1, _, e1 := Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func connect(s Handle, name uintptr, namelen int32) (errno int) {
+func connect(s Handle, name uintptr, namelen int32) (err error) {
r1, _, e1 := Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (errno int) {
+func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
r1, _, e1 := Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (errno int) {
+func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
r1, _, e1 := Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func listen(s Handle, backlog int32) (errno int) {
+func listen(s Handle, backlog int32) (err error) {
r1, _, e1 := Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func shutdown(s Handle, how int32) (errno int) {
+func shutdown(s Handle, how int32) (err error) {
r1, _, e1 := Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func Closesocket(s Handle) (errno int) {
+func Closesocket(s Handle) (err error) {
r1, _, e1 := Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (errno int) {
+func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) {
r1, _, e1 := Syscall9(procAcceptEx.Addr(), 8, uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -1298,88 +1144,76 @@
return
}
-func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) {
r1, _, e1 := Syscall9(procWSARecv.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) {
r1, _, e1 := Syscall9(procWSASend.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) {
r1, _, e1 := Syscall9(procWSARecvFrom.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) {
r1, _, e1 := Syscall9(procWSASendTo.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetHostByName(name string) (h *Hostent, errno int) {
+func GetHostByName(name string) (h *Hostent, err error) {
r0, _, e1 := Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
h = (*Hostent)(unsafe.Pointer(r0))
if h == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetServByName(name string, proto string) (s *Servent, errno int) {
+func GetServByName(name string, proto string) (s *Servent, err error) {
r0, _, e1 := Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(StringBytePtr(name))), uintptr(unsafe.Pointer(StringBytePtr(proto))), 0)
s = (*Servent)(unsafe.Pointer(r0))
if s == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -1390,24 +1224,22 @@
return
}
-func GetProtoByName(name string) (p *Protoent, errno int) {
+func GetProtoByName(name string) (p *Protoent, err error) {
r0, _, e1 := Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
p = (*Protoent)(unsafe.Pointer(r0))
if p == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status uint32) {
+func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status Errno) {
r0, _, _ := Syscall6(procDnsQuery_W.Addr(), 6, uintptr(unsafe.Pointer(StringToUTF16Ptr(name))), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr)))
- status = uint32(r0)
+ status = Errno(r0)
return
}
@@ -1416,14 +1248,14 @@
return
}
-func GetIfEntry(pIfRow *MibIfRow) (errcode int) {
+func GetIfEntry(pIfRow *MibIfRow) (errcode Errno) {
r0, _, _ := Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0)
- errcode = int(r0)
+ errcode = Errno(r0)
return
}
-func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode int) {
+func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode Errno) {
r0, _, _ := Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0)
- errcode = int(r0)
+ errcode = Errno(r0)
return
}
diff --git a/src/pkg/syscall/zsyscall_windows_amd64.go b/src/pkg/syscall/zsyscall_windows_amd64.go
index f7dc79d..56d4399 100644
--- a/src/pkg/syscall/zsyscall_windows_amd64.go
+++ b/src/pkg/syscall/zsyscall_windows_amd64.go
@@ -114,72 +114,64 @@
procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo")
)
-func GetLastError() (lasterrno int) {
+func GetLastError() (lasterr uintptr) {
r0, _, _ := Syscall(procGetLastError.Addr(), 0, 0, 0, 0)
- lasterrno = int(r0)
+ lasterr = uintptr(r0)
return
}
-func LoadLibrary(libname string) (handle Handle, errno int) {
+func LoadLibrary(libname string) (handle Handle, err error) {
r0, _, e1 := Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(StringToUTF16Ptr(libname))), 0, 0)
handle = Handle(r0)
if handle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FreeLibrary(handle Handle) (errno int) {
+func FreeLibrary(handle Handle) (err error) {
r1, _, e1 := Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetProcAddress(module Handle, procname string) (proc uintptr, errno int) {
+func GetProcAddress(module Handle, procname string) (proc uintptr, err error) {
r0, _, e1 := Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(StringBytePtr(procname))), 0)
proc = uintptr(r0)
if proc == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetVersion() (ver uint32, errno int) {
+func GetVersion() (ver uint32, err error) {
r0, _, e1 := Syscall(procGetVersion.Addr(), 0, 0, 0, 0)
ver = uint32(r0)
if ver == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, errno int) {
+func FormatMessage(flags uint32, msgsrc uint32, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) {
var _p0 *uint16
if len(buf) > 0 {
_p0 = &buf[0]
@@ -188,12 +180,10 @@
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -203,22 +193,20 @@
return
}
-func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, errno int) {
+func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) {
r0, _, e1 := Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)
handle = Handle(r0)
if handle == InvalidHandle {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (errno int) {
+func ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {
var _p0 *byte
if len(buf) > 0 {
_p0 = &buf[0]
@@ -226,17 +214,15 @@
r1, _, e1 := Syscall6(procReadFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (errno int) {
+func WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {
var _p0 *byte
if len(buf) > 0 {
_p0 = &buf[0]
@@ -244,226 +230,194 @@
r1, _, e1 := Syscall6(procWriteFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, errno int) {
+func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) {
r0, _, e1 := Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0)
newlowoffset = uint32(r0)
if newlowoffset == 0xffffffff {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CloseHandle(handle Handle) (errno int) {
+func CloseHandle(handle Handle) (err error) {
r1, _, e1 := Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetStdHandle(stdhandle int) (handle Handle, errno int) {
+func GetStdHandle(stdhandle int) (handle Handle, err error) {
r0, _, e1 := Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0)
handle = Handle(r0)
if handle == InvalidHandle {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, errno int) {
+func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) {
r0, _, e1 := Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0)
handle = Handle(r0)
if handle == InvalidHandle {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FindNextFile(handle Handle, data *Win32finddata) (errno int) {
+func FindNextFile(handle Handle, data *Win32finddata) (err error) {
r1, _, e1 := Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FindClose(handle Handle) (errno int) {
+func FindClose(handle Handle) (err error) {
r1, _, e1 := Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (errno int) {
+func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) {
r1, _, e1 := Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, errno int) {
+func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) {
r0, _, e1 := Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetCurrentDirectory(path *uint16) (errno int) {
+func SetCurrentDirectory(path *uint16) (err error) {
r1, _, e1 := Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreateDirectory(path *uint16, sa *SecurityAttributes) (errno int) {
+func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) {
r1, _, e1 := Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func RemoveDirectory(path *uint16) (errno int) {
+func RemoveDirectory(path *uint16) (err error) {
r1, _, e1 := Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func DeleteFile(path *uint16) (errno int) {
+func DeleteFile(path *uint16) (err error) {
r1, _, e1 := Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func MoveFile(from *uint16, to *uint16) (errno int) {
+func MoveFile(from *uint16, to *uint16) (err error) {
r1, _, e1 := Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetComputerName(buf *uint16, n *uint32) (errno int) {
+func GetComputerName(buf *uint16, n *uint32) (err error) {
r1, _, e1 := Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetEndOfFile(handle Handle) (errno int) {
+func SetEndOfFile(handle Handle) (err error) {
r1, _, e1 := Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -478,79 +432,69 @@
return
}
-func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, errno int) {
+func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) {
r0, _, e1 := Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0)
rc = uint32(r0)
if rc == 0xffffffff {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, errno int) {
+func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error) {
r0, _, e1 := Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0)
handle = Handle(r0)
if handle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (errno int) {
+func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error) {
r1, _, e1 := Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (errno int) {
+func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error) {
r1, _, e1 := Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CancelIo(s Handle) (errno int) {
+func CancelIo(s Handle) (err error) {
r1, _, e1 := Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (errno int) {
+func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) {
var _p0 uint32
if inheritHandles {
_p0 = 1
@@ -560,17 +504,15 @@
r1, _, e1 := Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, errno int) {
+func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) {
var _p0 uint32
if inheritHandle {
_p0 = 1
@@ -581,74 +523,64 @@
handle = Handle(r0)
if handle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func TerminateProcess(handle Handle, exitcode uint32) (errno int) {
+func TerminateProcess(handle Handle, exitcode uint32) (err error) {
r1, _, e1 := Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetExitCodeProcess(handle Handle, exitcode *uint32) (errno int) {
+func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) {
r1, _, e1 := Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetStartupInfo(startupInfo *StartupInfo) (errno int) {
+func GetStartupInfo(startupInfo *StartupInfo) (err error) {
r1, _, e1 := Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetCurrentProcess() (pseudoHandle Handle, errno int) {
+func GetCurrentProcess() (pseudoHandle Handle, err error) {
r0, _, e1 := Syscall(procGetCurrentProcess.Addr(), 0, 0, 0, 0)
pseudoHandle = Handle(r0)
if pseudoHandle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (errno int) {
+func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) {
var _p0 uint32
if bInheritHandle {
_p0 = 1
@@ -658,228 +590,196 @@
r1, _, e1 := Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, errno int) {
+func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) {
r0, _, e1 := Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0)
event = uint32(r0)
if event == 0xffffffff {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetTempPath(buflen uint32, buf *uint16) (n uint32, errno int) {
+func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) {
r0, _, e1 := Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (errno int) {
+func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) {
r1, _, e1 := Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFileType(filehandle Handle) (n uint32, errno int) {
+func GetFileType(filehandle Handle) (n uint32, err error) {
r0, _, e1 := Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0)
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (errno int) {
+func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) {
r1, _, e1 := Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CryptReleaseContext(provhandle Handle, flags uint32) (errno int) {
+func CryptReleaseContext(provhandle Handle, flags uint32) (err error) {
r1, _, e1 := Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (errno int) {
+func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) {
r1, _, e1 := Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf)))
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetEnvironmentStrings() (envs *uint16, errno int) {
+func GetEnvironmentStrings() (envs *uint16, err error) {
r0, _, e1 := Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0)
envs = (*uint16)(unsafe.Pointer(r0))
if envs == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FreeEnvironmentStrings(envs *uint16) (errno int) {
+func FreeEnvironmentStrings(envs *uint16) (err error) {
r1, _, e1 := Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, errno int) {
+func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) {
r0, _, e1 := Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size))
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetEnvironmentVariable(name *uint16, value *uint16) (errno int) {
+func SetEnvironmentVariable(name *uint16, value *uint16) (err error) {
r1, _, e1 := Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (errno int) {
+func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) {
r1, _, e1 := Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFileAttributes(name *uint16) (attrs uint32, errno int) {
+func GetFileAttributes(name *uint16) (attrs uint32, err error) {
r0, _, e1 := Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
attrs = uint32(r0)
if attrs == INVALID_FILE_ATTRIBUTES {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetFileAttributes(name *uint16, attrs uint32) (errno int) {
+func SetFileAttributes(name *uint16, attrs uint32) (err error) {
r1, _, e1 := Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFileAttributesEx(name *uint16, level uint32, info *byte) (errno int) {
+func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) {
r1, _, e1 := Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info)))
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -890,180 +790,156 @@
return
}
-func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, errno int) {
+func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) {
r0, _, e1 := Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0)
argv = (*[8192]*[8192]uint16)(unsafe.Pointer(r0))
if argv == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func LocalFree(hmem Handle) (handle Handle, errno int) {
+func LocalFree(hmem Handle) (handle Handle, err error) {
r0, _, e1 := Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0)
handle = Handle(r0)
if handle != 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func SetHandleInformation(handle Handle, mask uint32, flags uint32) (errno int) {
+func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) {
r1, _, e1 := Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags))
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FlushFileBuffers(handle Handle) (errno int) {
+func FlushFileBuffers(handle Handle) (err error) {
r1, _, e1 := Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, errno int) {
+func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) {
r0, _, e1 := Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0)
n = uint32(r0)
if n == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, errno int) {
+func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) {
r0, _, e1 := Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name)))
handle = Handle(r0)
if handle == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, errno int) {
+func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) {
r0, _, e1 := Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0)
addr = uintptr(r0)
if addr == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func UnmapViewOfFile(addr uintptr) (errno int) {
+func UnmapViewOfFile(addr uintptr) (err error) {
r1, _, e1 := Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func FlushViewOfFile(addr uintptr, length uintptr) (errno int) {
+func FlushViewOfFile(addr uintptr, length uintptr) (err error) {
r1, _, e1 := Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func VirtualLock(addr uintptr, length uintptr) (errno int) {
+func VirtualLock(addr uintptr, length uintptr) (err error) {
r1, _, e1 := Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func VirtualUnlock(addr uintptr, length uintptr) (errno int) {
+func VirtualUnlock(addr uintptr, length uintptr) (err error) {
r1, _, e1 := Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (errno int) {
+func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) {
r1, _, e1 := Syscall9(procTransmitFile.Addr(), 7, uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags), 0, 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (errno int) {
+func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
var _p0 uint32
if watchSubTree {
_p0 = 1
@@ -1073,27 +949,23 @@
r1, _, e1 := Syscall9(procReadDirectoryChangesW.Addr(), 8, uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, errno int) {
+func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) {
r0, _, e1 := Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0)
store = Handle(r0)
if store == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -1104,191 +976,165 @@
return
}
-func CertCloseStore(store Handle, flags uint32) (errno int) {
+func CertCloseStore(store Handle, flags uint32) (err error) {
r1, _, e1 := Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSAStartup(verreq uint32, data *WSAData) (sockerrno int) {
+func WSAStartup(verreq uint32, data *WSAData) (sockerr uintptr) {
r0, _, _ := Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0)
- sockerrno = int(r0)
+ sockerr = uintptr(r0)
return
}
-func WSACleanup() (errno int) {
+func WSACleanup() (err error) {
r1, _, e1 := Syscall(procWSACleanup.Addr(), 0, 0, 0, 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (errno int) {
+func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
r1, _, e1 := Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func socket(af int32, typ int32, protocol int32) (handle Handle, errno int) {
+func socket(af int32, typ int32, protocol int32) (handle Handle, err error) {
r0, _, e1 := Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol))
handle = Handle(r0)
if handle == InvalidHandle {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (errno int) {
+func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) {
r1, _, e1 := Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func bind(s Handle, name uintptr, namelen int32) (errno int) {
+func bind(s Handle, name uintptr, namelen int32) (err error) {
r1, _, e1 := Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func connect(s Handle, name uintptr, namelen int32) (errno int) {
+func connect(s Handle, name uintptr, namelen int32) (err error) {
r1, _, e1 := Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (errno int) {
+func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
r1, _, e1 := Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (errno int) {
+func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
r1, _, e1 := Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func listen(s Handle, backlog int32) (errno int) {
+func listen(s Handle, backlog int32) (err error) {
r1, _, e1 := Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func shutdown(s Handle, how int32) (errno int) {
+func shutdown(s Handle, how int32) (err error) {
r1, _, e1 := Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func Closesocket(s Handle) (errno int) {
+func Closesocket(s Handle) (err error) {
r1, _, e1 := Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (errno int) {
+func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) {
r1, _, e1 := Syscall9(procAcceptEx.Addr(), 8, uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)), 0)
if int(r1) == 0 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -1298,88 +1144,76 @@
return
}
-func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) {
r1, _, e1 := Syscall9(procWSARecv.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) {
r1, _, e1 := Syscall9(procWSASend.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) {
r1, _, e1 := Syscall9(procWSARecvFrom.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (errno int) {
+func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) {
r1, _, e1 := Syscall9(procWSASendTo.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
if int(r1) == -1 {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetHostByName(name string) (h *Hostent, errno int) {
+func GetHostByName(name string) (h *Hostent, err error) {
r0, _, e1 := Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
h = (*Hostent)(unsafe.Pointer(r0))
if h == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func GetServByName(name string, proto string) (s *Servent, errno int) {
+func GetServByName(name string, proto string) (s *Servent, err error) {
r0, _, e1 := Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(StringBytePtr(name))), uintptr(unsafe.Pointer(StringBytePtr(proto))), 0)
s = (*Servent)(unsafe.Pointer(r0))
if s == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
@@ -1390,24 +1224,22 @@
return
}
-func GetProtoByName(name string) (p *Protoent, errno int) {
+func GetProtoByName(name string) (p *Protoent, err error) {
r0, _, e1 := Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0)
p = (*Protoent)(unsafe.Pointer(r0))
if p == nil {
if e1 != 0 {
- errno = int(e1)
+ err = error(e1)
} else {
- errno = EINVAL
+ err = EINVAL
}
- } else {
- errno = 0
}
return
}
-func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status uint32) {
+func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status Errno) {
r0, _, _ := Syscall6(procDnsQuery_W.Addr(), 6, uintptr(unsafe.Pointer(StringToUTF16Ptr(name))), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr)))
- status = uint32(r0)
+ status = Errno(r0)
return
}
@@ -1416,14 +1248,14 @@
return
}
-func GetIfEntry(pIfRow *MibIfRow) (errcode int) {
+func GetIfEntry(pIfRow *MibIfRow) (errcode Errno) {
r0, _, _ := Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0)
- errcode = int(r0)
+ errcode = Errno(r0)
return
}
-func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode int) {
+func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode Errno) {
r0, _, _ := Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0)
- errcode = int(r0)
+ errcode = Errno(r0)
return
}
diff --git a/src/pkg/syscall/zsysnum_darwin_386.go b/src/pkg/syscall/zsysnum_darwin_386.go
index 50aec39..abdef77 100644
--- a/src/pkg/syscall/zsysnum_darwin_386.go
+++ b/src/pkg/syscall/zsysnum_darwin_386.go
@@ -4,352 +4,357 @@
package syscall
const (
- SYS_SYSCALL = 0
- SYS_EXIT = 1
- SYS_FORK = 2
- SYS_READ = 3
- SYS_WRITE = 4
- SYS_OPEN = 5
- SYS_CLOSE = 6
- SYS_WAIT4 = 7
- SYS_LINK = 9
- SYS_UNLINK = 10
- SYS_CHDIR = 12
- SYS_FCHDIR = 13
- SYS_MKNOD = 14
- SYS_CHMOD = 15
- SYS_CHOWN = 16
- SYS_GETFSSTAT = 18
- SYS_GETPID = 20
- SYS_SETUID = 23
- SYS_GETUID = 24
- SYS_GETEUID = 25
- SYS_PTRACE = 26
- SYS_RECVMSG = 27
- SYS_SENDMSG = 28
- SYS_RECVFROM = 29
- SYS_ACCEPT = 30
- SYS_GETPEERNAME = 31
- SYS_GETSOCKNAME = 32
- SYS_ACCESS = 33
- SYS_CHFLAGS = 34
- SYS_FCHFLAGS = 35
- SYS_SYNC = 36
- SYS_KILL = 37
- SYS_GETPPID = 39
- SYS_DUP = 41
- SYS_PIPE = 42
- SYS_GETEGID = 43
- SYS_PROFIL = 44
- SYS_SIGACTION = 46
- SYS_GETGID = 47
- SYS_SIGPROCMASK = 48
- SYS_GETLOGIN = 49
- SYS_SETLOGIN = 50
- SYS_ACCT = 51
- SYS_SIGPENDING = 52
- SYS_SIGALTSTACK = 53
- SYS_IOCTL = 54
- SYS_REBOOT = 55
- SYS_REVOKE = 56
- SYS_SYMLINK = 57
- SYS_READLINK = 58
- SYS_EXECVE = 59
- SYS_UMASK = 60
- SYS_CHROOT = 61
- SYS_MSYNC = 65
- SYS_VFORK = 66
- SYS_MUNMAP = 73
- SYS_MPROTECT = 74
- SYS_MADVISE = 75
- SYS_MINCORE = 78
- SYS_GETGROUPS = 79
- SYS_SETGROUPS = 80
- SYS_GETPGRP = 81
- SYS_SETPGID = 82
- SYS_SETITIMER = 83
- SYS_SWAPON = 85
- SYS_GETITIMER = 86
- SYS_GETDTABLESIZE = 89
- SYS_DUP2 = 90
- SYS_FCNTL = 92
- SYS_SELECT = 93
- SYS_FSYNC = 95
- SYS_SETPRIORITY = 96
- SYS_SOCKET = 97
- SYS_CONNECT = 98
- SYS_GETPRIORITY = 100
- SYS_BIND = 104
- SYS_SETSOCKOPT = 105
- SYS_LISTEN = 106
- SYS_SIGSUSPEND = 111
- SYS_GETTIMEOFDAY = 116
- SYS_GETRUSAGE = 117
- SYS_GETSOCKOPT = 118
- SYS_READV = 120
- SYS_WRITEV = 121
- SYS_SETTIMEOFDAY = 122
- SYS_FCHOWN = 123
- SYS_FCHMOD = 124
- SYS_SETREUID = 126
- SYS_SETREGID = 127
- SYS_RENAME = 128
- SYS_FLOCK = 131
- SYS_MKFIFO = 132
- SYS_SENDTO = 133
- SYS_SHUTDOWN = 134
- SYS_SOCKETPAIR = 135
- SYS_MKDIR = 136
- SYS_RMDIR = 137
- SYS_UTIMES = 138
- SYS_FUTIMES = 139
- SYS_ADJTIME = 140
- SYS_GETHOSTUUID = 142
- SYS_SETSID = 147
- SYS_GETPGID = 151
- SYS_SETPRIVEXEC = 152
- SYS_PREAD = 153
- SYS_PWRITE = 154
- SYS_NFSSVC = 155
- SYS_STATFS = 157
- SYS_FSTATFS = 158
- SYS_UNMOUNT = 159
- SYS_GETFH = 161
- SYS_QUOTACTL = 165
- SYS_MOUNT = 167
- SYS_CSOPS = 169
- SYS_WAITID = 173
- SYS_ADD_PROFIL = 176
- SYS_KDEBUG_TRACE = 180
- SYS_SETGID = 181
- SYS_SETEGID = 182
- SYS_SETEUID = 183
- SYS_SIGRETURN = 184
- SYS_CHUD = 185
- SYS_FDATASYNC = 187
- SYS_STAT = 188
- SYS_FSTAT = 189
- SYS_LSTAT = 190
- SYS_PATHCONF = 191
- SYS_FPATHCONF = 192
- SYS_GETRLIMIT = 194
- SYS_SETRLIMIT = 195
- SYS_GETDIRENTRIES = 196
- SYS_MMAP = 197
- SYS_LSEEK = 199
- SYS_TRUNCATE = 200
- SYS_FTRUNCATE = 201
- SYS___SYSCTL = 202
- SYS_MLOCK = 203
- SYS_MUNLOCK = 204
- SYS_UNDELETE = 205
- SYS_ATSOCKET = 206
- SYS_ATGETMSG = 207
- SYS_ATPUTMSG = 208
- SYS_ATPSNDREQ = 209
- SYS_ATPSNDRSP = 210
- SYS_ATPGETREQ = 211
- SYS_ATPGETRSP = 212
- SYS_MKCOMPLEX = 216
- SYS_STATV = 217
- SYS_LSTATV = 218
- SYS_FSTATV = 219
- SYS_GETATTRLIST = 220
- SYS_SETATTRLIST = 221
- SYS_GETDIRENTRIESATTR = 222
- SYS_EXCHANGEDATA = 223
- SYS_SEARCHFS = 225
- SYS_DELETE = 226
- SYS_COPYFILE = 227
- SYS_FGETATTRLIST = 228
- SYS_FSETATTRLIST = 229
- SYS_POLL = 230
- SYS_WATCHEVENT = 231
- SYS_WAITEVENT = 232
- SYS_MODWATCH = 233
- SYS_GETXATTR = 234
- SYS_FGETXATTR = 235
- SYS_SETXATTR = 236
- SYS_FSETXATTR = 237
- SYS_REMOVEXATTR = 238
- SYS_FREMOVEXATTR = 239
- SYS_LISTXATTR = 240
- SYS_FLISTXATTR = 241
- SYS_FSCTL = 242
- SYS_INITGROUPS = 243
- SYS_POSIX_SPAWN = 244
- SYS_FFSCTL = 245
- SYS_NFSCLNT = 247
- SYS_FHOPEN = 248
- SYS_MINHERIT = 250
- SYS_SEMSYS = 251
- SYS_MSGSYS = 252
- SYS_SHMSYS = 253
- SYS_SEMCTL = 254
- SYS_SEMGET = 255
- SYS_SEMOP = 256
- SYS_MSGCTL = 258
- SYS_MSGGET = 259
- SYS_MSGSND = 260
- SYS_MSGRCV = 261
- SYS_SHMAT = 262
- SYS_SHMCTL = 263
- SYS_SHMDT = 264
- SYS_SHMGET = 265
- SYS_SHM_OPEN = 266
- SYS_SHM_UNLINK = 267
- SYS_SEM_OPEN = 268
- SYS_SEM_CLOSE = 269
- SYS_SEM_UNLINK = 270
- SYS_SEM_WAIT = 271
- SYS_SEM_TRYWAIT = 272
- SYS_SEM_POST = 273
- SYS_SEM_GETVALUE = 274
- SYS_SEM_INIT = 275
- SYS_SEM_DESTROY = 276
- SYS_OPEN_EXTENDED = 277
- SYS_UMASK_EXTENDED = 278
- SYS_STAT_EXTENDED = 279
- SYS_LSTAT_EXTENDED = 280
- SYS_FSTAT_EXTENDED = 281
- SYS_CHMOD_EXTENDED = 282
- SYS_FCHMOD_EXTENDED = 283
- SYS_ACCESS_EXTENDED = 284
- SYS_SETTID = 285
- SYS_GETTID = 286
- SYS_SETSGROUPS = 287
- SYS_GETSGROUPS = 288
- SYS_SETWGROUPS = 289
- SYS_GETWGROUPS = 290
- SYS_MKFIFO_EXTENDED = 291
- SYS_MKDIR_EXTENDED = 292
- SYS_IDENTITYSVC = 293
- SYS_SHARED_REGION_CHECK_NP = 294
- SYS_SHARED_REGION_MAP_NP = 295
- SYS_VM_PRESSURE_MONITOR = 296
- SYS_PSYNCH_RW_LONGRDLOCK = 297
- SYS_PSYNCH_RW_YIELDWRLOCK = 298
- SYS_PSYNCH_RW_DOWNGRADE = 299
- SYS_PSYNCH_RW_UPGRADE = 300
- SYS_PSYNCH_MUTEXWAIT = 301
- SYS_PSYNCH_MUTEXDROP = 302
- SYS_PSYNCH_CVBROAD = 303
- SYS_PSYNCH_CVSIGNAL = 304
- SYS_PSYNCH_CVWAIT = 305
- SYS_PSYNCH_RW_RDLOCK = 306
- SYS_PSYNCH_RW_WRLOCK = 307
- SYS_PSYNCH_RW_UNLOCK = 308
- SYS_PSYNCH_RW_UNLOCK2 = 309
- SYS_GETSID = 310
- SYS_SETTID_WITH_PID = 311
- SYS_AIO_FSYNC = 313
- SYS_AIO_RETURN = 314
- SYS_AIO_SUSPEND = 315
- SYS_AIO_CANCEL = 316
- SYS_AIO_ERROR = 317
- SYS_AIO_READ = 318
- SYS_AIO_WRITE = 319
- SYS_LIO_LISTIO = 320
- SYS_IOPOLICYSYS = 322
- SYS_MLOCKALL = 324
- SYS_MUNLOCKALL = 325
- SYS_ISSETUGID = 327
- SYS___PTHREAD_KILL = 328
- SYS___PTHREAD_SIGMASK = 329
- SYS___SIGWAIT = 330
- SYS___DISABLE_THREADSIGNAL = 331
- SYS___PTHREAD_MARKCANCEL = 332
- SYS___PTHREAD_CANCELED = 333
- SYS___SEMWAIT_SIGNAL = 334
- SYS_PROC_INFO = 336
- SYS_SENDFILE = 337
- SYS_STAT64 = 338
- SYS_FSTAT64 = 339
- SYS_LSTAT64 = 340
- SYS_STAT64_EXTENDED = 341
- SYS_LSTAT64_EXTENDED = 342
- SYS_FSTAT64_EXTENDED = 343
- SYS_GETDIRENTRIES64 = 344
- SYS_STATFS64 = 345
- SYS_FSTATFS64 = 346
- SYS_GETFSSTAT64 = 347
- SYS___PTHREAD_CHDIR = 348
- SYS___PTHREAD_FCHDIR = 349
- SYS_AUDIT = 350
- SYS_AUDITON = 351
- SYS_GETAUID = 353
- SYS_SETAUID = 354
- SYS_GETAUDIT = 355
- SYS_SETAUDIT = 356
- SYS_GETAUDIT_ADDR = 357
- SYS_SETAUDIT_ADDR = 358
- SYS_AUDITCTL = 359
- SYS_BSDTHREAD_CREATE = 360
- SYS_BSDTHREAD_TERMINATE = 361
- SYS_KQUEUE = 362
- SYS_KEVENT = 363
- SYS_LCHOWN = 364
- SYS_STACK_SNAPSHOT = 365
- SYS_BSDTHREAD_REGISTER = 366
- SYS_WORKQ_OPEN = 367
- SYS_WORKQ_KERNRETURN = 368
- SYS_KEVENT64 = 369
- SYS___OLD_SEMWAIT_SIGNAL = 370
- SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371
- SYS_THREAD_SELFID = 372
- SYS___MAC_EXECVE = 380
- SYS___MAC_SYSCALL = 381
- SYS___MAC_GET_FILE = 382
- SYS___MAC_SET_FILE = 383
- SYS___MAC_GET_LINK = 384
- SYS___MAC_SET_LINK = 385
- SYS___MAC_GET_PROC = 386
- SYS___MAC_SET_PROC = 387
- SYS___MAC_GET_FD = 388
- SYS___MAC_SET_FD = 389
- SYS___MAC_GET_PID = 390
- SYS___MAC_GET_LCID = 391
- SYS___MAC_GET_LCTX = 392
- SYS___MAC_SET_LCTX = 393
- SYS_SETLCID = 394
- SYS_GETLCID = 395
- SYS_READ_NOCANCEL = 396
- SYS_WRITE_NOCANCEL = 397
- SYS_OPEN_NOCANCEL = 398
- SYS_CLOSE_NOCANCEL = 399
- SYS_WAIT4_NOCANCEL = 400
- SYS_RECVMSG_NOCANCEL = 401
- SYS_SENDMSG_NOCANCEL = 402
- SYS_RECVFROM_NOCANCEL = 403
- SYS_ACCEPT_NOCANCEL = 404
- SYS_MSYNC_NOCANCEL = 405
- SYS_FCNTL_NOCANCEL = 406
- SYS_SELECT_NOCANCEL = 407
- SYS_FSYNC_NOCANCEL = 408
- SYS_CONNECT_NOCANCEL = 409
- SYS_SIGSUSPEND_NOCANCEL = 410
- SYS_READV_NOCANCEL = 411
- SYS_WRITEV_NOCANCEL = 412
- SYS_SENDTO_NOCANCEL = 413
- SYS_PREAD_NOCANCEL = 414
- SYS_PWRITE_NOCANCEL = 415
- SYS_WAITID_NOCANCEL = 416
- SYS_POLL_NOCANCEL = 417
- SYS_MSGSND_NOCANCEL = 418
- SYS_MSGRCV_NOCANCEL = 419
- SYS_SEM_WAIT_NOCANCEL = 420
- SYS_AIO_SUSPEND_NOCANCEL = 421
- SYS___SIGWAIT_NOCANCEL = 422
- SYS___SEMWAIT_SIGNAL_NOCANCEL = 423
- SYS___MAC_MOUNT = 424
- SYS___MAC_GET_MOUNT = 425
- SYS___MAC_GETFSSTAT = 426
- SYS_FSGETPATH = 427
- SYS_AUDIT_SESSION_SELF = 428
- SYS_AUDIT_SESSION_JOIN = 429
- SYS_PID_SUSPEND = 430
- SYS_PID_RESUME = 431
- SYS_FILEPORT_MAKEPORT = 432
- SYS_FILEPORT_MAKEFD = 433
- SYS_MAXSYSCALL = 434
+ SYS_SYSCALL = 0
+ SYS_EXIT = 1
+ SYS_FORK = 2
+ SYS_READ = 3
+ SYS_WRITE = 4
+ SYS_OPEN = 5
+ SYS_CLOSE = 6
+ SYS_WAIT4 = 7
+ SYS_LINK = 9
+ SYS_UNLINK = 10
+ SYS_CHDIR = 12
+ SYS_FCHDIR = 13
+ SYS_MKNOD = 14
+ SYS_CHMOD = 15
+ SYS_CHOWN = 16
+ SYS_GETFSSTAT = 18
+ SYS_GETPID = 20
+ SYS_SETUID = 23
+ SYS_GETUID = 24
+ SYS_GETEUID = 25
+ SYS_PTRACE = 26
+ SYS_RECVMSG = 27
+ SYS_SENDMSG = 28
+ SYS_RECVFROM = 29
+ SYS_ACCEPT = 30
+ SYS_GETPEERNAME = 31
+ SYS_GETSOCKNAME = 32
+ SYS_ACCESS = 33
+ SYS_CHFLAGS = 34
+ SYS_FCHFLAGS = 35
+ SYS_SYNC = 36
+ SYS_KILL = 37
+ SYS_GETPPID = 39
+ SYS_DUP = 41
+ SYS_PIPE = 42
+ SYS_GETEGID = 43
+ SYS_PROFIL = 44
+ SYS_SIGACTION = 46
+ SYS_GETGID = 47
+ SYS_SIGPROCMASK = 48
+ SYS_GETLOGIN = 49
+ SYS_SETLOGIN = 50
+ SYS_ACCT = 51
+ SYS_SIGPENDING = 52
+ SYS_SIGALTSTACK = 53
+ SYS_IOCTL = 54
+ SYS_REBOOT = 55
+ SYS_REVOKE = 56
+ SYS_SYMLINK = 57
+ SYS_READLINK = 58
+ SYS_EXECVE = 59
+ SYS_UMASK = 60
+ SYS_CHROOT = 61
+ SYS_MSYNC = 65
+ SYS_VFORK = 66
+ SYS_MUNMAP = 73
+ SYS_MPROTECT = 74
+ SYS_MADVISE = 75
+ SYS_MINCORE = 78
+ SYS_GETGROUPS = 79
+ SYS_SETGROUPS = 80
+ SYS_GETPGRP = 81
+ SYS_SETPGID = 82
+ SYS_SETITIMER = 83
+ SYS_SWAPON = 85
+ SYS_GETITIMER = 86
+ SYS_GETDTABLESIZE = 89
+ SYS_DUP2 = 90
+ SYS_FCNTL = 92
+ SYS_SELECT = 93
+ SYS_FSYNC = 95
+ SYS_SETPRIORITY = 96
+ SYS_SOCKET = 97
+ SYS_CONNECT = 98
+ SYS_GETPRIORITY = 100
+ SYS_BIND = 104
+ SYS_SETSOCKOPT = 105
+ SYS_LISTEN = 106
+ SYS_SIGSUSPEND = 111
+ SYS_GETTIMEOFDAY = 116
+ SYS_GETRUSAGE = 117
+ SYS_GETSOCKOPT = 118
+ SYS_READV = 120
+ SYS_WRITEV = 121
+ SYS_SETTIMEOFDAY = 122
+ SYS_FCHOWN = 123
+ SYS_FCHMOD = 124
+ SYS_SETREUID = 126
+ SYS_SETREGID = 127
+ SYS_RENAME = 128
+ SYS_FLOCK = 131
+ SYS_MKFIFO = 132
+ SYS_SENDTO = 133
+ SYS_SHUTDOWN = 134
+ SYS_SOCKETPAIR = 135
+ SYS_MKDIR = 136
+ SYS_RMDIR = 137
+ SYS_UTIMES = 138
+ SYS_FUTIMES = 139
+ SYS_ADJTIME = 140
+ SYS_GETHOSTUUID = 142
+ SYS_SETSID = 147
+ SYS_GETPGID = 151
+ SYS_SETPRIVEXEC = 152
+ SYS_PREAD = 153
+ SYS_PWRITE = 154
+ SYS_NFSSVC = 155
+ SYS_STATFS = 157
+ SYS_FSTATFS = 158
+ SYS_UNMOUNT = 159
+ SYS_GETFH = 161
+ SYS_QUOTACTL = 165
+ SYS_MOUNT = 167
+ SYS_CSOPS = 169
+ SYS_WAITID = 173
+ SYS_ADD_PROFIL = 176
+ SYS_KDEBUG_TRACE = 180
+ SYS_SETGID = 181
+ SYS_SETEGID = 182
+ SYS_SETEUID = 183
+ SYS_SIGRETURN = 184
+ SYS_CHUD = 185
+ SYS_FDATASYNC = 187
+ SYS_STAT = 188
+ SYS_FSTAT = 189
+ SYS_LSTAT = 190
+ SYS_PATHCONF = 191
+ SYS_FPATHCONF = 192
+ SYS_GETRLIMIT = 194
+ SYS_SETRLIMIT = 195
+ SYS_GETDIRENTRIES = 196
+ SYS_MMAP = 197
+ SYS_LSEEK = 199
+ SYS_TRUNCATE = 200
+ SYS_FTRUNCATE = 201
+ SYS___SYSCTL = 202
+ SYS_MLOCK = 203
+ SYS_MUNLOCK = 204
+ SYS_UNDELETE = 205
+ SYS_ATSOCKET = 206
+ SYS_ATGETMSG = 207
+ SYS_ATPUTMSG = 208
+ SYS_ATPSNDREQ = 209
+ SYS_ATPSNDRSP = 210
+ SYS_ATPGETREQ = 211
+ SYS_ATPGETRSP = 212
+ SYS_MKCOMPLEX = 216
+ SYS_STATV = 217
+ SYS_LSTATV = 218
+ SYS_FSTATV = 219
+ SYS_GETATTRLIST = 220
+ SYS_SETATTRLIST = 221
+ SYS_GETDIRENTRIESATTR = 222
+ SYS_EXCHANGEDATA = 223
+ SYS_SEARCHFS = 225
+ SYS_DELETE = 226
+ SYS_COPYFILE = 227
+ SYS_FGETATTRLIST = 228
+ SYS_FSETATTRLIST = 229
+ SYS_POLL = 230
+ SYS_WATCHEVENT = 231
+ SYS_WAITEVENT = 232
+ SYS_MODWATCH = 233
+ SYS_GETXATTR = 234
+ SYS_FGETXATTR = 235
+ SYS_SETXATTR = 236
+ SYS_FSETXATTR = 237
+ SYS_REMOVEXATTR = 238
+ SYS_FREMOVEXATTR = 239
+ SYS_LISTXATTR = 240
+ SYS_FLISTXATTR = 241
+ SYS_FSCTL = 242
+ SYS_INITGROUPS = 243
+ SYS_POSIX_SPAWN = 244
+ SYS_FFSCTL = 245
+ SYS_NFSCLNT = 247
+ SYS_FHOPEN = 248
+ SYS_MINHERIT = 250
+ SYS_SEMSYS = 251
+ SYS_MSGSYS = 252
+ SYS_SHMSYS = 253
+ SYS_SEMCTL = 254
+ SYS_SEMGET = 255
+ SYS_SEMOP = 256
+ SYS_MSGCTL = 258
+ SYS_MSGGET = 259
+ SYS_MSGSND = 260
+ SYS_MSGRCV = 261
+ SYS_SHMAT = 262
+ SYS_SHMCTL = 263
+ SYS_SHMDT = 264
+ SYS_SHMGET = 265
+ SYS_SHM_OPEN = 266
+ SYS_SHM_UNLINK = 267
+ SYS_SEM_OPEN = 268
+ SYS_SEM_CLOSE = 269
+ SYS_SEM_UNLINK = 270
+ SYS_SEM_WAIT = 271
+ SYS_SEM_TRYWAIT = 272
+ SYS_SEM_POST = 273
+ SYS_SEM_GETVALUE = 274
+ SYS_SEM_INIT = 275
+ SYS_SEM_DESTROY = 276
+ SYS_OPEN_EXTENDED = 277
+ SYS_UMASK_EXTENDED = 278
+ SYS_STAT_EXTENDED = 279
+ SYS_LSTAT_EXTENDED = 280
+ SYS_FSTAT_EXTENDED = 281
+ SYS_CHMOD_EXTENDED = 282
+ SYS_FCHMOD_EXTENDED = 283
+ SYS_ACCESS_EXTENDED = 284
+ SYS_SETTID = 285
+ SYS_GETTID = 286
+ SYS_SETSGROUPS = 287
+ SYS_GETSGROUPS = 288
+ SYS_SETWGROUPS = 289
+ SYS_GETWGROUPS = 290
+ SYS_MKFIFO_EXTENDED = 291
+ SYS_MKDIR_EXTENDED = 292
+ SYS_IDENTITYSVC = 293
+ SYS_SHARED_REGION_CHECK_NP = 294
+ SYS_VM_PRESSURE_MONITOR = 296
+ SYS_PSYNCH_RW_LONGRDLOCK = 297
+ SYS_PSYNCH_RW_YIELDWRLOCK = 298
+ SYS_PSYNCH_RW_DOWNGRADE = 299
+ SYS_PSYNCH_RW_UPGRADE = 300
+ SYS_PSYNCH_MUTEXWAIT = 301
+ SYS_PSYNCH_MUTEXDROP = 302
+ SYS_PSYNCH_CVBROAD = 303
+ SYS_PSYNCH_CVSIGNAL = 304
+ SYS_PSYNCH_CVWAIT = 305
+ SYS_PSYNCH_RW_RDLOCK = 306
+ SYS_PSYNCH_RW_WRLOCK = 307
+ SYS_PSYNCH_RW_UNLOCK = 308
+ SYS_PSYNCH_RW_UNLOCK2 = 309
+ SYS_GETSID = 310
+ SYS_SETTID_WITH_PID = 311
+ SYS_PSYNCH_CVCLRPREPOST = 312
+ SYS_AIO_FSYNC = 313
+ SYS_AIO_RETURN = 314
+ SYS_AIO_SUSPEND = 315
+ SYS_AIO_CANCEL = 316
+ SYS_AIO_ERROR = 317
+ SYS_AIO_READ = 318
+ SYS_AIO_WRITE = 319
+ SYS_LIO_LISTIO = 320
+ SYS_IOPOLICYSYS = 322
+ SYS_PROCESS_POLICY = 323
+ SYS_MLOCKALL = 324
+ SYS_MUNLOCKALL = 325
+ SYS_ISSETUGID = 327
+ SYS___PTHREAD_KILL = 328
+ SYS___PTHREAD_SIGMASK = 329
+ SYS___SIGWAIT = 330
+ SYS___DISABLE_THREADSIGNAL = 331
+ SYS___PTHREAD_MARKCANCEL = 332
+ SYS___PTHREAD_CANCELED = 333
+ SYS___SEMWAIT_SIGNAL = 334
+ SYS_PROC_INFO = 336
+ SYS_SENDFILE = 337
+ SYS_STAT64 = 338
+ SYS_FSTAT64 = 339
+ SYS_LSTAT64 = 340
+ SYS_STAT64_EXTENDED = 341
+ SYS_LSTAT64_EXTENDED = 342
+ SYS_FSTAT64_EXTENDED = 343
+ SYS_GETDIRENTRIES64 = 344
+ SYS_STATFS64 = 345
+ SYS_FSTATFS64 = 346
+ SYS_GETFSSTAT64 = 347
+ SYS___PTHREAD_CHDIR = 348
+ SYS___PTHREAD_FCHDIR = 349
+ SYS_AUDIT = 350
+ SYS_AUDITON = 351
+ SYS_GETAUID = 353
+ SYS_SETAUID = 354
+ SYS_GETAUDIT = 355
+ SYS_SETAUDIT = 356
+ SYS_GETAUDIT_ADDR = 357
+ SYS_SETAUDIT_ADDR = 358
+ SYS_AUDITCTL = 359
+ SYS_BSDTHREAD_CREATE = 360
+ SYS_BSDTHREAD_TERMINATE = 361
+ SYS_KQUEUE = 362
+ SYS_KEVENT = 363
+ SYS_LCHOWN = 364
+ SYS_STACK_SNAPSHOT = 365
+ SYS_BSDTHREAD_REGISTER = 366
+ SYS_WORKQ_OPEN = 367
+ SYS_WORKQ_KERNRETURN = 368
+ SYS_KEVENT64 = 369
+ SYS___OLD_SEMWAIT_SIGNAL = 370
+ SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371
+ SYS_THREAD_SELFID = 372
+ SYS___MAC_EXECVE = 380
+ SYS___MAC_SYSCALL = 381
+ SYS___MAC_GET_FILE = 382
+ SYS___MAC_SET_FILE = 383
+ SYS___MAC_GET_LINK = 384
+ SYS___MAC_SET_LINK = 385
+ SYS___MAC_GET_PROC = 386
+ SYS___MAC_SET_PROC = 387
+ SYS___MAC_GET_FD = 388
+ SYS___MAC_SET_FD = 389
+ SYS___MAC_GET_PID = 390
+ SYS___MAC_GET_LCID = 391
+ SYS___MAC_GET_LCTX = 392
+ SYS___MAC_SET_LCTX = 393
+ SYS_SETLCID = 394
+ SYS_GETLCID = 395
+ SYS_READ_NOCANCEL = 396
+ SYS_WRITE_NOCANCEL = 397
+ SYS_OPEN_NOCANCEL = 398
+ SYS_CLOSE_NOCANCEL = 399
+ SYS_WAIT4_NOCANCEL = 400
+ SYS_RECVMSG_NOCANCEL = 401
+ SYS_SENDMSG_NOCANCEL = 402
+ SYS_RECVFROM_NOCANCEL = 403
+ SYS_ACCEPT_NOCANCEL = 404
+ SYS_MSYNC_NOCANCEL = 405
+ SYS_FCNTL_NOCANCEL = 406
+ SYS_SELECT_NOCANCEL = 407
+ SYS_FSYNC_NOCANCEL = 408
+ SYS_CONNECT_NOCANCEL = 409
+ SYS_SIGSUSPEND_NOCANCEL = 410
+ SYS_READV_NOCANCEL = 411
+ SYS_WRITEV_NOCANCEL = 412
+ SYS_SENDTO_NOCANCEL = 413
+ SYS_PREAD_NOCANCEL = 414
+ SYS_PWRITE_NOCANCEL = 415
+ SYS_WAITID_NOCANCEL = 416
+ SYS_POLL_NOCANCEL = 417
+ SYS_MSGSND_NOCANCEL = 418
+ SYS_MSGRCV_NOCANCEL = 419
+ SYS_SEM_WAIT_NOCANCEL = 420
+ SYS_AIO_SUSPEND_NOCANCEL = 421
+ SYS___SIGWAIT_NOCANCEL = 422
+ SYS___SEMWAIT_SIGNAL_NOCANCEL = 423
+ SYS___MAC_MOUNT = 424
+ SYS___MAC_GET_MOUNT = 425
+ SYS___MAC_GETFSSTAT = 426
+ SYS_FSGETPATH = 427
+ SYS_AUDIT_SESSION_SELF = 428
+ SYS_AUDIT_SESSION_JOIN = 429
+ SYS_FILEPORT_MAKEPORT = 430
+ SYS_FILEPORT_MAKEFD = 431
+ SYS_AUDIT_SESSION_PORT = 432
+ SYS_PID_SUSPEND = 433
+ SYS_PID_RESUME = 434
+ SYS_PID_HIBERNATE = 435
+ SYS_PID_SHUTDOWN_SOCKETS = 436
+ SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438
+ SYS_MAXSYSCALL = 439
)
diff --git a/src/pkg/syscall/zsysnum_darwin_amd64.go b/src/pkg/syscall/zsysnum_darwin_amd64.go
index 50aec39..abdef77 100644
--- a/src/pkg/syscall/zsysnum_darwin_amd64.go
+++ b/src/pkg/syscall/zsysnum_darwin_amd64.go
@@ -4,352 +4,357 @@
package syscall
const (
- SYS_SYSCALL = 0
- SYS_EXIT = 1
- SYS_FORK = 2
- SYS_READ = 3
- SYS_WRITE = 4
- SYS_OPEN = 5
- SYS_CLOSE = 6
- SYS_WAIT4 = 7
- SYS_LINK = 9
- SYS_UNLINK = 10
- SYS_CHDIR = 12
- SYS_FCHDIR = 13
- SYS_MKNOD = 14
- SYS_CHMOD = 15
- SYS_CHOWN = 16
- SYS_GETFSSTAT = 18
- SYS_GETPID = 20
- SYS_SETUID = 23
- SYS_GETUID = 24
- SYS_GETEUID = 25
- SYS_PTRACE = 26
- SYS_RECVMSG = 27
- SYS_SENDMSG = 28
- SYS_RECVFROM = 29
- SYS_ACCEPT = 30
- SYS_GETPEERNAME = 31
- SYS_GETSOCKNAME = 32
- SYS_ACCESS = 33
- SYS_CHFLAGS = 34
- SYS_FCHFLAGS = 35
- SYS_SYNC = 36
- SYS_KILL = 37
- SYS_GETPPID = 39
- SYS_DUP = 41
- SYS_PIPE = 42
- SYS_GETEGID = 43
- SYS_PROFIL = 44
- SYS_SIGACTION = 46
- SYS_GETGID = 47
- SYS_SIGPROCMASK = 48
- SYS_GETLOGIN = 49
- SYS_SETLOGIN = 50
- SYS_ACCT = 51
- SYS_SIGPENDING = 52
- SYS_SIGALTSTACK = 53
- SYS_IOCTL = 54
- SYS_REBOOT = 55
- SYS_REVOKE = 56
- SYS_SYMLINK = 57
- SYS_READLINK = 58
- SYS_EXECVE = 59
- SYS_UMASK = 60
- SYS_CHROOT = 61
- SYS_MSYNC = 65
- SYS_VFORK = 66
- SYS_MUNMAP = 73
- SYS_MPROTECT = 74
- SYS_MADVISE = 75
- SYS_MINCORE = 78
- SYS_GETGROUPS = 79
- SYS_SETGROUPS = 80
- SYS_GETPGRP = 81
- SYS_SETPGID = 82
- SYS_SETITIMER = 83
- SYS_SWAPON = 85
- SYS_GETITIMER = 86
- SYS_GETDTABLESIZE = 89
- SYS_DUP2 = 90
- SYS_FCNTL = 92
- SYS_SELECT = 93
- SYS_FSYNC = 95
- SYS_SETPRIORITY = 96
- SYS_SOCKET = 97
- SYS_CONNECT = 98
- SYS_GETPRIORITY = 100
- SYS_BIND = 104
- SYS_SETSOCKOPT = 105
- SYS_LISTEN = 106
- SYS_SIGSUSPEND = 111
- SYS_GETTIMEOFDAY = 116
- SYS_GETRUSAGE = 117
- SYS_GETSOCKOPT = 118
- SYS_READV = 120
- SYS_WRITEV = 121
- SYS_SETTIMEOFDAY = 122
- SYS_FCHOWN = 123
- SYS_FCHMOD = 124
- SYS_SETREUID = 126
- SYS_SETREGID = 127
- SYS_RENAME = 128
- SYS_FLOCK = 131
- SYS_MKFIFO = 132
- SYS_SENDTO = 133
- SYS_SHUTDOWN = 134
- SYS_SOCKETPAIR = 135
- SYS_MKDIR = 136
- SYS_RMDIR = 137
- SYS_UTIMES = 138
- SYS_FUTIMES = 139
- SYS_ADJTIME = 140
- SYS_GETHOSTUUID = 142
- SYS_SETSID = 147
- SYS_GETPGID = 151
- SYS_SETPRIVEXEC = 152
- SYS_PREAD = 153
- SYS_PWRITE = 154
- SYS_NFSSVC = 155
- SYS_STATFS = 157
- SYS_FSTATFS = 158
- SYS_UNMOUNT = 159
- SYS_GETFH = 161
- SYS_QUOTACTL = 165
- SYS_MOUNT = 167
- SYS_CSOPS = 169
- SYS_WAITID = 173
- SYS_ADD_PROFIL = 176
- SYS_KDEBUG_TRACE = 180
- SYS_SETGID = 181
- SYS_SETEGID = 182
- SYS_SETEUID = 183
- SYS_SIGRETURN = 184
- SYS_CHUD = 185
- SYS_FDATASYNC = 187
- SYS_STAT = 188
- SYS_FSTAT = 189
- SYS_LSTAT = 190
- SYS_PATHCONF = 191
- SYS_FPATHCONF = 192
- SYS_GETRLIMIT = 194
- SYS_SETRLIMIT = 195
- SYS_GETDIRENTRIES = 196
- SYS_MMAP = 197
- SYS_LSEEK = 199
- SYS_TRUNCATE = 200
- SYS_FTRUNCATE = 201
- SYS___SYSCTL = 202
- SYS_MLOCK = 203
- SYS_MUNLOCK = 204
- SYS_UNDELETE = 205
- SYS_ATSOCKET = 206
- SYS_ATGETMSG = 207
- SYS_ATPUTMSG = 208
- SYS_ATPSNDREQ = 209
- SYS_ATPSNDRSP = 210
- SYS_ATPGETREQ = 211
- SYS_ATPGETRSP = 212
- SYS_MKCOMPLEX = 216
- SYS_STATV = 217
- SYS_LSTATV = 218
- SYS_FSTATV = 219
- SYS_GETATTRLIST = 220
- SYS_SETATTRLIST = 221
- SYS_GETDIRENTRIESATTR = 222
- SYS_EXCHANGEDATA = 223
- SYS_SEARCHFS = 225
- SYS_DELETE = 226
- SYS_COPYFILE = 227
- SYS_FGETATTRLIST = 228
- SYS_FSETATTRLIST = 229
- SYS_POLL = 230
- SYS_WATCHEVENT = 231
- SYS_WAITEVENT = 232
- SYS_MODWATCH = 233
- SYS_GETXATTR = 234
- SYS_FGETXATTR = 235
- SYS_SETXATTR = 236
- SYS_FSETXATTR = 237
- SYS_REMOVEXATTR = 238
- SYS_FREMOVEXATTR = 239
- SYS_LISTXATTR = 240
- SYS_FLISTXATTR = 241
- SYS_FSCTL = 242
- SYS_INITGROUPS = 243
- SYS_POSIX_SPAWN = 244
- SYS_FFSCTL = 245
- SYS_NFSCLNT = 247
- SYS_FHOPEN = 248
- SYS_MINHERIT = 250
- SYS_SEMSYS = 251
- SYS_MSGSYS = 252
- SYS_SHMSYS = 253
- SYS_SEMCTL = 254
- SYS_SEMGET = 255
- SYS_SEMOP = 256
- SYS_MSGCTL = 258
- SYS_MSGGET = 259
- SYS_MSGSND = 260
- SYS_MSGRCV = 261
- SYS_SHMAT = 262
- SYS_SHMCTL = 263
- SYS_SHMDT = 264
- SYS_SHMGET = 265
- SYS_SHM_OPEN = 266
- SYS_SHM_UNLINK = 267
- SYS_SEM_OPEN = 268
- SYS_SEM_CLOSE = 269
- SYS_SEM_UNLINK = 270
- SYS_SEM_WAIT = 271
- SYS_SEM_TRYWAIT = 272
- SYS_SEM_POST = 273
- SYS_SEM_GETVALUE = 274
- SYS_SEM_INIT = 275
- SYS_SEM_DESTROY = 276
- SYS_OPEN_EXTENDED = 277
- SYS_UMASK_EXTENDED = 278
- SYS_STAT_EXTENDED = 279
- SYS_LSTAT_EXTENDED = 280
- SYS_FSTAT_EXTENDED = 281
- SYS_CHMOD_EXTENDED = 282
- SYS_FCHMOD_EXTENDED = 283
- SYS_ACCESS_EXTENDED = 284
- SYS_SETTID = 285
- SYS_GETTID = 286
- SYS_SETSGROUPS = 287
- SYS_GETSGROUPS = 288
- SYS_SETWGROUPS = 289
- SYS_GETWGROUPS = 290
- SYS_MKFIFO_EXTENDED = 291
- SYS_MKDIR_EXTENDED = 292
- SYS_IDENTITYSVC = 293
- SYS_SHARED_REGION_CHECK_NP = 294
- SYS_SHARED_REGION_MAP_NP = 295
- SYS_VM_PRESSURE_MONITOR = 296
- SYS_PSYNCH_RW_LONGRDLOCK = 297
- SYS_PSYNCH_RW_YIELDWRLOCK = 298
- SYS_PSYNCH_RW_DOWNGRADE = 299
- SYS_PSYNCH_RW_UPGRADE = 300
- SYS_PSYNCH_MUTEXWAIT = 301
- SYS_PSYNCH_MUTEXDROP = 302
- SYS_PSYNCH_CVBROAD = 303
- SYS_PSYNCH_CVSIGNAL = 304
- SYS_PSYNCH_CVWAIT = 305
- SYS_PSYNCH_RW_RDLOCK = 306
- SYS_PSYNCH_RW_WRLOCK = 307
- SYS_PSYNCH_RW_UNLOCK = 308
- SYS_PSYNCH_RW_UNLOCK2 = 309
- SYS_GETSID = 310
- SYS_SETTID_WITH_PID = 311
- SYS_AIO_FSYNC = 313
- SYS_AIO_RETURN = 314
- SYS_AIO_SUSPEND = 315
- SYS_AIO_CANCEL = 316
- SYS_AIO_ERROR = 317
- SYS_AIO_READ = 318
- SYS_AIO_WRITE = 319
- SYS_LIO_LISTIO = 320
- SYS_IOPOLICYSYS = 322
- SYS_MLOCKALL = 324
- SYS_MUNLOCKALL = 325
- SYS_ISSETUGID = 327
- SYS___PTHREAD_KILL = 328
- SYS___PTHREAD_SIGMASK = 329
- SYS___SIGWAIT = 330
- SYS___DISABLE_THREADSIGNAL = 331
- SYS___PTHREAD_MARKCANCEL = 332
- SYS___PTHREAD_CANCELED = 333
- SYS___SEMWAIT_SIGNAL = 334
- SYS_PROC_INFO = 336
- SYS_SENDFILE = 337
- SYS_STAT64 = 338
- SYS_FSTAT64 = 339
- SYS_LSTAT64 = 340
- SYS_STAT64_EXTENDED = 341
- SYS_LSTAT64_EXTENDED = 342
- SYS_FSTAT64_EXTENDED = 343
- SYS_GETDIRENTRIES64 = 344
- SYS_STATFS64 = 345
- SYS_FSTATFS64 = 346
- SYS_GETFSSTAT64 = 347
- SYS___PTHREAD_CHDIR = 348
- SYS___PTHREAD_FCHDIR = 349
- SYS_AUDIT = 350
- SYS_AUDITON = 351
- SYS_GETAUID = 353
- SYS_SETAUID = 354
- SYS_GETAUDIT = 355
- SYS_SETAUDIT = 356
- SYS_GETAUDIT_ADDR = 357
- SYS_SETAUDIT_ADDR = 358
- SYS_AUDITCTL = 359
- SYS_BSDTHREAD_CREATE = 360
- SYS_BSDTHREAD_TERMINATE = 361
- SYS_KQUEUE = 362
- SYS_KEVENT = 363
- SYS_LCHOWN = 364
- SYS_STACK_SNAPSHOT = 365
- SYS_BSDTHREAD_REGISTER = 366
- SYS_WORKQ_OPEN = 367
- SYS_WORKQ_KERNRETURN = 368
- SYS_KEVENT64 = 369
- SYS___OLD_SEMWAIT_SIGNAL = 370
- SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371
- SYS_THREAD_SELFID = 372
- SYS___MAC_EXECVE = 380
- SYS___MAC_SYSCALL = 381
- SYS___MAC_GET_FILE = 382
- SYS___MAC_SET_FILE = 383
- SYS___MAC_GET_LINK = 384
- SYS___MAC_SET_LINK = 385
- SYS___MAC_GET_PROC = 386
- SYS___MAC_SET_PROC = 387
- SYS___MAC_GET_FD = 388
- SYS___MAC_SET_FD = 389
- SYS___MAC_GET_PID = 390
- SYS___MAC_GET_LCID = 391
- SYS___MAC_GET_LCTX = 392
- SYS___MAC_SET_LCTX = 393
- SYS_SETLCID = 394
- SYS_GETLCID = 395
- SYS_READ_NOCANCEL = 396
- SYS_WRITE_NOCANCEL = 397
- SYS_OPEN_NOCANCEL = 398
- SYS_CLOSE_NOCANCEL = 399
- SYS_WAIT4_NOCANCEL = 400
- SYS_RECVMSG_NOCANCEL = 401
- SYS_SENDMSG_NOCANCEL = 402
- SYS_RECVFROM_NOCANCEL = 403
- SYS_ACCEPT_NOCANCEL = 404
- SYS_MSYNC_NOCANCEL = 405
- SYS_FCNTL_NOCANCEL = 406
- SYS_SELECT_NOCANCEL = 407
- SYS_FSYNC_NOCANCEL = 408
- SYS_CONNECT_NOCANCEL = 409
- SYS_SIGSUSPEND_NOCANCEL = 410
- SYS_READV_NOCANCEL = 411
- SYS_WRITEV_NOCANCEL = 412
- SYS_SENDTO_NOCANCEL = 413
- SYS_PREAD_NOCANCEL = 414
- SYS_PWRITE_NOCANCEL = 415
- SYS_WAITID_NOCANCEL = 416
- SYS_POLL_NOCANCEL = 417
- SYS_MSGSND_NOCANCEL = 418
- SYS_MSGRCV_NOCANCEL = 419
- SYS_SEM_WAIT_NOCANCEL = 420
- SYS_AIO_SUSPEND_NOCANCEL = 421
- SYS___SIGWAIT_NOCANCEL = 422
- SYS___SEMWAIT_SIGNAL_NOCANCEL = 423
- SYS___MAC_MOUNT = 424
- SYS___MAC_GET_MOUNT = 425
- SYS___MAC_GETFSSTAT = 426
- SYS_FSGETPATH = 427
- SYS_AUDIT_SESSION_SELF = 428
- SYS_AUDIT_SESSION_JOIN = 429
- SYS_PID_SUSPEND = 430
- SYS_PID_RESUME = 431
- SYS_FILEPORT_MAKEPORT = 432
- SYS_FILEPORT_MAKEFD = 433
- SYS_MAXSYSCALL = 434
+ SYS_SYSCALL = 0
+ SYS_EXIT = 1
+ SYS_FORK = 2
+ SYS_READ = 3
+ SYS_WRITE = 4
+ SYS_OPEN = 5
+ SYS_CLOSE = 6
+ SYS_WAIT4 = 7
+ SYS_LINK = 9
+ SYS_UNLINK = 10
+ SYS_CHDIR = 12
+ SYS_FCHDIR = 13
+ SYS_MKNOD = 14
+ SYS_CHMOD = 15
+ SYS_CHOWN = 16
+ SYS_GETFSSTAT = 18
+ SYS_GETPID = 20
+ SYS_SETUID = 23
+ SYS_GETUID = 24
+ SYS_GETEUID = 25
+ SYS_PTRACE = 26
+ SYS_RECVMSG = 27
+ SYS_SENDMSG = 28
+ SYS_RECVFROM = 29
+ SYS_ACCEPT = 30
+ SYS_GETPEERNAME = 31
+ SYS_GETSOCKNAME = 32
+ SYS_ACCESS = 33
+ SYS_CHFLAGS = 34
+ SYS_FCHFLAGS = 35
+ SYS_SYNC = 36
+ SYS_KILL = 37
+ SYS_GETPPID = 39
+ SYS_DUP = 41
+ SYS_PIPE = 42
+ SYS_GETEGID = 43
+ SYS_PROFIL = 44
+ SYS_SIGACTION = 46
+ SYS_GETGID = 47
+ SYS_SIGPROCMASK = 48
+ SYS_GETLOGIN = 49
+ SYS_SETLOGIN = 50
+ SYS_ACCT = 51
+ SYS_SIGPENDING = 52
+ SYS_SIGALTSTACK = 53
+ SYS_IOCTL = 54
+ SYS_REBOOT = 55
+ SYS_REVOKE = 56
+ SYS_SYMLINK = 57
+ SYS_READLINK = 58
+ SYS_EXECVE = 59
+ SYS_UMASK = 60
+ SYS_CHROOT = 61
+ SYS_MSYNC = 65
+ SYS_VFORK = 66
+ SYS_MUNMAP = 73
+ SYS_MPROTECT = 74
+ SYS_MADVISE = 75
+ SYS_MINCORE = 78
+ SYS_GETGROUPS = 79
+ SYS_SETGROUPS = 80
+ SYS_GETPGRP = 81
+ SYS_SETPGID = 82
+ SYS_SETITIMER = 83
+ SYS_SWAPON = 85
+ SYS_GETITIMER = 86
+ SYS_GETDTABLESIZE = 89
+ SYS_DUP2 = 90
+ SYS_FCNTL = 92
+ SYS_SELECT = 93
+ SYS_FSYNC = 95
+ SYS_SETPRIORITY = 96
+ SYS_SOCKET = 97
+ SYS_CONNECT = 98
+ SYS_GETPRIORITY = 100
+ SYS_BIND = 104
+ SYS_SETSOCKOPT = 105
+ SYS_LISTEN = 106
+ SYS_SIGSUSPEND = 111
+ SYS_GETTIMEOFDAY = 116
+ SYS_GETRUSAGE = 117
+ SYS_GETSOCKOPT = 118
+ SYS_READV = 120
+ SYS_WRITEV = 121
+ SYS_SETTIMEOFDAY = 122
+ SYS_FCHOWN = 123
+ SYS_FCHMOD = 124
+ SYS_SETREUID = 126
+ SYS_SETREGID = 127
+ SYS_RENAME = 128
+ SYS_FLOCK = 131
+ SYS_MKFIFO = 132
+ SYS_SENDTO = 133
+ SYS_SHUTDOWN = 134
+ SYS_SOCKETPAIR = 135
+ SYS_MKDIR = 136
+ SYS_RMDIR = 137
+ SYS_UTIMES = 138
+ SYS_FUTIMES = 139
+ SYS_ADJTIME = 140
+ SYS_GETHOSTUUID = 142
+ SYS_SETSID = 147
+ SYS_GETPGID = 151
+ SYS_SETPRIVEXEC = 152
+ SYS_PREAD = 153
+ SYS_PWRITE = 154
+ SYS_NFSSVC = 155
+ SYS_STATFS = 157
+ SYS_FSTATFS = 158
+ SYS_UNMOUNT = 159
+ SYS_GETFH = 161
+ SYS_QUOTACTL = 165
+ SYS_MOUNT = 167
+ SYS_CSOPS = 169
+ SYS_WAITID = 173
+ SYS_ADD_PROFIL = 176
+ SYS_KDEBUG_TRACE = 180
+ SYS_SETGID = 181
+ SYS_SETEGID = 182
+ SYS_SETEUID = 183
+ SYS_SIGRETURN = 184
+ SYS_CHUD = 185
+ SYS_FDATASYNC = 187
+ SYS_STAT = 188
+ SYS_FSTAT = 189
+ SYS_LSTAT = 190
+ SYS_PATHCONF = 191
+ SYS_FPATHCONF = 192
+ SYS_GETRLIMIT = 194
+ SYS_SETRLIMIT = 195
+ SYS_GETDIRENTRIES = 196
+ SYS_MMAP = 197
+ SYS_LSEEK = 199
+ SYS_TRUNCATE = 200
+ SYS_FTRUNCATE = 201
+ SYS___SYSCTL = 202
+ SYS_MLOCK = 203
+ SYS_MUNLOCK = 204
+ SYS_UNDELETE = 205
+ SYS_ATSOCKET = 206
+ SYS_ATGETMSG = 207
+ SYS_ATPUTMSG = 208
+ SYS_ATPSNDREQ = 209
+ SYS_ATPSNDRSP = 210
+ SYS_ATPGETREQ = 211
+ SYS_ATPGETRSP = 212
+ SYS_MKCOMPLEX = 216
+ SYS_STATV = 217
+ SYS_LSTATV = 218
+ SYS_FSTATV = 219
+ SYS_GETATTRLIST = 220
+ SYS_SETATTRLIST = 221
+ SYS_GETDIRENTRIESATTR = 222
+ SYS_EXCHANGEDATA = 223
+ SYS_SEARCHFS = 225
+ SYS_DELETE = 226
+ SYS_COPYFILE = 227
+ SYS_FGETATTRLIST = 228
+ SYS_FSETATTRLIST = 229
+ SYS_POLL = 230
+ SYS_WATCHEVENT = 231
+ SYS_WAITEVENT = 232
+ SYS_MODWATCH = 233
+ SYS_GETXATTR = 234
+ SYS_FGETXATTR = 235
+ SYS_SETXATTR = 236
+ SYS_FSETXATTR = 237
+ SYS_REMOVEXATTR = 238
+ SYS_FREMOVEXATTR = 239
+ SYS_LISTXATTR = 240
+ SYS_FLISTXATTR = 241
+ SYS_FSCTL = 242
+ SYS_INITGROUPS = 243
+ SYS_POSIX_SPAWN = 244
+ SYS_FFSCTL = 245
+ SYS_NFSCLNT = 247
+ SYS_FHOPEN = 248
+ SYS_MINHERIT = 250
+ SYS_SEMSYS = 251
+ SYS_MSGSYS = 252
+ SYS_SHMSYS = 253
+ SYS_SEMCTL = 254
+ SYS_SEMGET = 255
+ SYS_SEMOP = 256
+ SYS_MSGCTL = 258
+ SYS_MSGGET = 259
+ SYS_MSGSND = 260
+ SYS_MSGRCV = 261
+ SYS_SHMAT = 262
+ SYS_SHMCTL = 263
+ SYS_SHMDT = 264
+ SYS_SHMGET = 265
+ SYS_SHM_OPEN = 266
+ SYS_SHM_UNLINK = 267
+ SYS_SEM_OPEN = 268
+ SYS_SEM_CLOSE = 269
+ SYS_SEM_UNLINK = 270
+ SYS_SEM_WAIT = 271
+ SYS_SEM_TRYWAIT = 272
+ SYS_SEM_POST = 273
+ SYS_SEM_GETVALUE = 274
+ SYS_SEM_INIT = 275
+ SYS_SEM_DESTROY = 276
+ SYS_OPEN_EXTENDED = 277
+ SYS_UMASK_EXTENDED = 278
+ SYS_STAT_EXTENDED = 279
+ SYS_LSTAT_EXTENDED = 280
+ SYS_FSTAT_EXTENDED = 281
+ SYS_CHMOD_EXTENDED = 282
+ SYS_FCHMOD_EXTENDED = 283
+ SYS_ACCESS_EXTENDED = 284
+ SYS_SETTID = 285
+ SYS_GETTID = 286
+ SYS_SETSGROUPS = 287
+ SYS_GETSGROUPS = 288
+ SYS_SETWGROUPS = 289
+ SYS_GETWGROUPS = 290
+ SYS_MKFIFO_EXTENDED = 291
+ SYS_MKDIR_EXTENDED = 292
+ SYS_IDENTITYSVC = 293
+ SYS_SHARED_REGION_CHECK_NP = 294
+ SYS_VM_PRESSURE_MONITOR = 296
+ SYS_PSYNCH_RW_LONGRDLOCK = 297
+ SYS_PSYNCH_RW_YIELDWRLOCK = 298
+ SYS_PSYNCH_RW_DOWNGRADE = 299
+ SYS_PSYNCH_RW_UPGRADE = 300
+ SYS_PSYNCH_MUTEXWAIT = 301
+ SYS_PSYNCH_MUTEXDROP = 302
+ SYS_PSYNCH_CVBROAD = 303
+ SYS_PSYNCH_CVSIGNAL = 304
+ SYS_PSYNCH_CVWAIT = 305
+ SYS_PSYNCH_RW_RDLOCK = 306
+ SYS_PSYNCH_RW_WRLOCK = 307
+ SYS_PSYNCH_RW_UNLOCK = 308
+ SYS_PSYNCH_RW_UNLOCK2 = 309
+ SYS_GETSID = 310
+ SYS_SETTID_WITH_PID = 311
+ SYS_PSYNCH_CVCLRPREPOST = 312
+ SYS_AIO_FSYNC = 313
+ SYS_AIO_RETURN = 314
+ SYS_AIO_SUSPEND = 315
+ SYS_AIO_CANCEL = 316
+ SYS_AIO_ERROR = 317
+ SYS_AIO_READ = 318
+ SYS_AIO_WRITE = 319
+ SYS_LIO_LISTIO = 320
+ SYS_IOPOLICYSYS = 322
+ SYS_PROCESS_POLICY = 323
+ SYS_MLOCKALL = 324
+ SYS_MUNLOCKALL = 325
+ SYS_ISSETUGID = 327
+ SYS___PTHREAD_KILL = 328
+ SYS___PTHREAD_SIGMASK = 329
+ SYS___SIGWAIT = 330
+ SYS___DISABLE_THREADSIGNAL = 331
+ SYS___PTHREAD_MARKCANCEL = 332
+ SYS___PTHREAD_CANCELED = 333
+ SYS___SEMWAIT_SIGNAL = 334
+ SYS_PROC_INFO = 336
+ SYS_SENDFILE = 337
+ SYS_STAT64 = 338
+ SYS_FSTAT64 = 339
+ SYS_LSTAT64 = 340
+ SYS_STAT64_EXTENDED = 341
+ SYS_LSTAT64_EXTENDED = 342
+ SYS_FSTAT64_EXTENDED = 343
+ SYS_GETDIRENTRIES64 = 344
+ SYS_STATFS64 = 345
+ SYS_FSTATFS64 = 346
+ SYS_GETFSSTAT64 = 347
+ SYS___PTHREAD_CHDIR = 348
+ SYS___PTHREAD_FCHDIR = 349
+ SYS_AUDIT = 350
+ SYS_AUDITON = 351
+ SYS_GETAUID = 353
+ SYS_SETAUID = 354
+ SYS_GETAUDIT = 355
+ SYS_SETAUDIT = 356
+ SYS_GETAUDIT_ADDR = 357
+ SYS_SETAUDIT_ADDR = 358
+ SYS_AUDITCTL = 359
+ SYS_BSDTHREAD_CREATE = 360
+ SYS_BSDTHREAD_TERMINATE = 361
+ SYS_KQUEUE = 362
+ SYS_KEVENT = 363
+ SYS_LCHOWN = 364
+ SYS_STACK_SNAPSHOT = 365
+ SYS_BSDTHREAD_REGISTER = 366
+ SYS_WORKQ_OPEN = 367
+ SYS_WORKQ_KERNRETURN = 368
+ SYS_KEVENT64 = 369
+ SYS___OLD_SEMWAIT_SIGNAL = 370
+ SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371
+ SYS_THREAD_SELFID = 372
+ SYS___MAC_EXECVE = 380
+ SYS___MAC_SYSCALL = 381
+ SYS___MAC_GET_FILE = 382
+ SYS___MAC_SET_FILE = 383
+ SYS___MAC_GET_LINK = 384
+ SYS___MAC_SET_LINK = 385
+ SYS___MAC_GET_PROC = 386
+ SYS___MAC_SET_PROC = 387
+ SYS___MAC_GET_FD = 388
+ SYS___MAC_SET_FD = 389
+ SYS___MAC_GET_PID = 390
+ SYS___MAC_GET_LCID = 391
+ SYS___MAC_GET_LCTX = 392
+ SYS___MAC_SET_LCTX = 393
+ SYS_SETLCID = 394
+ SYS_GETLCID = 395
+ SYS_READ_NOCANCEL = 396
+ SYS_WRITE_NOCANCEL = 397
+ SYS_OPEN_NOCANCEL = 398
+ SYS_CLOSE_NOCANCEL = 399
+ SYS_WAIT4_NOCANCEL = 400
+ SYS_RECVMSG_NOCANCEL = 401
+ SYS_SENDMSG_NOCANCEL = 402
+ SYS_RECVFROM_NOCANCEL = 403
+ SYS_ACCEPT_NOCANCEL = 404
+ SYS_MSYNC_NOCANCEL = 405
+ SYS_FCNTL_NOCANCEL = 406
+ SYS_SELECT_NOCANCEL = 407
+ SYS_FSYNC_NOCANCEL = 408
+ SYS_CONNECT_NOCANCEL = 409
+ SYS_SIGSUSPEND_NOCANCEL = 410
+ SYS_READV_NOCANCEL = 411
+ SYS_WRITEV_NOCANCEL = 412
+ SYS_SENDTO_NOCANCEL = 413
+ SYS_PREAD_NOCANCEL = 414
+ SYS_PWRITE_NOCANCEL = 415
+ SYS_WAITID_NOCANCEL = 416
+ SYS_POLL_NOCANCEL = 417
+ SYS_MSGSND_NOCANCEL = 418
+ SYS_MSGRCV_NOCANCEL = 419
+ SYS_SEM_WAIT_NOCANCEL = 420
+ SYS_AIO_SUSPEND_NOCANCEL = 421
+ SYS___SIGWAIT_NOCANCEL = 422
+ SYS___SEMWAIT_SIGNAL_NOCANCEL = 423
+ SYS___MAC_MOUNT = 424
+ SYS___MAC_GET_MOUNT = 425
+ SYS___MAC_GETFSSTAT = 426
+ SYS_FSGETPATH = 427
+ SYS_AUDIT_SESSION_SELF = 428
+ SYS_AUDIT_SESSION_JOIN = 429
+ SYS_FILEPORT_MAKEPORT = 430
+ SYS_FILEPORT_MAKEFD = 431
+ SYS_AUDIT_SESSION_PORT = 432
+ SYS_PID_SUSPEND = 433
+ SYS_PID_RESUME = 434
+ SYS_PID_HIBERNATE = 435
+ SYS_PID_SHUTDOWN_SOCKETS = 436
+ SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438
+ SYS_MAXSYSCALL = 439
)
diff --git a/src/pkg/syscall/ztypes_darwin_386.go b/src/pkg/syscall/ztypes_darwin_386.go
index 914534c..566b021 100644
--- a/src/pkg/syscall/ztypes_darwin_386.go
+++ b/src/pkg/syscall/ztypes_darwin_386.go
@@ -56,10 +56,6 @@
type _Gid_t uint32
-const (
- O_CLOEXEC = 0
-)
-
type Stat_t struct {
Dev int32
Mode uint16
@@ -138,13 +134,13 @@
}
type Dirent struct {
- Ino uint64
- Seekoff uint64
- Reclen uint16
- Namlen uint16
- Type uint8
- Name [1024]int8
- Pad_godefs_0 [3]byte
+ Ino uint64
+ Seekoff uint64
+ Reclen uint16
+ Namlen uint16
+ Type uint8
+ Name [1024]int8
+ Pad_cgo_0 [3]byte
}
type RawSockaddrInet4 struct {
@@ -279,14 +275,14 @@
)
type IfMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Pad_godefs_0 [2]byte
- Data IfData
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Addrs int32
+ Flags int32
+ Index uint16
+ Pad_cgo_0 [2]byte
+ Data IfData
}
type IfData struct {
@@ -322,51 +318,51 @@
}
type IfaMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Pad_godefs_0 [2]byte
- Metric int32
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Addrs int32
+ Flags int32
+ Index uint16
+ Pad_cgo_0 [2]byte
+ Metric int32
}
type IfmaMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Pad_godefs_0 [2]byte
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Addrs int32
+ Flags int32
+ Index uint16
+ Pad_cgo_0 [2]byte
}
type IfmaMsghdr2 struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Pad_godefs_0 [2]byte
- Refcount int32
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Addrs int32
+ Flags int32
+ Index uint16
+ Pad_cgo_0 [2]byte
+ Refcount int32
}
type RtMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Index uint16
- Pad_godefs_0 [2]byte
- Flags int32
- Addrs int32
- Pid int32
- Seq int32
- Errno int32
- Use int32
- Inits uint32
- Rmx RtMetrics
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Index uint16
+ Pad_cgo_0 [2]byte
+ Flags int32
+ Addrs int32
+ Pid int32
+ Seq int32
+ Errno int32
+ Use int32
+ Inits uint32
+ Rmx RtMetrics
}
type RtMetrics struct {
@@ -414,9 +410,9 @@
}
type BpfHdr struct {
- Tstamp Timeval
- Caplen uint32
- Datalen uint32
- Hdrlen uint16
- Pad_godefs_0 [2]byte
+ Tstamp Timeval
+ Caplen uint32
+ Datalen uint32
+ Hdrlen uint16
+ Pad_cgo_0 [2]byte
}
diff --git a/src/pkg/syscall/ztypes_darwin_amd64.go b/src/pkg/syscall/ztypes_darwin_amd64.go
index fbbb503..2c65311 100644
--- a/src/pkg/syscall/ztypes_darwin_amd64.go
+++ b/src/pkg/syscall/ztypes_darwin_amd64.go
@@ -24,9 +24,9 @@
}
type Timeval struct {
- Sec int64
- Usec int32
- Pad_godefs_0 [4]byte
+ Sec int64
+ Usec int32
+ Pad_cgo_0 [4]byte
}
type Timeval32 struct {
@@ -60,10 +60,6 @@
type _Gid_t uint32
-const (
- O_CLOEXEC = 0
-)
-
type Stat_t struct {
Dev int32
Mode uint16
@@ -72,7 +68,7 @@
Uid uint32
Gid uint32
Rdev int32
- Pad_godefs_0 [4]byte
+ Pad_cgo_0 [4]byte
Atimespec Timespec
Mtimespec Timespec
Ctimespec Timespec
@@ -122,9 +118,9 @@
}
type Radvisory_t struct {
- Offset int64
- Count int32
- Pad_godefs_0 [4]byte
+ Offset int64
+ Count int32
+ Pad_cgo_0 [4]byte
}
type Fbootstraptransfer_t struct {
@@ -144,13 +140,13 @@
}
type Dirent struct {
- Ino uint64
- Seekoff uint64
- Reclen uint16
- Namlen uint16
- Type uint8
- Name [1024]int8
- Pad_godefs_0 [3]byte
+ Ino uint64
+ Seekoff uint64
+ Reclen uint16
+ Namlen uint16
+ Type uint8
+ Name [1024]int8
+ Pad_cgo_0 [3]byte
}
type RawSockaddrInet4 struct {
@@ -221,15 +217,15 @@
}
type Msghdr struct {
- Name *byte
- Namelen uint32
- Pad_godefs_0 [4]byte
- Iov *Iovec
- Iovlen int32
- Pad_godefs_1 [4]byte
- Control *byte
- Controllen uint32
- Flags int32
+ Name *byte
+ Namelen uint32
+ Pad_cgo_0 [4]byte
+ Iov *Iovec
+ Iovlen int32
+ Pad_cgo_1 [4]byte
+ Control *byte
+ Controllen uint32
+ Flags int32
}
type Cmsghdr struct {
@@ -287,14 +283,14 @@
)
type IfMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Pad_godefs_0 [2]byte
- Data IfData
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Addrs int32
+ Flags int32
+ Index uint16
+ Pad_cgo_0 [2]byte
+ Data IfData
}
type IfData struct {
@@ -330,51 +326,51 @@
}
type IfaMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Pad_godefs_0 [2]byte
- Metric int32
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Addrs int32
+ Flags int32
+ Index uint16
+ Pad_cgo_0 [2]byte
+ Metric int32
}
type IfmaMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Pad_godefs_0 [2]byte
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Addrs int32
+ Flags int32
+ Index uint16
+ Pad_cgo_0 [2]byte
}
type IfmaMsghdr2 struct {
- Msglen uint16
- Version uint8
- Type uint8
- Addrs int32
- Flags int32
- Index uint16
- Pad_godefs_0 [2]byte
- Refcount int32
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Addrs int32
+ Flags int32
+ Index uint16
+ Pad_cgo_0 [2]byte
+ Refcount int32
}
type RtMsghdr struct {
- Msglen uint16
- Version uint8
- Type uint8
- Index uint16
- Pad_godefs_0 [2]byte
- Flags int32
- Addrs int32
- Pid int32
- Seq int32
- Errno int32
- Use int32
- Inits uint32
- Rmx RtMetrics
+ Msglen uint16
+ Version uint8
+ Type uint8
+ Index uint16
+ Pad_cgo_0 [2]byte
+ Flags int32
+ Addrs int32
+ Pid int32
+ Seq int32
+ Errno int32
+ Use int32
+ Inits uint32
+ Rmx RtMetrics
}
type RtMetrics struct {
@@ -410,9 +406,9 @@
}
type BpfProgram struct {
- Len uint32
- Pad_godefs_0 [4]byte
- Insns *BpfInsn
+ Len uint32
+ Pad_cgo_0 [4]byte
+ Insns *BpfInsn
}
type BpfInsn struct {
@@ -423,9 +419,9 @@
}
type BpfHdr struct {
- Tstamp Timeval32
- Caplen uint32
- Datalen uint32
- Hdrlen uint16
- Pad_godefs_0 [2]byte
+ Tstamp Timeval32
+ Caplen uint32
+ Datalen uint32
+ Hdrlen uint16
+ Pad_cgo_0 [2]byte
}
diff --git a/src/pkg/syscall/ztypes_windows.go b/src/pkg/syscall/ztypes_windows.go
index 4fe1fa21..211fc0c 100644
--- a/src/pkg/syscall/ztypes_windows.go
+++ b/src/pkg/syscall/ztypes_windows.go
@@ -2,18 +2,18 @@
const (
// Windows errors.
- ERROR_FILE_NOT_FOUND = 2
- ERROR_PATH_NOT_FOUND = 3
- ERROR_ACCESS_DENIED = 5
- ERROR_NO_MORE_FILES = 18
- ERROR_BROKEN_PIPE = 109
- ERROR_BUFFER_OVERFLOW = 111
- ERROR_INSUFFICIENT_BUFFER = 122
- ERROR_MOD_NOT_FOUND = 126
- ERROR_PROC_NOT_FOUND = 127
- ERROR_ENVVAR_NOT_FOUND = 203
- ERROR_OPERATION_ABORTED = 995
- ERROR_IO_PENDING = 997
+ ERROR_FILE_NOT_FOUND Errno = 2
+ ERROR_PATH_NOT_FOUND Errno = 3
+ ERROR_ACCESS_DENIED Errno = 5
+ ERROR_NO_MORE_FILES Errno = 18
+ ERROR_BROKEN_PIPE Errno = 109
+ ERROR_BUFFER_OVERFLOW Errno = 111
+ ERROR_INSUFFICIENT_BUFFER Errno = 122
+ ERROR_MOD_NOT_FOUND Errno = 126
+ ERROR_PROC_NOT_FOUND Errno = 127
+ ERROR_ENVVAR_NOT_FOUND Errno = 203
+ ERROR_OPERATION_ABORTED Errno = 995
+ ERROR_IO_PENDING Errno = 997
)
const (
diff --git a/src/pkg/time/zoneinfo_windows.go b/src/pkg/time/zoneinfo_windows.go
index ba152e0..995fd44 100644
--- a/src/pkg/time/zoneinfo_windows.go
+++ b/src/pkg/time/zoneinfo_windows.go
@@ -161,7 +161,7 @@
func setupZone() {
var i syscall.Timezoneinformation
- if _, e := syscall.GetTimeZoneInformation(&i); e != 0 {
+ if _, e := syscall.GetTimeZoneInformation(&i); e != nil {
initError = os.NewSyscallError("GetTimeZoneInformation", e)
return
}