aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/os_plan9.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2019-09-01 10:37:44 -0400
committerAustin Clements <austin@google.com>2019-09-04 17:56:09 +0000
commit4af3c17f8cd37288a5bb9bc53e8b88c58f5624d1 (patch)
tree0d8dd44ab11f568977ca4521d896323fcd744c37 /src/runtime/os_plan9.go
parent6719d889e1a333989c6f461a66090d5583eeaedf (diff)
downloadgo-4af3c17f8cd37288a5bb9bc53e8b88c58f5624d1.tar.gz
go-4af3c17f8cd37288a5bb9bc53e8b88c58f5624d1.zip
runtime: wrap nanotime, walltime, and write
In preparation for general faketime support, this renames the existing nanotime, walltime, and write functions to nanotime1, walltime1, and write1 and wraps them with trivial Go functions. This will let us inject different implementations on all platforms when faketime is enabled. Updates #30439. Change-Id: Ice5ccc513a32a6d89ea051638676d3ee05b00418 Reviewed-on: https://go-review.googlesource.com/c/go/+/192738 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/os_plan9.go')
-rw-r--r--src/runtime/os_plan9.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/os_plan9.go b/src/runtime/os_plan9.go
index d7ea1ef841..2f8d0a0c8e 100644
--- a/src/runtime/os_plan9.go
+++ b/src/runtime/os_plan9.go
@@ -328,7 +328,7 @@ func usleep(µs uint32) {
}
//go:nosplit
-func nanotime() int64 {
+func nanotime1() int64 {
var scratch int64
ns := nsec(&scratch)
// TODO(aram): remove hack after I fix _nsec in the pc64 kernel.
@@ -373,7 +373,7 @@ func postnote(pid uint64, msg []byte) int {
return -1
}
len := findnull(&msg[0])
- if write(uintptr(fd), unsafe.Pointer(&msg[0]), int32(len)) != int64(len) {
+ if write1(uintptr(fd), unsafe.Pointer(&msg[0]), int32(len)) != int32(len) {
closefd(fd)
return -1
}
@@ -451,8 +451,8 @@ func read(fd int32, buf unsafe.Pointer, n int32) int32 {
}
//go:nosplit
-func write(fd uintptr, buf unsafe.Pointer, n int32) int64 {
- return int64(pwrite(int32(fd), buf, n, -1))
+func write1(fd uintptr, buf unsafe.Pointer, n int32) int32 {
+ return pwrite(int32(fd), buf, n, -1)
}
var _badsignal = []byte("runtime: signal received on thread not created by Go.\n")