OSDN Git Service

長音記号の修正を release に反映
[linuxjm/LDP_man-pages.git] / release / man3 / getgrent.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 .\" Modified Sat Jul 24 19:29:54 1993 by Rik Faith (faith@cs.unc.edu)
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .\"
36 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
37 .\"     all rights reserved.
38 .\" Translated 1997-12-19, HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
39 .\" Updated & Modified 2004-05-30, Yuichi SATO <ysato444@yahoo.co.jp>
40 .\" Updated & Modified 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
41 .\"
42 .TH GETGRENT 3 2014\-10\-02 "" "Linux Programmer's Manual"
43 .SH 名前
44 getgrent, setgrent, endgrent \- グループファイルエントリーの取得
45 .SH 書式
46 .nf
47 \fB#include <sys/types.h>\fP
48 \fB#include <grp.h>\fP
49 .sp
50 \fBstruct group *getgrent(void);\fP
51 .sp
52 \fBvoid setgrent(void);\fP
53 .sp
54 \fBvoid endgrent(void);\fP
55 .fi
56 .sp
57 .in -4n
58 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
59 .in
60 .sp
61 .PD 0
62 .ad l
63 \fBsetgrent\fP():
64 .RS 4
65 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED ||
66 .br
67 /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L
68 .RE
69 .sp
70 \fBgetgrent\fP(), \fBendgrent\fP():
71 .RS 4
72 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
73 .RE
74 .PD
75 .ad b
76 .SH 説明
77 \fBgetgrent\fP()  関数は、グループデータベースから取得したエントリーを 要素毎に分解し、各要素を格納した構造体へのポインターを返す
78 (グループデータベースの例: ローカルのグループファイル \fI/etc/group\fP, NIS, LDAP)。 \fBgetgrent\fP()
79 は、最初に呼び出された時は最初のエントリーを返し、 それ以降は呼び出される毎に次のエントリーを返す。
80 .PP
81 \fBsetgrent\fP()  関数を使うと、もう一度読み込めるように、 グループデータベースの先頭に戻る。
82 .PP
83 \fBendgrent\fP()  関数は、全ての処理が終わった後にグループ データベースをクローズする。
84 .PP
85 \fIgroup\fP 構造体は \fI<grp.h>\fP で以下のように定義されている:
86 .sp
87 .in +4n
88 .nf
89 struct group {
90     char   *gr_name;        /* グループ名 */
91     char   *gr_passwd;      /* グループのパスワード */
92     gid_t   gr_gid;         /* グループ ID */
93     char  **gr_mem;         /* グループのメンバ名へのポインター
94                                の配列 (配列はヌルで終端する) */
95 };
96 .fi
97 .in
98 .PP
99 この構造体のフィールドの詳細は \fBgroup\fP(5)  を参照のこと。
100 .SH 返り値
101 \fBgetgrent\fP()  関数は \fIgroup\fP 構造体へのポインターを返す。 これ以上エントリーが無いか、エラーが発生した場合は NULL
102 を返す。
103 .LP
104 エラーが発生すると、 \fIerrno\fP が適切に設定される。 この関数の呼び出し後に \fIerrno\fP をチェックしたい場合は、呼び出し前に
105 \fIerrno\fP を 0 に設定しておかないといけない。
106
107 返り値は静的な領域を指しており、その後の \fBgetgrent\fP(), \fBgetgrgid\fP(3), \fBgetgrnam\fP(3)
108 の呼び出しで上書きされるかもしれない。 (返されたポインターを \fBfree\fP(3)  に渡さないこと。)
109 .SH エラー
110 .TP 
111 \fBEAGAIN\fP
112 サービスが一時的に利用できなかったこと。あとでもう一度試してほしい。 NSS バックエンドの場合、glibc
113 では、バックエンドとの通信中に一時的なエラーが発生したことを示す。 このエラーは直るかもしれないので、あとでもう一度試すよう提案している。
114 .TP 
115 \fBEINTR\fP
116 シグナルが捕捉された。
117 .TP 
118 \fBEIO\fP
119 I/O エラー。
120 .TP 
121 \fBEMFILE\fP
122 呼び出したプロセスが既にファイルをオープンし過ぎている。
123 .TP 
124 \fBENFILE\fP
125 システム上にオープンされたファイルが多過ぎる。
126 .TP 
127 .\" not in POSIX
128 \fBENOENT\fP
129 必要な入力ファイルが見つからなかった。 NSS バックエンドの場合、glibc では、このエラーはバックエンドが正しく設定されていないことを示す。
130 .TP 
131 \fBENOMEM\fP
132 .\" not in POSIX
133 \fIgroup\fP 構造体を割り当てるためのメモリーが不十分。
134 .TP 
135 \fBERANGE\fP
136 与えられたバッファー空間が不十分である。
137 .SH ファイル
138 .TP 
139 \fI/etc/group\fP
140 ローカルのグループデータベースファイル
141 .SH 属性
142 .SS "マルチスレッディング (pthreads(7) 参照)"
143 \fBgetgrent\fP() 関数はスレッドセーフではない。
144 .LP
145 関数 \fBsetgrent\fP() と \fBendgrent\fP() はスレッドセーフである。
146 .SH 準拠
147 SVr4, 4.3BSD, POSIX.1\-2001.
148 .SH 関連項目
149 \fBfgetgrent\fP(3), \fBgetgrent_r\fP(3), \fBgetgrgid\fP(3), \fBgetgrnam\fP(3)
150 \fBgetgrouplist\fP(3), \fBputgrent\fP(3), \fBgroup\fP(5)
151 .SH この文書について
152 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部
153 である。プロジェクトの説明とバグ報告に関する情報は
154 http://www.kernel.org/doc/man\-pages/ に書かれている。