package polly

  1. Overview
  2. Docs

Module Polly.EventFDSource

This module provides an interface to the eventfd(2) system call

Sourcetype t = private Unix.file_descr
Sourcetype flags
Sourceval create : int -> flags -> t

create initval flags creates an evenfd with the given initial value and flags. See man evenfd(2).

Sourceval close : t -> unit
Sourceval cloexec : flags

close on exec

Sourceval nonblock : flags

non blocking

Sourceval semaphore : flags

semaphore semantics, see man eventfd(2)

Sourceval empty : flags

no flags

Sourceval test : flags -> flags -> bool

test x y returns true, if and only if the intersection of the two sets is not empty. The common case is test set x where set is unknown and x is a singleton to check that x is contained in set.

Sourceval (lor) : flags -> flags -> flags
Sourceval (land) : flags -> flags -> flags
Sourceval lnot : flags -> flags
Sourceval to_string : flags -> string

to_string flags return a string representation of flags for debugging

Sourceval read : t -> int64

Read the vaue of the eventfd. Block if it is zero (or trigger EAGAIN) and if non zero, reset to 0 if it is not a semaphore otherwise it decrements by 1.

Sourceval add : t -> int64 -> unit

Add the given value in the eventfd