--- a/src/libgo/go/runtime/os_hurd.go	2019-12-11 23:50:43.000000000 +0100
+++ b/src/libgo/go/runtime/os_hurd.go	2019-12-12 00:02:20.000000000 +0100
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// This file is derived from os_solaris.go.
+// This file is derived from os_aix.go.
 
 package runtime
 
@@ -31,6 +31,10 @@
 //extern sem_timedwait
 func sem_timedwait(sem *_sem_t, timeout *timespec) int32
 
+//go:noescape
+//extern clock_gettime
+func clock_gettime(clock_id int32, timeout *timespec) int32
+
 //go:nosplit
 func semacreate(mp *m) {
 	if mp.mos.waitsema != 0 {
@@ -54,8 +58,23 @@
 	_m_ := getg().m
 	if ns >= 0 {
 		var ts timespec
-		ts.set_sec(ns / 1000000000)
-		ts.set_nsec(int32(ns % 1000000000))
+
+		if clock_gettime(_CLOCK_REALTIME, &ts) != 0 {
+			throw("clock_gettime")
+		}
+
+		sec := int64(ts.tv_sec) + ns/1e9
+		nsec := int64(ts.tv_nsec) + ns%1e9
+		if nsec >= 1e9 {
+			sec++
+			nsec -= 1e9
+		}
+		if sec != int64(timespec_sec_t(sec)) {
+		// Handle overflows (timespec_sec_t is 32-bit in 32-bit applications)
+		sec = 1<<31 - 1
+		}
+		ts.tv_sec = timespec_sec_t(sec)
+		ts.tv_nsec = timespec_nsec_t(nsec)
 
 		if sem_timedwait((*_sem_t)(unsafe.Pointer(_m_.mos.waitsema)), &ts) != 0 {
 			err := errno()
--- a/src/libgo/go/syscall/export_unix_test.go	2017-05-10 19:26:09.000000000 +0200
+++ b/src/libgo/go/syscall/export_unix_test.go	2019-12-23 00:34:36.000000000 +0100
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
 
 package syscall
 
