1996-04-29 06:25:10 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
1996-04-29 06:25:10 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
2001-12-07 05:41:02 -08:00
|
|
|
(* under the terms of the GNU Library General Public License, with *)
|
|
|
|
(* the special exception on linking described in file ../../LICENSE. *)
|
1996-04-29 06:25:10 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
2001-10-29 12:07:20 -08:00
|
|
|
(** Thread-compatible system calls.
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2001-10-29 12:07:20 -08:00
|
|
|
@deprecated The functionality of this module has been merged back into
|
|
|
|
the {!Unix} module. Threaded programs can now call the functions
|
|
|
|
from module {!Unix} directly, and still get the correct behavior
|
2001-06-25 01:04:00 -07:00
|
|
|
(block the calling thread, if required, but do not block all threads
|
|
|
|
in the process). *)
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2001-12-28 15:14:14 -08:00
|
|
|
(** {6 Process handling} *)
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2001-09-06 01:52:32 -07:00
|
|
|
val execv : string -> string array -> unit
|
|
|
|
val execve : string -> string array -> string array -> unit
|
|
|
|
val execvp : string -> string array -> unit
|
1996-04-29 06:25:10 -07:00
|
|
|
val wait : unit -> int * Unix.process_status
|
2001-09-06 01:52:32 -07:00
|
|
|
val waitpid : Unix.wait_flag list -> int -> int * Unix.process_status
|
1996-04-29 06:25:10 -07:00
|
|
|
val system : string -> Unix.process_status
|
|
|
|
|
2001-12-28 15:14:14 -08:00
|
|
|
(** {6 Basic input/output} *)
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2014-04-29 04:56:17 -07:00
|
|
|
val read : Unix.file_descr -> bytes -> int -> int -> int
|
|
|
|
val write : Unix.file_descr -> bytes -> int -> int -> int
|
|
|
|
val single_write : Unix.file_descr -> bytes -> int -> int -> int
|
|
|
|
val write_substring : Unix.file_descr -> string -> int -> int -> int
|
|
|
|
val single_write_substring : Unix.file_descr -> string -> int -> int -> int
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2001-12-28 15:14:14 -08:00
|
|
|
(** {6 Input/output with timeout} *)
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2014-04-29 04:56:17 -07:00
|
|
|
val timed_read : Unix.file_descr -> bytes -> int -> int -> float -> int
|
2001-10-29 12:07:20 -08:00
|
|
|
(** See {!ThreadUnix.timed_write}. *)
|
2001-12-04 08:16:05 -08:00
|
|
|
|
2014-04-29 04:56:17 -07:00
|
|
|
val timed_write : Unix.file_descr -> bytes -> int -> int -> float -> int
|
2001-10-29 12:07:20 -08:00
|
|
|
(** Behave as {!ThreadUnix.read} and {!ThreadUnix.write}, except that
|
|
|
|
[Unix_error(ETIMEDOUT,_,_)] is raised if no data is
|
|
|
|
available for reading or ready for writing after [d] seconds.
|
|
|
|
The delay [d] is given in the fifth argument, in seconds. *)
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2014-04-29 04:56:17 -07:00
|
|
|
val timed_write_substring :
|
|
|
|
Unix.file_descr -> string -> int -> int -> float -> int
|
|
|
|
(** See {!ThreadUnix.timed_write}. *)
|
|
|
|
|
2001-12-28 15:14:14 -08:00
|
|
|
(** {6 Polling} *)
|
1997-04-11 06:57:34 -07:00
|
|
|
|
|
|
|
val select :
|
2001-12-04 08:16:05 -08:00
|
|
|
Unix.file_descr list -> Unix.file_descr list -> Unix.file_descr list ->
|
|
|
|
float ->
|
|
|
|
Unix.file_descr list * Unix.file_descr list * Unix.file_descr list
|
1997-04-11 06:57:34 -07:00
|
|
|
|
2001-12-28 15:14:14 -08:00
|
|
|
(** {6 Pipes and redirections} *)
|
1996-04-29 06:25:10 -07:00
|
|
|
|
|
|
|
val pipe : unit -> Unix.file_descr * Unix.file_descr
|
2001-12-04 08:16:05 -08:00
|
|
|
val open_process_in : string -> in_channel
|
|
|
|
val open_process_out : string -> out_channel
|
|
|
|
val open_process : string -> in_channel * out_channel
|
|
|
|
val open_process_full :
|
|
|
|
string -> string array -> in_channel * out_channel * in_channel
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2001-12-28 15:14:14 -08:00
|
|
|
(** {6 Time} *)
|
1996-04-29 06:25:10 -07:00
|
|
|
|
|
|
|
val sleep : int -> unit
|
|
|
|
|
2001-12-28 15:14:14 -08:00
|
|
|
(** {6 Sockets} *)
|
1996-04-29 06:25:10 -07:00
|
|
|
|
2001-12-04 08:16:05 -08:00
|
|
|
val socket : Unix.socket_domain -> Unix.socket_type -> int -> Unix.file_descr
|
|
|
|
val socketpair :
|
|
|
|
Unix.socket_domain -> Unix.socket_type -> int ->
|
|
|
|
Unix.file_descr * Unix.file_descr
|
1996-04-29 06:25:10 -07:00
|
|
|
val accept : Unix.file_descr -> Unix.file_descr * Unix.sockaddr
|
2001-09-06 01:52:32 -07:00
|
|
|
val connect : Unix.file_descr -> Unix.sockaddr -> unit
|
2001-12-04 08:16:05 -08:00
|
|
|
val recv :
|
2014-04-29 04:56:17 -07:00
|
|
|
Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list -> int
|
2001-12-04 08:16:05 -08:00
|
|
|
val recvfrom :
|
2014-04-29 04:56:17 -07:00
|
|
|
Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list ->
|
2001-12-04 08:16:05 -08:00
|
|
|
int * Unix.sockaddr
|
|
|
|
val send :
|
2014-04-29 04:56:17 -07:00
|
|
|
Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list -> int
|
|
|
|
val send_substring :
|
2001-12-04 08:16:05 -08:00
|
|
|
Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> int
|
|
|
|
val sendto :
|
2014-04-29 04:56:17 -07:00
|
|
|
Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list ->
|
|
|
|
Unix.sockaddr -> int
|
|
|
|
val sendto_substring :
|
2001-12-04 08:16:05 -08:00
|
|
|
Unix.file_descr -> string -> int -> int -> Unix.msg_flag list ->
|
|
|
|
Unix.sockaddr -> int
|
1996-04-29 06:25:10 -07:00
|
|
|
val open_connection : Unix.sockaddr -> in_channel * out_channel
|
|
|
|
val establish_server :
|
2001-12-04 08:16:05 -08:00
|
|
|
(in_channel -> out_channel -> unit) -> Unix.sockaddr -> unit
|