summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2018-04-28 15:28:25 +0000
committerschwarze <>2018-04-28 15:28:25 +0000
commit249ea9925fc6cab53616b6e4f39a454a847dd373 (patch)
tree11fedef494111ce2af2bb82eb0c8c945cbed7c51 /src/lib
parent576e1262a2eeb01aa82b8346754026420b6143b7 (diff)
downloadopenbsd-249ea9925fc6cab53616b6e4f39a454a847dd373.tar.gz
openbsd-249ea9925fc6cab53616b6e4f39a454a847dd373.tar.bz2
openbsd-249ea9925fc6cab53616b6e4f39a454a847dd373.zip
Say that sethostent(3), gethostent(3), and endhostent(3) do nothing.
While here, stop implying plans to support additional address families in the future, and do not call gethostbyname2(3) "advanced". OK deraadt@ guenther@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/gethostbyname.369
1 files changed, 19 insertions, 50 deletions
diff --git a/src/lib/libc/net/gethostbyname.3 b/src/lib/libc/net/gethostbyname.3
index 8b8dc66952..251f363ff1 100644
--- a/src/lib/libc/net/gethostbyname.3
+++ b/src/lib/libc/net/gethostbyname.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: gethostbyname.3,v 1.32 2016/08/05 16:16:06 schwarze Exp $ 1.\" $OpenBSD: gethostbyname.3,v 1.33 2018/04/28 15:28:25 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1987, 1991, 1993 3.\" Copyright (c) 1983, 1987, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -27,7 +27,7 @@
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.Dd $Mdocdate: August 5 2016 $ 30.Dd $Mdocdate: April 28 2018 $
31.Dt GETHOSTBYNAME 3 31.Dt GETHOSTBYNAME 3
32.Os 32.Os
33.Sh NAME 33.Sh NAME
@@ -124,14 +124,14 @@ and
124.Xr hostname 7 . 124.Xr hostname 7 .
125.Pp 125.Pp
126.Fn gethostbyname2 126.Fn gethostbyname2
127is an advanced form of 127is similar to
128.Fn gethostbyname 128.Fn gethostbyname
129which allows lookups in address families other than 129except that it supports an
130.Fa af
131of
132.Dv AF_INET6
133in addition to
130.Dv AF_INET . 134.Dv AF_INET .
131Currently, the only supported address family besides
132.Dv AF_INET
133is
134.Dv AF_INET6 .
135.Pp 135.Pp
136The 136The
137.Fn gethostbyaddr 137.Fn gethostbyaddr
@@ -139,26 +139,19 @@ function will search for the specified address of length
139.Fa len 139.Fa len
140in the address family 140in the address family
141.Fa af . 141.Fa af .
142The only address family currently supported is 142The only address family supported is
143.Dv AF_INET . 143.Dv AF_INET .
144.Pp 144.Pp
145The 145The
146.Fn sethostent 146.Fn sethostent ,
147function may be used to request the use of a connected 147.Fn gethostent ,
148TCP socket for queries. 148and
149If the
150.Fa stayopen
151flag is non-zero,
152this sets the option to send all queries to the name server using TCP
153and to retain the connection after each call to
154.Fn gethostbyname
155or
156.Fn gethostbyaddr .
157Otherwise, queries are performed using UDP datagrams.
158.Pp
159The
160.Fn endhostent 149.Fn endhostent
161function closes the TCP connection. 150functions are deprecated and no longer have any effect.
151They could be used in the past for queries over a persistent TCP
152connection or to iterate entries in the
153.Xr hosts 5
154file.
162.Pp 155.Pp
163The 156The
164.Fn herror 157.Fn herror
@@ -231,6 +224,8 @@ This may occur when an address family other than
231or 224or
232.Dv AF_INET6 225.Dv AF_INET6
233is specified or when a resource is unable to be allocated. 226is specified or when a resource is unable to be allocated.
227It is always set by
228.Fn gethostent .
234.It Dv NETDB_SUCCESS 229.It Dv NETDB_SUCCESS
235The function completed successfully. 230The function completed successfully.
236.El 231.El
@@ -262,32 +257,6 @@ and
262.Fn gethostbyname2 257.Fn gethostbyname2
263in 258in
264.Ox 2.1 . 259.Ox 2.1 .
265.Sh CAVEATS
266If the search routines in
267.Xr resolv.conf 5
268decide to read the
269.Pa /etc/hosts
270file,
271.Fn gethostent
272and other functions will
273read the next line of the file,
274re-opening the file if necessary.
275.Pp
276The
277.Fn sethostent
278function opens and/or rewinds the file
279.Pa /etc/hosts .
280If the
281.Fa stayopen
282argument is non-zero, the file will not be closed after each call to
283.Fn gethostbyname ,
284.Fn gethostbyname2 ,
285or
286.Fn gethostbyaddr .
287.Pp
288The
289.Fn endhostent
290function closes the file.
291.Sh BUGS 260.Sh BUGS
292These functions use static data storage; 261These functions use static data storage;
293if the data is needed for future use, it should be 262if the data is needed for future use, it should be