diff options
Diffstat (limited to 'src/pkg/net/fd_poll_runtime.go')
-rw-r--r-- | src/pkg/net/fd_poll_runtime.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pkg/net/fd_poll_runtime.go b/src/pkg/net/fd_poll_runtime.go index e2b276886..2bddc836c 100644 --- a/src/pkg/net/fd_poll_runtime.go +++ b/src/pkg/net/fd_poll_runtime.go @@ -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 darwin dragonfly freebsd linux netbsd openbsd windows +// +build darwin dragonfly freebsd linux netbsd openbsd windows solaris package net @@ -12,6 +12,9 @@ import ( "time" ) +// runtimeNano returns the current value of the runtime clock in nanoseconds. +func runtimeNano() int64 + func runtime_pollServerInit() func runtime_pollOpen(fd uintptr) (uintptr, int) func runtime_pollClose(ctx uintptr) @@ -128,7 +131,7 @@ func (fd *netFD) setWriteDeadline(t time.Time) error { } func setDeadlineImpl(fd *netFD, t time.Time, mode int) error { - d := t.UnixNano() + d := runtimeNano() + int64(t.Sub(time.Now())) if t.IsZero() { d = 0 } |