OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / gethostbyname.3
index 36f2da1..57e3827 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -19,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" References consulted:
 .\"     Linux libc source code
@@ -33,7 +35,7 @@
 .\" Modified 2002-08-05, Michael Kerrisk
 .\" Modified 2004-10-31, Andries Brouwer
 .\"
-.TH GETHOSTBYNAME 3 2009-12-03 "" "Linux Programmer's Manual"
+.TH GETHOSTBYNAME 3 2014-03-11 "" "Linux Programmer's Manual"
 .SH NAME
 gethostbyname, gethostbyaddr, sethostent, gethostent, endhostent,
 h_errno,
@@ -90,28 +92,53 @@ Feature Test Macro Requirements for glibc (see
 .BR feature_test_macros (7)):
 .in
 .sp
+.PD 0
 .ad l
 .BR gethostbyname2 (),
 .BR gethostent_r (),
 .BR gethostbyaddr_r (),
 .BR gethostbyname_r (),
 .BR gethostbyname2_r ():
+.RS 4
 _BSD_SOURCE || _SVID_SOURCE
+.RE
 
 .BR herror (),
-.BR hstrerror ()
-(since glibc 2.8): _BSD_SOURCE || _SVID_SOURCE || _GNU_SOURCE
+.BR hstrerror ():
+.RS 4
+.TP 4
+Since glibc 2.8:
+_BSD_SOURCE || _SVID_SOURCE
+.TP
+Before glibc 2.8:
+none
+.RE
+
+.BR h_errno :
+.RS 4
+.TP 4
+Since glibc 2.12:
+_BSD_SOURCE || _SVID_SOURCE ||
+    (_POSIX_C_SOURCE < 200809L && _XOPEN_SOURCE < 700)
+.TP
+Before glibc 2.12:
+none
+.RE
 .ad b
+.PD
 .SH DESCRIPTION
 The
-.BR gethostbyname* ()
+.BR gethostbyname* (),
+.BR gethostbyaddr* (),
+.BR herror (),
 and
-.BR gethostbyaddr* ()
+.BR hstrerror ()
 functions are obsolete.
 Applications should use
-.BR getaddrinfo (3)
+.BR getaddrinfo (3),
+.BR getnameinfo (3),
 and
-.BR getnameinfo (3)
+.BR gai_strerror (3)
 instead.
 
 The
@@ -232,7 +259,7 @@ The members of the \fIhostent\fP structure are:
 The official name of the host.
 .TP
 .I h_aliases
-An array of alternative names for the host, terminated by a NULL pointer.
+An array of alternative names for the host, terminated by a null pointer.
 .TP
 .I h_addrtype
 The type of address; always
@@ -246,18 +273,18 @@ The length of the address in bytes.
 .TP
 .I h_addr_list
 An array of pointers to network addresses for the host (in network byte
-order), terminated by a NULL pointer.
+order), terminated by a null pointer.
 .TP
 .I h_addr
 The first address in \fIh_addr_list\fP for backward compatibility.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 The
 .BR gethostbyname ()
 and
 .BR gethostbyaddr ()
 functions return the
 .I hostent
-structure or a NULL pointer if an error occurs.
+structure or a null pointer if an error occurs.
 On error, the
 .I h_errno
 variable holds an error number.
@@ -287,7 +314,7 @@ host database file
 .TP
 .I /etc/nsswitch.conf
 name service switch configuration
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 POSIX.1-2001 specifies
 .BR gethostbyname (),
 .BR gethostbyaddr (),
@@ -349,9 +376,9 @@ See also
 The BSD prototype for
 .BR gethostbyaddr ()
 uses
-.I const char *
+.I "const char\ *"
 for the first argument.
-.SS "System V/POSIX Extension"
+.SS System V/POSIX extension
 POSIX requires the
 .BR gethostent ()
 call, that should return the next entry in the host data base.
@@ -361,14 +388,14 @@ line by line.
 On many systems a routine of this name reads
 from the file
 .IR /etc/hosts .
-.\" e.g., Linux, FreeBSD, Unixware, HP-UX
+.\" e.g., Linux, FreeBSD, UnixWare, HP-UX
 It may be available only when the library was built without DNS support.
 .\" e.g., FreeBSD, AIX
 The glibc version will ignore ipv6 entries.
 This function is not reentrant,
 and glibc adds a reentrant version
 .BR gethostent_r ().
-.SS "GNU Extensions"
+.SS GNU extensions
 Glibc2 also has a
 .BR gethostbyname2 ()
 that works like
@@ -413,7 +440,7 @@ is passed in
 does not recognize components of a dotted IPv4 address string
 that are expressed in hexadecimal.
 .\" http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482973
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR getaddrinfo (3),
 .\" .BR getipnodebyaddr (3),
 .\" .BR getipnodebyname (3),
@@ -427,3 +454,12 @@ that are expressed in hexadecimal.
 .BR hostname (7),
 .BR named (8)
 .\" .BR resolv+ (8)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.