go.sys/unix: use syscall.Errno for errors

If we use a local type, it won't compare properly with errors from
the rest of the standard library. Errors are the one type from syscall
that propagates through the system, so it's important to have only
one type for them.

Ditto for syscall.Signal.

LGTM=dave
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/123490043
This commit is contained in:
Rob Pike
2014-08-15 09:57:24 -07:00
parent 70c4b52aa0
commit dc3c21c62b
58 changed files with 2546 additions and 2491 deletions
+5 -2
View File
@@ -4,7 +4,10 @@
package unix
import "unsafe"
import (
"syscall"
"unsafe"
)
func Getpagesize() int { return 4096 }
@@ -25,7 +28,7 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
// Underlying system call writes to newoffset via pointer.
// Implemented in assembly to avoid allocation.
func seek(fd int, offset int64, whence int) (newoffset int64, err Errno)
func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
newoffset, errno := seek(fd, offset, whence)