module Lwt_unix:Modulesig..end
Lwt_unix: thread-compatible system callstype descr =
| |
Plain of |
| |
Encrypted of |
val sleep : float -> unit Lwt.tsleep d is a threads which remain suspended for d seconds
(letting other threads run) and then terminates.val yield : unit -> unit Lwt.tyield () is a threads which suspends itself (letting other
thread run) and then resumes as soon as possible and
terminates.val run : 'a Lwt.t -> 'arun t lets the thread t run until it terminates. It
evaluates to the return value of t, or raise the exception
associated to t if t fails.
You should avoid using run inside threads:
run
returns.run are serialized: an
invocation of run will not terminate before all
subsequent invocations are terminated.Unix counterparts, but let other
threads run while waiting for the completion of the system call.
PITFALL
If you want to read or write from stdin, stdout or stderr using
this library, you must first turn them into non-blocking mode
using Unix.set_nonblock.
val read : descr -> string -> int -> int -> int Lwt.tval write : descr -> string -> int -> int -> int Lwt.tval pipe : unit -> (descr * descr) Lwt.tval socket : Unix.socket_domain -> Unix.socket_type -> int -> Unix.file_descr Lwt.tval socketpair : Unix.socket_domain ->
Unix.socket_type -> int -> (Unix.file_descr * Unix.file_descr) Lwt.tval shutdown : descr -> Unix.shutdown_command -> unitval accept : descr -> (descr * Unix.sockaddr) Lwt.tval connect : descr -> Unix.sockaddr -> unit Lwt.tval wait : unit -> (int * Unix.process_status) Lwt.tval waitpid : Unix.wait_flag list -> int -> (int * Unix.process_status) Lwt.tval system : string -> Unix.process_status Lwt.ttype lwt_in_channel
type lwt_out_channel
val input_value : lwt_in_channel -> 'a Lwt.tval input_char : lwt_in_channel -> char Lwt.tval input_line : lwt_in_channel -> string Lwt.tval input_binary_int : lwt_in_channel -> int Lwt.tval input : lwt_in_channel -> string -> int -> int -> int Lwt.tval really_input : lwt_in_channel -> string -> int -> int -> unit Lwt.tval output_binary_int : lwt_out_channel -> int -> unit Lwt.tval output_value : lwt_out_channel -> 'a -> unit Lwt.tval output_string : lwt_out_channel -> string -> unit Lwt.tval flush : lwt_out_channel -> unit Lwt.tval open_process_in : string -> lwt_in_channel Lwt.tval open_process_out : string -> lwt_out_channel Lwt.tval open_process : string -> (lwt_in_channel * lwt_out_channel) Lwt.tval open_process_full : string ->
string array ->
(lwt_in_channel * lwt_out_channel * lwt_in_channel)
Lwt.tval close_process_in : lwt_in_channel -> Unix.process_status Lwt.tval close_process_out : lwt_out_channel -> Unix.process_status Lwt.tval close_process : lwt_in_channel * lwt_out_channel ->
Unix.process_status Lwt.tval close_process_full : lwt_in_channel * lwt_out_channel * lwt_in_channel ->
Unix.process_status Lwt.tval in_channel_of_descr : descr -> lwt_in_channelval out_channel_of_descr : descr -> lwt_out_channelval in_channel_of_unixdescr : Unix.file_descr -> lwt_in_channelval out_channel_of_unixdescr : Unix.file_descr -> lwt_out_channelval set_close_on_exec : descr -> unit