diff options
author | Russ Cox <rsc@golang.org> | 2009-02-16 17:07:11 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-02-16 17:07:11 -0800 |
commit | f59180e60caf369965ecc3f30f6bb40e18b05560 (patch) | |
tree | a7c36fb933c5ae34e8af4f48f6f1a79169b6a395 /src | |
parent | 550082e3be6db5e3f8e1b0ac780d08f5368108dc (diff) | |
download | golang-f59180e60caf369965ecc3f30f6bb40e18b05560.tar.gz |
fix build - missed this file before
TBR=r
OCL=25074
CL=25074
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/time/sleep.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/time/sleep.go b/src/lib/time/sleep.go new file mode 100644 index 000000000..1ce58b291 --- /dev/null +++ b/src/lib/time/sleep.go @@ -0,0 +1,20 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package time + +import ( + "os"; + "syscall"; + "unsafe"; +) + +func Sleep(ns int64) *os.Error { + var tv syscall.Timeval; + syscall.Nstotimeval(ns, &tv); + r1, r2, err := syscall.Syscall6(syscall.SYS_SELECT, 0, 0, 0, 0, + int64(uintptr(unsafe.Pointer(&tv))), 0); + return os.ErrnoToError(err); +} + |