OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man2 / getgroups.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified Thu Oct 31 12:04:29 1996 by Eric S. Raymond <esr@thyrsus.com>
26 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
27 .\"     Added notes on capability requirements
28 .\" 2008-05-03, mtk, expanded and rewrote parts of DESCRIPTION and RETURN
29 .\"     VALUE, made style of page more consistent with man-pages style.
30 .\"
31 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
32 .\"         all rights reserved.
33 .\" Translated 1997-02-22, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
34 .\" Updated 2001-02-10, Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
35 .\" Updated & Modified 2004-12-30, Yuichi SATO <ysato444@yahoo.co.jp>
36 .\" Updated 2008-08-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
37 .\"
38 .\"WORD:        group                   グループ
39 .\"WORD:        access                  アクセス
40 .\"WORD:        process                 プロセス
41 .\"WORD:        super user              スーパー・ユーザー
42 .\"WORD:        supplementary group     補助グループ
43 .\"
44 .TH GETGROUPS 2 2008-06-03 "Linux" "Linux Programmer's Manual"
45 .\"O .SH NAME
46 .SH 名前
47 .\"O getgroups, setgroups \- get/set list of supplementary group IDs
48 getgroups, setgroups \- 補助グループ ID のリストを取得/設定する
49 .\"O .SH SYNOPSIS
50 .SH 書式
51 .B #include <sys/types.h>
52 .br
53 .B #include <unistd.h>
54 .sp
55 .BI "int getgroups(int " size ", gid_t " list []);
56 .sp
57 .B #include <grp.h>
58 .sp
59 .BI "int setgroups(size_t " size ", const gid_t *" list );
60 .sp
61 .in -4n
62 .\"O Feature Test Macro Requirements for glibc (see
63 .\"O .BR feature_test_macros (7)):
64 glibc 向けの機能検査マクロの要件
65 .RB ( feature_test_macros (7)
66 参照):
67 .in
68 .sp
69 .BR setgroups ():
70 _BSD_SOURCE
71 .\"O .SH DESCRIPTION
72 .SH 説明
73 .PP
74 .\"O .BR getgroups ()
75 .\"O returns the supplementary group IDs of the calling process in
76 .\"O .IR list .
77 .\"O The argument
78 .\"O .I size
79 .\"O should be set to the maximum number of items that can be stored in the
80 .\"O buffer pointed to by
81 .\"O .IR list .
82 .\"O If the calling process is a member of more than
83 .\"O .I size
84 .\"O supplementary groups, then an error results.
85 .BR getgroups ()
86 は呼び出し元プロセスの補助グループ (supplementary group) ID を
87 .I list
88 に返す。
89 .I size
90 引き数には、
91 .I list
92 により参照されるバッファに格納できる要素の最大数を設定すべきである。
93 呼び出し元プロセスが
94 .I size
95 個より多くの補助グループのメンバの場合には、エラーとなる。
96 .\"O It is unspecified whether the effective group ID of the calling process
97 .\"O is included in the returned list.
98 .\"O (Thus, an application should also call
99 .\"O .BR getegid (2)
100 .\"O and add or remove the resulting value.)
101 この関数を呼び出したプロセスの実効グループ ID が、
102 返されるリストに含まれるかどうかは規定されていない
103 (したがって、アプリケーションは
104 .BR getegid (2)
105 を呼び出し、その結果の値を追加・削除すべきである)。
106
107 .\"O If
108 .\"O .I size
109 .\"O is zero,
110 .\"O .I list
111 .\"O is not modified, but the total number of supplementary group IDs for the
112 .\"O process is returned.
113 .I size
114 が 0 ならば、
115 .I list
116 は修正されないが、そのプロセスの補助グループ ID の合計数が返される。
117 .\"O This allows the caller to determine the size of a dynamically allocated
118 .\"O .I list
119 .\"O to be used in a further call to
120 .\"O .BR getgroups ().
121 これを使うことで、それ以降の
122 .BR getgroups ()
123 の呼び出しで必要となる動的割り当てバッファ
124 .I list
125 のサイズを、呼び出し元が決定することができる。
126 .PP
127 .\"O .BR setgroups ()
128 .\"O sets the supplementary group IDs for the calling process.
129 .\"O Appropriate privileges (Linux: the
130 .\"O .B CAP_SETGID
131 .\"O capability) are required.
132 .BR setgroups ()
133 は、呼び出し元プロセスの補助グループ ID を設定する。
134 適切な特権 (Linux では
135 .B CAP_SETGID
136 ケーパビリティ (capability)) が必要である。
137 .\"O The
138 .\"O .I size
139 .\"O argument specifies the number of supplementary group IDs
140 .\"O in the buffer pointed to by
141 .\"O .IR list .
142 .I size
143 引き数には、
144 .I list
145 により参照されるバッファに格納された補助グループ ID の数を指定する。
146 .\"O .SH "RETURN VALUE"
147 .SH 返り値
148 .\"O On success,
149 .\"O .BR getgroups ()
150 .\"O returns the number of supplementary group IDs.
151 .\"O On error, \-1 is returned, and
152 .\"O .I errno
153 .\"O is set appropriately.
154 .BR getgroups ()
155 は、成功すると補助グループ ID の数を返す。
156 エラーの場合 \-1 を返し、
157 .I errno
158 を適切に設定する。
159
160 .\"O On success,
161 .\"O .BR setgroups ()
162 .\"O returns 0.
163 .\"O On error, \-1 is returned, and
164 .\"O .I errno
165 .\"O is set appropriately.
166 .BR setgroups ()
167 は、成功すると 0 を返す。
168 エラーの場合 \-1 を返し、
169 .I errno
170 を適切に設定する。
171 .\"O .SH ERRORS
172 .SH エラー
173 .TP
174 .B EFAULT
175 .\"O .I list
176 .\"O has an invalid address.
177 .I list
178 が不正なアドレスである。
179 .PP
180 .\"O .BR getgroups ()
181 .\"O can additionally fail with the following error:
182 .BR getgroups ()
183 は、上記に加えて以下のエラーで失敗する可能性がある。
184 .TP
185 .B EINVAL
186 .\"O .I size
187 .\"O is less than the number of supplementary group IDs, but is not zero.
188 .I size
189 が補助グループ ID の数より小さいが 0 でない。
190 .PP
191 .\"O .BR setgroups ()
192 .\"O can additionally fail with the following errors:
193 .BR setgroups ()
194 は、上記に加えて以下のエラーで失敗する可能性がある。
195 .TP
196 .B EINVAL
197 .\"O .I size
198 .\"O is greater than
199 .\"O .B NGROUPS_MAX
200 .\"O (32 before Linux 2.6.4; 65536 since Linux 2.6.4).
201 .I size
202
203 .B NGROUPS_MAX
204 より大きい
205 .RB ( NGROUPS_MAX
206 は Linux 2.6.4 より前では 32、Linux 2.6.4 以降では 65536)。
207 .TP
208 .B ENOMEM
209 .\"O Out of memory.
210 メモリ不足。
211 .TP
212 .B EPERM
213 .\"O The calling process has insufficient privilege.
214 呼び出し元プロセスが十分な特権を持っていない。
215 .\"O .SH "CONFORMING TO"
216 .SH 準拠
217 .\"O SVr4, 4.3BSD.
218 .\"O The
219 .\"O .BR getgroups ()
220 .\"O function is in POSIX.1-2001.
221 .\"O Since
222 .\"O .BR setgroups ()
223 .\"O requires privilege, it is not covered by POSIX.1-2001.
224 SVr4, 4.3BSD.
225 .BR getgroups ()
226 関数は POSIX.1-2001 に準拠している。
227 .BR setgroups ()
228 は特権を必要とするため、POSIX.1-2001 に従っていない。
229 .\"O .SH NOTES
230 .SH 注意
231 .\"O A process can have up to
232 .\"O .B NGROUPS_MAX
233 .\"O supplementary group IDs
234 .\"O in addition to the effective group ID.
235 .\"O The set of supplementary group IDs
236 .\"O is inherited from the parent process, and preserved across an
237 .\"O .BR execve (2).
238 プロセスは、実効グループ ID に加え、最大
239 .B NGROUPS_MAX
240 までの補助グループ ID を持つことができる。
241 補助グループ ID の集合は親プロセスから継承され、
242 .BR execve (2)
243 の前後で保持される。
244
245 .\"O The maximum number of supplementary group IDs can be found using
246 .\"O .BR sysconf (3):
247 補助グループ ID の最大数は
248 .BR sysconf (3)
249 を使って以下のようにして調べることができる:
250 .nf
251
252     long ngroups_max;
253     ngroups_max = sysconf(_SC_NGROUPS_MAX);
254
255 .fi
256 .\"O The maximum return value of
257 .\"O .BR getgroups ()
258 .\"O cannot be larger than one more than this value.
259 .BR getgroups ()
260 の返り値の最大値は、この値より 1 大きい値より大きくなることはない。
261 .\"O .SH "SEE ALSO"
262 .SH 関連項目
263 .BR getgid (2),
264 .BR setgid (2),
265 .BR getgrouplist (3),
266 .BR initgroups (3),
267 .BR capabilities (7),
268 .BR credentials (7)