]> Cypherpunks repositories - gostls13.git/commitdiff
race: syscall changes
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 9 Oct 2012 16:51:58 +0000 (20:51 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 9 Oct 2012 16:51:58 +0000 (20:51 +0400)
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
The purpose of this patch is to provide coarse-grained synchronization
between all Read() and Write() calls.

R=rsc, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/6610064

22 files changed:
src/pkg/syscall/exec_unix.go
src/pkg/syscall/race.go [new file with mode: 0644]
src/pkg/syscall/race0.go [new file with mode: 0644]
src/pkg/syscall/syscall_darwin.go
src/pkg/syscall/syscall_freebsd.go
src/pkg/syscall/syscall_linux.go
src/pkg/syscall/syscall_netbsd.go
src/pkg/syscall/syscall_openbsd.go
src/pkg/syscall/syscall_plan9.go
src/pkg/syscall/syscall_unix.go
src/pkg/syscall/syscall_windows.go
src/pkg/syscall/zsyscall_darwin_386.go
src/pkg/syscall/zsyscall_darwin_amd64.go
src/pkg/syscall/zsyscall_freebsd_386.go
src/pkg/syscall/zsyscall_freebsd_amd64.go
src/pkg/syscall/zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_amd64.go
src/pkg/syscall/zsyscall_linux_arm.go
src/pkg/syscall/zsyscall_netbsd_386.go
src/pkg/syscall/zsyscall_netbsd_amd64.go
src/pkg/syscall/zsyscall_openbsd_386.go
src/pkg/syscall/zsyscall_openbsd_amd64.go

index 98587666dcac28983513cbb519dd4cdfd63f9695..dd892a9abe05e12a01d2bfd580deb3e12c5946bf 100644 (file)
@@ -203,7 +203,7 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)
 
        // Read child error status from pipe.
        Close(p[1])
-       n, err = read(p[0], (*byte)(unsafe.Pointer(&err1)), int(unsafe.Sizeof(err1)))
+       n, err = readlen(p[0], (*byte)(unsafe.Pointer(&err1)), int(unsafe.Sizeof(err1)))
        Close(p[0])
        if err != nil || n != 0 {
                if n == int(unsafe.Sizeof(err1)) {
diff --git a/src/pkg/syscall/race.go b/src/pkg/syscall/race.go
new file mode 100644 (file)
index 0000000..8177884
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build race
+
+package syscall
+
+import (
+       "runtime"
+       "unsafe"
+)
+
+const raceenabled = true
+
+func raceAcquire(addr unsafe.Pointer) {
+       runtime.RaceAcquire(addr)
+}
+
+func raceReleaseMerge(addr unsafe.Pointer) {
+       runtime.RaceReleaseMerge(addr)
+}
diff --git a/src/pkg/syscall/race0.go b/src/pkg/syscall/race0.go
new file mode 100644 (file)
index 0000000..e94fb47
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !race
+
+package syscall
+
+import (
+       "unsafe"
+)
+
+const raceenabled = false
+
+func raceAcquire(addr unsafe.Pointer) {
+}
+
+func raceReleaseMerge(addr unsafe.Pointer) {
+}
index 1ab8f11670b2ec4bc42957abb025f9067200915d..273a62eae4cde415a7e953b9b8fc87341ba8e136 100644 (file)
@@ -162,7 +162,7 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
 //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  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)
@@ -191,11 +191,11 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
 //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  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)
+//sys  readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
+//sys  writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
 
 /*
  * Unimplemented
index 786b94bb09541751e32ab72c8e1d2253bba2505d..c7ffe223ea2a668c9ebcafe38764e21bae7005e4 100644 (file)
@@ -158,7 +158,7 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (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  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)
@@ -186,11 +186,11 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
 //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  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)
+//sys  readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
+//sys  writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
 
 /*
  * Unimplemented
index 89bba25210af097f2fbdd231db78b2841e627ceb..9998188cecf8eff2136ad53a49302086b1b8f6af 100644 (file)
@@ -864,7 +864,7 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
 //sys  Pause() (err error)
 //sys  PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
 //sysnb prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) = SYS_PRLIMIT64
-//sys  Read(fd int, p []byte) (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(oldpath string, newpath string) (err error)
 //sys  Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
@@ -889,10 +889,10 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
 //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  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)
+//sys  readlen(fd int, p *byte, np int) (n int, err error) = SYS_READ
+//sys  writelen(fd int, p *byte, np int) (n int, err error) = SYS_WRITE
 
 // mmap varies by architecture; see syscall_linux_*.go.
 //sys  munmap(addr uintptr, length uintptr) (err error)
index f45801a92ae486269e40b7229579e266b13a9bdc..adaaa42a701ed218dda0fa8649a4b8dc39ea761b 100644 (file)
@@ -188,7 +188,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 //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  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)
@@ -213,11 +213,11 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 //sys  Umask(newmask int) (oldmask 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  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)
+//sys  readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
+//sys  writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
 
 /*
  * Unimplemented
index 7cd1191087c700e4538c6c387fc80e49200b2260..8f2b0854a094755294f3b7d4629f8b7a10cdf8b6 100644 (file)
@@ -149,7 +149,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 //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  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)
@@ -176,11 +176,11 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 //sys  Umask(newmask int) (oldmask 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  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)
+//sys  readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
+//sys  writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
 
 /*
  * Unimplemented
index e2da9fe8645fb84ade4749721029a34c26eee5f7..4379731f79064938b442e3d74bfcdb21b347591c 100644 (file)
@@ -115,13 +115,22 @@ func Getppid() (ppid int) {
 }
 
 func Read(fd int, p []byte) (n int, err error) {
-       return Pread(fd, p, -1)
+       n, err = Pread(fd, p, -1)
+       if raceenabled && err == nil {
+               raceAcquire(unsafe.Pointer(&ioSync))
+       }
+       return
 }
 
 func Write(fd int, p []byte) (n int, err error) {
+       if raceenabled {
+               raceReleaseMerge(unsafe.Pointer(&ioSync))
+       }
        return Pwrite(fd, p, -1)
 }
 
+var ioSync int64
+
 func Getwd() (wd string, err error) {
        fd, e := Open(".", O_RDONLY)
 
index d4e02f68a7b85e9d8bb8cd7ffce58c10c484b99d..978350829b70be562c74e8ce7fbbe51c08a6a154 100644 (file)
@@ -127,3 +127,20 @@ func (s Signal) String() string {
        }
        return "signal " + itoa(int(s))
 }
+
+func Read(fd int, p []byte) (n int, err error) {
+       n, err = read(fd, p)
+       if raceenabled && err == nil {
+               raceAcquire(unsafe.Pointer(&ioSync))
+       }
+       return
+}
+
+func Write(fd int, p []byte) (n int, err error) {
+       if raceenabled {
+               raceReleaseMerge(unsafe.Pointer(&ioSync))
+       }
+       return write(fd, p)
+}
+
+var ioSync int64
index 342eb569280338b3f560556312a2ba6bf4e464d9..e997409d23b126c4e1c712a726ce2c538cbc3b3f 100644 (file)
@@ -267,10 +267,16 @@ func Read(fd Handle, p []byte) (n int, err error) {
                }
                return 0, e
        }
+       if raceenabled {
+               raceAcquire(unsafe.Pointer(&ioSync))
+       }
        return int(done), nil
 }
 
 func Write(fd Handle, p []byte) (n int, err error) {
+       if raceenabled {
+               raceReleaseMerge(unsafe.Pointer(&ioSync))
+       }
        var done uint32
        e := WriteFile(fd, p, &done, nil)
        if e != nil {
@@ -279,6 +285,8 @@ func Write(fd Handle, p []byte) (n int, err error) {
        return int(done), nil
 }
 
+var ioSync int64
+
 func Seek(fd Handle, offset int64, whence int) (newoffset int64, err error) {
        var w uint32
        switch whence {
index 34aa1fc8e9e336a467479fd1a80cfe470d934c1c..2f99b7f6c29ce7e5d9c227f40f1043ec712641b6 100644 (file)
@@ -895,7 +895,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1269,7 +1269,7 @@ func Unmount(path string, flags int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1307,7 +1307,7 @@ func munmap(addr uintptr, length uintptr) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, buf *byte, nbuf int) (n int, err error) {
+func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
@@ -1318,7 +1318,7 @@ func read(fd int, buf *byte, nbuf int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, buf *byte, nbuf int) (n int, err error) {
+func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
index fb56e2ec1c86d1b0405253ea233bf07738b088fd..0f08df4c527da342f786fdd37b25595f362145d8 100644 (file)
@@ -895,7 +895,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1269,7 +1269,7 @@ func Unmount(path string, flags int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1307,7 +1307,7 @@ func munmap(addr uintptr, length uintptr) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, buf *byte, nbuf int) (n int, err error) {
+func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
@@ -1318,7 +1318,7 @@ func read(fd int, buf *byte, nbuf int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, buf *byte, nbuf int) (n int, err error) {
+func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
index 6a7524ba4622ec7fc650056004fa8cf101a871ae..5ca0bcb16b417d0e3650c8b62c1773ae4f63e0c5 100644 (file)
@@ -885,7 +885,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1249,7 +1249,7 @@ func Unmount(path string, flags int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1287,7 +1287,7 @@ func munmap(addr uintptr, length uintptr) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, buf *byte, nbuf int) (n int, err error) {
+func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
@@ -1298,7 +1298,7 @@ func read(fd int, buf *byte, nbuf int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, buf *byte, nbuf int) (n int, err error) {
+func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
index 3f84dc23c6c5cebf57f55a1f2d535a0767afec99..260677473fe629eefe968409f5d6872ec1839352 100644 (file)
@@ -885,7 +885,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1249,7 +1249,7 @@ func Unmount(path string, flags int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1287,7 +1287,7 @@ func munmap(addr uintptr, length uintptr) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, buf *byte, nbuf int) (n int, err error) {
+func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
@@ -1298,7 +1298,7 @@ func read(fd int, buf *byte, nbuf int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, buf *byte, nbuf int) (n int, err error) {
+func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
index c5d2683f5b71ac5d12ab20af5a57d82daaacd323..0364c51c60fb5c8472783665bf41ccc7d7117ea1 100644 (file)
@@ -733,7 +733,7 @@ func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1067,7 +1067,7 @@ func Utime(path string, buf *Utimbuf) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1094,7 +1094,7 @@ func exitThread(code int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, p *byte, np int) (n int, err error) {
+func readlen(fd int, p *byte, np int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
        n = int(r0)
        if e1 != 0 {
@@ -1105,7 +1105,7 @@ func read(fd int, p *byte, np int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, p *byte, np int) (n int, err error) {
+func writelen(fd int, p *byte, np int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
        n = int(r0)
        if e1 != 0 {
index 28d86079bf67a8e4f44a0a44752dfaae1ae4b8a8..82c8b0408a817d9f3e02c255b9f68191fe8350f2 100644 (file)
@@ -733,7 +733,7 @@ func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1067,7 +1067,7 @@ func Utime(path string, buf *Utimbuf) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1094,7 +1094,7 @@ func exitThread(code int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, p *byte, np int) (n int, err error) {
+func readlen(fd int, p *byte, np int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
        n = int(r0)
        if e1 != 0 {
@@ -1105,7 +1105,7 @@ func read(fd int, p *byte, np int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, p *byte, np int) (n int, err error) {
+func writelen(fd int, p *byte, np int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
        n = int(r0)
        if e1 != 0 {
index 7ce6c4732283b202fb1e4f310d20186e100e15c3..3bb4b75f7ba4abd20baf02f53738b8420e9e3e11 100644 (file)
@@ -733,7 +733,7 @@ func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1067,7 +1067,7 @@ func Utime(path string, buf *Utimbuf) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1094,7 +1094,7 @@ func exitThread(code int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, p *byte, np int) (n int, err error) {
+func readlen(fd int, p *byte, np int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
        n = int(r0)
        if e1 != 0 {
@@ -1105,7 +1105,7 @@ func read(fd int, p *byte, np int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, p *byte, np int) (n int, err error) {
+func writelen(fd int, p *byte, np int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
        n = int(r0)
        if e1 != 0 {
index 3b84c4fe76d68d2ca473eeb9941de2e2b57c02ae..10ac072db89bd9a372d33cd693756fbe55119279 100644 (file)
@@ -850,7 +850,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1169,7 +1169,7 @@ func Unmount(path string, flags int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1207,7 +1207,7 @@ func munmap(addr uintptr, length uintptr) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, buf *byte, nbuf int) (n int, err error) {
+func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
@@ -1218,7 +1218,7 @@ func read(fd int, buf *byte, nbuf int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, buf *byte, nbuf int) (n int, err error) {
+func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
index a8affd9315c70e0cebccdf80a9a7efdc2d1fd14b..f10dc0bf41e2e4448b228ba20da5fea6c1a58591 100644 (file)
@@ -850,7 +850,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1169,7 +1169,7 @@ func Unmount(path string, flags int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1207,7 +1207,7 @@ func munmap(addr uintptr, length uintptr) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, buf *byte, nbuf int) (n int, err error) {
+func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
@@ -1218,7 +1218,7 @@ func read(fd int, buf *byte, nbuf int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, buf *byte, nbuf int) (n int, err error) {
+func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
index 21a61474e677d9aee5ef1285bce572502f7b3103..60e907bd279412c70a8ea6b15c6a1b6340d6c3d0 100644 (file)
@@ -875,7 +875,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1224,7 +1224,7 @@ func Unmount(path string, flags int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1262,7 +1262,7 @@ func munmap(addr uintptr, length uintptr) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, buf *byte, nbuf int) (n int, err error) {
+func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
@@ -1273,7 +1273,7 @@ func read(fd int, buf *byte, nbuf int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, buf *byte, nbuf int) (n int, err error) {
+func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
index a6ede5980b84a1656d702c9d07654d5af3bc697a..1403dd7e79ec2f2b4d2df0f3385df35c0e0058fd 100644 (file)
@@ -875,7 +875,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Read(fd int, p []byte) (n int, err error) {
+func read(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1224,7 +1224,7 @@ func Unmount(path string, flags int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Write(fd int, p []byte) (n int, err error) {
+func write(fd int, p []byte) (n int, err error) {
        var _p0 unsafe.Pointer
        if len(p) > 0 {
                _p0 = unsafe.Pointer(&p[0])
@@ -1262,7 +1262,7 @@ func munmap(addr uintptr, length uintptr) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func read(fd int, buf *byte, nbuf int) (n int, err error) {
+func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {
@@ -1273,7 +1273,7 @@ func read(fd int, buf *byte, nbuf int) (n int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func write(fd int, buf *byte, nbuf int) (n int, err error) {
+func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
        r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
        n = int(r0)
        if e1 != 0 {