-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified Thu Oct 31 12:04:29 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
.\" 2008-05-03, mtk, expanded and rewrote parts of DESCRIPTION and RETURN
.\" VALUE, made style of page more consistent with man-pages style.
.\"
-.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
-.\" all rights reserved.
-.\" Translated 1997-02-22, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Updated 2001-02-10, Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
-.\" Updated & Modified 2004-12-30, Yuichi SATO <ysato444@yahoo.co.jp>
-.\" Updated 2008-08-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
+.\"*******************************************************************
.\"
-.\"WORD: group グループ
-.\"WORD: access アクセス
-.\"WORD: process プロセス
-.\"WORD: super user スーパー・ユーザー
-.\"WORD: supplementary group 補助グループ
+.\" This file was generated with po4a. Translate the source file.
.\"
-.TH GETGROUPS 2 2008-06-03 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.\"*******************************************************************
+.TH GETGROUPS 2 2010\-11\-22 Linux "Linux Programmer's Manual"
.SH 名前
-.\"O getgroups, setgroups \- get/set list of supplementary group IDs
getgroups, setgroups \- 補助グループ ID のリストを取得/設定する
-.\"O .SH SYNOPSIS
.SH 書式
-.B #include <sys/types.h>
+\fB#include <sys/types.h>\fP
.br
-.B #include <unistd.h>
+\fB#include <unistd.h>\fP
.sp
-.BI "int getgroups(int " size ", gid_t " list []);
+\fBint getgroups(int \fP\fIsize\fP\fB, gid_t \fP\fIlist\fP\fB[]);\fP
.sp
-.B #include <grp.h>
+\fB#include <grp.h>\fP
.sp
-.BI "int setgroups(size_t " size ", const gid_t *" list );
+\fBint setgroups(size_t \fP\fIsize\fP\fB, const gid_t *\fP\fIlist\fP\fB);\fP
.sp
.in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc 向けの機能検査マクロの要件
-.RB ( feature_test_macros (7)
-参照):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
.in
.sp
-.BR setgroups ():
-_BSD_SOURCE
-.\"O .SH DESCRIPTION
+\fBsetgroups\fP(): _BSD_SOURCE
.SH 説明
.PP
-.\"O .BR getgroups ()
-.\"O returns the supplementary group IDs of the calling process in
-.\"O .IR list .
-.\"O The argument
-.\"O .I size
-.\"O should be set to the maximum number of items that can be stored in the
-.\"O buffer pointed to by
-.\"O .IR list .
-.\"O If the calling process is a member of more than
-.\"O .I size
-.\"O supplementary groups, then an error results.
-.BR getgroups ()
-は呼び出し元プロセスの補助グループ (supplementary group) ID を
-.I list
-に返す。
-.I size
-引き数には、
-.I list
-により参照されるバッファに格納できる要素の最大数を設定すべきである。
-呼び出し元プロセスが
-.I size
-個より多くの補助グループのメンバの場合には、エラーとなる。
-.\"O It is unspecified whether the effective group ID of the calling process
-.\"O is included in the returned list.
-.\"O (Thus, an application should also call
-.\"O .BR getegid (2)
-.\"O and add or remove the resulting value.)
-この関数を呼び出したプロセスの実効グループ ID が、
-返されるリストに含まれるかどうかは規定されていない
-(したがって、アプリケーションは
-.BR getegid (2)
+\fBgetgroups\fP() は呼び出し元プロセスの補助グループ (supplementary group) ID を \fIlist\fP に返す。
+\fIsize\fP 引き数には、 \fIlist\fP により参照されるバッファに格納できる要素の最大数を設定すべきである。 呼び出し元プロセスが \fIsize\fP
+個より多くの補助グループのメンバの場合には、エラーとなる。 この関数を呼び出したプロセスの実効グループ ID が、
+返されるリストに含まれるかどうかは規定されていない (したがって、アプリケーションは \fBgetegid\fP(2)
を呼び出し、その結果の値を追加・削除すべきである)。
-.\"O If
-.\"O .I size
-.\"O is zero,
-.\"O .I list
-.\"O is not modified, but the total number of supplementary group IDs for the
-.\"O process is returned.
-.I size
-が 0 ならば、
-.I list
-は修正されないが、そのプロセスの補助グループ ID の合計数が返される。
-.\"O This allows the caller to determine the size of a dynamically allocated
-.\"O .I list
-.\"O to be used in a further call to
-.\"O .BR getgroups ().
-これを使うことで、それ以降の
-.BR getgroups ()
-の呼び出しで必要となる動的割り当てバッファ
-.I list
-のサイズを、呼び出し元が決定することができる。
+\fIsize\fP が 0 ならば、 \fIlist\fP は修正されないが、そのプロセスの補助グループ ID の合計数が返される。 これを使うことで、それ以降の
+\fBgetgroups\fP() の呼び出しで必要となる動的割り当てバッファ \fIlist\fP のサイズを、呼び出し元が決定することができる。
.PP
-.\"O .BR setgroups ()
-.\"O sets the supplementary group IDs for the calling process.
-.\"O Appropriate privileges (Linux: the
-.\"O .B CAP_SETGID
-.\"O capability) are required.
-.BR setgroups ()
-は、呼び出し元プロセスの補助グループ ID を設定する。
-適切な特権 (Linux では
-.B CAP_SETGID
-ケーパビリティ (capability)) が必要である。
-.\"O The
-.\"O .I size
-.\"O argument specifies the number of supplementary group IDs
-.\"O in the buffer pointed to by
-.\"O .IR list .
-.I size
-引き数には、
-.I list
+\fBsetgroups\fP() は、呼び出し元プロセスの補助グループ ID を設定する。 適切な特権 (Linux では \fBCAP_SETGID\fP
+ケーパビリティ (capability)) が必要である。 \fIsize\fP 引き数には、 \fIlist\fP
により参照されるバッファに格納された補助グループ ID の数を指定する。
-.\"O .SH "RETURN VALUE"
.SH 返り値
-.\"O On success,
-.\"O .BR getgroups ()
-.\"O returns the number of supplementary group IDs.
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-.BR getgroups ()
-は、成功すると補助グループ ID の数を返す。
-エラーの場合 \-1 を返し、
-.I errno
-を適切に設定する。
+\fBgetgroups\fP() は、成功すると補助グループ ID の数を返す。 エラーの場合 \-1 を返し、 \fIerrno\fP を適切に設定する。
-.\"O On success,
-.\"O .BR setgroups ()
-.\"O returns 0.
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-.BR setgroups ()
-は、成功すると 0 を返す。
-エラーの場合 \-1 を返し、
-.I errno
-を適切に設定する。
-.\"O .SH ERRORS
+\fBsetgroups\fP() は、成功すると 0 を返す。 エラーの場合 \-1 を返し、 \fIerrno\fP を適切に設定する。
.SH エラー
-.TP
-.B EFAULT
-.\"O .I list
-.\"O has an invalid address.
-.I list
-が不正なアドレスである。
+.TP
+\fBEFAULT\fP
+\fIlist\fP が不正なアドレスである。
.PP
-.\"O .BR getgroups ()
-.\"O can additionally fail with the following error:
-.BR getgroups ()
-は、上記に加えて以下のエラーで失敗する可能性がある。
-.TP
-.B EINVAL
-.\"O .I size
-.\"O is less than the number of supplementary group IDs, but is not zero.
-.I size
-が補助グループ ID の数より小さいが 0 でない。
+\fBgetgroups\fP() は、上記に加えて以下のエラーで失敗する可能性がある。
+.TP
+\fBEINVAL\fP
+\fIsize\fP が補助グループ ID の数より小さいが 0 でない。
.PP
-.\"O .BR setgroups ()
-.\"O can additionally fail with the following errors:
-.BR setgroups ()
-は、上記に加えて以下のエラーで失敗する可能性がある。
-.TP
-.B EINVAL
-.\"O .I size
-.\"O is greater than
-.\"O .B NGROUPS_MAX
-.\"O (32 before Linux 2.6.4; 65536 since Linux 2.6.4).
-.I size
-が
-.B NGROUPS_MAX
-より大きい
-.RB ( NGROUPS_MAX
-は Linux 2.6.4 より前では 32、Linux 2.6.4 以降では 65536)。
-.TP
-.B ENOMEM
-.\"O Out of memory.
+\fBsetgroups\fP() は、上記に加えて以下のエラーで失敗する可能性がある。
+.TP
+\fBEINVAL\fP
+\fIsize\fP が \fBNGROUPS_MAX\fP より大きい (\fBNGROUPS_MAX\fP は Linux 2.6.4 より前では 32、Linux
+2.6.4 以降では 65536)。
+.TP
+\fBENOMEM\fP
メモリ不足。
-.TP
-.B EPERM
-.\"O The calling process has insufficient privilege.
+.TP
+\fBEPERM\fP
呼び出し元プロセスが十分な特権を持っていない。
-.\"O .SH "CONFORMING TO"
.SH 準拠
-.\"O SVr4, 4.3BSD.
-.\"O The
-.\"O .BR getgroups ()
-.\"O function is in POSIX.1-2001.
-.\"O Since
-.\"O .BR setgroups ()
-.\"O requires privilege, it is not covered by POSIX.1-2001.
-SVr4, 4.3BSD.
-.BR getgroups ()
-関数は POSIX.1-2001 に準拠している。
-.BR setgroups ()
-は特権を必要とするため、POSIX.1-2001 に従っていない。
-.\"O .SH NOTES
+SVr4, 4.3BSD. \fBgetgroups\fP() 関数は POSIX.1\-2001 に準拠している。 \fBsetgroups\fP()
+は特権を必要とするため、POSIX.1\-2001 に従っていない。
.SH 注意
-.\"O A process can have up to
-.\"O .B NGROUPS_MAX
-.\"O supplementary group IDs
-.\"O in addition to the effective group ID.
-.\"O The set of supplementary group IDs
-.\"O is inherited from the parent process, and preserved across an
-.\"O .BR execve (2).
-プロセスは、実効グループ ID に加え、最大
-.B NGROUPS_MAX
-までの補助グループ ID を持つことができる。
-補助グループ ID の集合は親プロセスから継承され、
-.BR execve (2)
-の前後で保持される。
+プロセスは、実効グループ ID に加え、最大 \fBNGROUPS_MAX\fP までの補助グループ ID を持つことができる。 補助グループ ID
+の集合は親プロセスから継承され、 \fBexecve\fP(2) の前後で保持される。
-.\"O The maximum number of supplementary group IDs can be found using
-.\"O .BR sysconf (3):
-補助グループ ID の最大数は
-.BR sysconf (3)
-を使って以下のようにして調べることができる:
+補助グループ ID の最大数は \fBsysconf\fP(3) を使って以下のようにして調べることができる:
.nf
long ngroups_max;
ngroups_max = sysconf(_SC_NGROUPS_MAX);
.fi
-.\"O The maximum return value of
-.\"O .BR getgroups ()
-.\"O cannot be larger than one more than this value.
-.BR getgroups ()
-の返り値の最大値は、この値より 1 大きい値より大きくなることはない。
-.\"O .SH "SEE ALSO"
+\fBgetgroups\fP() の返り値の最大値は、この値より 1 大きい値より大きくなることはない。
+
+元々の Linux の \fBgetgroups\fP() システムコールは 16 ビットのグループ ID だけ
+に対応していた。その後、Linux 2.4 で、32 ビットの ID に対応した
+\fBgetgroups\fP() が追加された。glibc の \fBgetgroups\fP のラッパー関数はカーネル
+バージョンによるこの違いを吸収している。
.SH 関連項目
-.BR getgid (2),
-.BR setgid (2),
-.BR getgrouplist (3),
-.BR initgroups (3),
-.BR capabilities (7),
-.BR credentials (7)
+\fBgetgid\fP(2), \fBsetgid\fP(2), \fBgetgrouplist\fP(3), \fBinitgroups\fP(3),
+\fBcapabilities\fP(7), \fBcredentials\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。