package core
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=8c158c12345d36a5cdd71081728f4317b2b04c09eb4126b6de00c482a6fec2a0
md5=b11f58205953d84cedb0003efcdab231
doc/core.linux_ext/Linux_ext/Eventfd/index.html
Module Linux_ext.Eventfd
module Flags : sig ... end
type t = private Core.Unix.File_descr.t
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
create ?flags init
creates a new event file descriptor with init
as the counter's initial value. With Linux 2.6.26 or earlier, flags
must be empty
.
val read : t -> Core.Int64.t
read t
will block until t
's counter is nonzero, after which its behavior depends on whether t
was created with the Flags.semaphore
flag set. If it was set, then read t
will return 1
and decrement t
's counter. If it was not set, then read t
will return the value of t
's counter and set the counter to 0
. The returned value should be interpreted as an unsigned 64-bit integer.
In the case that t
was created with the Flags.nonblock
flag set, this function will raise a Unix error with the error code EAGAIN
or EWOULDBLOCK
, instead of blocking.
val write : t -> Core.Int64.t -> unit
write t v
will block until t
's counter is less than the max value of a uint64_t
, after which it will increment t
's counter by v
, which will be interpreted as an unsigned 64-bit integer.
In the case that t
was created with the Flags.nonblock
flag set, this function will raise a Unix error with the error code EAGAIN
or EWOULDBLOCK
, instead of blocking.
val to_file_descr : t -> Core.Unix.File_descr.t