1ThreadUnix(3) OCaml library ThreadUnix(3)
2
3
4
6 ThreadUnix - Thread-compatible system calls.
7
9 Module ThreadUnix
10
12 Module ThreadUnix
13 : sig end
14
15
16 Deprecated. The functionality of this module has been merged back into
17 the Unix module. Threaded programs can now call the functions from
18 module Unix directly, and still get the correct behavior (block the
19 calling thread, if required, but do not block all threads in the
20 process).
21
22
23 Thread-compatible system calls.
24
25
26
27
28
29
30
31 Process handling
32 val execv : string -> string array -> unit
33
34
35
36
37 val execve : string -> string array -> string array -> unit
38
39
40
41
42 val execvp : string -> string array -> unit
43
44
45
46
47 val wait : unit -> int * Unix.process_status
48
49
50
51
52 val waitpid : Unix.wait_flag list -> int -> int * Unix.process_status
53
54
55
56
57 val system : string -> Unix.process_status
58
59
60
61
62
63 Basic input/output
64 val read : Unix.file_descr -> bytes -> int -> int -> int
65
66
67
68
69 val write : Unix.file_descr -> bytes -> int -> int -> int
70
71
72
73
74 val write_substring : Unix.file_descr -> string -> int -> int -> int
75
76
77
78
79
80 Input/output with timeout
81 val timed_read : Unix.file_descr -> bytes -> int -> int -> float -> int
82
83 See ThreadUnix.timed_write .
84
85
86
87 val timed_write : Unix.file_descr -> bytes -> int -> int -> float ->
88 int
89
90 Behave as ThreadUnix.read and ThreadUnix.write , except that Unix_er‐
91 ror(ETIMEDOUT,_,_) is raised if no data is available for reading or
92 ready for writing after d seconds. The delay d is given in the fifth
93 argument, in seconds.
94
95
96
97 val timed_write_substring : Unix.file_descr -> string -> int -> int ->
98 float -> int
99
100 See ThreadUnix.timed_write .
101
102
103
104
105 Polling
106 val select : Unix.file_descr list -> Unix.file_descr list ->
107 Unix.file_descr list -> float -> Unix.file_descr list * Unix.file_descr
108 list * Unix.file_descr list
109
110
111
112
113
114 Pipes and redirections
115 val pipe : ?cloexec:bool -> unit -> Unix.file_descr * Unix.file_descr
116
117
118
119
120 val open_process_in : string -> in_channel
121
122
123
124
125 val open_process_out : string -> out_channel
126
127
128
129
130 val open_process : string -> in_channel * out_channel
131
132
133
134
135
136 Time
137 val sleep : int -> unit
138
139
140
141
142
143 Sockets
144 val socket : ?cloexec:bool -> Unix.socket_domain -> Unix.socket_type ->
145 int -> Unix.file_descr
146
147
148
149
150 val accept : ?cloexec:bool -> Unix.file_descr -> Unix.file_descr *
151 Unix.sockaddr
152
153
154
155
156 val connect : Unix.file_descr -> Unix.sockaddr -> unit
157
158
159
160
161 val recv : Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list
162 -> int
163
164
165
166
167 val recvfrom : Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag
168 list -> int * Unix.sockaddr
169
170
171
172
173 val send : Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list
174 -> int
175
176
177
178
179 val send_substring : Unix.file_descr -> string -> int -> int ->
180 Unix.msg_flag list -> int
181
182
183
184
185 val sendto : Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag
186 list -> Unix.sockaddr -> int
187
188
189
190
191 val sendto_substring : Unix.file_descr -> string -> int -> int ->
192 Unix.msg_flag list -> Unix.sockaddr -> int
193
194
195
196
197 val open_connection : Unix.sockaddr -> in_channel * out_channel
198
199
200
201
202
203
204OCamldoc 2022-02-04 ThreadUnix(3)