OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / release / man2 / setgid.2
index 5e7398c..fe830ec 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
 .\"
+.\" %%%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
 .\"
 .\" Fri Jul 29th 12:56:44 BST 1994  Wilf. <G.Wilford@ee.surrey.ac.uk>
 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
 .\" Modified 2002-03-09 by aeb
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
 .\"         all rights reserved.
 .\" Translated Sat Mar  1 16:31:56 JST 1997
 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
 .\" Updated Fri Feb  7 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       identity                ¼±ÊÌ
-.\"WORD:       effective group ID      ¼Â¸ú¥°¥ë¡¼¥×ID
-.\"WORD:       real group ID           ¼Â¥°¥ë¡¼¥×ID
-.\"WORD:       saved set-group-ID      Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID
-.\"WORD:       implement               ¼ÂÁõ
-.\"WORD:       superuser               ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
-.\"
-.TH SETGID 2 2009-10-17 "Linux" "Linux Programmer's Manual"
-.SH Ì¾Á°
-setgid \- ¥°¥ë¡¼¥×¼±ÊÌ(identity)¤òÀßÄꤹ¤ë
-.SH ½ñ¼°
-.B #include <sys/types.h>
+.TH SETGID 2 2014\-09\-21 Linux "Linux Programmer's Manual"
+.SH 名前
+setgid \- グループ識別(identity)を設定する
+.SH 書式
+\fB#include <sys/types.h>\fP
 .br
-.B #include <unistd.h>
+\fB#include <unistd.h>\fP
 .sp
-.BI "int setgid(gid_t " gid );
-.SH ÀâÌÀ
-.BR setgid ()
-¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë¡£
-¤â¤·¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¡¢
-¼Â (real) ¥°¥ë¡¼¥×ID ¤ÈÊݸ (saved) set-group-ID ¤âÀßÄꤵ¤ì¤ë¡£
+\fBint setgid(gid_t \fP\fIgid\fP\fB);\fP
+.SH 説明
+\fBsetgid\fP()  は呼び出し元のプロセスの実効 (effective) グループID を設定する。
+もしスーパーユーザーによって呼び出された場合は、 実 (real) グループID と保存 (saved) set\-group\-ID も設定される。
 
-Linux ¤Ë¤ª¤¤¤Æ¡¢
-.BR setgid ()
-¤Ï
-.B _POSIX_SAVED_IDS
-¤ò¤â¤Ã¤¿ POSIX ÈǤΤ褦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
-¤³¤ì¤Ï set-user-ID-root ¤Ç¤Ê¤¤ set-group-ID ¥×¥í¥°¥é¥à¤Ë¤½¤Î¥°¥ë¡¼¥×¤Î
-Æø¢¤ÎÁ´¤ÆÍî¤È¤·¡¢Æø¢¤ÎɬÍפʤ¤»Å»ö¤ò¤·¡¢ËÜÍè¤Î¼Â¸ú¥°¥ë¡¼¥×ID ¤Ë
-°ÂÁ´¤ÊÊýË¡¤ÇºÆ¤ÓÌ᤹¤³¤È¤òµö¤¹¡£
-.SH ÊÖ¤êÃÍ
-À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
-.I errno
-¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
-.SH ¥¨¥é¡¼
-.TP
-.B EPERM
-¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¸¢¸Â¤¬¤Ê¤¯ (\fBCAP_SETGID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¯)¡¢¤«¤Ä
-.I gid
-¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥×ID ¤ÈÊݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID
-¤Î¤É¤Á¤é¤È¤â°ìÃפ·¤Ê¤¤¡£
-.SH ½àµò
-SVr4, POSIX.1-2001.
-.SH ´ØÏ¢¹àÌÜ
-.BR getgid (2),
-.BR setegid (2),
-.BR setregid (2),
-.BR capabilities (7),
-.BR credentials (7)
+Linux において、 \fBsetgid\fP()  は \fB_POSIX_SAVED_IDS\fP をもった POSIX 版のように実装されている。 これは
+set\-user\-ID\-root でない set\-group\-ID プログラムにそのグループの
+特権の全て落とし、特権の必要ない仕事をし、本来の実効グループID に 安全な方法で再び戻すことを許す。
+.SH 返り値
+成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
+.SH エラー
+.TP 
+\fBEINVAL\fP
+\fIgid\fP で指定されたグループ ID がこのユーザー名前空間では有効ではない。
+.TP 
+\fBEPERM\fP
+呼び出し元のプロセスに権限がなく (\fBCAP_SETGID\fP ケーパビリティがなく)、かつ \fIgid\fP が呼び出し元のプロセスの実グループID
+と保存セットグループID のどちらとも一致しない。
+.SH 準拠
+SVr4, POSIX.1\-2001.
+.SH 注意
+元々の Linux の \fBsetgid\fP() システムコールは
+16 ビットのグループ ID だけに対応していた。
+その後、Linux 2.4 で、32 ビットの ID に対応した
+\fBsetgid32\fP() が追加された。
+glibc の \fBsetgid\fP() のラッパー関数は
+カーネルバージョンによるこの違いを吸収している。
+.SH 関連項目
+\fBgetgid\fP(2), \fBsetegid\fP(2), \fBsetregid\fP(2), \fBcapabilities\fP(7),
+\fBcredentials\fP(7), \fBuser_namespaces\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。