| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: getgrent.3,v 1.30 2010/03/22 19:30:53 joerg Exp $ | | 1 | .\" $NetBSD: getgrent.3,v 1.31 2011/04/28 16:34:01 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1989, 1991, 1993 | | 3 | .\" Copyright (c) 1989, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" 3. Neither the name of the University nor the names of its contributors | | 14 | .\" 3. Neither the name of the University nor the names of its contributors |
| @@ -206,74 +206,79 @@ to indicate the nature of the failure. | | | @@ -206,74 +206,79 @@ to indicate the nature of the failure. |
206 | .Pp | | 206 | .Pp |
207 | The | | 207 | The |
208 | .Fn setgroupent | | 208 | .Fn setgroupent |
209 | function returns the value 1 if successful, otherwise the value | | 209 | function returns the value 1 if successful, otherwise the value |
210 | 0 is returned, setting the global variable | | 210 | 0 is returned, setting the global variable |
211 | .Dv errno | | 211 | .Dv errno |
212 | to indicate the nature of the failure. | | 212 | to indicate the nature of the failure. |
213 | .Pp | | 213 | .Pp |
214 | The | | 214 | The |
215 | .Fn endgrent | | 215 | .Fn endgrent |
216 | and | | 216 | and |
217 | .Fn setgrent | | 217 | .Fn setgrent |
218 | functions have no return value. | | 218 | functions have no return value. |
| | | 219 | .Sh FILES |
| | | 220 | .Bl -tag -width /etc/group -compact |
| | | 221 | .It Pa /etc/group |
| | | 222 | group database file |
| | | 223 | .El |
| | | 224 | .Sh COMPATIBILITY |
| | | 225 | The historic function |
| | | 226 | .Fn setgrfile , |
| | | 227 | which allowed the specification of alternative group databases, has |
| | | 228 | been deprecated and is no longer available. |
219 | .Sh ERRORS | | 229 | .Sh ERRORS |
220 | The following error codes may be set in | | 230 | The following error codes may be set in |
221 | .Va errno | | 231 | .Va errno |
222 | for | | 232 | for |
223 | .Nm getgrent , | | 233 | .Nm getgrent , |
224 | .Nm getgrent_r , | | 234 | .Nm getgrent_r , |
225 | .Nm getgrnam , | | 235 | .Nm getgrnam , |
226 | .Nm getgrnam_r , | | 236 | .Nm getgrnam_r , |
227 | .Nm getgrgid , | | 237 | .Nm getgrgid , |
228 | .Nm getgrgid_r , | | 238 | .Nm getgrgid_r , |
229 | and | | 239 | and |
230 | .Nm setgroupent : | | 240 | .Nm setgroupent : |
231 | .Bl -tag -width Er | | 241 | .Bl -tag -width Er |
232 | .It Bq Er EIO | | | |
233 | An I/O error has occurred. | | | |
234 | .It Bq Er EINTR | | 242 | .It Bq Er EINTR |
235 | A signal was caught during the database search. | | 243 | A signal was caught during the database search. |
| | | 244 | .It Bq Er EIO |
| | | 245 | An I/O error has occurred. |
236 | .It Bq Er EMFILE | | 246 | .It Bq Er EMFILE |
237 | The limit on open files for this process has been reached. | | 247 | The limit on open files for this process has been reached. |
238 | .It Bq Er ENFILE | | 248 | .It Bq Er ENFILE |
239 | The system limit on open files has been reached. | | 249 | The system limit on open files has been reached. |
240 | .El | | 250 | .El |
241 | .Pp | | 251 | .Pp |
242 | The following error code may be set in | | 252 | The following error code may be set in |
243 | .Va errno | | 253 | .Va errno |
244 | for | | 254 | for |
245 | .Nm getgrent_r , | | 255 | .Nm getgrent_r , |
246 | .Nm getgrnam_r , | | 256 | .Nm getgrnam_r , |
247 | and | | 257 | and |
248 | .Nm getgrgid_r : | | 258 | .Nm getgrgid_r : |
249 | .Bl -tag -width Er | | 259 | .Bl -tag -width Er |
250 | .It Bq Er ERANGE | | 260 | .It Bq Er ERANGE |
251 | The resulting | | 261 | The resulting |
252 | .Ft struct group | | 262 | .Ft struct group |
253 | does not fit in the space defined by | | 263 | does not fit in the space defined by |
254 | .Dv buffer | | 264 | .Dv buffer |
255 | and | | 265 | and |
256 | .Dv buflen | | 266 | .Dv buflen |
257 | .El | | 267 | .El |
258 | .Pp | | 268 | .Pp |
259 | Other | | 269 | Other |
260 | .Dv errno | | 270 | .Dv errno |
261 | values may be set depending on the specific database backends. | | 271 | values may be set depending on the specific database backends. |
262 | .Sh FILES | | | |
263 | .Bl -tag -width /etc/group -compact | | | |
264 | .It Pa /etc/group | | | |
265 | group database file | | | |
266 | .El | | | |
267 | .Sh SEE ALSO | | 272 | .Sh SEE ALSO |
268 | .Xr getpwent 3 , | | 273 | .Xr getpwent 3 , |
269 | .Xr group 5 , | | 274 | .Xr group 5 , |
270 | .Xr nsswitch.conf 5 | | 275 | .Xr nsswitch.conf 5 |
271 | .Sh STANDARDS | | 276 | .Sh STANDARDS |
272 | The | | 277 | The |
273 | .Fn getgrgid | | 278 | .Fn getgrgid |
274 | and | | 279 | and |
275 | .Fn getgrnam | | 280 | .Fn getgrnam |
276 | functions conform to | | 281 | functions conform to |
277 | .St -p1003.1-90 . | | 282 | .St -p1003.1-90 . |
278 | The | | 283 | The |
279 | .Fn getgrgid_r | | 284 | .Fn getgrgid_r |
| @@ -303,31 +308,26 @@ appeared in | | | @@ -303,31 +308,26 @@ appeared in |
303 | .At v7 . | | 308 | .At v7 . |
304 | The functions | | 309 | The functions |
305 | .Fn setgrfile | | 310 | .Fn setgrfile |
306 | and | | 311 | and |
307 | .Fn setgroupent | | 312 | .Fn setgroupent |
308 | appeared in | | 313 | appeared in |
309 | .Bx 4.3 Reno . | | 314 | .Bx 4.3 Reno . |
310 | The functions | | 315 | The functions |
311 | .Fn getgrgid_r | | 316 | .Fn getgrgid_r |
312 | and | | 317 | and |
313 | .Fn getgrnam_r | | 318 | .Fn getgrnam_r |
314 | appeared in | | 319 | appeared in |
315 | .Nx 3.0 . | | 320 | .Nx 3.0 . |
316 | .Sh COMPATIBILITY | | | |
317 | The historic function | | | |
318 | .Fn setgrfile , | | | |
319 | which allowed the specification of alternative group databases, has | | | |
320 | been deprecated and is no longer available. | | | |
321 | .Sh BUGS | | 321 | .Sh BUGS |
322 | The functions | | 322 | The functions |
323 | .Fn getgrent , | | 323 | .Fn getgrent , |
324 | .Fn getgrgid , | | 324 | .Fn getgrgid , |
325 | .Fn getgrnam , | | 325 | .Fn getgrnam , |
326 | .Fn setgroupent | | 326 | .Fn setgroupent |
327 | and | | 327 | and |
328 | .Fn setgrent | | 328 | .Fn setgrent |
329 | leave their results in an internal static object and return | | 329 | leave their results in an internal static object and return |
330 | a pointer to that object. | | 330 | a pointer to that object. |
331 | Subsequent calls to the same function will modify the same object. | | 331 | Subsequent calls to the same function will modify the same object. |
332 | .Pp | | 332 | .Pp |
333 | The functions | | 333 | The functions |