package polly

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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

type t = private Unix.file_descr
type flags
val create : int -> flags -> t

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

val close : t -> unit
val cloexec : flags

close on exec

val nonblock : flags

non blocking

val semaphore : flags

semaphore semantics, see man eventfd(2)

val empty : flags

no flags

val 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.

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

to_string flags return a string representation of flags for debugging

val 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.

val add : t -> int64 -> unit

Add the given value in the eventfd

OCaml

Innovation. Community. Security.