eventfd

package
v0.0.0-...-ba09d25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2021 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Overview

Package eventfd provides an implementation of Linux's file-based event notification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, initVal uint64, semMode bool) *fs.File

New creates a new event object with the supplied initial value and mode.

Types

type EventOperations

type EventOperations struct {
	fsutil.FileNoopRelease          `state:"nosave"`
	fsutil.FilePipeSeek             `state:"nosave"`
	fsutil.FileNotDirReaddir        `state:"nosave"`
	fsutil.FileNoFsync              `state:"nosave"`
	fsutil.FileNoIoctl              `state:"nosave"`
	fsutil.FileNoMMap               `state:"nosave"`
	fsutil.FileNoSplice             `state:"nosave"`
	fsutil.FileNoopFlush            `state:"nosave"`
	fsutil.FileUseInodeUnstableAttr `state:"nosave"`
	// contains filtered or unexported fields
}

EventOperations represents an event with the semantics of Linux's file-based event notification (eventfd). Eventfds are usually internal to the Sentry but in certain situations they may be converted into a host-backed eventfd.

+stateify savable

func (*EventOperations) EventRegister

func (e *EventOperations) EventRegister(entry *waiter.Entry) error

EventRegister implements waiter.Waitable.EventRegister.

func (*EventOperations) EventUnregister

func (e *EventOperations) EventUnregister(entry *waiter.Entry)

EventUnregister implements waiter.Waitable.EventUnregister.

func (*EventOperations) HostFD

func (e *EventOperations) HostFD() (int, error)

HostFD returns the host eventfd associated with this event.

func (*EventOperations) Read

func (e *EventOperations) Read(ctx context.Context, _ *fs.File, dst usermem.IOSequence, _ int64) (int64, error)

Read implements fs.FileOperations.Read.

func (*EventOperations) Readiness

func (e *EventOperations) Readiness(mask waiter.EventMask) waiter.EventMask

Readiness returns the ready events for the event fd.

func (*EventOperations) Release

func (e *EventOperations) Release(context.Context)

Release implements fs.FileOperations.Release.

func (*EventOperations) Signal

func (e *EventOperations) Signal(val uint64) error

Signal is an internal function to signal the event fd.

func (*EventOperations) Write

func (e *EventOperations) Write(ctx context.Context, _ *fs.File, src usermem.IOSequence, _ int64) (int64, error)

Write implements fs.FileOperations.Write.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL