aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/syscall/syscall_unix.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2016-02-03 21:58:02 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-02-03 21:58:02 +0000
commitf98dd1a338867a408f7c72d73fbad7fe7fc93e3a (patch)
tree2f8da9862a9c1fe0df138917f997b03439c02773 /libgo/go/syscall/syscall_unix.go
parentb081ed4efc144da0c45a6484aebfd10e0eb9fda3 (diff)
downloadgcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.zip
gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.tar.gz
gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.tar.bz2
libgo: Update to go1.6rc1.
Reviewed-on: https://go-review.googlesource.com/19200 From-SVN: r233110
Diffstat (limited to 'libgo/go/syscall/syscall_unix.go')
-rw-r--r--libgo/go/syscall/syscall_unix.go21
1 files changed, 14 insertions, 7 deletions
diff --git a/libgo/go/syscall/syscall_unix.go b/libgo/go/syscall/syscall_unix.go
index 21bf6ea..c47050d 100644
--- a/libgo/go/syscall/syscall_unix.go
+++ b/libgo/go/syscall/syscall_unix.go
@@ -7,6 +7,7 @@
package syscall
import (
+ "internal/race"
"runtime"
"sync"
"unsafe"
@@ -210,24 +211,30 @@ func (s Signal) String() string {
func Read(fd int, p []byte) (n int, err error) {
n, err = read(fd, p)
- if raceenabled {
+ if race.Enabled {
if n > 0 {
- raceWriteRange(unsafe.Pointer(&p[0]), n)
+ race.WriteRange(unsafe.Pointer(&p[0]), n)
}
if err == nil {
- raceAcquire(unsafe.Pointer(&ioSync))
+ race.Acquire(unsafe.Pointer(&ioSync))
}
}
+ if msanenabled && n > 0 {
+ msanWrite(unsafe.Pointer(&p[0]), n)
+ }
return
}
func Write(fd int, p []byte) (n int, err error) {
- if raceenabled {
- raceReleaseMerge(unsafe.Pointer(&ioSync))
+ if race.Enabled {
+ race.ReleaseMerge(unsafe.Pointer(&ioSync))
}
n, err = write(fd, p)
- if raceenabled && n > 0 {
- raceReadRange(unsafe.Pointer(&p[0]), n)
+ if race.Enabled && n > 0 {
+ race.ReadRange(unsafe.Pointer(&p[0]), n)
+ }
+ if msanenabled && n > 0 {
+ msanRead(unsafe.Pointer(&p[0]), n)
}
return
}