diff options
Diffstat (limited to 'pkg/fdnotifier/fdnotifier.go')
-rw-r--r-- | pkg/fdnotifier/fdnotifier.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/pkg/fdnotifier/fdnotifier.go b/pkg/fdnotifier/fdnotifier.go index a6b63c982..1290d5d10 100644 --- a/pkg/fdnotifier/fdnotifier.go +++ b/pkg/fdnotifier/fdnotifier.go @@ -22,7 +22,6 @@ package fdnotifier import ( "fmt" - "syscall" "golang.org/x/sys/unix" "gvisor.dev/gvisor/pkg/sync" @@ -51,7 +50,7 @@ type notifier struct { // newNotifier creates a new notifier object. func newNotifier() (*notifier, error) { - epfd, err := syscall.EpollCreate1(0) + epfd, err := unix.EpollCreate1(0) if err != nil { return nil, err } @@ -72,22 +71,22 @@ func (n *notifier) waitFD(fd int32, fi *fdInfo, mask waiter.EventMask) error { return nil } - e := syscall.EpollEvent{ + e := unix.EpollEvent{ Events: mask.ToLinux() | unix.EPOLLET, Fd: fd, } switch { case !fi.waiting && mask != 0: - if err := syscall.EpollCtl(n.epFD, syscall.EPOLL_CTL_ADD, int(fd), &e); err != nil { + if err := unix.EpollCtl(n.epFD, unix.EPOLL_CTL_ADD, int(fd), &e); err != nil { return err } fi.waiting = true case fi.waiting && mask == 0: - syscall.EpollCtl(n.epFD, syscall.EPOLL_CTL_DEL, int(fd), nil) + unix.EpollCtl(n.epFD, unix.EPOLL_CTL_DEL, int(fd), nil) fi.waiting = false case fi.waiting && mask != 0: - if err := syscall.EpollCtl(n.epFD, syscall.EPOLL_CTL_MOD, int(fd), &e); err != nil { + if err := unix.EpollCtl(n.epFD, unix.EPOLL_CTL_MOD, int(fd), &e); err != nil { return err } } @@ -144,10 +143,10 @@ func (n *notifier) hasFD(fd int32) bool { // notifications from the epoll object. Once notifications arrive, they are // dispatched to the registered queue. func (n *notifier) waitAndNotify() error { - e := make([]syscall.EpollEvent, 100) + e := make([]unix.EpollEvent, 100) for { v, err := epollWait(n.epFD, e, -1) - if err == syscall.EINTR { + if err == unix.EINTR { continue } |