summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/zsyscall_darwin_386.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-06-16 17:17:02 -0700
committerRuss Cox <rsc@golang.org>2009-06-16 17:17:02 -0700
commit67d5e00af1c62a237623278b0181b98f25a3179c (patch)
treee6f2ed8488a281a586664e0a0085aa6fe227365e /src/pkg/syscall/zsyscall_darwin_386.go
parent16cf893acaf7106a53a595ac6ca736026a617f93 (diff)
downloadgolang-67d5e00af1c62a237623278b0181b98f25a3179c.tar.gz
386 system call fixes:
* use 64-bit file system calls (Linux, Darwin) * use 32-bit [sic] uid/gid calls (Linux) * fix sockets on Linux Darwin/386 works again. Linux/386 is better but must never have worked; there are still bugs surrounding the creation of new threads in the runtime package. R=austin DELTA=1332 (673 added, 614 deleted, 45 changed) OCL=30327 CL=30380
Diffstat (limited to 'src/pkg/syscall/zsyscall_darwin_386.go')
-rw-r--r--src/pkg/syscall/zsyscall_darwin_386.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/pkg/syscall/zsyscall_darwin_386.go b/src/pkg/syscall/zsyscall_darwin_386.go
index 61f7c01db..6974c83bf 100644
--- a/src/pkg/syscall/zsyscall_darwin_386.go
+++ b/src/pkg/syscall/zsyscall_darwin_386.go
@@ -36,13 +36,6 @@ func pipe() (r int, w int, errno int) {
return;
}
-func lseek(fd int, offset int64, whence int) (newoffset uintptr, errno int) {
- r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset >> 32), uintptr(whence), 0, 0);
- newoffset = uintptr(r0);
- errno = int(e1);
- return;
-}
-
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
r0, r1, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)));
fd = int(r0);
@@ -450,6 +443,12 @@ func Rmdir(path string) (errno int) {
return;
}
+func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
+ r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset >> 32), uintptr(whence), 0, 0);
+ newoffset = int64(int64(r1)<<32 | int64(r0));
+ return;
+}
+
func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
r0, r1, 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);
@@ -612,9 +611,9 @@ func write(fd int, buf *byte, nbuf int) (n int, errno int) {
return;
}
-func gettimeofday(tp *Timeval) (sec int64, usec int32, errno int) {
+func gettimeofday(tp *Timeval) (sec int32, usec int32, errno int) {
r0, r1, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0);
- sec = int64(r0);
+ sec = int32(r0);
usec = int32(r1);
errno = int(e1);
return;