OSDN Git Service

(split) LDP: Update original to LDP v3.38.
[linuxjm/LDP_man-pages.git] / original / man3 / fgetgrent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 19:38:44 1993 by Rik Faith (faith@cs.unc.edu)
28 .TH FGETGRENT 3  2008-07-10 "GNU" "Linux Programmer's Manual"
29 .SH NAME
30 fgetgrent \- get group file entry
31 .SH SYNOPSIS
32 .nf
33 .B #include <stdio.h>
34 .B #include <sys/types.h>
35 .B #include <grp.h>
36 .sp
37 .BI "struct group *fgetgrent(FILE *" stream );
38 .fi
39 .sp
40 .in -4n
41 Feature Test Macro Requirements for glibc (see
42 .BR feature_test_macros (7)):
43 .in
44 .sp
45 .BR fgetgrent ():
46 _SVID_SOURCE
47 .SH DESCRIPTION
48 The
49 .BR fgetgrent ()
50 function returns a pointer to a structure containing
51 the group information from the file referred to by
52 .IR stream .
53 The first time it is called
54 it returns the first entry; thereafter, it returns successive entries.
55 The file referred to by
56 .I stream
57 must have the same format as
58 .I /etc/group
59 (see
60 .BR group (5)).
61 .PP
62 The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
63 .sp
64 .in +4n
65 .nf
66 struct group {
67     char   *gr_name;        /* group name */
68     char   *gr_passwd;      /* group password */
69     gid_t   gr_gid;         /* group ID */
70     char  **gr_mem;         /* group members */
71 };
72 .fi
73 .in
74 .SH "RETURN VALUE"
75 The
76 .BR fgetgrent ()
77 function returns a pointer to a
78 .I group
79 structure,
80 or NULL if there are no more entries or an error occurs.
81 .SH ERRORS
82 .TP
83 .B ENOMEM
84 Insufficient memory to allocate
85 .I group
86 structure.
87 .SH "CONFORMING TO"
88 SVr4.
89 .SH "SEE ALSO"
90 .BR endgrent (3),
91 .BR fgetgrent_r (3),
92 .BR fopen (3),
93 .BR getgrent (3),
94 .BR getgrgid (3),
95 .BR getgrnam (3),
96 .BR putgrent (3),
97 .BR setgrent (3),
98 .BR group (5)