diff options
Diffstat (limited to 'usr/src/man/man3nsl/gethostbyname.3nsl')
| -rw-r--r-- | usr/src/man/man3nsl/gethostbyname.3nsl | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/usr/src/man/man3nsl/gethostbyname.3nsl b/usr/src/man/man3nsl/gethostbyname.3nsl index 925f3ebb85..2468a6696b 100644 --- a/usr/src/man/man3nsl/gethostbyname.3nsl +++ b/usr/src/man/man3nsl/gethostbyname.3nsl @@ -44,12 +44,11 @@ .\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. .\" -.TH GETHOSTBYNAME 3NSL "Sep 10, 2013" +.TH GETHOSTBYNAME 3NSL "June 18, 2021" .SH NAME gethostbyname, gethostbyname_r, gethostbyaddr, gethostbyaddr_r, gethostent, gethostent_r, sethostent, endhostent \- get network host entry .SH SYNOPSIS -.LP .nf \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lnsl\fR [ \fIlibrary\fR... ] #include <netdb.h> @@ -99,7 +98,6 @@ gethostent_r, sethostent, endhostent \- get network host entry .fi .SH DESCRIPTION -.LP These functions are used to obtain entries describing hosts. An entry can come from any of the sources for \fBhosts\fR specified in the \fB/etc/nsswitch.conf\fR file. See \fBnsswitch.conf\fR(4). These functions have @@ -150,7 +148,6 @@ deallocate resources it was using. It is still allowed, but possibly less efficient, for the process to call more host retrieval functions after calling \fBendhostent()\fR. .SS "Reentrant Interfaces" -.LP The \fBgethostbyname()\fR, \fBgethostbyaddr()\fR, and \fBgethostent()\fR functions use static storage that is reused in each call, making these functions unsafe for use in multithreaded applications. @@ -194,7 +191,6 @@ Like their non-reentrant counterparts, \fBgethostbyname_r()\fR and \fBgethostbyaddr_r()\fR leave the enumeration position in an indeterminate state. .SH RETURN VALUES -.LP Host entries are represented by the \fBstruct hostent\fR structure defined in \fB<netdb.h>\fR: .sp @@ -241,7 +237,6 @@ always equal to the \fIresult\fR pointer that was supplied by the caller. The \fBsethostent()\fR and \fBendhostent()\fR functions return \fB0\fR on success. .SH ERRORS -.LP The reentrant functions \fBgethostbyname_r()\fR, \fBgethostbyaddr_r()\fR, and \fBgethostent_r()\fR will return \fINULL\fR and set \fIerrno\fR to \fBERANGE\fR if the length of the buffer supplied by caller is not large enough to store the @@ -268,7 +263,6 @@ returns an internal error with a value of \(mi1. The \fBgethostbyname()\fR function will set \fIh_errno\fR to \fBNETDB_INTERNAL\fR when it returns a \fINULL\fR value. .SH EXAMPLES -.LP \fBExample 1 \fRUsing \fBgethostbyaddr()\fR .sp .LP @@ -280,7 +274,7 @@ address: .in +2 .nf #include <stdio.h> -#include <stdlib.h +#include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> @@ -353,7 +347,6 @@ configuration file for the name service switch .RE .SH ATTRIBUTES -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -370,17 +363,14 @@ T} .TE .SH SEE ALSO -.LP \fBIntro\fR(2), \fBIntro\fR(3), \fBbyteorder\fR(3C), \fBinet\fR(3SOCKET), \fBnetdb.h\fR(3HEAD), \fBnetdir\fR(3NSL), \fBhosts\fR(4), \fBnetconfig\fR(4), \fBnss\fR(4), \fBnsswitch.conf\fR(4), \fBattributes\fR(5) .SH WARNINGS -.LP The reentrant interfaces \fBgethostbyname_r()\fR, \fBgethostbyaddr_r()\fR, and \fBgethostent_r()\fR are included in this release on an uncommitted basis only and are subject to change or removal in future minor releases. .SH NOTES -.LP To ensure that they all return consistent results, \fBgethostbyname()\fR, \fBgethostbyname_r()\fR, and \fBnetdir_getbyname()\fR are implemented in terms of the same internal library function. This function obtains the system-wide |
