Commit 90a75085 authored by Russ Cox's avatar Russ Cox

syscall: update darwin/amd64 for timespec change

Change-Id: I74f47f519dfee10cd079ad9a4e09e36e8d74c6dc
Reviewed-on: https://go-review.googlesource.com/30937
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 14e545b6
...@@ -6,17 +6,12 @@ package syscall ...@@ -6,17 +6,12 @@ package syscall
import "unsafe" import "unsafe"
func NsecToTimespec(nsec int64) (ts Timespec) { func setTimespec(sec, nsec int64) Timespec {
ts.Sec = nsec / 1e9 return Timespec{Sec: int64(sec), Nsec: int64(nsec)}
ts.Nsec = nsec % 1e9
return
} }
func NsecToTimeval(nsec int64) (tv Timeval) { func setTimeval(sec, usec int64) Timeval {
nsec += 999 // round up to microsecond return Timeval{Sec: int64(sec), Usec: int32(usec)}
tv.Usec = int32(nsec % 1e9 / 1e3)
tv.Sec = int64(nsec / 1e9)
return
} }
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment