summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/getprotoent.3
diff options
context:
space:
mode:
authoraaron <>2000-12-24 00:31:00 +0000
committeraaron <>2000-12-24 00:31:00 +0000
commitb11608439e707f8c7601b090028e530ea5a1e067 (patch)
tree966934b4f9368fd14deca5be22b83ff9fb439cbd /src/lib/libc/net/getprotoent.3
parent71213d0b131a3545184a31aa671f269eceacad1e (diff)
downloadopenbsd-b11608439e707f8c7601b090028e530ea5a1e067.tar.gz
openbsd-b11608439e707f8c7601b090028e530ea5a1e067.tar.bz2
openbsd-b11608439e707f8c7601b090028e530ea5a1e067.zip
Various repairs, mostly to get rid of short lines.
Diffstat (limited to 'src/lib/libc/net/getprotoent.3')
-rw-r--r--src/lib/libc/net/getprotoent.334
1 files changed, 11 insertions, 23 deletions
diff --git a/src/lib/libc/net/getprotoent.3 b/src/lib/libc/net/getprotoent.3
index 4d1e96e615..1f95529532 100644
--- a/src/lib/libc/net/getprotoent.3
+++ b/src/lib/libc/net/getprotoent.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getprotoent.3,v 1.7 2000/12/17 21:30:38 millert Exp $ 1.\" $OpenBSD: getprotoent.3,v 1.8 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 getprotobyname , 59.Fn getprotobyname ,
60and 60and
61.Fn getprotobynumber 61.Fn getprotobynumber
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 protocol database,
64following structure
65containing the broken-out
66fields of a line in the network protocol database,
67.Pa /etc/protocols . 64.Pa /etc/protocols .
68.Bd -literal -offset indent 65.Bd -literal -offset indent
69.Pp 66.Pp
@@ -86,13 +83,11 @@ The protocol number.
86.Pp 83.Pp
87The 84The
88.Fn getprotoent 85.Fn getprotoent
89function 86function reads the next line of the file, opening the file if necessary.
90reads the next line of the file, opening the file if necessary.
91.Pp 87.Pp
92The 88The
93.Fn setprotoent 89.Fn setprotoent
94function 90function opens and rewinds the file.
95opens and rewinds the file.
96If the 91If the
97.Fa stayopen 92.Fa stayopen
98flag is non-zero, 93flag is non-zero,
@@ -103,24 +98,18 @@ or
103.Pp 98.Pp
104The 99The
105.Fn endprotoent 100.Fn endprotoent
106function 101function closes the file.
107closes the file.
108.Pp 102.Pp
109The 103The
110.Fn getprotobyname 104.Fn getprotobyname
111function
112and 105and
113.Fn getprotobynumber 106.Fn getprotobynumber
114sequentially search from the beginning 107functions sequentially search from the beginning of the file until a
115of the file until a matching 108matching protocol name or protocol number is found, or until
116protocol name or
117protocol number is found,
118or until
119.Dv EOF 109.Dv EOF
120is encountered. 110is encountered.
121.Sh RETURN VALUES 111.Sh RETURN VALUES
122Null pointer 112Null pointer (0) returned on
123(0) returned on
124.Dv EOF 113.Dv EOF
125or error. 114or error.
126.Sh FILES 115.Sh FILES
@@ -140,7 +129,6 @@ and
140functions appeared in 129functions appeared in
141.Bx 4.2 . 130.Bx 4.2 .
142.Sh BUGS 131.Sh BUGS
143These functions use a static data space; 132These functions use a static data space; if the data is needed for future use,
144if the data is needed for future use, it should be 133it should be copied before any subsequent calls overwrite it.
145copied before any subsequent calls overwrite it.
146Only the Internet protocols are currently understood. 134Only the Internet protocols are currently understood.