OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / release / 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  2010-10-21 "GNU" "Linux Programmer's Manual"
37 .SH Ì¾Á°
38 getpwent, setpwent, endpwent \- ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤Î¼èÆÀ
39 .SH ½ñ¼°
40 .nf
41 .B #include <sys/types.h>
42 .B #include <pwd.h>
43 .sp
44 .B struct passwd *getpwent(void);
45 .sp
46 .B void setpwent(void);
47 .sp
48 .B void endpwent(void);
49 .fi
50 .sp
51 .in -4n
52 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
53 .RB ( feature_test_macros (7)
54 »²¾È):
55 .in
56 .sp
57 .ad l
58 .BR getpwent (),
59 .BR setpwent (),
60 .BR endpwent ():
61 .RS 4
62 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
63 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
64 .RE
65 .ad b
66 .SH ÀâÌÀ
67 .BR getpwent ()
68 ´Ø¿ô¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼èÆÀ¤·¤¿¥¨¥ó¥È¥ê¤ò
69 Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹
70 (¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã:
71 ¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë
72 .IR /etc/passwd ,
73 NIS, LDAP)¡£
74 .BR getpwent ()
75 ¤Ï¡¢ºÇ½é¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤ÏºÇ½é¤Î¥¨¥ó¥È¥ê¤òÊÖ¤·¡¢¤½¤ì°Ê¹ß¤Ï
76 ¸Æ¤Ó½Ð¤µ¤ì¤ëËè¤Ë¼¡¤Î¥¨¥ó¥È¥ê¤òÊÖ¤¹¡£
77 .PP
78 .BR setpwent ()
79 ´Ø¿ô¤ò»È¤¦¤È¡¢¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀèƬ¤ËÌá¤ë¡£
80 .PP
81 .BR endpwent ()
82 ´Ø¿ô¤Ï¡¢Á´¤Æ¤Î½èÍý¤¬½ª¤ï¤Ã¤¿¸å¤Ë¥Ñ¥¹¥ï¡¼¥É¡¦
83 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
84 .PP
85 \fIpasswd\fP ¹½Â¤ÂΤϠ\fI<pwd.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
86 .sp
87 .in +4n
88 .nf
89 struct passwd {
90     char   *pw_passwd;     /* ¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É */
91     uid_t   pw_uid;        /* ¥æ¡¼¥¶ ID */
92     gid_t   pw_gid;        /* ¥°¥ë¡¼¥× ID */
93     char   *pw_gecos;      /* ¥æ¡¼¥¶¾ðÊó */
94     char   *pw_dir;        /* ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê */
95     char   *pw_shell;      /* ¥·¥§¥ë¥×¥í¥°¥é¥à */
96 };
97 .fi
98 .in
99 .PP
100 ¤³¤Î¹½Â¤ÂΤΥե£¡¼¥ë¥É¤Î¾ÜºÙ¤Ï
101 .BR passwd (5)
102 ¤ò»²¾È¤Î¤³¤È¡£
103 .SH ÊÖ¤êÃÍ
104 .BR getpwent ()
105 ´Ø¿ô¤Ï
106 .I passwd
107 ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
108 ¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
109 ¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢
110 .I errno
111 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
112 ¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸å¤Ë
113 .I errno
114 ¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤·Á°¤Ë
115 .I errno
116 ¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£
117
118 ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î
119 .BR getpwent (),
120 .BR getpwnam (3),
121 .BR getpwuid (3)
122 ¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
123 (ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò
124 .BR free (3)
125 ¤ËÅϤµ¤Ê¤¤¤³¤È¡£)
126 .SH ¥¨¥é¡¼
127 .TP
128 .B EINTR
129 ¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¡£
130 .TP
131 .B EIO
132 Æþ½ÐÎÏ¥¨¥é¡¼¡£
133 .TP
134 .B EMFILE
135 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬
136 ¤¹¤Ç¤Ë¾å¸Â
137 .RB ( OPEN_MAX )
138 ¤Ç¤¢¤Ã¤¿¡£
139 .TP
140 .B ENFILE
141 ¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤Ë¾å¸Â¤Ç¤¢¤Ã¤¿¡£
142 .TP
143 .B ENOMEM
144 .\" POSIX ¤Ë¤Ï¤Ê¤¤¡£
145 .I passwd
146 ¹½Â¤ÂΤ˳ä¤êÅö¤Æ¤ë¥á¥â¥ê¤¬½½Ê¬¤Ê¤«¤Ã¤¿¡£
147 .TP
148 .B ERANGE
149 ½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤¡£
150 .SH ¥Õ¥¡¥¤¥ë
151 .TP
152 .I /etc/passwd
153 ¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
154 .SH ½àµò
155 SVr4, 4.3BSD, POSIX.1-2001.
156 .I pw_gecos
157 ¥Õ¥£¡¼¥ë¥É¤Ï POSIX ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢
158 ¤Û¤È¤ó¤É¤Î¼ÂÁõ¤Ë¸ºß¤¹¤ë¡£
159 .SH ´ØÏ¢¹àÌÜ
160 .BR fgetpwent (3),
161 .BR getpw (3),
162 .BR getpwent_r (3),
163 .BR getpwnam (3),
164 .BR getpwuid (3),
165 .BR putpwent (3),
166 .BR passwd (5)