@@ -0,0 +1,45 @@
1+diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
2+index e09b906ba5..fa8ff2f65c 100644
3+--- a/src/runtime/sys_darwin_amd64.s
4++++ b/src/runtime/sys_darwin_amd64.s
5+@@ -157,6 +157,7 @@ systime:
6+ // Fall back to system call (usually first call in this thread).
7+ MOVQ SP, DI
8+ MOVQ $0, SI
9++ MOVQ $0, DX // required as of Sierra; Issue 16570
10+ MOVL $(0x2000000+116), AX
11+ SYSCALL
12+ CMPQ AX, $0
13+diff --git a/src/syscall/syscall_darwin_amd64.go b/src/syscall/syscall_darwin_amd64.go
14+index 70b53b87f4..79083117b6 100644
15+--- a/src/syscall/syscall_darwin_amd64.go
16++++ b/src/syscall/syscall_darwin_amd64.go
17+@@ -26,14 +26,21 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
18+ }
19+
20+ //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
21+-func Gettimeofday(tv *Timeval) (err error) {
22+- // The tv passed to gettimeofday must be non-nil
23+- // but is otherwise unused. The answers come back
24+- // in the two registers.
25++func Gettimeofday(tv *Timeval) error {
26++ // The tv passed to gettimeofday must be non-nil.
27++ // Before macOS Sierra (10.12), tv was otherwise unused and
28++ // the answers came back in the two registers.
29++ // As of Sierra, gettimeofday return zeros and populates
30++ // tv itself.
31+ sec, usec, err := gettimeofday(tv)
32+- tv.Sec = sec
33+- tv.Usec = usec
34+- return err
35++ if err != nil {
36++ return err
37++ }
38++ if sec != 0 || usec != 0 {
39++ tv.Sec = sec
40++ tv.Usec = usec
41++ }
42++ return nil
43+ }
44+
45+ func SetKevent(k *Kevent_t, fd, mode, flags int) {