module Linux_ext: Linux_ext
module Sysinfo:sig
..end
val sendfile : (?pos:int ->
?len:int -> fd:Unix.File_descr.t -> Unix.File_descr.t -> int)
Or_error.t
sendfile ?pos ?len ~fd sock
sends mmap-able data from file
descriptor fd
to socket sock
using offset pos
and length len
.Unix_error
on Unix-errors.
NOTE: if the returned value is unequal to what was requested (=
the initial size of the data by default), the system call may have
been interrupted by a signal, the source file may have been truncated
during operation, or a timeout occurred on the socket during sending.
It is currently impossible to find out which of the events above
happened. Calling Linux_ext.sendfile
several times on the same descriptor
that only partially accepted data due to a timeout will eventually
lead to the unix error EAGAIN
.
type
tcp_bool_option =
| |
TCP_CORK |
val gettcpopt_bool : (Unix.File_descr.t -> tcp_bool_option -> bool) Or_error.t
gettcpopt_bool sock opt
opt
for socket sock
.val settcpopt_bool : (Unix.File_descr.t -> tcp_bool_option -> bool -> unit)
Or_error.t
settcpopt_bool sock opt v
sets the current value of the boolean
TCP socket option opt
for socket sock
to value v
.val send_nonblocking_no_sigpipe : (Unix.File_descr.t -> ?pos:int -> ?len:int -> string -> int option)
Or_error.t
send_nonblocking_no_sigpipe sock ?pos ?len buf
tries to do a
nonblocking send on socket sock
given buffer buf
, offset pos
and length len
. Prevents SIGPIPE
, i.e. raise a Unix-error
in that case immediately.Invalid_argument
if the designated buffer range is invalid.Unix_error
on Unix-errors.Some bytes_written
or None
if the operation would have blocked.val send_no_sigpipe : (Unix.File_descr.t -> ?pos:int -> ?len:int -> string -> int) Or_error.t
send_no_sigpipe sock ?pos ?len buf
tries to do a
blocking send on socket sock
given buffer buf
, offset pos
and length len
. Prevents SIGPIPE
, i.e. raise a Unix-error in
that case immediately.Invalid_argument
if the designated buffer range is invalid.Unix_error
on Unix-errors.val sendmsg_nonblocking_no_sigpipe : (Unix.File_descr.t ->
?count:int -> string Unix.IOVec.t array -> int option)
Or_error.t
sendmsg_nonblocking_no_sigpipe sock ?count iovecs
tries to do
a nonblocking send on socket sock
using count
I/O-vectors
iovecs
. Prevents SIGPIPE
, i.e. raises a Unix-error in that
case immediately.Invalid_argument
if the designated ranges are invalid.Unix_error
on Unix-errors.Some bytes_written
or None
if the
operation would have blocked.module Clock:sig
..end
val pr_set_pdeathsig : (Signal.t -> unit) Or_error.t
pr_set_pdeathsig s
sets the signal s
to be sent to the executing
process when its parent dies. NOTE: the parent may have died
before or while executing this system call. To make sure that you
do not miss this event, you should call getppid
to get
the parent process id after this system call. If the parent has
died, the returned parent PID will be 1, i.e. the init process will
have adopted the child. You should then either send the signal to
yourself using Unix.kill, or execute an appropriate handler.val pr_get_pdeathsig : (unit -> Signal.t) Or_error.t
pr_get_pdeathsig ()
get the signal that will be sent to the
currently executing process when its parent dies.val pr_set_name_first16 : (string -> unit) Or_error.t
pr_set_name_first16 name
sets the name of the executing thread to name
. Only
the first 16 bytes in name
will be used, the rest is ignored.val pr_get_name : (unit -> string) Or_error.t
pr_get_name ()
gets the name of the executing thread. The name is
at most 16 bytes long.val file_descr_realpath : (Unix.File_descr.t -> string) Or_error.t
file_descr_realpath fd
Unix_error
on errors.fd
.val out_channel_realpath : (Pervasives.out_channel -> string) Or_error.t
out_channel_realpath oc
Unix_error
on errors.oc
.val in_channel_realpath : (Pervasives.in_channel -> string) Or_error.t
in_channel_realpath ic
Unix_error
on errors.ic
.val sched_setaffinity : (?pid:Pid.t -> cpuset:int list -> unit -> unit) Or_error.t
val sched_setaffinity_this_thread : (cpuset:int list -> unit) Or_error.t
val cores : (unit -> int) Or_error.t
cores ()
val get_terminal_size : (unit -> int * int) Or_error.t
get_terminal_size ()
(rows, cols)
, the number of rows and
columns of the terminal.val gettid : (unit -> int) Or_error.t
module Priority:sig
..end
val setpriority : (Priority.t -> unit) Or_error.t
val getpriority : (unit -> Priority.t) Or_error.t
val get_ipv4_address_for_interface : (string -> string) Or_error.t
module Epoll:sig
..end
val bin_tcp_bool_option : tcp_bool_option Bin_prot.Type_class.t
val bin_read_tcp_bool_option : tcp_bool_option Bin_prot.Read_ml.reader
val bin_read_tcp_bool_option_ : tcp_bool_option Bin_prot.Unsafe_read_c.reader
val bin_read_tcp_bool_option__ : (int -> tcp_bool_option) Bin_prot.Unsafe_read_c.reader
val bin_reader_tcp_bool_option : tcp_bool_option Bin_prot.Type_class.reader
val bin_size_tcp_bool_option : tcp_bool_option Bin_prot.Size.sizer
val bin_write_tcp_bool_option : tcp_bool_option Bin_prot.Write_ml.writer
val bin_write_tcp_bool_option_ : tcp_bool_option Bin_prot.Unsafe_write_c.writer
val bin_writer_tcp_bool_option : tcp_bool_option Bin_prot.Type_class.writer
val tcp_bool_option_of_sexp : Sexplib.Sexp.t -> tcp_bool_option
val sexp_of_tcp_bool_option : tcp_bool_option -> Sexplib.Sexp.t