summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/gethostbyname.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/gethostbyname.3')
-rw-r--r--src/lib/libc/net/gethostbyname.321
1 files changed, 11 insertions, 10 deletions
diff --git a/src/lib/libc/net/gethostbyname.3 b/src/lib/libc/net/gethostbyname.3
index c2db100c9b..f3f3ea580f 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.23 2005/06/08 18:32:34 millert Exp $ 1.\" $OpenBSD: gethostbyname.3,v 1.24 2005/07/22 04:50:51 jaredy 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.
@@ -42,7 +42,7 @@
42.Nd get network host entry 42.Nd get network host entry
43.Sh SYNOPSIS 43.Sh SYNOPSIS
44.Fd #include <netdb.h> 44.Fd #include <netdb.h>
45.Fd extern int h_errno; 45.Vt extern int h_errno ;
46.Ft struct hostent * 46.Ft struct hostent *
47.Fn gethostbyname "const char *name" 47.Fn gethostbyname "const char *name"
48.Ft struct hostent * 48.Ft struct hostent *
@@ -62,11 +62,11 @@
62.Sh DESCRIPTION 62.Sh DESCRIPTION
63The 63The
64.Fn gethostbyname , 64.Fn gethostbyname ,
65.Fn gethostbyname2 65.Fn gethostbyname2 ,
66and 66and
67.Fn gethostbyaddr 67.Fn gethostbyaddr
68functions each return a pointer to an object with the following structure 68functions each return a pointer to an object with the following structure
69describing an internet host referenced by name or by address, respectively. 69describing an Internet host referenced by name or by address, respectively.
70This structure contains either information obtained from the name server (i.e., 70This structure contains either information obtained from the name server (i.e.,
71.Xr resolver 3 71.Xr resolver 3
72and 72and
@@ -78,15 +78,15 @@ or database entries supplied by the
78system. 78system.
79.Xr resolv.conf 5 79.Xr resolv.conf 5
80describes how the particular database is chosen. 80describes how the particular database is chosen.
81.Bd -literal 81.Bd -literal -offset indent
82struct hostent { 82struct hostent {
83 char *h_name; /* official name of host */ 83 char *h_name; /* official name of host */
84 char **h_aliases; /* alias list */ 84 char **h_aliases; /* alias list */
85 int h_addrtype; /* host address type */ 85 int h_addrtype; /* host address type */
86 int h_length; /* length of address */ 86 int h_length; /* length of address */
87 char **h_addr_list; /* list of addresses from name server */ 87 char **h_addr_list; /* list of returned addresses */
88}; 88};
89#define h_addr h_addr_list[0] /* address, for backward compatibility */ 89#define h_addr h_addr_list[0] /* address, for backward compat */
90.Ed 90.Ed
91.Pp 91.Pp
92The members of this structure are: 92The members of this structure are:
@@ -94,13 +94,13 @@ The members of this structure are:
94.It Fa h_name 94.It Fa h_name
95Official name of the host. 95Official name of the host.
96.It Fa h_aliases 96.It Fa h_aliases
97A NULL-terminated array of alternate names for the host. 97A null-terminated array of alternate names for the host.
98.It Fa h_addrtype 98.It Fa h_addrtype
99The type of address being returned. 99The type of address being returned.
100.It Fa h_length 100.It Fa h_length
101The length, in bytes, of the address. 101The length, in bytes, of the address.
102.It Fa h_addr_list 102.It Fa h_addr_list
103A zero-terminated array of network addresses for the host. 103A null-terminated array of network addresses for the host.
104Host addresses are returned in network byte order. 104Host addresses are returned in network byte order.
105.It Fa h_addr 105.It Fa h_addr
106The first address in 106The first address in
@@ -227,7 +227,7 @@ will result in an answer;
227for example, a mail-forwarder may be registered for this domain. 227for example, a mail-forwarder may be registered for this domain.
228.It Dv NETDB_INTERNAL 228.It Dv NETDB_INTERNAL
229An internal error occurred. 229An internal error occurred.
230This may occurs when an address family other than 230This may occur when an address family other than
231.Dv AF_INET 231.Dv AF_INET
232or 232or
233.Dv AF_INET6 233.Dv AF_INET6
@@ -287,6 +287,7 @@ function closes the file.
287These functions use static data storage; 287These functions use static data storage;
288if the data is needed for future use, it should be 288if the data is needed for future use, it should be
289copied before any subsequent calls overwrite it. 289copied before any subsequent calls overwrite it.
290.Pp
290Only the Internet 291Only the Internet
291address formats are currently understood. 292address formats are currently understood.
292.Pp 293.Pp