mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-04-15 05:26:54 +02:00
This is a temporary measure while we wait for https://go-review.googlesource.com/c/sys/+/352310 to land. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
17 lines
372 B
Go
17 lines
372 B
Go
/* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright (C) 2017-2021 WireGuard LLC. All Rights Reserved.
|
|
*/
|
|
|
|
package rwcancel
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
func poll(fds []unix.PollFd, timeout int) (n int, err error) {
|
|
var ts *unix.Timespec
|
|
if timeout >= 0 {
|
|
ts = new(unix.Timespec)
|
|
*ts = unix.NsecToTimespec(int64(timeout) * 1e6)
|
|
}
|
|
return unix.Ppoll(fds, ts, nil)
|
|
}
|