summaryrefslogtreecommitdiff
path: root/src/syscall/time_amd64_darwin.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/time_amd64_darwin.go')
-rw-r--r--src/syscall/time_amd64_darwin.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/syscall/time_amd64_darwin.go b/src/syscall/time_amd64_darwin.go
new file mode 100644
index 000000000..d4cdaa048
--- /dev/null
+++ b/src/syscall/time_amd64_darwin.go
@@ -0,0 +1,19 @@
+// Copyright 2009 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.
+
+package syscall
+
+import syscall "syscall"
+
+export func gettimeofday() (sec, nsec, errno int64) {
+ const GETTIMEOFDAY = 116;
+ // The "1" in the call is the timeval pointer, which must be
+ // non-zero but is otherwise unused. The results
+ // are returned in r1, r2.
+ r1, r2, err := syscall.Syscall(GETTIMEOFDAY, 1, 0, 0);
+ if err != 0 {
+ return 0, 0, err
+ }
+ return r1, r2, 0
+}