module Linux_ext:Interface to Linux-specific system callssig
..end
type
sysinfo = {
|
uptime : |
(* | time since boot | *) |
|
load1 : |
(* | load average over the last minute | *) |
|
load5 : |
(* | load average over the last 5 minutes | *) |
|
load15 : |
(* | load average over the last 15 minutes | *) |
|
total_ram : |
(* | total usable main memory | *) |
|
free_ram : |
(* | available memory size | *) |
|
shared_ram : |
(* | amount of shared memory | *) |
|
buffer_ram : |
(* | memory used by buffers | *) |
|
total_swap : |
(* | total swap page size | *) |
|
free_swap : |
(* | available swap space | *) |
|
procs : |
(* | number of current processes | *) |
|
totalhigh : |
(* | Total high memory size | *) |
|
freehigh : |
(* | Available high memory size | *) |
|
mem_unit : |
val bin_size_sysinfo : sysinfo Bin_prot.Size.sizer
val bin_write_sysinfo : sysinfo Bin_prot.Write_ml.writer
val bin_write_sysinfo_ : sysinfo Bin_prot.Unsafe_write_c.writer
val bin_writer_sysinfo : sysinfo Bin_prot.Type_class.writer
val bin_read_sysinfo : sysinfo Bin_prot.Read_ml.reader
val bin_read_sysinfo_ : sysinfo Bin_prot.Unsafe_read_c.reader
val bin_read_sysinfo__ : (int -> sysinfo) Bin_prot.Unsafe_read_c.reader
val bin_reader_sysinfo : sysinfo Bin_prot.Type_class.reader
val bin_sysinfo : sysinfo Bin_prot.Type_class.t
val sexp_of_sysinfo : sysinfo -> Sexplib.Sexp.t
val sysinfo_of_sexp : Sexplib.Sexp.t -> sysinfo
val sysinfo : unit -> sysinfo
val sendfile : ?pos:int -> ?len:int -> fd:Unix.file_descr -> Unix.file_descr -> int
sendfile ?pos ?len ~fd sock
sends mmap-able data from file
descriptor fd
to socket sock
using offset pos
and length len
.
Raises Unix_error
on Unix-errors.
Returns the number of characters actually written.
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 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 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_tcp_bool_option : tcp_bool_option Bin_prot.Type_class.t
val sexp_of_tcp_bool_option : tcp_bool_option -> Sexplib.Sexp.t
val tcp_bool_option_of_sexp : Sexplib.Sexp.t -> tcp_bool_option
val gettcpopt_bool : Unix.file_descr -> tcp_bool_option -> bool
gettcpopt_bool sock opt
opt
for socket sock
.val settcpopt_bool : Unix.file_descr -> tcp_bool_option -> bool -> unit
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 -> ?pos:int -> ?len:int -> string -> int option
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.pos
: default = 0len
: default = String.length buf - pos
val send_no_sigpipe : Unix.file_descr -> ?pos:int -> ?len:int -> string -> int
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.pos
: default = 0len
: default = String.length buf - pos
val sendmsg_nonblocking_no_sigpipe : Unix.file_descr -> ?count:int -> string Unix_ext.IOVec.t array -> int option
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.val clock_process_cputime_id : Unix_ext.Clock.t
val clock_thread_cputime_id : Unix_ext.Clock.t
clock_thread_cputime_id
the clock measuring the CPU-time of a thread.val get_terminal_size : unit -> int * int
get_terminal_size ()
Returns (rows, cols)
, the number of rows and
columns of the terminal.
val pr_set_pdeathsig : Signal.t -> unit
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 Unix.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
pr_get_pdeathsig ()
get the signal that will be sent to the
currently executing process when its parent dies.val file_descr_realpath : Unix.file_descr -> string
file_descr_realpath fd
Raises Unix_error
on errors.
Returns the canonicalized absolute
pathname of the file associated with file descriptor fd
.
val out_channel_realpath : Pervasives.out_channel -> string
out_channel_realpath oc
Unix_error
on errors.oc
.val in_channel_realpath : Pervasives.in_channel -> string