mirror of
https://github.com/golang/go
synced 2024-11-11 19:21:37 -07:00
[dev.cc] runtime: fix linux build
TBR=austin CC=golang-codereviews https://golang.org/cl/176760044
This commit is contained in:
parent
1d05d5880e
commit
a87e4a2d01
@ -134,6 +134,10 @@ func (ts *timespec) set_sec(x int32) {
|
||||
ts.tv_sec = x
|
||||
}
|
||||
|
||||
func (ts *timespec) set_nsec(x int32) {
|
||||
ts.tv_nsec = x
|
||||
}
|
||||
|
||||
type timeval struct {
|
||||
tv_sec int32
|
||||
tv_usec int32
|
||||
|
@ -96,6 +96,10 @@ func (ts *timespec) set_sec(x int32) {
|
||||
ts.tv_sec = int64(x)
|
||||
}
|
||||
|
||||
func (ts *timespec) set_nsec(x int32) {
|
||||
ts.tv_nsec = int64(x)
|
||||
}
|
||||
|
||||
type timeval struct {
|
||||
tv_sec int64
|
||||
tv_usec int64
|
||||
|
@ -88,6 +88,10 @@ func (ts *timespec) set_sec(x int32) {
|
||||
ts.tv_sec = x
|
||||
}
|
||||
|
||||
func (ts *timespec) set_nsec(x int32) {
|
||||
ts.tv_nsec = x
|
||||
}
|
||||
|
||||
type sigaltstackt struct {
|
||||
ss_sp *byte
|
||||
ss_flags int32
|
||||
|
@ -48,8 +48,8 @@ func futexsleep(addr *uint32, val uint32, ns int64) {
|
||||
// is not, even timediv is too heavy, and we really need to use just an
|
||||
// ordinary machine instruction.
|
||||
if ptrSize == 8 {
|
||||
ts.set_sec(ns / 1000000000)
|
||||
ts.set_nsec(ns % 1000000000)
|
||||
ts.set_sec(int32(ns / 1000000000))
|
||||
ts.set_nsec(int32(ns % 1000000000))
|
||||
} else {
|
||||
ts.tv_nsec = 0
|
||||
ts.set_sec(timediv(ns, 1000000000, (*int32)(unsafe.Pointer(&ts.tv_nsec))))
|
||||
|
Loading…
Reference in New Issue
Block a user