diff options
Diffstat (limited to 'pkg/unet/unet_unsafe.go')
-rw-r--r-- | pkg/unet/unet_unsafe.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/pkg/unet/unet_unsafe.go b/pkg/unet/unet_unsafe.go index f8a42c914..85ef46edf 100644 --- a/pkg/unet/unet_unsafe.go +++ b/pkg/unet/unet_unsafe.go @@ -16,12 +16,11 @@ package unet import ( "io" - "math" "sync/atomic" "syscall" "unsafe" - "gvisor.dev/gvisor/pkg/abi/linux" + "golang.org/x/sys/unix" ) // wait blocks until the socket FD is ready for reading or writing, depending @@ -37,23 +36,23 @@ func (s *Socket) wait(write bool) error { return errClosing } - events := []linux.PollFD{ + events := []unix.PollFd{ { // The actual socket FD. - FD: fd, - Events: linux.POLLIN, + Fd: fd, + Events: unix.POLLIN, }, { // The eventfd, signaled when we are closing. - FD: int32(s.efd), - Events: linux.POLLIN, + Fd: int32(s.efd), + Events: unix.POLLIN, }, } if write { - events[0].Events = linux.POLLOUT + events[0].Events = unix.POLLOUT } - _, _, e := syscall.Syscall(syscall.SYS_POLL, uintptr(unsafe.Pointer(&events[0])), 2, uintptr(math.MaxUint64)) + _, _, e := syscall.Syscall6(syscall.SYS_PPOLL, uintptr(unsafe.Pointer(&events[0])), 2, 0, 0, 0, 0) if e == syscall.EINTR { continue } @@ -61,7 +60,7 @@ func (s *Socket) wait(write bool) error { return e } - if events[1].REvents&linux.POLLIN == linux.POLLIN { + if events[1].Revents&unix.POLLIN == unix.POLLIN { // eventfd signaled, we're closing. return errClosing } |