diff options
Diffstat (limited to 'src/lib/libc/net/gethostbyname.3')
-rw-r--r-- | src/lib/libc/net/gethostbyname.3 | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/src/lib/libc/net/gethostbyname.3 b/src/lib/libc/net/gethostbyname.3 index 8dfdb88cf0..1394fa3467 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.3 1996/08/19 08:28:38 tholo Exp $ | 1 | .\" $OpenBSD: gethostbyname.3,v 1.4 1997/03/13 19:07:23 downsj 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. |
@@ -31,11 +31,12 @@ | |||
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
33 | .\" | 33 | .\" |
34 | .Dd April 19, 1994 | 34 | .Dd March 13, 1997 |
35 | .Dt GETHOSTBYNAME 3 | 35 | .Dt GETHOSTBYNAME 3 |
36 | .Os BSD 4.2 | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
38 | .Nm gethostbyname , | 38 | .Nm gethostbyname , |
39 | .Nm gethostbyname2 , | ||
39 | .Nm gethostbyaddr , | 40 | .Nm gethostbyaddr , |
40 | .Nm gethostent , | 41 | .Nm gethostent , |
41 | .Nm sethostent , | 42 | .Nm sethostent , |
@@ -48,6 +49,8 @@ | |||
48 | .Ft struct hostent * | 49 | .Ft struct hostent * |
49 | .Fn gethostbyname "const char *name" | 50 | .Fn gethostbyname "const char *name" |
50 | .Ft struct hostent * | 51 | .Ft struct hostent * |
52 | .Fn gethostbyname2 "const char *name" "int af" | ||
53 | .Ft struct hostent * | ||
51 | .Fn gethostbyaddr "const char *addr" "int len" "int type" | 54 | .Fn gethostbyaddr "const char *addr" "int len" "int type" |
52 | .Ft struct hostent * | 55 | .Ft struct hostent * |
53 | .Fn gethostent void | 56 | .Fn gethostent void |
@@ -93,8 +96,7 @@ Official name of the host. | |||
93 | .It Fa h_aliases | 96 | .It Fa h_aliases |
94 | A zero terminated array of alternate names for the host. | 97 | A zero terminated array of alternate names for the host. |
95 | .It Fa h_addrtype | 98 | .It Fa h_addrtype |
96 | The type of address being returned; currently always | 99 | The type of address being returned. |
97 | .Dv AF_INET . | ||
98 | .It Fa h_length | 100 | .It Fa h_length |
99 | The length, in bytes, of the address. | 101 | The length, in bytes, of the address. |
100 | .It Fa h_addr_list | 102 | .It Fa h_addr_list |
@@ -104,6 +106,7 @@ Host addresses are returned in network byte order. | |||
104 | The first address in | 106 | The first address in |
105 | .Fa h_addr_list ; | 107 | .Fa h_addr_list ; |
106 | this is for backward compatibility. | 108 | this is for backward compatibility. |
109 | .El | ||
107 | .Pp | 110 | .Pp |
108 | When using the nameserver, | 111 | When using the nameserver, |
109 | .Fn gethostbyname | 112 | .Fn gethostbyname |
@@ -117,6 +120,14 @@ See | |||
117 | .Xr hostname 7 | 120 | .Xr hostname 7 |
118 | for the domain search procedure and the alias file format. | 121 | for the domain search procedure and the alias file format. |
119 | .Pp | 122 | .Pp |
123 | .Fn Gethostbyname2 | ||
124 | is an advanced form of | ||
125 | .Fn gethostbyname | ||
126 | which allows lookups in address families other than | ||
127 | .Dv AF_INET , | ||
128 | for example | ||
129 | .Dv AF_INET6 . | ||
130 | .Pp | ||
120 | The | 131 | The |
121 | .Fn sethostent | 132 | .Fn sethostent |
122 | function | 133 | function |
@@ -148,7 +159,8 @@ connection. | |||
148 | .El | 159 | .El |
149 | .Sh DIAGNOSTICS | 160 | .Sh DIAGNOSTICS |
150 | Error return status from | 161 | Error return status from |
151 | .Fn gethostbyname | 162 | .Fn gethostbyname , |
163 | .Fn gethostbyname2 , | ||
152 | and | 164 | and |
153 | .Fn gethostbyaddr | 165 | .Fn gethostbyaddr |
154 | is indicated by return of a null pointer. | 166 | is indicated by return of a null pointer. |
@@ -198,20 +210,6 @@ for example, a mail-forwarder may be registered for this domain. | |||
198 | The | 210 | The |
199 | .Fn gethostent | 211 | .Fn gethostent |
200 | function | 212 | function |
201 | is defined, and | ||
202 | .Fn sethostent | ||
203 | and | ||
204 | .Fn endhostent | ||
205 | are redefined, | ||
206 | when | ||
207 | .Xr libc 3 | ||
208 | is built to use only the routines to lookup in | ||
209 | .Pa /etc/hosts | ||
210 | and not the name server. | ||
211 | .Pp | ||
212 | The | ||
213 | .Fn gethostent | ||
214 | function | ||
215 | reads the next line of | 213 | reads the next line of |
216 | .Pa /etc/hosts , | 214 | .Pa /etc/hosts , |
217 | opening the file if necessary. | 215 | opening the file if necessary. |
@@ -225,7 +223,8 @@ If the | |||
225 | .Fa stayopen | 223 | .Fa stayopen |
226 | argument is non-zero, | 224 | argument is non-zero, |
227 | the file will not be closed after each call to | 225 | the file will not be closed after each call to |
228 | .Fn gethostbyname | 226 | .Fn gethostbyname , |
227 | .Fn gethostbyname2 , | ||
229 | or | 228 | or |
230 | .Fn gethostbyaddr . | 229 | .Fn gethostbyaddr . |
231 | .Pp | 230 | .Pp |
@@ -252,4 +251,9 @@ These functions use static data storage; | |||
252 | if the data is needed for future use, it should be | 251 | if the data is needed for future use, it should be |
253 | copied before any subsequent calls overwrite it. | 252 | copied before any subsequent calls overwrite it. |
254 | Only the Internet | 253 | Only the Internet |
255 | address format is currently understood. | 254 | address formats are currently understood. |
255 | .Pp | ||
256 | YP does not support any address families other than | ||
257 | .Dv AF_INET | ||
258 | and uses | ||
259 | the traditional database format. | ||