buildtools/gcc/libgo/go/syscall/sleep_select.go

17 lines
374 B
Go
Raw Permalink Normal View History

2022-07-15 14:14:32 +02:00
// sleep_select.go -- Sleep using select.
// Copyright 2011 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.
//go:build !rtems
2022-07-15 14:14:32 +02:00
// +build !rtems
package syscall
func Sleep(nsec int64) (err error) {
tv := NsecToTimeval(nsec)
_, err = Select(0, nil, nil, nil, &tv)
return err
}