summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-11-14 12:55:10 -0500
committerRuss Cox <rsc@golang.org>2014-11-14 12:55:10 -0500
commit2230a043056b56c74cfdd0031fb4a7e589dad752 (patch)
tree8a31c52a4ce1cd506ca1269824e53635a8b534af
parent4f29938642faba6ad5e91eed5117fd2d4ec265b3 (diff)
downloadgo-2230a043056b56c74cfdd0031fb4a7e589dad752.tar.gz
[dev.cc] runtime: fix linux build
TBR=austin CC=golang-codereviews https://codereview.appspot.com/176760044
-rw-r--r--src/runtime/defs_linux_386.go4
-rw-r--r--src/runtime/defs_linux_amd64.go4
-rw-r--r--src/runtime/defs_linux_arm.go4
-rw-r--r--src/runtime/os1_linux.go4
4 files changed, 14 insertions, 2 deletions
diff --git a/src/runtime/defs_linux_386.go b/src/runtime/defs_linux_386.go
index be5e5b3ad..a468f60d9 100644
--- a/src/runtime/defs_linux_386.go
+++ b/src/runtime/defs_linux_386.go
@@ -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
diff --git a/src/runtime/defs_linux_amd64.go b/src/runtime/defs_linux_amd64.go
index 386926fbd..7a1caea74 100644
--- a/src/runtime/defs_linux_amd64.go
+++ b/src/runtime/defs_linux_amd64.go
@@ -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
diff --git a/src/runtime/defs_linux_arm.go b/src/runtime/defs_linux_arm.go
index 1e7c6797a..7f8300293 100644
--- a/src/runtime/defs_linux_arm.go
+++ b/src/runtime/defs_linux_arm.go
@@ -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
diff --git a/src/runtime/os1_linux.go b/src/runtime/os1_linux.go
index 7b096533c..0d24c5edc 100644
--- a/src/runtime/os1_linux.go
+++ b/src/runtime/os1_linux.go
@@ -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))))