aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_darwin.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/sys_darwin.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/sys_darwin.go')
-rw-r--r--src/runtime/sys_darwin.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/sys_darwin.go b/src/runtime/sys_darwin.go
index 376f76dbc5..932a2a7757 100644
--- a/src/runtime/sys_darwin.go
+++ b/src/runtime/sys_darwin.go
@@ -230,7 +230,7 @@ func usleep_trampoline()
//go:nosplit
//go:cgo_unsafe_args
-func write(fd uintptr, p unsafe.Pointer, n int32) int32 {
+func write1(fd uintptr, p unsafe.Pointer, n int32) int32 {
return libcCall(unsafe.Pointer(funcPC(write_trampoline)), unsafe.Pointer(&fd))
}
func write_trampoline()
@@ -244,7 +244,7 @@ func open_trampoline()
//go:nosplit
//go:cgo_unsafe_args
-func nanotime() int64 {
+func nanotime1() int64 {
var r struct {
t int64 // raw timer
numer, denom uint32 // conversion factors. nanoseconds = t * numer / denom.
@@ -266,7 +266,7 @@ func nanotime_trampoline()
//go:nosplit
//go:cgo_unsafe_args
-func walltime() (int64, int32) {
+func walltime1() (int64, int32) {
var t timeval
libcCall(unsafe.Pointer(funcPC(walltime_trampoline)), unsafe.Pointer(&t))
return int64(t.tv_sec), 1000 * t.tv_usec