1
by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages. |
1 |
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved |
2
by Francesco Paolo Lovergine
* Alligned to linux main manpages edition. |
2 |
.TH "ENDHOSTENT" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual" |
1
by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages. |
3 |
.\" endhostent |
4 |
.SH NAME |
|
5 |
endhostent, gethostent, sethostent \- network host database functions
|
|
6 |
.SH SYNOPSIS |
|
7 |
.LP
|
|
8 |
\fB#include <netdb.h>
|
|
9 |
.br
|
|
10 |
.sp
|
|
11 |
void endhostent(void); |
|
12 |
.br
|
|
13 |
struct hostent *gethostent(void); |
|
14 |
.br
|
|
15 |
void sethostent(int\fP \fIstayopen\fP\fB); |
|
16 |
.br
|
|
17 |
\fP
|
|
18 |
.SH DESCRIPTION |
|
19 |
.LP
|
|
20 |
These functions shall retrieve information about hosts. This information |
|
21 |
is considered to be stored in a database that can be |
|
22 |
accessed sequentially or randomly. The implementation of this database |
|
23 |
is unspecified. |
|
24 |
.TP 7 |
|
25 |
\fBNote:\fP |
|
26 |
In many cases this database is implemented by the Domain Name System, |
|
27 |
as documented in RFC\ 1034, RFC\ 1035, and |
|
28 |
RFC\ 1886.
|
|
29 |
.sp
|
|
30 |
.LP
|
|
31 |
The \fIsethostent\fP() function shall open a connection to the database |
|
32 |
and set the next entry for retrieval to the first entry |
|
33 |
in the database. If the \fIstayopen\fP argument is non-zero, the connection |
|
34 |
shall not be closed by a call to \fIgethostent\fP(), |
|
35 |
\fIgethostbyname\fP(), or \fIgethostbyaddr\fP(), and the implementation |
|
36 |
may maintain an open file descriptor. |
|
37 |
.LP
|
|
38 |
The \fIgethostent\fP() function shall read the next entry in the database, |
|
39 |
opening and closing a connection to the database as |
|
40 |
necessary. |
|
41 |
.LP
|
|
42 |
Entries shall be returned in \fBhostent\fP structures. Refer to \fIgethostbyaddr\fP() |
|
43 |
for a |
|
44 |
definition of the \fBhostent\fP structure. |
|
45 |
.LP
|
|
46 |
The \fIendhostent\fP() function shall close the connection to the |
|
47 |
database, releasing any open file descriptor. |
|
48 |
.LP
|
|
49 |
These functions need not be reentrant. A function that is not required |
|
50 |
to be reentrant is not required to be thread-safe. |
|
51 |
.SH RETURN VALUE |
|
52 |
.LP
|
|
53 |
Upon successful completion, the \fIgethostent\fP() function shall |
|
54 |
return a pointer to a \fBhostent\fP structure if the |
|
55 |
requested entry was found, and a null pointer if the end of the database |
|
56 |
was reached or the requested entry was not found. |
|
57 |
.SH ERRORS |
|
58 |
.LP
|
|
59 |
No errors are defined for \fIendhostent\fP(), \fIgethostent\fP(), |
|
60 |
and \fIsethostent\fP(). |
|
61 |
.LP
|
|
62 |
\fIThe following sections are informative.\fP |
|
63 |
.SH EXAMPLES |
|
64 |
.LP
|
|
65 |
None. |
|
66 |
.SH APPLICATION USAGE |
|
67 |
.LP
|
|
68 |
The \fIgethostent\fP() function may return pointers to static data, |
|
69 |
which may be overwritten by subsequent calls to any of |
|
70 |
these functions. |
|
71 |
.SH RATIONALE |
|
72 |
.LP
|
|
73 |
None. |
|
74 |
.SH FUTURE DIRECTIONS |
|
75 |
.LP
|
|
76 |
None. |
|
77 |
.SH SEE ALSO |
|
78 |
.LP
|
|
79 |
\fIendservent\fP() , \fIgethostbyaddr\fP() , the Base |
|
80 |
Definitions volume of IEEE\ Std\ 1003.1-2001, \fI<netdb.h>\fP |
|
81 |
.SH COPYRIGHT |
|
82 |
Portions of this text are reprinted and reproduced in electronic form |
|
83 |
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology |
|
84 |
-- Portable Operating System Interface (POSIX), The Open Group Base |
|
85 |
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of |
|
86 |
Electrical and Electronics Engineers, Inc and The Open Group. In the |
|
87 |
event of any discrepancy between this version and the original IEEE and |
|
88 |
The Open Group Standard, the original IEEE and The Open Group Standard |
|
89 |
is the referee document. The original Standard can be obtained online at |
|
90 |
http://www.opengroup.org/unix/online.html . |