package miou

  1. Overview
  2. Docs

Module Miou_epollSource

A direct binding of epoll(7).

Sourcetype t

An epoll instance.

Sourcemodule Flags : sig ... end
Sourceval invalid_fd : t
Sourceval create : unit -> t
Sourceval close : t -> unit
Sourceval add : t -> Unix.file_descr -> Flags.t -> int

add t fd flags registers fd. Returns 0 on success, otherwise the errno (registering a descriptor that is already there gives EEXIST).

Sourceval upd : t -> Unix.file_descr -> Flags.t -> int

upd t fd flags changes (or re-arms) the events watched for fd. Returns 0 on success, otherwise the errno (typically ENOENT if fd was closed in the meantime, which drops it from the set automatically).

Sourceval del : t -> Unix.file_descr -> int

del t fd stops watching fd.

Sourcetype events

A buffer holding the descriptors reported ready by the last wait.

Sourceval events : int -> events
Sourcetype epoll_timeout =
  1. | Infinite
  2. | No_wait
  3. | Nanoseconds of int64
Sourceval wait : t -> events -> epoll_timeout -> int

wait t events timeout fills events and returns how many descriptors are ready. An interruption by a signal returns 0.

Sourceval iter : events -> int -> (Unix.file_descr -> Flags.t -> unit) -> unit

iter events n fn applies fn to the n descriptors reported ready.