diff options
author | Haibo Xu <haibo.xu@arm.com> | 2019-07-30 10:59:57 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-07-30 11:01:29 -0700 |
commit | 1decf764718f66097ce5bbfe2cd14a883a4ef713 (patch) | |
tree | c248d286343a2b52f34667322ef3197261c48fc5 /pkg/tcpip/link/rawfile/blockingpoll_unsafe.go | |
parent | 8da9f8a12c51de41c4e048128a163fbb63679e4b (diff) |
Change syscall.POLL to syscall.PPOLL.
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gvisor/pull/543 from xiaobo55x:master ba598263fd3748d1addd48e4194080aa12085164
PiperOrigin-RevId: 260752049
Diffstat (limited to 'pkg/tcpip/link/rawfile/blockingpoll_unsafe.go')
-rw-r--r-- | pkg/tcpip/link/rawfile/blockingpoll_unsafe.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/tcpip/link/rawfile/blockingpoll_unsafe.go b/pkg/tcpip/link/rawfile/blockingpoll_unsafe.go index 4eab77c74..84dc0e918 100644 --- a/pkg/tcpip/link/rawfile/blockingpoll_unsafe.go +++ b/pkg/tcpip/link/rawfile/blockingpoll_unsafe.go @@ -21,9 +21,11 @@ import ( "unsafe" ) -// BlockingPoll is just a stub function that forwards to the poll() system call +// BlockingPoll is just a stub function that forwards to the ppoll() system call // on non-amd64 platforms. -func BlockingPoll(fds *PollEvent, nfds int, timeout int64) (int, syscall.Errno) { - n, _, e := syscall.Syscall(syscall.SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) +func BlockingPoll(fds *PollEvent, nfds int, timeout *syscall.Timespec) (int, syscall.Errno) { + n, _, e := syscall.Syscall6(syscall.SYS_PPOLL, uintptr(unsafe.Pointer(fds)), + uintptr(nfds), uintptr(unsafe.Pointer(timeout)), 0, 0, 0) + return int(n), e } |