OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / getgrent.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:29:54 1993 by Rik Faith (faith@cs.unc.edu)
28 .\"
29 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
30 .\"     all rights reserved.
31 .\" Translated 1997-12-19, HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
32 .\" Updated & Modified 2004-05-30, Yuichi SATO <ysato444@yahoo.co.jp>
33 .\" Updated & Modified 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
34 .\"
35 .TH GETGRENT 3  2009-03-30 "" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .SH Ì¾Á°
38 .\"O getgrent, setgrent, endgrent \- get group file entry
39 getgrent, setgrent, endgrent \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼èÆÀ
40 .\"O .SH SYNOPSIS
41 .SH ½ñ¼°
42 .nf
43 .B #include <sys/types.h>
44 .B #include <grp.h>
45 .sp
46 .B struct group *getgrent(void);
47 .sp
48 .B void setgrent(void);
49 .sp
50 .B void endgrent(void);
51 .fi
52 .sp
53 .in -4n
54 .\"O Feature Test Macro Requirements for glibc (see
55 .\"O .BR feature_test_macros (7)):
56 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
57 .RB ( feature_test_macros (7)
58 »²¾È):
59 .in
60 .sp
61 .ad l
62 .BR getgrent (),
63 .BR setgrent (),
64 .BR endgrent ():
65 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
66 .ad b
67 .\"O .SH DESCRIPTION
68 .SH ÀâÌÀ
69 .\"O The
70 .\"O .BR getgrent ()
71 .\"O function returns a pointer to a structure containing
72 .\"O the broken-out fields of a record in the group database
73 .\"O (e.g., the local group file
74 .\"O .IR /etc/group ,
75 .\"O NIS, and LDAP).
76 .\"O The first time it is called
77 .\"O it returns the first entry; thereafter, it returns successive entries.
78 .BR getgrent ()
79 ´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼èÆÀ¤·¤¿¥¨¥ó¥È¥ê¤ò
80 Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹
81 (¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã:
82 ¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë
83 .IR /etc/group ,
84 NIS, LDAP)¡£
85 ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤ÏºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï
86 ¸Æ¤Ó½Ð¤µ¤ì¤ëËè¤Ë¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£
87 .PP
88 .\"O The
89 .\"O .BR setgrent ()
90 .\"O function rewinds to the beginning
91 .\"O of the group database, to allow repeated scans.
92 .BR setgrent ()
93 ´Ø¿ô¤ò»È¤¦¤È¡¢¤â¤¦°ìÅÙÆɤ߹þ¤á¤ë¤è¤¦¤Ë¡¢
94 ¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀèƬ¤ËÌá¤ë¡£
95 .PP
96 .\"O The
97 .\"O .BR endgrent ()
98 .\"O function is used to close the group database
99 .\"O after all processing has been performed.
100 .BR endgrent ()
101 ´Ø¿ô¤Ï¡¢Á´¤Æ¤Î½èÍý¤¬½ª¤ï¤Ã¤¿¸å¤Ë¥°¥ë¡¼¥×¡¦
102 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
103 .PP
104 .\"O The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
105 \fIgroup\fP ¹½Â¤ÂΤϡ¢\fI<grp.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
106 .sp
107 .in +4n
108 .nf
109 struct group {
110 .\"O     char   *gr_name;       /* group name */
111 .\"O     char   *gr_passwd;     /* group password */
112 .\"O     gid_t   gr_gid;        /* group ID */
113 .\"O     char  **gr_mem;        /* group members */
114     char   *gr_name;       /* ¥°¥ë¡¼¥×̾ */
115     char   *gr_passwd;     /* ¥°¥ë¡¼¥×¤Î¥Ñ¥¹¥ï¡¼¥É */
116     gid_t   gr_gid;        /* ¥°¥ë¡¼¥× ID */
117     char  **gr_mem;        /* ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð */
118 };
119 .fi
120 .in
121 .\"O .SH "RETURN VALUE"
122 .SH ÊÖ¤êÃÍ
123 .\"O The
124 .\"O .BR getgrent ()
125 .\"O function returns a pointer to a
126 .\"O .I group
127 .\"O structure,
128 .\"O or NULL if there are no more entries or an error occurs.
129 .BR getgrent ()
130 ´Ø¿ô¤Ï
131 .I group
132 ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
133 ¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
134 .LP
135 .\"O Upon error,
136 .\"O .I errno
137 .\"O may be set.
138 .\"O If one wants to check
139 .\"O .I errno
140 .\"O after the call, it should be set to zero before the call.
141 ¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢
142 .I errno
143 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
144 ¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸å¤Ë
145 .I errno
146 ¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤·Á°¤Ë
147 .I errno
148 ¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£
149
150 .\"O The return value may point to a static area, and may be overwritten
151 .\"O by subsequent calls to
152 .\"O .BR getgrent (),
153 .\"O .BR getgrgid (3),
154 .\"O or
155 .\"O .BR getgrnam (3).
156 .\"O (Do not pass the returned pointer to
157 .\"O .BR free (3).)
158 ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î
159 .BR getgrent (),
160 .BR getgrgid (3),
161 .BR getgrnam (3)
162 ¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
163 (ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò
164 .BR free (3)
165 ¤ËÅϤµ¤Ê¤¤¤³¤È¡£)
166 .\"O .SH ERRORS
167 .SH ¥¨¥é¡¼
168 .TP
169 .B EINTR
170 .\"O A signal was caught.
171 ¥·¥°¥Ê¥ë¤¬¥­¥ã¥Ã¥Á¤µ¤ì¤¿¡£
172 .TP
173 .B EIO
174 .\"O I/O error.
175 I/O ¥¨¥é¡¼¡£
176 .TP
177 .B EMFILE
178 .\"O The calling process already has too many open files.
179 ¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬´û¤Ë¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·²á¤®¤Æ¤¤¤ë¡£
180 .TP
181 .B ENFILE
182 .\"O Too many open files in the system.
183 ¥·¥¹¥Æ¥à¾å¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¿²á¤®¤ë¡£
184 .TP
185 .B ENOMEM
186 .\"O .\" not in POSIX
187 .\"O Insufficient memory to allocate
188 .\"O .I group
189 .\"O structure.
190 .\" POSIX ¤Ë¤Ï¤Ê¤¤¡£
191 .I group
192 ¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£
193 .TP
194 .B ERANGE
195 .\"O Insufficient buffer space supplied.
196 ½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤¡£
197 .SH ¥Õ¥¡¥¤¥ë
198 .TP
199 .I /etc/group
200 .\"O local group database file
201 ¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
202 .\"O .SH "CONFORMING TO"
203 .SH ½àµò
204 SVr4, 4.3BSD, POSIX.1-2001.
205 .\"O .SH "SEE ALSO"
206 .SH ´ØÏ¢¹àÌÜ
207 .BR fgetgrent (3),
208 .BR getgrent_r (3),
209 .BR getgrgid (3),
210 .BR getgrnam (3)
211 .BR getgrouplist (3),
212 .BR putgrent (3)