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.ttype dir_fd = | Fd of fdConfined to fd.
| CwdConfined to "."
*)| FsUnconfined "."; also allows absolute paths
*)val await_readable : string -> fd -> unitval await_writable : string -> fd -> 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 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 read_link : dir_fd -> string -> stringval mkdir : mode:int -> dir_fd -> string -> unitval unlink : dir:bool -> dir_fd -> string -> unitval symlink : link_to:string -> dir_fd -> string -> unitsymlink ~link_to dir path will create a new symlink at dir / path linking to link_to.
val readdir : dir_fd -> string -> string arrayval readv : fd -> Cstruct.t array -> intval writev : fd -> Cstruct.t array -> intval 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 :
sw:Eio.Std.Switch.t ->
mode:int ->
dir_fd ->
string ->
Open_flags.t ->
fdNote: the returned FD is always non-blocking and close-on-exec.
module Process : sig ... end