package core_unix

  1. Overview
  2. Docs
On This Page
  1. Expert
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Unix := Core_unix
type ok_or_eof =
  1. | Ok
  2. | Eof
val compare_ok_or_eof : ok_or_eof -> ok_or_eof -> int
val sexp_of_ok_or_eof : ok_or_eof -> Sexplib0.Sexp.t

Iobuf has analogs of various Bigstring functions. These analogs advance by the amount written/read.

val read_assume_fd_is_nonblocking : ([> Core.write ], Iobuf.seek) Iobuf.t -> Unix.File_descr.t -> Unix.Syscall_result.Unit.t
val pread_assume_fd_is_nonblocking : ([> Core.write ], Iobuf.seek) Iobuf.t -> Unix.File_descr.t -> offset:int -> unit
val recvfrom_assume_fd_is_nonblocking : ([> Core.write ], Iobuf.seek) Iobuf.t -> Unix.File_descr.t -> Unix.sockaddr
module Recvmmsg_context : sig ... end

recvmmsg's context comprises data needed by the system call. Setup can be expensive, particularly for many buffers.

val recvmmsg_assume_fd_is_nonblocking : (Unix.File_descr.t -> Recvmmsg_context.t -> Unix.Syscall_result.Int.t) Core.Or_error.t

recvmmsg_assume_fd_is_nonblocking fd context returns the number of context iobufs read into (or errno). fd must not block. THREAD_IO_CUTOFF is ignored.

EINVAL is returned if an Iobuf passed to Recvmmsg_context.create has its buf or limits changed.

val send_nonblocking_no_sigpipe : unit -> (([> Core.read ], Iobuf.seek) Iobuf.t -> Unix.File_descr.t -> Unix.Syscall_result.Unit.t) Core.Or_error.t
val sendto_nonblocking_no_sigpipe : unit -> (([> Core.read ], Iobuf.seek) Iobuf.t -> Unix.File_descr.t -> Unix.sockaddr -> Unix.Syscall_result.Unit.t) Core.Or_error.t
module Peek : sig ... end

Write from the iobuf to the specified channel without changing the iobuf window. Returns the number of bytes written.

val output : ([> Core.read ], Iobuf.seek) Iobuf.t -> Core.Out_channel.t -> unit

As Peek, but advances the window by the number of bytes written.

val write : ([> Core.read ], Iobuf.seek) Iobuf.t -> Unix.File_descr.t -> unit
val write_assume_fd_is_nonblocking : ([> Core.read ], Iobuf.seek) Iobuf.t -> Unix.File_descr.t -> unit
val pwrite_assume_fd_is_nonblocking : ([> Core.read ], Iobuf.seek) Iobuf.t -> Unix.File_descr.t -> offset:int -> unit

Expert

module Expert : sig ... end

The Expert module is for building efficient out-of-module Iobuf abstractions.

OCaml

Innovation. Community. Security.