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.module Fd : sig ... end
A safe wrapper for Unix.file_descr
.
val await_readable : Fd.t -> unit
val await_writable : Fd.t -> unit
val sleep_until : Mtime.t -> unit
val read : Fd.t -> bytes -> int -> int -> int
val write : Fd.t -> bytes -> int -> int -> int
val socket :
sw:Eio.Std.Switch.t ->
Unix.socket_domain ->
Unix.socket_type ->
int ->
Fd.t
val connect : Fd.t -> Unix.sockaddr -> unit
val accept : sw:Eio.Std.Switch.t -> Fd.t -> Fd.t * Unix.sockaddr
val shutdown : Fd.t -> Unix.shutdown_command -> unit
val recv_msg : Fd.t -> bytes -> int * Unix.sockaddr
val send_msg : Fd.t -> dst:Unix.sockaddr -> bytes -> int
val getrandom : Cstruct.t -> unit
val fstat : Fd.t -> Unix.LargeFile.stats
val lstat : string -> Unix.LargeFile.stats
val mkdir : ?dirfd:Fd.t -> mode:int -> string -> unit
val unlink : ?dirfd:Fd.t -> dir:bool -> string -> unit
val preadv : file_offset:Optint.Int63.t -> Fd.t -> Cstruct.t array -> int
val pwritev : file_offset:Optint.Int63.t -> Fd.t -> Cstruct.t array -> int
val pipe : sw:Eio.Std.Switch.t -> Fd.t * Fd.t
module Open_flags : sig ... end
val openat :
?dirfd:Fd.t ->
sw:Eio.Std.Switch.t ->
mode:int ->
string ->
Open_flags.t ->
Fd.t
Note: the returned FD is always non-blocking and close-on-exec.
module Process : sig ... end