diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/net/gethostbyname.3 | 69 |
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 |
| 127 | is an advanced form of | 127 | is similar to |
| 128 | .Fn gethostbyname | 128 | .Fn gethostbyname |
| 129 | which allows lookups in address families other than | 129 | except that it supports an |
| 130 | .Fa af | ||
| 131 | of | ||
| 132 | .Dv AF_INET6 | ||
| 133 | in addition to | ||
| 130 | .Dv AF_INET . | 134 | .Dv AF_INET . |
| 131 | Currently, the only supported address family besides | ||
| 132 | .Dv AF_INET | ||
| 133 | is | ||
| 134 | .Dv AF_INET6 . | ||
| 135 | .Pp | 135 | .Pp |
| 136 | The | 136 | The |
| 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 |
| 140 | in the address family | 140 | in the address family |
| 141 | .Fa af . | 141 | .Fa af . |
| 142 | The only address family currently supported is | 142 | The only address family supported is |
| 143 | .Dv AF_INET . | 143 | .Dv AF_INET . |
| 144 | .Pp | 144 | .Pp |
| 145 | The | 145 | The |
| 146 | .Fn sethostent | 146 | .Fn sethostent , |
| 147 | function may be used to request the use of a connected | 147 | .Fn gethostent , |
| 148 | TCP socket for queries. | 148 | and |
| 149 | If the | ||
| 150 | .Fa stayopen | ||
| 151 | flag is non-zero, | ||
| 152 | this sets the option to send all queries to the name server using TCP | ||
| 153 | and to retain the connection after each call to | ||
| 154 | .Fn gethostbyname | ||
| 155 | or | ||
| 156 | .Fn gethostbyaddr . | ||
| 157 | Otherwise, queries are performed using UDP datagrams. | ||
| 158 | .Pp | ||
| 159 | The | ||
| 160 | .Fn endhostent | 149 | .Fn endhostent |
| 161 | function closes the TCP connection. | 150 | functions are deprecated and no longer have any effect. |
| 151 | They could be used in the past for queries over a persistent TCP | ||
| 152 | connection or to iterate entries in the | ||
| 153 | .Xr hosts 5 | ||
| 154 | file. | ||
| 162 | .Pp | 155 | .Pp |
| 163 | The | 156 | The |
| 164 | .Fn herror | 157 | .Fn herror |
| @@ -231,6 +224,8 @@ This may occur when an address family other than | |||
| 231 | or | 224 | or |
| 232 | .Dv AF_INET6 | 225 | .Dv AF_INET6 |
| 233 | is specified or when a resource is unable to be allocated. | 226 | is specified or when a resource is unable to be allocated. |
| 227 | It is always set by | ||
| 228 | .Fn gethostent . | ||
| 234 | .It Dv NETDB_SUCCESS | 229 | .It Dv NETDB_SUCCESS |
| 235 | The function completed successfully. | 230 | The function completed successfully. |
| 236 | .El | 231 | .El |
| @@ -262,32 +257,6 @@ and | |||
| 262 | .Fn gethostbyname2 | 257 | .Fn gethostbyname2 |
| 263 | in | 258 | in |
| 264 | .Ox 2.1 . | 259 | .Ox 2.1 . |
| 265 | .Sh CAVEATS | ||
| 266 | If the search routines in | ||
| 267 | .Xr resolv.conf 5 | ||
| 268 | decide to read the | ||
| 269 | .Pa /etc/hosts | ||
| 270 | file, | ||
| 271 | .Fn gethostent | ||
| 272 | and other functions will | ||
| 273 | read the next line of the file, | ||
| 274 | re-opening the file if necessary. | ||
| 275 | .Pp | ||
| 276 | The | ||
| 277 | .Fn sethostent | ||
| 278 | function opens and/or rewinds the file | ||
| 279 | .Pa /etc/hosts . | ||
| 280 | If the | ||
| 281 | .Fa stayopen | ||
| 282 | argument is non-zero, the file will not be closed after each call to | ||
| 283 | .Fn gethostbyname , | ||
| 284 | .Fn gethostbyname2 , | ||
| 285 | or | ||
| 286 | .Fn gethostbyaddr . | ||
| 287 | .Pp | ||
| 288 | The | ||
| 289 | .Fn endhostent | ||
| 290 | function closes the file. | ||
| 291 | .Sh BUGS | 260 | .Sh BUGS |
| 292 | These functions use static data storage; | 261 | These functions use static data storage; |
| 293 | if the data is needed for future use, it should be | 262 | if the data is needed for future use, it should be |
