gethostbyname.3 (108037) | gethostbyname.3 (108087) |
---|---|
1.\" Copyright (c) 1983, 1987, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 | 1.\" Copyright (c) 1983, 1987, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 |
33.\" $FreeBSD: head/lib/libc/net/gethostbyname.3 108037 2002-12-18 12:45:11Z ru $ | 33.\" $FreeBSD: head/lib/libc/net/gethostbyname.3 108087 2002-12-19 09:40:28Z ru $ |
34.\" 35.Dd May 25, 1995 36.Dt GETHOSTBYNAME 3 37.Os 38.Sh NAME 39.Nm gethostbyname , 40.Nm gethostbyname2 , 41.Nm gethostbyaddr , --- 45 unchanged lines hidden (view full) --- 87.Fn gethostbyaddr 88functions 89each return a pointer to an object with the 90following structure describing an internet host 91referenced by name or by address, respectively. 92.Pp 93The 94.Fa name | 34.\" 35.Dd May 25, 1995 36.Dt GETHOSTBYNAME 3 37.Os 38.Sh NAME 39.Nm gethostbyname , 40.Nm gethostbyname2 , 41.Nm gethostbyaddr , --- 45 unchanged lines hidden (view full) --- 87.Fn gethostbyaddr 88functions 89each return a pointer to an object with the 90following structure describing an internet host 91referenced by name or by address, respectively. 92.Pp 93The 94.Fa name |
95parameter passed to | 95argument passed to |
96.Fn gethostbyname 97or 98.Fn gethostbyname2 99should point to a 100.Dv NUL Ns -terminated 101hostname. 102The 103.Fa addr | 96.Fn gethostbyname 97or 98.Fn gethostbyname2 99should point to a 100.Dv NUL Ns -terminated 101hostname. 102The 103.Fa addr |
104parameter passed to | 104argument passed to |
105.Fn gethostbyaddr 106should point to an address which is 107.Fa len 108bytes long, 109in binary form 110(i.e. not an IP address in human readable 111.Tn ASCII 112form). 113The 114.Fa type | 105.Fn gethostbyaddr 106should point to an address which is 107.Fa len 108bytes long, 109in binary form 110(i.e. not an IP address in human readable 111.Tn ASCII 112form). 113The 114.Fa type |
115parameter specifies the address family | 115argument specifies the address family |
116(e.g.\& 117.Dv AF_INET , AF_INET6 , 118etc.) of this address. 119.Pp 120The structure returned contains either the information obtained from the name 121server, 122.Xr named 8 , 123broken-out fields from a line in --- 88 unchanged lines hidden (view full) --- 212function 213closes the 214.Tn TCP 215connection. 216.Pp 217The 218.Fn herror 219function writes a message to the diagnostic output consisting of the | 116(e.g.\& 117.Dv AF_INET , AF_INET6 , 118etc.) of this address. 119.Pp 120The structure returned contains either the information obtained from the name 121server, 122.Xr named 8 , 123broken-out fields from a line in --- 88 unchanged lines hidden (view full) --- 212function 213closes the 214.Tn TCP 215connection. 216.Pp 217The 218.Fn herror 219function writes a message to the diagnostic output consisting of the |
220string parameter 221.Fa s , | 220string argument 221.Fa string , |
222the constant string 223.Qq Li ":\ " , 224and a message corresponding to the value of 225.Va h_errno . 226.Pp 227The 228.Fn hstrerror 229function returns a string which is the message text corresponding to the 230value of the 231.Fa err | 222the constant string 223.Qq Li ":\ " , 224and a message corresponding to the value of 225.Va h_errno . 226.Pp 227The 228.Fn hstrerror 229function returns a string which is the message text corresponding to the 230value of the 231.Fa err |
232parameter. | 232argument. |
233.Sh FILES 234.Bl -tag -width /etc/nsswitch.conf -compact 235.It Pa /etc/hosts 236.It Pa /etc/nsswitch.conf 237.It Pa /etc/resolv.conf 238.El 239.Sh EXAMPLES 240Print out the hostname associated with a specific IP address: --- 142 unchanged lines hidden --- | 233.Sh FILES 234.Bl -tag -width /etc/nsswitch.conf -compact 235.It Pa /etc/hosts 236.It Pa /etc/nsswitch.conf 237.It Pa /etc/resolv.conf 238.El 239.Sh EXAMPLES 240Print out the hostname associated with a specific IP address: --- 142 unchanged lines hidden --- |