### Get Probe Information with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Retrieves probe information for a uring, allowing checks for supported operations. ```ocaml val get_probe : _ t -> probe `val get_probe : _ t -> probe` ``` -------------------------------- ### Stat File Path with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a statx request to get file information. The path is resolved relative to a given file descriptor or the current directory. ```ocaml val statx : 'a t -> ?fd:Unix.file_descr -> mask:Statx.Mask.t -> string -> Statx.t -> Statx.Flags.t -> 'a -> 'a job option `statx t ?fd ~mask path stat flags` stats `path`, which is resolved relative to `fd` (or the current directory if `fd` is not given). ``` -------------------------------- ### Get OCaml-uring SQE Ready Count Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Returns the number of entries in the submission queue ring that are ready to be submitted or have not yet been submitted. This is particularly relevant when using SQPOLL. ```ocaml val sqe_ready : _ t -> int ``` -------------------------------- ### Get OCaml-uring Debug Statistics Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Collects and returns internal metrics about the state of the ouring instance. This function is intended for debugging and performance analysis. ```ocaml val get_debug_stats : _ t -> Stats.t ``` -------------------------------- ### Get OCaml-Uring Queue Depth Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Retrieves the total number of submission slots available for a given Io_uring structure. ```OCaml val queue_depth : 'a t -> int ``` -------------------------------- ### Get OCaml-uring Completion Non-blocking Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Retrieves the next completion entry from the ouring instance without blocking. If no completion is available, it returns `None`. This is useful for polling for results. ```ocaml val get_cqe_nonblocking : 'a t -> 'a completion_option ``` -------------------------------- ### Accept Connection with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a request to accept a new connection on a file descriptor. The new file descriptor is configured with SOCK_CLOEXEC, and the remote address is stored. ```ocaml val accept : 'a t -> Unix.file_descr -> Sockaddr.t -> 'a -> 'a job option `accept t fd addr d` will submit a request to accept a new connection on `fd`. The new FD will be configured with `SOCK_CLOEXEC`. The remote address will be stored in `addr`. ``` -------------------------------- ### OCaml Uring Resolve Flags - Basic Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Resolve/index Demonstrates basic operations for managing OCaml-uring resolve flags, including creating empty sets, converting from integers, and combining flag sets. ```ocaml val empty : t val of_int : int -> t val (+) : t -> t -> t ``` -------------------------------- ### Get File Descriptors from Msghdr in OCaml Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Msghdr/index Retrieves a list of `Unix.file_descr` associated with a given `msghdr` structure. ```ocaml val get_fds : t -> Unix.file_descr list ``` -------------------------------- ### Ocaml-uring Statx Creation Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Introduces the `create` function for the `Uring.Statx` module. This function is used to create a buffer for statx results, which is then passed to the `statx` system call. ```ocaml val create : unit -> t ``` -------------------------------- ### Fsync File with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits an fsync(2) request to synchronize file data and metadata to disk. Supports optional offset and length to specify a subset of the file. ```ocaml val fsync : 'a t -> ?off:int64 -> ?len:int -> Unix.file_descr -> 'a -> 'a job option `fsync t ?off ?len fd d` will submit an `fsync(2)` request, with the optional offset `off` and length `len` specifying the subset of the file to perform the synchronisation on. ``` -------------------------------- ### Connect Socket with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a request to connect a file descriptor to a socket address. ```ocaml val connect : 'a t -> Unix.file_descr -> Unix.sockaddr -> 'a -> 'a job option `connect t fd addr d` will submit a request to connect `fd` to `addr`. ``` -------------------------------- ### Fdatasync File with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits an fdatasync(2) request to synchronize file data to disk. Supports optional offset and length to specify a subset of the file. ```ocaml val fdatasync : 'a t -> ?off:int64 -> ?len:int -> Unix.file_descr -> 'a -> 'a job option `fdatasync t ?off ?len fd d` will submit an `fdatasync(2)` request, with the optional offset `off` and length `len` specifying the subset of the file to perform the synchronisation on. ``` -------------------------------- ### Get OCaml-Uring Fixed Buffer Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Retrieves the fixed internal memory buffer associated with an Io_uring structure. Returns a zero-length buffer if no fixed buffer has been set. ```OCaml val buf : 'a t -> Cstruct.buffer ``` -------------------------------- ### Ocaml-uring Op: Network Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Op/index Defines types for network operations such as `sendmsg`, `recvmsg`, `accept`, `connect`, `send`, `recv`, and `shutdown`. ```ocaml val sendmsg : t ``` ```ocaml val recvmsg : t ``` ```ocaml val accept : t ``` ```ocaml val connect : t ``` ```ocaml val send : t ``` ```ocaml val recv : t ``` ```ocaml val shutdown : t ``` -------------------------------- ### Get Available Chunks in OCaml-Uring Region Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Region/index Returns the number of free memory chunks currently available in the region. This indicates how many more allocations can be made. ```ocaml val avail : t -> int ``` -------------------------------- ### Create OCaml-Uring Instance Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Creates a new Io_uring structure with a specified queue depth. Optionally configures polling mode with a timeout, which requires privileges. The created structure can be used for submitting I/O operations. ```OCaml val create : ?polling_timeout:int -> queue_depth:int -> unit -> 'a t ``` -------------------------------- ### Get Active OCaml-uring Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Returns the count of operations that have been added to the ring but whose completion events have not yet been collected. This metric helps in understanding the current workload. ```ocaml val active_ops : _ t -> int ``` -------------------------------- ### Ocaml-uring Open Flags: Creat Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Open_flags/index The `creat` flag specifies that if the target pathname does not exist, it should be created as a regular file. This is a common flag for file creation during open operations. ```ocaml val creat : t ``` -------------------------------- ### Initialize OCaml-Uring Region Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Region/index Initializes a memory region for OCaml-Uring operations. It takes a block size, a buffer, and the number of slots to create the region. ```ocaml val init : block_size:int -> Cstruct.buffer -> int -> t ``` -------------------------------- ### Get Chunk Length in OCaml-Uring Region Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Region/index Retrieves the block size (length) of a given memory chunk. This is useful for understanding the size of the allocated memory segment. ```ocaml val length : chunk -> int ``` -------------------------------- ### Read from File Descriptor with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a read(2) request to a uring. Reads bytes from a file descriptor at a specific offset and writes to a memory buffer. The user data is returned upon completion. ```ocaml val read : ?len:int -> 'a t -> file_offset:offset -> Unix.file_descr -> off:int -> 'a -> 'a job option `read t ~file_offset fd ~off ~len d` will submit a `read(2)` request to uring `t`. It reads up to `len` bytes from absolute `file_offset` on the `fd` file descriptor and writes the results into the fixed memory buffer associated with uring `t` at offset `off`. The user data `d` will be returned by `wait` or `peek` upon completion. ``` -------------------------------- ### Statx Flags: Force Sync Behavior in OCaml Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/Flags/index Explains the `statx_force_sync` flag, which compels synchronization with the server, particularly relevant for network-backed filesystems. ```ocaml val statx_force_sync : t (* statx_force_sync forces synchronisation with the server, if the filesystem is a network-backed one. *) ``` -------------------------------- ### Ocaml-uring Statx Kind Formatting Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `pp_kind` to format the `kind` type into a human-readable string. This is useful for displaying file types in a user-friendly manner. ```ocaml val pp_kind : kind Fmt.t ``` -------------------------------- ### Ocaml-uring openat2 Function Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Opens a file path with specified access modes, flags, permissions, and path resolution options. It supports resolving paths relative to a given file descriptor. The function returns a job that completes with the opened file descriptor. ```ocaml val openat2 : 'a t -> access:[ `R | `W | `RW ] -> flags:Open_flags.t -> perm:Unix.file_perm -> resolve:Resolve.t -> ?fd:Unix.file_descr -> string -> 'a -> 'a job option ``` -------------------------------- ### Ocaml-uring Op: File System Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Op/index Defines types for various file system operations such as `fsync`, `files_update`, `statx`, `fadvise`, `madvise`, `openat`, `close`, `openat2`, `fallocate`, `renameat`, `unlinkat`, `mkdirat`, `symlinkat`, `linkat`, and `fsetxattr`, `setxattr`, `fgetxattr`, `getxattr`. ```ocaml val fsync : t ``` ```ocaml val files_update : t ``` ```ocaml val statx : t ``` ```ocaml val fadvise : t ``` ```ocaml val madvise : t ``` ```ocaml val openat : t ``` ```ocaml val close : t ``` ```ocaml val openat2 : t ``` ```ocaml val fallocate : t ``` ```ocaml val renameat : t ``` ```ocaml val unlinkat : t ``` ```ocaml val mkdirat : t ``` ```ocaml val symlinkat : t ``` ```ocaml val linkat : t ``` ```ocaml val fsetxattr : t ``` ```ocaml val setxattr : t ``` ```ocaml val fgetxattr : t ``` ```ocaml val getxattr : t ``` -------------------------------- ### OCaml-uring Private.Heap: create function Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Private/Heap/index The `create n` function initializes a new heap that can hold at most `n` elements. This function is essential for setting up the heap data structure. ```ocaml val create : int -> _ t ``` -------------------------------- ### Send Message with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a sendmsg(2) request. Constructs the Msghdr from file descriptors, address, and buffers. Requires the number of buffers to be within the iov_max limit. ```ocaml val send_msg : ?fds:Unix.file_descr list -> ?dst:Unix.sockaddr -> 'a t -> Unix.file_descr -> Cstruct.t list -> 'a -> 'a job option `send_msg t fd buffs d` will submit a `sendmsg(2)` request. The `Msghdr` will be constructed from the FDs (`fds`), address (`dst`) and buffers (`buffs`). Requires `List.length buffs <= Uring.iov_max` * parameter dst Destination address. * parameter fds Extra file descriptors to attach to the message. ``` -------------------------------- ### Ocaml-uring Open Flags: Excl Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Open_flags/index The `excl` flag, used with `creat`, ensures that the file is created exclusively by the `openat2` call. If the file already exists, the operation fails with `Unix.EEXIST`. It can also be used with block devices to fail if they are already mounted (`Unix.EBUSY`). ```ocaml val excl : t ``` -------------------------------- ### Write to File Descriptor with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a write(2) request to a uring. Writes bytes from a memory buffer to a file descriptor at a specific offset. The user data is returned upon completion. ```ocaml val write_fixed : 'a t -> file_offset:offset -> Unix.file_descr -> off:int -> len:int -> 'a -> 'a job option `write t ~file_offset fd off d` will submit a `write(2)` request to uring `t`. It writes up to `len` bytes into absolute `file_offset` on the `fd` file descriptor from the fixed memory buffer associated with uring `t` at offset `off`. The user data `d` will be returned by `wait` or `peek` upon completion. ``` -------------------------------- ### Ocaml-uring Op: Miscellaneous Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Op/index Defines types for various other operations like `sync_file_range`, `timeout_remove`, `async_cancel`, `splice`, `tee`, `provide_buffers`, `remove_buffers`, `uring_cmd`, `msg_ring`, `epoll_ctl`, and `socket`. ```ocaml val sync_file_range : t ``` ```ocaml val timeout_remove : t ``` ```ocaml val async_cancel : t ``` ```ocaml val splice : t ``` ```ocaml val tee : t ``` ```ocaml val provide_buffers : t ``` ```ocaml val remove_buffers : t ``` ```ocaml val uring_cmd : t ``` ```ocaml val msg_ring : t ``` ```ocaml val epoll_ctl : t ``` ```ocaml val socket : t ``` -------------------------------- ### Ocaml-uring linkat Function Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Creates a new hard link to an existing file. It allows specifying paths relative to different directory file descriptors and provides flags to control the linking behavior. If the target path already exists, it is not overwritten. ```ocaml val linkat : 'a t -> ?old_dir_fd:Unix.file_descr -> ?new_dir_fd:Unix.file_descr -> flags:Linkat_flags.t -> old_path:string -> new_path:string -> 'a -> 'a job option ``` -------------------------------- ### Ocaml-uring Timeout Function Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a timeout request to the io_uring interface. It allows specifying a clock source (Boottime or Realtime) and a timeout duration in nanoseconds. The `absolute` flag determines how the clock and nanosecond values relate. ```ocaml type clock = | Boottime | Realtime val timeout : ?absolute:bool -> 'a t -> clock -> int64 -> 'a -> 'a job option ``` -------------------------------- ### Submit OCaml-uring Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits all outstanding queued requests on an ouring instance to the kernel. Results can be retrieved using `wait` or `peek`. This function is fundamental for initiating asynchronous operations. ```ocaml val submit : 'a t -> int ``` -------------------------------- ### Statx Flags: Sync As Stat Behavior in OCaml Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/Flags/index Describes the `statx_sync_as_stat` flag, which defines the filesystem-specific behavior when responding to `stat` calls. ```ocaml val statx_sync_as_stat : t (* statx_sync_as_stat is the filesystem-specific behaviour in response to stat calls. *) ``` -------------------------------- ### OCaml Uring Resolve Flags - InRoot Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Resolve/index Details the `in_root` flag for OCaml-uring resolve, which treats a specified directory as the root for path resolution. ```ocaml val in_root : t ``` -------------------------------- ### Receive Message with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a recvmsg(2) request. If successful, the Msghdr will contain the sender address and received data. ```ocaml val recv_msg : 'a t -> Unix.file_descr -> Msghdr.t -> 'a -> 'a job option `recv_msg t fd msghdr d` will submit a `recvmsg(2)` request. If the request is successful then the `msghdr` will contain the sender address and the data received. ``` -------------------------------- ### Check Operation Support with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Checks if a specific operation is supported by the kernel using probe information. ```ocaml val op_supported : probe -> Op.t -> bool `val op_supported : probe -> Op.t -> bool` ``` -------------------------------- ### Submit No-Operation to OCaml-Uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a no-operation (noop) operation to the specified Io_uring structure. The provided user data `d` will be returned upon completion. Returns None if the submission fails due to a full ring. ```OCaml val noop : 'a t -> 'a -> 'a job option ``` -------------------------------- ### Ocaml-uring Open Flags: Path Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Open_flags/index The `path` flag obtains a file descriptor that can only be used to indicate a location in the filesystem tree or perform fd-level operations. The file itself is not opened, and I/O operations will fail. It's primarily used with `cloexec`, `directory`, and `nofollow`. ```ocaml val path : t ``` -------------------------------- ### Close File Descriptor with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Submits a request to close a file descriptor. ```ocaml val close : 'a t -> Unix.file_descr -> 'a -> 'a job option ``` -------------------------------- ### OCaml Uring Resolve Flags - Beneath Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Resolve/index Explains the `beneath` flag for OCaml-uring resolve, which restricts path resolution to descendants of a specified directory. ```ocaml val beneath : t ``` -------------------------------- ### Register Eventfd with OCaml-uring Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Registers an eventfd with the ouring instance. This allows the eventfd to be used for signaling completion events. Refer to the io_uring_register_eventfd documentation for details. ```ocaml val register_eventfd : 'a t -> Unix.file_descr -> unit ``` -------------------------------- ### Ocaml-uring Statx Block Size Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `blksize` to retrieve the block size of the filesystem for a given statx result. This is typically returned as a 64-bit integer. ```ocaml val blksize : t -> Stdlib.Int64.t ``` -------------------------------- ### Create Msghdr in OCaml Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Msghdr/index Creates a new `msghdr` structure using provided buffers for `iovec`. It supports optional remote address and the number of file descriptors to reserve for receiving data. Requires the number of buffers to be less than or equal to `Uring.iov_max`. ```ocaml val create : ?n_fds:int -> ?addr:Sockaddr.t -> Cstruct.t list -> t ``` -------------------------------- ### Ocaml-uring Op: Timer Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Op/index Defines types for timer operations, including `timeout` to set a timeout and `link_timeout` to link a timeout to another operation. ```ocaml val timeout : t ``` ```ocaml val link_timeout : t ``` -------------------------------- ### Ocaml-uring Statx Kind Enumeration Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Defines the `kind` type for the `Uring.Statx` module, enumerating different types of file system objects such as regular files, directories, symbolic links, and more. This type is used to represent the type of a file or directory retrieved via the statx system call. ```ocaml type kind = [ | `Unknown | `Fifo | `Character_special | `Directory | `Block_device | `Regular_file | `Symbolic_link | `Socket ] ``` -------------------------------- ### Ocaml-uring Statx Access Time (Seconds) Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `atime_sec` to retrieve the seconds part of the last access time of the file from a statx result. This is returned as a 64-bit integer. ```ocaml val atime_sec : t -> int64 ``` -------------------------------- ### Ocaml-uring Open Flags: Sync Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Open_flags/index The `sync` flag ensures that write operations on the file complete according to the requirements of synchronized I/O file integrity completion. This guarantees that all data and metadata are written to stable storage. ```ocaml val sync : t ``` -------------------------------- ### Exit OCaml-Uring Instance Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Shuts down an Io_uring structure. Any subsequent requests to this structure will fail. Raises Invalid_argument if there are any operations still in progress. ```OCaml val exit : 'a t -> unit ``` -------------------------------- ### Ocaml-uring Statx Direct I/O Offset Alignment Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `dio_offset_align` to retrieve the offset alignment requirement for Direct I/O operations from a statx result. This is returned as a 64-bit integer. Refer to `Mask.dioalign` for more details. ```ocaml val dio_offset_align : t -> Stdlib.Int64.t ``` -------------------------------- ### Ocaml-uring Statx Birth Time (Seconds) Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `btime_sec` to retrieve the seconds part of the birth time (creation time) of the file from a statx result. This is returned as a 64-bit integer. ```ocaml val btime_sec : t -> int64 ``` -------------------------------- ### Ocaml-uring writev Function Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Performs a scatter-gather write operation on a file descriptor. It writes data from a list of buffers to a specified absolute file offset. The number of buffers is limited by `Uring.iov_max`. The operation is submitted to io_uring. ```ocaml val writev : 'a t -> file_offset:offset -> Unix.file_descr -> Cstruct.t list -> 'a -> 'a job option ``` -------------------------------- ### Wait for OCaml-uring Completions Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Blocks until an outstanding event completes on the ouring instance, or until a specified timeout occurs. It automatically calls `submit` and returns the result or `None` if no completion occurred. The result includes user data and the syscall result. ```ocaml val wait : ?timeout:float -> 'a t -> 'a completion_option ``` -------------------------------- ### Ocaml-uring write Function Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Performs a write operation on a file descriptor. It writes data from a provided buffer to a specified absolute file offset. The operation is submitted to the io_uring interface and returns user data upon completion. ```ocaml val write : 'a t -> file_offset:offset -> Unix.file_descr -> Cstruct.t -> 'a -> 'a job option ``` -------------------------------- ### Ocaml-uring Statx Direct I/O Memory Alignment Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `dio_mem_align` to retrieve the memory alignment requirement for Direct I/O operations from a statx result. This is returned as a 64-bit integer. Refer to `Mask.dioalign` for more details. ```ocaml val dio_mem_align : t -> Stdlib.Int64.t ``` -------------------------------- ### Statx Flags: Empty Path Behavior in OCaml Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/Flags/index Documents the `empty_path` flag for the `statx` system call. When set, it specifies that if the pathname is empty, the operation should apply to the file referred to by the `fd`. If `fd` is not provided, it defaults to the current working directory. ```ocaml val empty_path : t (* empty_path signals that if the pathname is an empty string then operate on the file referred to by the `fd` (which can refer to any type of file). If `fd` is not specified then the call operates on the current working directory. *) ``` -------------------------------- ### Ocaml-uring Op: Write Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Op/index Defines types for write operations, including `writev` for scatter-gather writes and `write_fixed` for fixed-size buffer writes. ```ocaml val writev : t ``` ```ocaml val write_fixed : t ``` ```ocaml val write : t ``` -------------------------------- ### Ocaml-uring Op: Read Operations Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Op/index Defines types for read operations, including `readv` for scatter-gather reads and `read_fixed` for fixed-size buffer reads. ```ocaml val readv : t ``` ```ocaml val read_fixed : t ``` ```ocaml val read : t ``` -------------------------------- ### Ocaml-uring Statx Number of Links Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `nlink` to retrieve the number of hard links to the file from a statx result. This value is returned as a 64-bit integer. ```ocaml val nlink : t -> Stdlib.Int64.t ``` -------------------------------- ### Ocaml-uring read Function Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Performs a read operation on a file descriptor. It reads data from a specified absolute file offset into a provided buffer. The operation is submitted to the io_uring interface and returns user data upon completion. ```ocaml type offset := Optint.Int63.t val read : 'a t -> file_offset:offset -> Unix.file_descr -> Cstruct.t -> 'a -> 'a job option ``` -------------------------------- ### Ocaml-uring Open Flags: Nofollow Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Open_flags/index The `nofollow` flag causes the open operation to fail with `Unix.ELOOP` if the basename of the path is a symbolic link. This prevents following symbolic links during path resolution. ```ocaml val nofollow : t ``` -------------------------------- ### OCaml Uring Resolve Flags - Cached Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Resolve/index Describes the `cached` flag for OCaml-uring resolve, which makes the open operation fail if path components are not in the kernel lookup cache. ```ocaml val cached : t ``` -------------------------------- ### Ocaml-uring readv Function Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/index Performs a scatter-gather read operation on a file descriptor. It reads data from a specified absolute file offset into a list of buffers. The number of buffers is limited by `Uring.iov_max`. The operation is submitted to io_uring. ```ocaml val readv : 'a t -> file_offset:offset -> Unix.file_descr -> Cstruct.t list -> 'a -> 'a job option ``` -------------------------------- ### Ocaml-uring Open Flags: Direct I/O Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Open_flags/index The `direct` flag bypasses the kernel's buffer cache, performing I/O directly between userspace buffers and the storage device. This can improve performance for certain workloads but requires careful management. ```ocaml val direct : t ``` -------------------------------- ### Ocaml-uring Statx.Attr Flags Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/Attr/index Defines the `t` type for file attribute flags and provides basic operations like union and membership testing. ```ocaml module Statx : sig module Attr : sig include FLAGS type t = private int val empty : t val of_int : int -> t val (+) : t -> t -> t val mem : t -> t -> bool val compressed : t val immutable : t val append : t val nodump : t val encrypted : t val verity : t val dax : t val check : ?mask:Stdlib.Int64.t -> Stdlib.Int64.t -> t -> bool end end ``` -------------------------------- ### Ocaml-uring Statx Device ID (dev) Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `dev` to retrieve the device ID of the filesystem containing the file from a statx result. This is returned as a 64-bit integer. ```ocaml val dev : t -> Stdlib.Int64.t ``` -------------------------------- ### OCaml Uring Resolve Flags - NoSymlinks Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Resolve/index Explains the `no_symlinks` flag for OCaml-uring resolve, which disallows the resolution of all symbolic links and implies `no_magiclinks`. ```ocaml val no_symlinks : t ``` -------------------------------- ### OCaml Uring Resolve Flags - NoXdev Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Resolve/index Details the `no_xdev` flag for OCaml-uring resolve, which prevents traversal across different mount points during path resolution. ```ocaml val no_xdev : t ``` -------------------------------- ### Convert OCaml-Uring Chunk to Bigarray Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Region/index Creates a zero-copy view of a memory chunk as a Bigarray. Similar to `to_cstruct`, this provides direct memory access but necessitates careful lifecycle management of the chunk and the Bigarray. ```ocaml val to_bigstring : ?len:int -> chunk -> Cstruct.buffer ``` -------------------------------- ### Ocaml-uring Statx File Size Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `size` to retrieve the total size of the file in bytes from a statx result. The size is returned as a 64-bit integer. ```ocaml val size : t -> Stdlib.Int64.t ``` -------------------------------- ### Ocaml-uring Statx Attributes Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `attributes` to retrieve the file attributes from a statx result. The attributes are returned as a 64-bit integer. ```ocaml val attributes : t -> Stdlib.Int64.t ``` -------------------------------- ### Ocaml-uring Open Flags: Cloexec Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Open_flags/index The `cloexec` flag enables the close-on-exec flag for the newly created file descriptor. This means the file descriptor will be automatically closed when an execve system call is made. ```ocaml val cloexec : t ``` -------------------------------- ### Ocaml-uring Open Flags: Directory Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Open_flags/index The `directory` flag ensures that the open operation only succeeds if the target path refers to a directory. If the target is not a directory, the operation will fail. ```ocaml val directory : t ``` -------------------------------- ### Ocaml-uring Statx Access Time (Nanoseconds) Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `atime_nsec` to retrieve the nanoseconds part of the last access time of the file from a statx result. This is returned as an integer. ```ocaml val atime_nsec : t -> int ``` -------------------------------- ### Ocaml-uring Statx Birth Time (Nanoseconds) Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Statx/index Provides a function `btime_nsec` to retrieve the nanoseconds part of the birth time (creation time) of the file from a statx result. This is returned as an integer. ```ocaml val btime_nsec : t -> int ``` -------------------------------- ### Convert OCaml-Uring Chunk to String Source: https://ocaml-multicore.github.io/ocaml-uring/uring/Uring/Region/index Returns a copy of a memory chunk as an OCaml string. This operation involves copying the memory content. ```ocaml val to_string : ?len:int -> chunk -> string ```