1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
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.
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.
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
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
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.
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
38 .\"WORD: group ¥°¥ë¡¼¥×
39 .\"WORD: access ¥¢¥¯¥»¥¹
40 .\"WORD: process ¥×¥í¥»¥¹
41 .\"WORD: super user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
42 .\"WORD: supplementary group Êä½õ¥°¥ë¡¼¥×
44 .TH GETGROUPS 2 2008-06-03 "Linux" "Linux Programmer's Manual"
46 getgroups, setgroups \- Êä½õ¥°¥ë¡¼¥× ID ¤Î¥ê¥¹¥È¤ò¼èÆÀ/ÀßÄꤹ¤ë
48 .B #include <sys/types.h>
50 .B #include <unistd.h>
52 .BI "int getgroups(int " size ", gid_t " list []);
56 .BI "int setgroups(size_t " size ", const gid_t *" list );
59 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
60 .RB ( feature_test_macros (7)
69 ¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× (supplementary group) ID ¤ò
75 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤Ç¤¤ëÍ×ÁǤκÇÂç¿ô¤òÀßÄꤹ¤Ù¤¤Ç¤¢¤ë¡£
78 ¸Ä¤è¤ê¿¤¯¤ÎÊä½õ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¤Î¾ì¹ç¤Ë¤Ï¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£
79 ¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥°¥ë¡¼¥× ID ¤¬¡¢
80 ÊÖ¤µ¤ì¤ë¥ê¥¹¥È¤Ë´Þ¤Þ¤ì¤ë¤«¤É¤¦¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤
81 (¤·¤¿¤¬¤Ã¤Æ¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï
83 ¤ò¸Æ¤Ó½Ð¤·¡¢¤½¤Î·ë²Ì¤ÎÃͤòÄɲᦺï½ü¤¹¤Ù¤¤Ç¤¢¤ë)¡£
88 ¤Ï½¤Àµ¤µ¤ì¤Ê¤¤¤¬¡¢¤½¤Î¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤Î¹ç·×¿ô¤¬ÊÖ¤µ¤ì¤ë¡£
89 ¤³¤ì¤ò»È¤¦¤³¤È¤Ç¡¢¤½¤ì°Ê¹ß¤Î
91 ¤Î¸Æ¤Ó½Ð¤·¤ÇɬÍפȤʤëưŪ³ä¤êÅö¤Æ¥Ð¥Ã¥Õ¥¡
93 ¤Î¥µ¥¤¥º¤ò¡¢¸Æ¤Ó½Ð¤·¸µ¤¬·èÄꤹ¤ë¤³¤È¤¬¤Ç¤¤ë¡£
96 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë¡£
97 ŬÀÚ¤ÊÆø¢ (Linux ¤Ç¤Ï
99 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤¬É¬ÍפǤ¢¤ë¡£
103 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤¿Êä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤ò»ØÄꤹ¤ë¡£
106 ¤Ï¡¢À®¸ù¤¹¤ë¤ÈÊä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤òÊÖ¤¹¡£
107 ¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
112 ¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
113 ¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
120 ¤¬ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£
123 ¤Ï¡¢¾åµ¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£
127 ¤¬Êä½õ¥°¥ë¡¼¥× ID ¤Î¿ô¤è¤ê¾®¤µ¤¤¤¬ 0 ¤Ç¤Ê¤¤¡£
130 ¤Ï¡¢¾åµ¤Ë²Ã¤¨¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£
138 ¤Ï Linux 2.6.4 ¤è¤êÁ°¤Ç¤Ï 32¡¢Linux 2.6.4 °Ê¹ß¤Ç¤Ï 65536)¡£
144 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬½½Ê¬¤ÊÆø¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
148 ´Ø¿ô¤Ï POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
150 ¤ÏÆø¢¤òɬÍפȤ¹¤ë¤¿¤á¡¢POSIX.1-2001 ¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¡£
152 ¥×¥í¥»¥¹¤Ï¡¢¼Â¸ú¥°¥ë¡¼¥× ID ¤Ë²Ã¤¨¡¢ºÇÂç
154 ¤Þ¤Ç¤ÎÊä½õ¥°¥ë¡¼¥× ID ¤ò»ý¤Ä¤³¤È¤¬¤Ç¤¤ë¡£
155 Êä½õ¥°¥ë¡¼¥× ID ¤Î½¸¹ç¤Ï¿Æ¥×¥í¥»¥¹¤«¤é·Ñ¾µ¤µ¤ì¡¢
159 Êä½õ¥°¥ë¡¼¥× ID ¤ÎºÇÂç¿ô¤Ï
161 ¤ò»È¤Ã¤Æ°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤¤ë:
165 ngroups_max = sysconf(_SC_NGROUPS_MAX);
169 ¤ÎÊÖ¤êÃͤκÇÂçÃͤϡ¢¤³¤ÎÃͤè¤ê 1 Â礤¤Ãͤè¤êÂ礤¯¤Ê¤ë¤³¤È¤Ï¤Ê¤¤¡£
173 .BR getgrouplist (3),
175 .BR capabilities (7),