]> Cypherpunks repositories - gostls13.git/commitdiff
fix build - missed this file before
authorRuss Cox <rsc@golang.org>
Tue, 17 Feb 2009 01:07:11 +0000 (17:07 -0800)
committerRuss Cox <rsc@golang.org>
Tue, 17 Feb 2009 01:07:11 +0000 (17:07 -0800)
TBR=r
OCL=25074
CL=25074

src/lib/time/sleep.go [new file with mode: 0644]

diff --git a/src/lib/time/sleep.go b/src/lib/time/sleep.go
new file mode 100644 (file)
index 0000000..1ce58b2
--- /dev/null
@@ -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);
+}
+