diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/net/getservent.3 | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/lib/libc/net/getservent.3 b/src/lib/libc/net/getservent.3 index 81ebc40cad..85e0d65352 100644 --- a/src/lib/libc/net/getservent.3 +++ b/src/lib/libc/net/getservent.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: getservent.3,v 1.10 2000/12/17 21:30:38 millert Exp $ | 1 | .\" $OpenBSD: getservent.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 getservbyname , | 59 | .Fn getservbyname , |
| 60 | and | 60 | and |
| 61 | .Fn getservbyport | 61 | .Fn getservbyport |
| 62 | functions | 62 | functions each return a pointer to an object with the following structure |
| 63 | each return a pointer to an object with the | 63 | containing the broken-out fields of a line in the network services database, |
| 64 | following structure | ||
| 65 | containing the broken-out | ||
| 66 | fields of a line in the network services database, | ||
| 67 | .Pa /etc/services . | 64 | .Pa /etc/services . |
| 68 | .Bd -literal -offset indent | 65 | .Bd -literal -offset indent |
| 69 | struct servent { | 66 | struct servent { |
| @@ -84,19 +81,16 @@ A zero-terminated list of alternate names for the service. | |||
| 84 | The port number at which the service resides. | 81 | The port number at which the service resides. |
| 85 | Port numbers are returned in network byte order. | 82 | Port numbers are returned in network byte order. |
| 86 | .It Fa s_proto | 83 | .It Fa s_proto |
| 87 | The name of the protocol to use when contacting the | 84 | The name of the protocol to use when contacting the service. |
| 88 | service. | ||
| 89 | .El | 85 | .El |
| 90 | .Pp | 86 | .Pp |
| 91 | The | 87 | The |
| 92 | .Fn getservent | 88 | .Fn getservent |
| 93 | function | 89 | function reads the next line of the file, opening the file if necessary. |
| 94 | reads the next line of the file, opening the file if necessary. | ||
| 95 | .Pp | 90 | .Pp |
| 96 | The | 91 | The |
| 97 | .Fn setservent | 92 | .Fn setservent |
| 98 | function | 93 | function opens and rewinds the file. |
| 99 | opens and rewinds the file. | ||
| 100 | If the | 94 | If the |
| 101 | .Fa stayopen | 95 | .Fa stayopen |
| 102 | flag is non-zero, | 96 | flag is non-zero, |
| @@ -107,19 +101,15 @@ or | |||
| 107 | .Pp | 101 | .Pp |
| 108 | The | 102 | The |
| 109 | .Fn endservent | 103 | .Fn endservent |
| 110 | function | 104 | function closes the file. |
| 111 | closes the file. | ||
| 112 | .Pp | 105 | .Pp |
| 113 | The | 106 | The |
| 114 | .Fn getservbyname | 107 | .Fn getservbyname |
| 115 | and | 108 | and |
| 116 | .Fn getservbyport | 109 | .Fn getservbyport |
| 117 | functions | 110 | functions sequentially search from the beginning of the file until a |
| 118 | sequentially search from the beginning | 111 | matching protocol name or port number (specified in network byte order) |
| 119 | of the file until a matching | 112 | is found, or until |
| 120 | protocol name or | ||
| 121 | port number (specified in network byte order) is found, | ||
| 122 | or until | ||
| 123 | .Dv EOF | 113 | .Dv EOF |
| 124 | is encountered. | 114 | is encountered. |
| 125 | If a protocol name is also supplied (non-null), | 115 | If a protocol name is also supplied (non-null), |
| @@ -129,8 +119,7 @@ searches must also match the protocol. | |||
| 129 | .It Pa /etc/services | 119 | .It Pa /etc/services |
| 130 | .El | 120 | .El |
| 131 | .Sh DIAGNOSTICS | 121 | .Sh DIAGNOSTICS |
| 132 | Null pointer | 122 | Null pointer (0) returned on |
| 133 | (0) returned on | ||
| 134 | .Dv EOF | 123 | .Dv EOF |
| 135 | or error. | 124 | or error. |
| 136 | .Sh SEE ALSO | 125 | .Sh SEE ALSO |
| @@ -147,7 +136,6 @@ and | |||
| 147 | functions appeared in | 136 | functions appeared in |
| 148 | .Bx 4.2 . | 137 | .Bx 4.2 . |
| 149 | .Sh BUGS | 138 | .Sh BUGS |
| 150 | These functions use static data storage; | 139 | These functions use static data storage; if the data is needed for future use, |
| 151 | if the data is needed for future use, it should be | 140 | it should be copied before any subsequent calls overwrite it. |
| 152 | copied before any subsequent calls overwrite it. | ||
| 153 | Expecting port numbers to fit in a 32-bit quantity is probably naive. | 141 | Expecting port numbers to fit in a 32-bit quantity is probably naive. |
