Source

ocaml_epoll / epoll.mli

camlspotter 74b8ba1 




























type t = Unix.file_descr

type flags

type flag = 
  | IN
  | PRI
  | OUT
  | RDNORM
  | RDBAND
  | WRNORM
  | WRBAND
  | MSG
  | ERR
  | HUP
  | RDHUP
  | ONESHOT
  | ET 

external make_flags : flag array -> flags = "caml_to_c_epoll_event_flags"
external get_flags  : flags -> flag list  = "c_to_caml_epoll_event_flags"

external create  : int -> t = "caml_epoll_create"
val close : t -> unit

external ctl_add : t -> Unix.file_descr -> flags -> unit = "caml_epoll_ctl_add"
external ctl_mod : t -> Unix.file_descr -> flags -> unit = "caml_epoll_ctl_mod"
external ctl_del : t -> Unix.file_descr -> unit          = "caml_epoll_ctl_del"

external wait : t -> maxevents:int -> timeout:int -> (Unix.file_descr * flags) array = "caml_epoll_wait"