OSDN Git Service

6854ba17db328ae576ea7a597c45f02a1307bd98
[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-09-20 "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 .SH ÊÖ¤êÃÍ
100 .BR getpwent ()
101 ´Ø¿ô¤Ï
102 .I passwd
103 ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
104 ¤³¤ì°Ê¾å¥¨¥ó¥È¥ê¤¬Ìµ¤¤¤«¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
105 ¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢
106 .I errno
107 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
108 ¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸å¤Ë
109 .I errno
110 ¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤·Á°¤Ë
111 .I errno
112 ¤ò 0 ¤ËÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£
113
114 ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î
115 .BR getpwent (),
116 .BR getpwnam (3),
117 .BR getpwuid (3)
118 ¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
119 (ÊÖ¤µ¤ì¤¿¥Ý¥¤¥ó¥¿¤ò
120 .BR free (3)
121 ¤ËÅϤµ¤Ê¤¤¤³¤È¡£)
122 .SH ¥¨¥é¡¼
123 .TP
124 .B EINTR
125 ¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¡£
126 .TP
127 .B EIO
128 Æþ½ÐÎÏ¥¨¥é¡¼¡£
129 .TP
130 .B EMFILE
131 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬
132 ¤¹¤Ç¤Ë¾å¸Â
133 .RB ( OPEN_MAX )
134 ¤Ç¤¢¤Ã¤¿¡£
135 .TP
136 .B ENFILE
137 ¥·¥¹¥Æ¥à¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô¤¬¤¹¤Ç¤Ë¾å¸Â¤Ç¤¢¤Ã¤¿¡£
138 .TP
139 .B ENOMEM
140 .\" POSIX ¤Ë¤Ï¤Ê¤¤¡£
141 .I passwd
142 ¹½Â¤ÂΤ˳ä¤êÅö¤Æ¤ë¥á¥â¥ê¤¬½½Ê¬¤Ê¤«¤Ã¤¿¡£
143 .TP
144 .B ERANGE
145 ½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬¤Ê¤¤¡£
146 .SH ¥Õ¥¡¥¤¥ë
147 .TP
148 .I /etc/passwd
149 ¥í¡¼¥«¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
150 .SH ½àµò
151 SVr4, 4.3BSD, POSIX.1-2001.
152 .SH ´ØÏ¢¹àÌÜ
153 .BR fgetpwent (3),
154 .BR getpw (3),
155 .BR getpwent_r (3),
156 .BR getpwnam (3),
157 .BR getpwuid (3),
158 .BR putpwent (3),
159 .BR passwd (5)