mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-02 15:17:31 -04:00
unix: add Poll function on Darwin
Tested with TestPoll extracted from syscall_linux_test.go. Once Poll is supported on all OSes this test can be moved to syscall_unix_test.go. Change-Id: Ia57e3a92e6a50cb22edde8a31e1c4e70d894dc4c Reviewed-on: https://go-review.googlesource.com/73310 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
e825973668
commit
f0d39a4bd5
@@ -239,6 +239,15 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||
return &value, err
|
||||
}
|
||||
|
||||
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||
|
||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||
if len(fds) == 0 {
|
||||
return poll(nil, 0, timeout)
|
||||
}
|
||||
return poll(&fds[0], len(fds), timeout)
|
||||
}
|
||||
|
||||
/*
|
||||
* Exposed directly
|
||||
*/
|
||||
@@ -377,7 +386,6 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||
// Searchfs
|
||||
// Delete
|
||||
// Copyfile
|
||||
// Poll
|
||||
// Watchevent
|
||||
// Waitevent
|
||||
// Modwatch
|
||||
|
||||
Reference in New Issue
Block a user