Eio_posix.Low_levelLow-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.tval await_readable : string -> fd -> unitval await_writable : string -> fd -> unitval sleep_until : Mtime.t -> unitval read : fd -> bytes -> int -> int -> intval write : fd -> bytes -> int -> int -> intval socket :
sw:Eio.Std.Switch.t ->
Unix.socket_domain ->
Unix.socket_type ->
int ->
fdval connect : fd -> Unix.sockaddr -> unitval accept : sw:Eio.Std.Switch.t -> fd -> fd * Unix.sockaddrval shutdown : fd -> Unix.shutdown_command -> unitval recv_msg : fd -> Cstruct.t array -> Unix.sockaddr * intval recv_msg_with_fds :
sw:Eio.Std.Switch.t ->
max_fds:int ->
fd ->
Cstruct.t array ->
Unix.sockaddr * int * fd listval send_msg :
fd ->
?fds:fd list ->
?dst:Unix.sockaddr ->
Cstruct.t array ->
intval getrandom : Cstruct.t -> unitval lseek : fd -> Optint.Int63.t -> [ `Set | `Cur | `End ] -> Optint.Int63.tval fsync : fd -> unitval ftruncate : fd -> Optint.Int63.t -> unitval create_stat : unit -> statval blksize : stat -> int64val nlink : stat -> int64val uid : stat -> int64val gid : stat -> int64val ino : stat -> int64val size : stat -> int64val rdev : stat -> int64val dev : stat -> int64val perm : stat -> intval mode : stat -> intval kind : stat -> Eio.File.Stat.kindval atime_sec : stat -> int64val ctime_sec : stat -> int64val mtime_sec : stat -> int64val atime_nsec : stat -> intval ctime_nsec : stat -> intval mtime_nsec : stat -> intval mkdir : ?dirfd:fd -> mode:int -> string -> unitval unlink : ?dirfd:fd -> dir:bool -> string -> unitval preadv : file_offset:Optint.Int63.t -> fd -> Cstruct.t array -> intval pwritev : file_offset:Optint.Int63.t -> fd -> Cstruct.t array -> intval pipe : sw:Eio.Std.Switch.t -> fd * fdmodule Open_flags : sig ... endval openat :
?dirfd:fd ->
sw:Eio.Std.Switch.t ->
mode:int ->
string ->
Open_flags.t ->
fdNote: the returned FD is always non-blocking and close-on-exec.
module Process : sig ... end