Rename archutils to epoll
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
97c3c3847a
commit
478f715836
3 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
// +build linux,!arm64
|
||||
|
||||
package archutils
|
||||
package epoll
|
||||
|
||||
import (
|
||||
"syscall"
|
|
@ -1,6 +1,6 @@
|
|||
// +build linux,arm64
|
||||
|
||||
package archutils
|
||||
package epoll
|
||||
|
||||
// #include <sys/epoll.h>
|
||||
/*
|
|
@ -5,7 +5,7 @@ import (
|
|||
"syscall"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/containerd/archutils"
|
||||
"github.com/docker/containerd/epoll"
|
||||
)
|
||||
|
||||
type Monitorable interface {
|
||||
|
@ -19,7 +19,7 @@ type Flusher interface {
|
|||
// New returns a new process monitor that emits events whenever the
|
||||
// state of the fd refering to a process changes
|
||||
func New() (*Monitor, error) {
|
||||
fd, err := archutils.EpollCreate1(0)
|
||||
fd, err := epoll.EpollCreate1(0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ func (m *Monitor) Add(ma Monitorable) error {
|
|||
Fd: int32(fd),
|
||||
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
|
||||
}
|
||||
m.receivers[fd] = ma
|
||||
|
@ -79,7 +79,7 @@ func (m *Monitor) Close() error {
|
|||
func (m *Monitor) Run() {
|
||||
var events [128]syscall.EpollEvent
|
||||
for {
|
||||
n, err := archutils.EpollWait(m.epollFd, events[:], -1)
|
||||
n, err := epoll.EpollWait(m.epollFd, events[:], -1)
|
||||
if err != nil {
|
||||
if err == syscall.EINTR {
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue