]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.cc] runtime: fix linux build
authorRuss Cox <rsc@golang.org>
Fri, 14 Nov 2014 17:55:10 +0000 (12:55 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 14 Nov 2014 17:55:10 +0000 (12:55 -0500)
TBR=austin
CC=golang-codereviews
https://golang.org/cl/176760044

src/runtime/defs_linux_386.go
src/runtime/defs_linux_amd64.go
src/runtime/defs_linux_arm.go
src/runtime/os1_linux.go

index be5e5b3ad9aac798f7e4c05c620586838de3a079..a468f60d9eb37fb8197bcf6177cda3b7202870f8 100644 (file)
@@ -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
index 386926fbdb0c9e0c9e9d23c88c93b4fc12554670..7a1caea74e06ceb33dbaafacb6fb7ae190d858c8 100644 (file)
@@ -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
index 1e7c6797a2b5804bcc089065cbc94f67085a8304..7f8300293a7478d8cf046190b7f04b7c3df96242 100644 (file)
@@ -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
index 7b096533c20e6b1e9dbe026015c427db59a1d760..0d24c5edc9dccae0ba19079c6bf96d7013c117fe 100644 (file)
@@ -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))))