package epoll

import "github.com/cilium/ebpf/internal/epoll"

Index

Variables

var (
	ErrFlushed = errors.New("data was flushed")
)

Types

type Poller

type Poller struct {
	// contains filtered or unexported fields
}

Poller waits for readiness notifications from multiple file descriptors.

The wait can be interrupted by calling Close.

func New

func New() (_ *Poller, err error)

func (*Poller) Add

func (p *Poller) Add(fd int, id int) error

Add an fd to the poller.

id is returned by Wait in the unix.EpollEvent.Pad field any may be zero. It must not exceed math.MaxInt32.

Add is blocked by Wait.

func (*Poller) Close

func (p *Poller) Close() error

Close the poller.

Interrupts any calls to Wait. Multiple calls to Close are valid, but subsequent calls will return os.ErrClosed.

func (*Poller) Flush

func (p *Poller) Flush() error

Flush unblocks Wait if it's epoll_wait, for purposes of reading pending samples

func (*Poller) Wait

func (p *Poller) Wait(events []unix.EpollEvent, deadline time.Time) (int, error)

Wait for events.

Returns the number of pending events and any errors.

Source Files

poller.go

Version
v0.18.0 (latest)
Published
Apr 2, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
1 week ago

Tools for package owners.