Rename archutils to epoll

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-09-22 14:08:41 -07:00
parent 97c3c3847a
commit 478f715836
3 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
// +build linux,!arm64 // +build linux,!arm64
package archutils package epoll
import ( import (
"syscall" "syscall"

View file

@ -1,6 +1,6 @@
// +build linux,arm64 // +build linux,arm64
package archutils package epoll
// #include <sys/epoll.h> // #include <sys/epoll.h>
/* /*

View file

@ -5,7 +5,7 @@ import (
"syscall" "syscall"
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
"github.com/docker/containerd/archutils" "github.com/docker/containerd/epoll"
) )
type Monitorable interface { type Monitorable interface {
@ -19,7 +19,7 @@ type Flusher interface {
// New returns a new process monitor that emits events whenever the // New returns a new process monitor that emits events whenever the
// state of the fd refering to a process changes // state of the fd refering to a process changes
func New() (*Monitor, error) { func New() (*Monitor, error) {
fd, err := archutils.EpollCreate1(0) fd, err := epoll.EpollCreate1(0)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -51,7 +51,7 @@ func (m *Monitor) Add(ma Monitorable) error {
Fd: int32(fd), Fd: int32(fd),
Events: syscall.EPOLLHUP, Events: syscall.EPOLLHUP,
} }
if err := archutils.EpollCtl(m.epollFd, syscall.EPOLL_CTL_ADD, fd, &event); err != nil { if err := epoll.EpollCtl(m.epollFd, syscall.EPOLL_CTL_ADD, fd, &event); err != nil {
return err return err
} }
m.receivers[fd] = ma m.receivers[fd] = ma
@ -79,7 +79,7 @@ func (m *Monitor) Close() error {
func (m *Monitor) Run() { func (m *Monitor) Run() {
var events [128]syscall.EpollEvent var events [128]syscall.EpollEvent
for { for {
n, err := archutils.EpollWait(m.epollFd, events[:], -1) n, err := epoll.EpollWait(m.epollFd, events[:], -1)
if err != nil { if err != nil {
if err == syscall.EINTR { if err == syscall.EINTR {
continue continue