1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 (** Thread-compatible system calls.
17
18 @deprecated The functionality of this module has been merged back into
19 the {!Unix} module. Threaded programs can now call the functions
20 from module {!Unix} directly, and still get the correct behavior
21 (block the calling thread, if required, but do not block all threads
22 in the process). *)
23
24 (** {1 Process handling} *)
25
26 val execv : string -> string array -> unit
27 val execve : string -> string array -> string array -> unit
28 val execvp : string -> string array -> unit
29 val wait : unit -> int * Unix.process_status
30 val waitpid : Unix.wait_flag list -> int -> int * Unix.process_status
31 val system : string -> Unix.process_status
32
33 (** {1 Basic input/output} *)
34
35 val read : Unix.file_descr -> bytes -> int -> int -> int
36 val write : Unix.file_descr -> bytes -> int -> int -> int
37 val write_substring : Unix.file_descr -> string -> int -> int -> int
38
39 (** {1 Input/output with timeout} *)
40
41 val timed_read :
42 Unix.file_descr ->
43 bytes -> int -> int -> float -> int
44 (** See {!ThreadUnix.timed_write}. *)
45
46 val timed_write :
47 Unix.file_descr ->
48 bytes -> int -> int -> float -> int
49 (** Behave as {!ThreadUnix.read} and {!ThreadUnix.write}, except that
50 [Unix_error(ETIMEDOUT,_,_)] is raised if no data is
51 available for reading or ready for writing after [d] seconds.
52 The delay [d] is given in the fifth argument, in seconds. *)
53
54 val timed_write_substring :
55 Unix.file_descr -> string -> int -> int -> float -> int
56 (** See {!ThreadUnix.timed_write}. *)
57
58 (** {1 Polling} *)
59
60 val select :
61 Unix.file_descr list -> Unix.file_descr list ->
62 Unix.file_descr list -> float ->
63 Unix.file_descr list * Unix.file_descr list * Unix.file_descr list
64
65 (** {1 Pipes and redirections} *)
66
67 val pipe : ?cloexec:bool -> unit -> Unix.file_descr * Unix.file_descr
68 val open_process_in: string -> in_channel
69 val open_process_out: string -> out_channel
70 val open_process: string -> in_channel * out_channel
71
72 (** {1 Time} *)
73
74 val sleep : int -> unit
75
76 (** {1 Sockets} *)
77
78 val socket :
79 ?cloexec:bool -> Unix.socket_domain -> Unix.socket_type -> int ->
80 Unix.file_descr
81 val accept :
82 ?cloexec:bool -> Unix.file_descr -> Unix.file_descr * Unix.sockaddr
83 val connect : Unix.file_descr -> Unix.sockaddr -> unit
84 val recv : Unix.file_descr -> bytes ->
85 int -> int -> Unix.msg_flag list -> int
86 val recvfrom : Unix.file_descr -> bytes -> int -> int ->
87 Unix.msg_flag list -> int * Unix.sockaddr
88 val send : Unix.file_descr -> bytes -> int -> int ->
89 Unix.msg_flag list -> int
90 val send_substring : Unix.file_descr -> string -> int -> int ->
91 Unix.msg_flag list -> int
92 val sendto : Unix.file_descr -> bytes -> int -> int ->
93 Unix.msg_flag list -> Unix.sockaddr -> int
94 val sendto_substring : Unix.file_descr -> string -> int -> int ->
95 Unix.msg_flag list -> Unix.sockaddr -> int
96 val open_connection : Unix.sockaddr -> in_channel * out_channel
97