OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / man2 / setgid.2
1 .\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Fri Jul 29th 12:56:44 BST 1994  Wilf. <G.Wilford@ee.surrey.ac.uk>
24 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
25 .\" Modified 2002-03-09 by aeb
26 .\"
27 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
28 .\"         all rights reserved.
29 .\" Translated Sat Mar  1 16:31:56 JST 1997
30 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
31 .\" Updated Fri Feb  7 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
32 .\"
33 .\"WORD:        identity                識別
34 .\"WORD:        effective group ID      実効グループID
35 .\"WORD:        real group ID           実グループID
36 .\"WORD:        saved set-group-ID      保存セットグループID
37 .\"WORD:        implement               実装
38 .\"WORD:        superuser               スーパー・ユーザー
39 .\"
40 .TH SETGID 2 2009-10-17 "Linux" "Linux Programmer's Manual"
41 .SH 名前
42 setgid \- グループ識別(identity)を設定する
43 .SH 書式
44 .B #include <sys/types.h>
45 .br
46 .B #include <unistd.h>
47 .sp
48 .BI "int setgid(gid_t " gid );
49 .SH 説明
50 .BR setgid ()
51 は呼び出し元のプロセスの実効 (effective) グループID を設定する。
52 もしスーパー・ユーザーによって呼び出された場合は、
53 実 (real) グループID と保存 (saved) set-group-ID も設定される。
54
55 Linux において、
56 .BR setgid ()
57
58 .B _POSIX_SAVED_IDS
59 をもった POSIX 版のように実装されている。
60 これは set-user-ID-root でない set-group-ID プログラムにそのグループの
61 特権の全て落とし、特権の必要ない仕事をし、本来の実効グループID に
62 安全な方法で再び戻すことを許す。
63 .SH 返り値
64 成功した場合はゼロが返される。エラーの場合は \-1 が返され、
65 .I errno
66 が適切に設定される。
67 .SH エラー
68 .TP
69 .B EPERM
70 呼び出し元のプロセスに権限がなく (\fBCAP_SETGID\fP ケーパビリティがなく)、かつ
71 .I gid
72 が呼び出し元のプロセスの実グループID と保存セットグループID
73 のどちらとも一致しない。
74 .SH 準拠
75 SVr4, POSIX.1-2001.
76 .SH 関連項目
77 .BR getgid (2),
78 .BR setegid (2),
79 .BR setregid (2),
80 .BR capabilities (7),
81 .BR credentials (7)