OSDN Git Service

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