summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/getnetent.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/getnetent.3')
-rw-r--r--src/lib/libc/net/getnetent.324
1 files changed, 8 insertions, 16 deletions
diff --git a/src/lib/libc/net/getnetent.3 b/src/lib/libc/net/getnetent.3
index 3227f39b06..0c401c74ff 100644
--- a/src/lib/libc/net/getnetent.3
+++ b/src/lib/libc/net/getnetent.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getnetent.3,v 1.10 2000/12/17 21:30:38 millert Exp $ 1.\" $OpenBSD: getnetent.3,v 1.11 2000/12/24 00:30:56 aaron Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -59,11 +59,8 @@ The
59.Fn getnetbyname , 59.Fn getnetbyname ,
60and 60and
61.Fn getnetbyaddr 61.Fn getnetbyaddr
62functions 62functions each return a pointer to an object with the following structure
63each return a pointer to an object with the 63containing the broken-out fields of a line in the network database,
64following structure
65containing the broken-out
66fields of a line in the network database,
67.Pa /etc/networks . 64.Pa /etc/networks .
68.Bd -literal -offset indent 65.Bd -literal -offset indent
69struct netent { 66struct netent {
@@ -90,13 +87,11 @@ Network numbers are returned in machine byte order.
90.Pp 87.Pp
91The 88The
92.Fn getnetent 89.Fn getnetent
93function 90function reads the next line of the file, opening the file if necessary.
94reads the next line of the file, opening the file if necessary.
95.Pp 91.Pp
96The 92The
97.Fn setnetent 93.Fn setnetent
98function 94function opens and rewinds the file.
99opens and rewinds the file.
100If the 95If the
101.Fa stayopen 96.Fa stayopen
102flag is non-zero, 97flag is non-zero,
@@ -107,15 +102,13 @@ or
107.Pp 102.Pp
108The 103The
109.Fn endnetent 104.Fn endnetent
110function 105function closes the file.
111closes the file.
112.Pp 106.Pp
113The 107The
114.Fn getnetbyname 108.Fn getnetbyname
115function
116and 109and
117.Fn getnetbyaddr 110.Fn getnetbyaddr
118search the domain name server if the system is configured to use one. 111functions search the domain name server if the system is configured to use one.
119If the search fails, or no name server is configured, they sequentially 112If the search fails, or no name server is configured, they sequentially
120search from the beginning of the file until a matching net name or 113search from the beginning of the file until a matching net name or
121net address and type is found, or until 114net address and type is found, or until
@@ -127,8 +120,7 @@ Network numbers are supplied in host order.
127.It Pa /etc/networks 120.It Pa /etc/networks
128.El 121.El
129.Sh DIAGNOSTICS 122.Sh DIAGNOSTICS
130Null pointer 123Null pointer (0) returned on
131(0) returned on
132.Dv EOF 124.Dv EOF
133or error. 125or error.
134.Sh SEE ALSO 126.Sh SEE ALSO