OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / 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 .SH Ì¾Á°
46 getgroups, setgroups \- Êä½õ¥°¥ë¡¼¥× ID ¤Î¥ê¥¹¥È¤ò¼èÆÀ/ÀßÄꤹ¤ë
47 .SH ½ñ¼°
48 .B #include <sys/types.h>
49 .br
50 .B #include <unistd.h>
51 .sp
52 .BI "int getgroups(int " size ", gid_t " list []);
53 .sp
54 .B #include <grp.h>
55 .sp
56 .BI "int setgroups(size_t " size ", const gid_t *" list );
57 .sp
58 .in -4n
59 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
60 .RB ( feature_test_macros (7)
61 »²¾È):
62 .in
63 .sp
64 .BR setgroups ():
65 _BSD_SOURCE
66 .SH ÀâÌÀ
67 .PP
68 .BR getgroups ()
69 ¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× (supplementary group) ID ¤ò
70 .I list
71 ¤ËÊÖ¤¹¡£
72 .I size
73 °ú¤­¿ô¤Ë¤Ï¡¢
74 .I list
75 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤Ç¤­¤ëÍ×ÁǤκÇÂç¿ô¤òÀßÄꤹ¤Ù¤­¤Ç¤¢¤ë¡£
76 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬
77 .I size
78 ¸Ä¤è¤ê¿¤¯¤ÎÊä½õ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¤Î¾ì¹ç¤Ë¤Ï¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£
79 ¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤¬¡¢
80 ÊÖ¤µ¤ì¤ë¥ê¥¹¥È¤Ë´Þ¤Þ¤ì¤ë¤«¤É¤¦¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤
81 (¤·¤¿¤¬¤Ã¤Æ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï
82 .BR getegid (2)
83 ¤ò¸Æ¤Ó½Ð¤·¡¢¤½¤Î·ë²Ì¤ÎÃͤòÄɲᦺï½ü¤¹¤Ù¤­¤Ç¤¢¤ë)¡£
84
85 .I size
86 ¤¬ 0 ¤Ê¤é¤Ð¡¢
87 .I list
88 ¤Ï½¤Àµ¤µ¤ì¤Ê¤¤¤¬¡¢¤½¤Î¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤Î¹ç·×¿ô¤¬ÊÖ¤µ¤ì¤ë¡£
89 ¤³¤ì¤ò»È¤¦¤³¤È¤Ç¡¢¤½¤ì°Ê¹ß¤Î
90 .BR getgroups ()
91 ¤Î¸Æ¤Ó½Ð¤·¤ÇɬÍפȤʤëưŪ³ä¤êÅö¤Æ¥Ð¥Ã¥Õ¥¡
92 .I list
93 ¤Î¥µ¥¤¥º¤ò¡¢¸Æ¤Ó½Ð¤·¸µ¤¬·èÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
94 .PP
95 .BR setgroups ()
96 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë¡£
97 ŬÀÚ¤ÊÆø¢ (Linux ¤Ç¤Ï
98 .B CAP_SETGID
99 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤¬É¬ÍפǤ¢¤ë¡£
100 .I size
101 °ú¤­¿ô¤Ë¤Ï¡¢
102 .I list
103 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤¿Êä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤ò»ØÄꤹ¤ë¡£
104 .SH ÊÖ¤êÃÍ
105 .BR getgroups ()
106 ¤Ï¡¢À®¸ù¤¹¤ë¤ÈÊä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤òÊÖ¤¹¡£
107 ¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
108 .I errno
109 ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
110
111 .BR setgroups ()
112 ¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
113 ¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
114 .I errno
115 ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
116 .SH ¥¨¥é¡¼
117 .TP
118 .B EFAULT
119 .I list
120 ¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£
121 .PP
122 .BR getgroups ()
123 ¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
124 .TP
125 .B EINVAL
126 .I size
127 ¤¬Êä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤è¤ê¾®¤µ¤¤¤¬ 0 ¤Ç¤Ê¤¤¡£
128 .PP
129 .BR setgroups ()
130 ¤Ï¡¢¾åµ­¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
131 .TP
132 .B EINVAL
133 .I size
134 ¤¬
135 .B NGROUPS_MAX
136 ¤è¤êÂ礭¤¤
137 .RB ( NGROUPS_MAX
138 ¤Ï Linux 2.6.4 ¤è¤êÁ°¤Ç¤Ï 32¡¢Linux 2.6.4 °Ê¹ß¤Ç¤Ï 65536)¡£
139 .TP
140 .B ENOMEM
141 ¥á¥â¥êÉÔ­¡£
142 .TP
143 .B EPERM
144 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬½½Ê¬¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
145 .SH ½àµò
146 SVr4, 4.3BSD.
147 .BR getgroups ()
148 ´Ø¿ô¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
149 .BR setgroups ()
150 ¤ÏÆø¢¤òɬÍפȤ¹¤ë¤¿¤á¡¢POSIX.1-2001 ¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¡£
151 .SH Ãí°Õ
152 ¥×¥í¥»¥¹¤Ï¡¢¼Â¸ú¥°¥ë¡¼¥× ID ¤Ë²Ã¤¨¡¢ºÇÂç
153 .B NGROUPS_MAX
154 ¤Þ¤Ç¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£
155 Êä½õ¥°¥ë¡¼¥× ID ¤Î½¸¹ç¤Ï¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¡¢
156 .BR execve (2)
157 ¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¤ë¡£
158
159 Êä½õ¥°¥ë¡¼¥× ID ¤ÎºÇÂç¿ô¤Ï
160 .BR sysconf (3)
161 ¤ò»È¤Ã¤Æ°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë:
162 .nf
163
164     long ngroups_max;
165     ngroups_max = sysconf(_SC_NGROUPS_MAX);
166
167 .fi
168 .BR getgroups ()
169 ¤ÎÊÖ¤êÃͤκÇÂçÃͤϡ¢¤³¤ÎÃͤè¤ê 1 Â礭¤¤Ãͤè¤êÂ礭¤¯¤Ê¤ë¤³¤È¤Ï¤Ê¤¤¡£
170 .SH ´ØÏ¢¹àÌÜ
171 .BR getgid (2),
172 .BR setgid (2),
173 .BR getgrouplist (3),
174 .BR initgroups (3),
175 .BR capabilities (7),
176 .BR credentials (7)