diff options
Diffstat (limited to 'lib/libc/net/getnetent.3')
-rw-r--r-- | lib/libc/net/getnetent.3 | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/lib/libc/net/getnetent.3 b/lib/libc/net/getnetent.3 index adf2760d132f..bd588bd7551a 100644 --- a/lib/libc/net/getnetent.3 +++ b/lib/libc/net/getnetent.3 @@ -25,10 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)getnetent.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD$ -.\" -.Dd June 4, 1993 +.Dd June 27, 2022 .Dt GETNETENT 3 .Os .Sh NAME @@ -52,6 +49,12 @@ .Fn setnetent "int stayopen" .Ft void .Fn endnetent void +.Ft int +.Fn getnetent_r "struct netent *ne" "char *buffer" "size_t buflen" "struct netent **result" "int *h_errnop" +.Ft int +.Fn getnetbyaddr_r "uint32_t net" "int type" "struct netent *ne" "char *buffer" "size_t buflen" "struct netent **result" int *h_errorp" +.Ft int +.Fn getnetbyname_r "const char *name" "struct netent *ne" "char *buffer" "size_t buflen" "struct netent **result" "int *h_errorp" .Sh DESCRIPTION The .Fn getnetent , @@ -62,9 +65,7 @@ functions each return a pointer to an object with the following structure describing an internet network. This structure contains either the information obtained -from the nameserver, -.Xr named 8 , -broken-out fields of a line in the network data base +from the nameserver, broken-out fields of a line in the network data base .Pa /etc/networks , or entries supplied by the .Xr yp 8 @@ -135,6 +136,26 @@ argument must be .Dv AF_INET . Network numbers are supplied in host order. +.Pp +Functions with the +.Em _r +suffix provide reentrant versions of their respective counterparts. +The caller must supply five additional parameters: a +.Vt struct netent +variable to be filled on success, a +.Va buffer +of +.Va buflen +bytes in size, a +.Vt struct netent +.Va result +variable that will point to the result on success or be set to +.Dv NULL +on failure or if the name is not found. +The +.Va h_errnop +variable will be filled with the error code if any. +All these functions return 0 on success. .Sh FILES .Bl -tag -width /etc/nsswitch.conf -compact .It Pa /etc/networks |