package eio_posix
-
eio_posix
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
module Fd : sig ... end
val await_readable : fd -> unit
val await_writable : fd -> unit
val sleep_until : Mtime.t -> 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 recv_msg : fd -> Cstruct.t array -> Unix.sockaddr * int
val send_msg : fd -> ?dst:Unix.sockaddr -> Cstruct.t array -> int
val getrandom : Cstruct.t -> unit
val fstat : fd -> Unix.LargeFile.stats
val lstat : string -> Unix.LargeFile.stats
val mkdir : ?dirfd:fd -> mode:int -> string -> unit
val unlink : ?dirfd:fd -> dir:bool -> string -> unit
val preadv : file_offset:Optint.Int63.t -> fd -> Cstruct.t array -> int
val pwritev : file_offset:Optint.Int63.t -> fd -> Cstruct.t array -> int
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