Files
oldlinux-files/study/Ref-docs/POSIX/susv3/functions/aio_suspend.html
2024-02-19 00:25:23 -05:00

161 lines
6.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>aio_suspend</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="aio_suspend"></a> <a name="tag_03_19"></a><!-- aio_suspend -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_03_19_01"></a>NAME</h4>
<blockquote>aio_suspend - wait for an asynchronous I/O request (<b>REALTIME</b>)</blockquote>
<h4><a name="tag_03_19_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<div class="box"><code><tt><sup>[<a href="javascript:open_code('AIO')">AIO</a>]</sup> <img src="../images/opt-start.gif" alt=
"[Option Start]" border="0"> #include &lt;<a href="../basedefs/aio.h.html">aio.h</a>&gt;<br>
<br>
int aio_suspend(const struct aiocb * const</tt> <i>list</i><tt>[], int</tt> <i>nent</i><tt>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const struct timespec *</tt><i>timeout</i><tt>); <img src="../images/opt-end.gif" alt=
"[Option End]" border="0"></tt></code></div>
<tt><br>
</tt></blockquote>
<h4><a name="tag_03_19_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>aio_suspend</i>() function shall suspend the calling thread until at least one of the asynchronous I/O operations
referenced by the <i>list</i> argument has completed, until a signal interrupts the function, or, if <i>timeout</i> is not NULL,
until the time interval specified by <i>timeout</i> has passed. If any of the <b>aiocb</b> structures in the list correspond to
completed asynchronous I/O operations (that is, the error status for the operation is not equal to [EINPROGRESS]) at the time of
the call, the function shall return without suspending the calling thread. The <i>list</i> argument is an array of pointers to
asynchronous I/O control blocks. The <i>nent</i> argument indicates the number of elements in the array. Each <b>aiocb</b>
structure pointed to has been used in initiating an asynchronous I/O request via <a href=
"../functions/aio_read.html"><i>aio_read</i>()</a>, <a href="../functions/aio_write.html"><i>aio_write</i>()</a>, or <a href=
"../functions/lio_listio.html"><i>lio_listio</i>()</a>. This array may contain NULL pointers, which are ignored. If this array
contains pointers that refer to <b>aiocb</b> structures that have not been used in submitting asynchronous I/O, the effect is
undefined.</p>
<p>If the time interval indicated in the <b>timespec</b> structure pointed to by <i>timeout</i> passes before any of the I/O
operations referenced by <i>list</i> are completed, then <i>aio_suspend</i>() shall return with an error. <sup>[<a href=
"javascript:open_code('MON')">MON</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> &nbsp;If the
Monotonic Clock option is supported, the clock that shall be used to measure this time interval shall be the CLOCK_MONOTONIC clock.
<img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
</blockquote>
<h4><a name="tag_03_19_04"></a>RETURN VALUE</h4>
<blockquote>
<p>If the <i>aio_suspend</i>() function returns after one or more asynchronous I/O operations have completed, the function shall
return zero. Otherwise, the function shall return a value of -1 and set <i>errno</i> to indicate the error.</p>
<p>The application may determine which asynchronous I/O completed by scanning the associated error and return status using <a href=
"../functions/aio_error.html"><i>aio_error</i>()</a> and <a href="../functions/aio_return.html"><i>aio_return</i>()</a>,
respectively.</p>
</blockquote>
<h4><a name="tag_03_19_05"></a>ERRORS</h4>
<blockquote>
<p>The <i>aio_suspend</i>() function shall fail if:</p>
<dl compact>
<dt>[EAGAIN]</dt>
<dd>No asynchronous I/O indicated in the list referenced by <i>list</i> completed in the time interval indicated by
<i>timeout</i>.</dd>
<dt>[EINTR]</dt>
<dd>A signal interrupted the <i>aio_suspend</i>() function. Note that, since each asynchronous I/O operation may possibly provoke a
signal when it completes, this error return may be caused by the completion of one (or more) of the very I/O operations being
awaited.</dd>
</dl>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_03_19_06"></a>EXAMPLES</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_19_07"></a>APPLICATION USAGE</h4>
<blockquote>
<p>The <i>aio_suspend</i>() function is part of the Asynchronous Input and Output option and need not be available on all
implementations.</p>
</blockquote>
<h4><a name="tag_03_19_08"></a>RATIONALE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_19_09"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_19_10"></a>SEE ALSO</h4>
<blockquote>
<p><a href="aio_read.html"><i>aio_read</i>()</a> , <a href="aio_write.html"><i>aio_write</i>()</a> , <a href=
"lio_listio.html"><i>lio_listio</i>()</a> , the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/aio.h.html"><i>&lt;aio.h&gt;</i></a></p>
</blockquote>
<h4><a name="tag_03_19_11"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 5. Included for alignment with the POSIX Realtime Extension.</p>
</blockquote>
<h4><a name="tag_03_19_12"></a>Issue 6</h4>
<blockquote>
<p>The [ENOSYS] error condition has been removed as stubs need not be provided if an implementation does not support the
Asynchronous Input and Output option.</p>
<p>The APPLICATION USAGE section is added.</p>
<p>The DESCRIPTION is updated for alignment with IEEE&nbsp;Std&nbsp;1003.1j-2000 by specifying that the CLOCK_MONOTONIC clock, if
supported, is used.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>