mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
fix build - missed this file before
TBR=r OCL=25074 CL=25074
This commit is contained in:
parent
dfad8ea647
commit
aa35aee07c
1 changed files with 20 additions and 0 deletions
20
src/lib/time/sleep.go
Normal file
20
src/lib/time/sleep.go
Normal file
|
|
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue