OSDN Git Service

(split) LDP: Update release from the latest PO files
[linuxjm/LDP_man-pages.git] / release / man3 / getpwent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\"
30 .\" Modified Sat Jul 24 19:22:14 1993 by Rik Faith (faith@cs.unc.edu)
31 .\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de)
32 .\"
33 .\"*******************************************************************
34 .\"
35 .\" This file was generated with po4a. Translate the source file.
36 .\"
37 .\"*******************************************************************
38 .TH GETPWENT 3 2010\-10\-21 GNU "Linux Programmer's Manual"
39 .SH 名前
40 getpwent, setpwent, endpwent \- パスワードファイルのエントリの取得
41 .SH 書式
42 .nf
43 \fB#include <sys/types.h>\fP
44 \fB#include <pwd.h>\fP
45 .sp
46 \fBstruct passwd *getpwent(void);\fP
47 .sp
48 \fBvoid setpwent(void);\fP
49 .sp
50 \fBvoid endpwent(void);\fP
51 .fi
52 .sp
53 .in -4n
54 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
55 .in
56 .sp
57 .ad l
58 \fBgetpwent\fP(), \fBsetpwent\fP(), \fBendpwent\fP():
59 .RS 4
60 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
61 .RE
62 .ad b
63 .SH 説明
64 \fBgetpwent\fP()  関数は、パスワード・データベースから取得したエントリを 要素毎に分解し、各要素を格納した構造体へのポインタを返す
65 (パスワード・データベースの例: ローカルのパスワードファイル \fI/etc/passwd\fP, NIS, LDAP)。 \fBgetpwent\fP()
66 は、最初に呼び出された時は最初のエントリを返し、それ以降は 呼び出される毎に次のエントリを返す。
67 .PP
68 \fBsetpwent\fP()  関数を使うと、パスワード・データベースの先頭に戻る。
69 .PP
70 \fBendpwent\fP()  関数は、全ての処理が終わった後にパスワード・ データベースをクローズする。
71 .PP
72 \fIpasswd\fP 構造体は、\fI<pwd.h>\fP で以下のように定義されている:
73 .sp
74 .in +4n
75 .nf
76 struct passwd {
77     char   *pw_name;       /* ユーザ名 */
78     char   *pw_passwd;     /* ユーザのパスワード */
79     uid_t   pw_uid;        /* ユーザ ID */
80     gid_t   pw_gid;        /* グループ ID */
81     char   *pw_gecos;      /* ユーザ情報 */
82     char   *pw_dir;        /* ホームディレクトリ */
83     char   *pw_shell;      /* シェルプログラム */
84 };
85 .fi
86 .in
87 .PP
88 この構造体のフィールドの詳細は \fBpasswd\fP(5)  を参照のこと。
89 .SH 返り値
90 \fBgetpwent\fP()  関数は \fIpasswd\fP 構造体へのポインタを返す。 これ以上エントリが無いか、エラーが発生した場合は NULL
91 を返す。 エラーが発生すると、 \fIerrno\fP が適切に設定される。 この関数の呼び出し後に \fIerrno\fP をチェックしたい場合は、呼び出し前に
92 \fIerrno\fP を 0 に設定しておかないといけない。
93
94 返り値は静的な領域を指しており、その後の \fBgetpwent\fP(), \fBgetpwnam\fP(3), \fBgetpwuid\fP(3)
95 の呼び出しで上書きされるかもしれない。 (返されたポインタを \fBfree\fP(3)  に渡さないこと。)
96 .SH エラー
97 .TP 
98 \fBEINTR\fP
99 シグナルが捕捉された。
100 .TP 
101 \fBEIO\fP
102 I/O エラー。
103 .TP 
104 \fBEMFILE\fP
105 呼び出し元プロセスがオープンしているファイル数が すでに上限 (\fBOPEN_MAX\fP)  であった。
106 .TP 
107 \fBENFILE\fP
108 システムでオープンされているファイル数がすでに上限であった。
109 .TP 
110 \fBENOMEM\fP
111 .\" not in POSIX
112 .\" to allocate the passwd structure, or to allocate buffers
113 \fIpasswd\fP 構造体に割り当てるメモリが十分なかった。
114 .TP 
115 \fBERANGE\fP
116 与えられたバッファ空間が不十分である。
117 .SH ファイル
118 .TP 
119 \fI/etc/passwd\fP
120 ローカルのパスワード・データベースファイル
121 .SH 準拠
122 SVr4, 4.3BSD, POSIX.1\-2001.  \fIpw_gecos\fP フィールドは POSIX では規定されていないが、
123 ほとんどの実装に存在する。
124 .SH 関連項目
125 \fBfgetpwent\fP(3), \fBgetpw\fP(3), \fBgetpwent_r\fP(3), \fBgetpwnam\fP(3),
126 \fBgetpwuid\fP(3), \fBputpwent\fP(3), \fBpasswd\fP(5)
127 .SH この文書について
128 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.51 の一部
129 である。プロジェクトの説明とバグ報告に関する情報は
130 http://www.kernel.org/doc/man\-pages/ に書かれている。