Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Low-level API for making POSIX calls directly.
This module provides an effects-based API for calling POSIX functions.
Normally it's better to use the cross-platform Eio
APIs instead, which uses these functions automatically where appropriate.
These functions mostly copy the POSIX APIs directly, except that:
EAGAIN
or similar.EINTR
by automatically restarting the call.Unix.file_descr
in Fd
, to avoid use-after-close bugs.type fd := Eio_unix.Fd.t
val await_readable : fd -> unit
val await_writable : fd -> unit
val read : fd -> bytes -> int -> int -> int
val write : fd -> bytes -> int -> int -> int
val socket :
sw:Eio.Std.Switch.t ->
Unix.socket_domain ->
Unix.socket_type ->
int ->
fd
val connect : fd -> Unix.sockaddr -> unit
val accept : sw:Eio.Std.Switch.t -> fd -> fd * Unix.sockaddr
val shutdown : fd -> Unix.shutdown_command -> unit
val getrandom : Cstruct.t -> unit
val fstat : fd -> Unix.LargeFile.stats
val mkdir : ?dirfd:fd -> mode:int -> string -> unit
val unlink : ?dirfd:fd -> dir:bool -> string -> unit
val pipe : sw:Eio.Std.Switch.t -> fd * fd
module Open_flags : sig ... end
val openat :
?dirfd:fd ->
sw:Eio.Std.Switch.t ->
mode:int ->
string ->
Open_flags.t ->
fd
Note: the returned FD is always non-blocking and close-on-exec.
module Process : sig ... end