gvisorgvisor.dev/gvisor/pkg/fdnotifier Index | Files

package fdnotifier

import "gvisor.dev/gvisor/pkg/fdnotifier"

Package fdnotifier contains an adapter that translates IO events (e.g., a file became readable/writable) from native FDs to the notifications in the waiter package. It uses epoll in edge-triggered mode to receive notifications for registered FDs.

Index

Functions

func AddFD

func AddFD(fd int32, queue *waiter.Queue) error

AddFD adds an FD to the list of observed FDs.

func HasFD

func HasFD(fd int32) bool

HasFD returns true if the FD is in the list of observed FDs.

This should only be used by tests to assert that FDs are correctly registered.

func NonBlockingPoll

func NonBlockingPoll(fd int32, mask waiter.EventMask) waiter.EventMask

NonBlockingPoll polls the given FD in non-blocking fashion. It is used just to query the FD's current state.

func RemoveFD

func RemoveFD(fd int32)

RemoveFD removes an FD from the list of observed FDs.

func UpdateFD

func UpdateFD(fd int32) error

UpdateFD updates the set of events the fd needs to be notified on.

Source Files

fdnotifier.go poll_unsafe.go

Version
v0.0.0-20250605235530-a6711d1e1dc6 (latest)
Published
Jun 5, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
4 hours ago

Tools for package owners.