man-pages/man3/ThreadUnix.3o.html
2021-03-31 01:06:50 +01:00

430 lines
5.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of ThreadUnix</TITLE>
</HEAD><BODY>
<H1>ThreadUnix</H1>
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
ThreadUnix - Thread-compatible system calls.
<A NAME="lbAC">&nbsp;</A>
<H2>Module</H2>
Module ThreadUnix
<A NAME="lbAD">&nbsp;</A>
<H2>Documentation</H2>
<P>
Module
<B>ThreadUnix</B>
<BR>&nbsp;:&nbsp;
<B>sig end</B>
<P>
<P>
<B>Deprecated.</B>
The functionality of this module has been merged back into
the
<B>Unix</B>
module. Threaded programs can now call the functions
from module
<B>Unix</B>
directly, and still get the correct behavior
(block the calling thread, if required, but do not block all threads
in the process).
<P>
<P>
Thread-compatible system calls.
<P>
<P>
<P>
<P>
<P>
<P>
<P>
<A NAME="lbAE">&nbsp;</A>
<H3>Process handling</H3>
<P>
<P>
<P>
<I>val execv </I>
:
<B>string -&gt; string array -&gt; unit</B>
<P>
<P>
<P>
<P>
<I>val execve </I>
:
<B>string -&gt; string array -&gt; string array -&gt; unit</B>
<P>
<P>
<P>
<P>
<I>val execvp </I>
:
<B>string -&gt; string array -&gt; unit</B>
<P>
<P>
<P>
<P>
<I>val wait </I>
:
<B>unit -&gt; int * Unix.process_status</B>
<P>
<P>
<P>
<P>
<I>val waitpid </I>
:
<B>Unix.wait_flag list -&gt; int -&gt; int * Unix.process_status</B>
<P>
<P>
<P>
<P>
<I>val system </I>
:
<B>string -&gt; Unix.process_status</B>
<P>
<P>
<P>
<P>
<P>
<A NAME="lbAF">&nbsp;</A>
<H3>Basic input/output</H3>
<P>
<P>
<P>
<I>val read </I>
:
<B>Unix.file_descr -&gt; bytes -&gt; int -&gt; int -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val write </I>
:
<B>Unix.file_descr -&gt; bytes -&gt; int -&gt; int -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val write_substring </I>
:
<B>Unix.file_descr -&gt; string -&gt; int -&gt; int -&gt; int</B>
<P>
<P>
<P>
<P>
<P>
<A NAME="lbAG">&nbsp;</A>
<H3>Input/output with timeout</H3>
<P>
<P>
<P>
<I>val timed_read </I>
:
<B>Unix.file_descr -&gt; bytes -&gt; int -&gt; int -&gt; float -&gt; int</B>
<P>
See
<B>ThreadUnix.timed_write</B>
.
<P>
<P>
<P>
<I>val timed_write </I>
:
<B>Unix.file_descr -&gt; bytes -&gt; int -&gt; int -&gt; float -&gt; int</B>
<P>
Behave as
<B>ThreadUnix.read</B>
and
<B>ThreadUnix.write</B>
, except that
<B>Unix_error(ETIMEDOUT,_,_)</B>
is raised if no data is
available for reading or ready for writing after
<B>d</B>
seconds.
The delay
<B>d</B>
is given in the fifth argument, in seconds.
<P>
<P>
<P>
<I>val timed_write_substring </I>
:
<B>Unix.file_descr -&gt; string -&gt; int -&gt; int -&gt; float -&gt; int</B>
<P>
See
<B>ThreadUnix.timed_write</B>
.
<P>
<P>
<P>
<P>
<A NAME="lbAH">&nbsp;</A>
<H3>Polling</H3>
<P>
<P>
<P>
<I>val select </I>
:
<B>Unix.file_descr list -&gt;</B>
<B>Unix.file_descr list -&gt;</B>
<B>Unix.file_descr list -&gt;</B>
<B>float -&gt; Unix.file_descr list * Unix.file_descr list * Unix.file_descr list</B>
<P>
<P>
<P>
<P>
<P>
<A NAME="lbAI">&nbsp;</A>
<H3>Pipes and redirections</H3>
<P>
<P>
<P>
<I>val pipe </I>
:
<B>?cloexec:bool -&gt; unit -&gt; Unix.file_descr * Unix.file_descr</B>
<P>
<P>
<P>
<P>
<I>val open_process_in </I>
:
<B>string -&gt; in_channel</B>
<P>
<P>
<P>
<P>
<I>val open_process_out </I>
:
<B>string -&gt; out_channel</B>
<P>
<P>
<P>
<P>
<I>val open_process </I>
:
<B>string -&gt; in_channel * out_channel</B>
<P>
<P>
<P>
<P>
<P>
<A NAME="lbAJ">&nbsp;</A>
<H3>Time</H3>
<P>
<P>
<P>
<I>val sleep </I>
:
<B>int -&gt; unit</B>
<P>
<P>
<P>
<P>
<P>
<A NAME="lbAK">&nbsp;</A>
<H3>Sockets</H3>
<P>
<P>
<P>
<I>val socket </I>
:
<B>?cloexec:bool -&gt;</B>
<B>Unix.socket_domain -&gt; Unix.socket_type -&gt; int -&gt; Unix.file_descr</B>
<P>
<P>
<P>
<P>
<I>val accept </I>
:
<B>?cloexec:bool -&gt; Unix.file_descr -&gt; Unix.file_descr * Unix.sockaddr</B>
<P>
<P>
<P>
<P>
<I>val connect </I>
:
<B>Unix.file_descr -&gt; Unix.sockaddr -&gt; unit</B>
<P>
<P>
<P>
<P>
<I>val recv </I>
:
<B>Unix.file_descr -&gt; bytes -&gt; int -&gt; int -&gt; Unix.msg_flag list -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val recvfrom </I>
:
<B>Unix.file_descr -&gt;</B>
<B>bytes -&gt; int -&gt; int -&gt; Unix.msg_flag list -&gt; int * Unix.sockaddr</B>
<P>
<P>
<P>
<P>
<I>val send </I>
:
<B>Unix.file_descr -&gt; bytes -&gt; int -&gt; int -&gt; Unix.msg_flag list -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val send_substring </I>
:
<B>Unix.file_descr -&gt; string -&gt; int -&gt; int -&gt; Unix.msg_flag list -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val sendto </I>
:
<B>Unix.file_descr -&gt;</B>
<B>bytes -&gt; int -&gt; int -&gt; Unix.msg_flag list -&gt; Unix.sockaddr -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val sendto_substring </I>
:
<B>Unix.file_descr -&gt;</B>
<B>string -&gt; int -&gt; int -&gt; Unix.msg_flag list -&gt; Unix.sockaddr -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val open_connection </I>
:
<B>Unix.sockaddr -&gt; in_channel * out_channel</B>
<P>
<P>
<P>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">Module</A><DD>
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
<DL>
<DT id="4"><A HREF="#lbAE">Process handling</A><DD>
<DT id="5"><A HREF="#lbAF">Basic input/output</A><DD>
<DT id="6"><A HREF="#lbAG">Input/output with timeout</A><DD>
<DT id="7"><A HREF="#lbAH">Polling</A><DD>
<DT id="8"><A HREF="#lbAI">Pipes and redirections</A><DD>
<DT id="9"><A HREF="#lbAJ">Time</A><DD>
<DT id="10"><A HREF="#lbAK">Sockets</A><DD>
</DL>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:58 GMT, March 31, 2021
</BODY>
</HTML>