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
This commit is contained in:
Russ Cox 2009-06-16 17:17:02 -07:00
parent cb897436eb
commit 76c87d58cd
16 changed files with 424 additions and 365 deletions

View file

@ -154,13 +154,6 @@ func Pipe(p []int) (errno int) {
return;
}
// TODO(rsc): How does 386 return an int64 newoffset?
//sys lseek(fd int, offset int64, whence int) (newoffset uintptr, errno int)
func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
n, e := lseek(fd, offset, whence);
return int64(n), e;
}
func Sleep(ns int64) (errno int) {
tv := NsecToTimeval(ns);
return Select(0, nil, nil, nil, &tv);
@ -427,6 +420,7 @@ func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, errno
//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)
//sys Seteuid(euid int) (errno int)