175 lines
5.3 KiB
HTML
175 lines
5.3 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><poll.h></title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="<poll.h>"></a> <a name="tag_13_35"></a><!-- <poll.h> -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_13_35_01"></a>NAME</h4>
|
|
|
|
<blockquote>poll.h - definitions for the poll() function</blockquote>
|
|
|
|
<h4><a name="tag_13_35_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> #include <poll.h> <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></div>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_35_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i><poll.h></i> header shall define the <b>pollfd</b> structure that includes at least the following members:</p>
|
|
|
|
<pre>
|
|
<tt>int fd </tt> The following descriptor being polled. <tt>
|
|
short events </tt> The input event flags (see below). <tt>
|
|
short revents </tt> The output event flags (see below). <tt>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The <i><poll.h></i> header shall define the following type through <b>typedef</b>:</p>
|
|
|
|
<dl compact>
|
|
<dt><b>nfds_t</b></dt>
|
|
|
|
<dd>An unsigned integer type used for the number of file descriptors.</dd>
|
|
</dl>
|
|
|
|
<p>The implementation shall support one or more programming environments in which the width of <b>nfds_t</b> is no greater than the
|
|
width of type <b>long</b>. The names of these programming environments can be obtained using the <a href=
|
|
"../functions/confstr.html"><i>confstr</i>()</a> function or the <a href="../utilities/getconf.html"><i>getconf</i></a>
|
|
utility.</p>
|
|
|
|
<p>The following symbolic constants shall be defined, zero or more of which may be OR'ed together to form the <i>events</i> or
|
|
<i>revents</i> members in the <b>pollfd</b> structure:</p>
|
|
|
|
<dl compact>
|
|
<dt>POLLIN</dt>
|
|
|
|
<dd>Data other than high-priority data may be read without blocking.</dd>
|
|
|
|
<dt>POLLRDNORM</dt>
|
|
|
|
<dd>Normal data may be read without blocking.</dd>
|
|
|
|
<dt>POLLRDBAND</dt>
|
|
|
|
<dd>Priority data may be read without blocking.</dd>
|
|
|
|
<dt>POLLPRI</dt>
|
|
|
|
<dd>High priority data may be read without blocking.</dd>
|
|
|
|
<dt>POLLOUT</dt>
|
|
|
|
<dd>Normal data may be written without blocking.</dd>
|
|
|
|
<dt>POLLWRNORM</dt>
|
|
|
|
<dd>Equivalent to POLLOUT.</dd>
|
|
|
|
<dt>POLLWRBAND</dt>
|
|
|
|
<dd>Priority data may be written.</dd>
|
|
|
|
<dt>POLLERR</dt>
|
|
|
|
<dd>An error has occurred ( <i>revents</i> only).</dd>
|
|
|
|
<dt>POLLHUP</dt>
|
|
|
|
<dd>Device has been disconnected ( <i>revents</i> only).</dd>
|
|
|
|
<dt>POLLNVAL</dt>
|
|
|
|
<dd>Invalid <i>fd</i> member ( <i>revents</i> only).</dd>
|
|
</dl>
|
|
|
|
<p>The significance and semantics of normal, priority, and high-priority data are file and device-specific.</p>
|
|
|
|
<p>The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided.</p>
|
|
|
|
<pre>
|
|
<tt>int poll(struct pollfd[], nfds_t, int);
|
|
</tt>
|
|
</pre>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_13_35_04"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_35_05"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_35_06"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_35_07"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p>The System Interfaces volume of IEEE Std 1003.1-2001, <a href="../functions/confstr.html"><i>confstr</i>()</a>, <a
|
|
href="../functions/poll.html"><i>poll</i>()</a>, the Shell and Utilities volume of IEEE Std 1003.1-2001, <a href=
|
|
"../utilities/getconf.html"><i>getconf</i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_35_08"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 4, Version 2.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_35_09"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>The description of the symbolic constants is updated to match the <a href="../functions/poll.html"><i>poll</i>()</a>
|
|
function.</p>
|
|
|
|
<p>Text related to STREAMS has been moved to the <a href="../functions/poll.html"><i>poll</i>()</a> reference page.</p>
|
|
|
|
<p>A note is added to the DESCRIPTION regarding the significance and semantics of normal, priority, and high-priority data.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® 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>
|
|
|