diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-23 04:31:11 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-23 04:31:11 +0000 |
commit | fb08d0057f91d420b6f48c112264fc87dc91b532 (patch) | |
tree | 46bb86f514fbf6bad82da48e69a18fb09d878834 /libgo/go/syscall/syscall_unix.go | |
parent | f507227a181bb31fa87d23a082485f99f3ef9183 (diff) |
libgo: Update to current sources.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192704 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/syscall/syscall_unix.go')
-rw-r--r-- | libgo/go/syscall/syscall_unix.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libgo/go/syscall/syscall_unix.go b/libgo/go/syscall/syscall_unix.go index d4bff9efc9c1..fb62681a9e1f 100644 --- a/libgo/go/syscall/syscall_unix.go +++ b/libgo/go/syscall/syscall_unix.go @@ -179,3 +179,20 @@ func Signame(s Signal) string func (s Signal) String() string { return Signame(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 |