📄 endhostent.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-2003 The Open Group, All Rights Reserved --><title>endhostent</title></head><body bgcolor="white"><basefont size="3"> <a name="endhostent"></a> <a name="tag_03_118"></a><!-- endhostent --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_118_01"></a>NAME</h4><blockquote>endhostent, gethostent, sethostent - network host database functions</blockquote><h4><a name="tag_03_118_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>#include <<a href="../basedefs/netdb.h.html">netdb.h</a>><br><br> void endhostent(void);<br> struct hostent *gethostent(void);<br> void sethostent(int</tt> <i>stayopen</i><tt>);<br></tt></code></p></blockquote><h4><a name="tag_03_118_03"></a>DESCRIPTION</h4><blockquote><p>These functions shall retrieve information about hosts. This information is considered to be stored in a database that can beaccessed sequentially or randomly. The implementation of this database is unspecified. <basefont size="2"></p><dl><dt><b>Note:</b></dt><dd>In many cases this database is implemented by the Domain Name System, as documented in RFC 1034, RFC 1035, andRFC 1886.</dd></dl><basefont size="3"> <p>The <i>sethostent</i>() function shall open a connection to the database and set the next entry for retrieval to the first entryin the database. If the <i>stayopen</i> argument is non-zero, the connection shall not be closed by a call to <i>gethostent</i>(),<a href="../functions/gethostbyname.html"><i>gethostbyname</i>()</a>, or <a href="../functions/gethostbyaddr.html"><i>gethostbyaddr</i>()</a>, and the implementation may maintain an open file descriptor.</p><p>The <i>gethostent</i>() function shall read the next entry in the database, opening and closing a connection to the database asnecessary.</p><p>Entries shall be returned in <b>hostent</b> structures. Refer to <a href="gethostbyaddr.html"><i>gethostbyaddr</i>()</a> for adefinition of the <b>hostent</b> structure.</p><p>The <i>endhostent</i>() function shall close the connection to the database, releasing any open file descriptor.</p><p>These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.</p></blockquote><h4><a name="tag_03_118_04"></a>RETURN VALUE</h4><blockquote><p>Upon successful completion, the <i>gethostent</i>() function shall return a pointer to a <b>hostent</b> structure if therequested entry was found, and a null pointer if the end of the database was reached or the requested entry was not found.</p></blockquote><h4><a name="tag_03_118_05"></a>ERRORS</h4><blockquote><p>No errors are defined for <i>endhostent</i>(), <i>gethostent</i>(), and <i>sethostent</i>().</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_118_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_118_07"></a>APPLICATION USAGE</h4><blockquote><p>The <i>gethostent</i>() function may return pointers to static data, which may be overwritten by subsequent calls to any ofthese functions.</p></blockquote><h4><a name="tag_03_118_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_118_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_118_10"></a>SEE ALSO</h4><blockquote><p><a href="endservent.html"><i>endservent</i>()</a> , <a href="gethostbyaddr.html"><i>gethostbyaddr</i>()</a> , the BaseDefinitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/netdb.h.html"><i><netdb.h></i></a></p></blockquote><h4><a name="tag_03_118_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 6. Derived from the XNS, Issue 5.2 specification.</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -