1ENDHOSTENT(3P)             POSIX Programmer's Manual            ENDHOSTENT(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       endhostent, gethostent, sethostent — network host database functions
14

SYNOPSIS

16       #include <netdb.h>
17
18       void endhostent(void);
19       struct hostent *gethostent(void);
20       void sethostent(int stayopen);
21

DESCRIPTION

23       These functions shall retrieve information about hosts.  This  informa‐
24       tion  is  considered  to  be  stored in a database that can be accessed
25       sequentially or  randomly.  The  implementation  of  this  database  is
26       unspecified.
27
28       Note:     In many cases this database is implemented by the Domain Name
29                 System, as documented in RFC 1034, RFC 1035, and RFC 1886.
30
31       The sethostent() function shall open a connection to the  database  and
32       set the next entry for retrieval to the first entry in the database. If
33       the stayopen argument is non-zero, the connection shall not  be  closed
34       by  a call to gethostent(), and the implementation may maintain an open
35       file descriptor.
36
37       The gethostent() function shall read the next entry  in  the  database,
38       opening and closing a connection to the database as necessary.
39
40       Entries shall be returned in hostent structures.
41
42       The  endhostent()  function shall close the connection to the database,
43       releasing any open file descriptor.
44
45       These functions need not be thread-safe.
46

RETURN VALUE

48       Upon successful completion, the gethostent() function  shall  return  a
49       pointer  to a hostent structure if the requested entry was found, and a
50       null pointer if the end of the database was reached  or  the  requested
51       entry was not found.
52
53       The  application  shall  not  modify  the structure to which the return
54       value points, nor any storage areas pointed to by pointers  within  the
55       structure.  The  returned  pointer,  and pointers within the structure,
56       might be invalidated or the structure or the  storage  areas  might  be
57       overwritten by a subsequent call to gethostent().
58

ERRORS

60       No errors are defined for endhostent(), gethostent(), and sethostent().
61
62       The following sections are informative.
63

EXAMPLES

65       None.
66

APPLICATION USAGE

68       None.
69

RATIONALE

71       None.
72

FUTURE DIRECTIONS

74       None.
75

SEE ALSO

77       endservent()
78
79       The Base Definitions volume of POSIX.1‐2008, <netdb.h>
80
82       Portions  of  this text are reprinted and reproduced in electronic form
83       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
84       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
85       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
86       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
87       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
88       event of any discrepancy between this version and the original IEEE and
89       The Open Group Standard, the original IEEE and The Open Group  Standard
90       is  the  referee document. The original Standard can be obtained online
91       at http://www.unix.org/online.html .
92
93       Any typographical or formatting errors that appear  in  this  page  are
94       most likely to have been introduced during the conversion of the source
95       files to man page format. To report such errors,  see  https://www.ker
96       nel.org/doc/man-pages/reporting_bugs.html .
97
98
99
100IEEE/The Open Group                  2013                       ENDHOSTENT(3P)
Impressum