📄 tcpip-freebsd-enhanced-select.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>Enhanced Select()</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="APIs"HREF="tcpip-freebsd-tcpip-apis.html"><LINKREL="PREVIOUS"TITLE="APIs"HREF="tcpip-freebsd-tcpip-apis.html"><LINKREL="NEXT"TITLE="OpenBSD TCP/IP Stack port for eCos"HREF="tcpip-openbsd.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="tcpip-freebsd-tcpip-apis.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 41. APIs</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="tcpip-openbsd.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="TCPIP-FREEBSD-ENHANCED-SELECT">Enhanced Select()</H1><P>The network stack supports an extension to the standard selectsemantics which allows all threads that are waiting to be restartedeven if the select conditions are not satisfied.</P><P>The standard select() API: </P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">int <TTCLASS="FUNCTION">select</TT>(int nfd, fd_set *in, fd_set *out, fd_set *ex, struct timeval *tv); </PRE></TD></TR></TABLE><P>does not support the restart.</P><P>The additional API: </P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">int <TTCLASS="FUNCTION">cyg_select_with_abort</TT>(int nfd, fd_set *in, fd_set *out, fd_set *ex, struct timeval *tv)</PRE></TD></TR></TABLE><P>behaves exactly as select() with the additional feature thata call to</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void <TTCLASS="FUNCTION">cyg_select_abort</TT>(void)</PRE></TD></TR></TABLE><P>will cause all threads waiting in any<TTCLASS="FUNCTION">cyg_select_with_abort()</TT> callto cease waiting and continue execution.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="tcpip-freebsd-tcpip-apis.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="tcpip-openbsd.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">APIs</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="tcpip-freebsd-tcpip-apis.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">OpenBSD TCP/IP Stack port for eCos</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -