Module Eio_posix.Low_levelSource
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:
- They suspend the calling fiber instead of returning
EAGAINor similar. - They handle
EINTRby automatically restarting the call. - They wrap
Unix.file_descrinFd, to avoid use-after-close bugs. - They attach new FDs to switches, to avoid resource leaks.
type fd := Eio_unix.Fd.tSource
type dir_fd = | Fd of Eio_posix.Low_level.fd(*Confined to
*)fd.| Cwd(*Confined to "."
*)| Fs(*Unconfined "."; also allows absolute paths
*)
Source
val socket :
sw:Eio.Std.Switch.t ->
Unix.socket_domain ->
Unix.socket_type ->
int ->
Eio_posix.Low_level.fdSource
val accept :
sw:Eio.Std.Switch.t ->
Eio_posix.Low_level.fd ->
Eio_posix.Low_level.fd * Unix.sockaddrSource
val recv_msg_with_fds :
sw:Eio.Std.Switch.t ->
max_fds:int ->
Eio_posix.Low_level.fd ->
Cstruct.t array ->
Unix.sockaddr * int * Eio_posix.Low_level.fd listSource
val send_msg :
Eio_posix.Low_level.fd ->
?fds:Eio_posix.Low_level.fd list ->
?dst:Unix.sockaddr ->
Cstruct.t array ->
intSource
val lseek :
Eio_posix.Low_level.fd ->
Optint.Int63.t ->
[ `Set | `Cur | `End ] ->
Optint.Int63.tSource
val fstatat :
buf:Eio_posix.Low_level.stat ->
follow:bool ->
Eio_posix.Low_level.dir_fd ->
string ->
unitSource
val rename :
Eio_posix.Low_level.dir_fd ->
string ->
Eio_posix.Low_level.dir_fd ->
string ->
unitsymlink ~link_to dir path will create a new symlink at dir / path linking to link_to.
Source
val openat :
sw:Eio.Std.Switch.t ->
mode:int ->
Eio_posix.Low_level.dir_fd ->
string ->
Eio_posix.Low_level.Open_flags.t ->
Eio_posix.Low_level.fdNote: the returned FD is always non-blocking and close-on-exec.