OSDN Git Service

9b80286def753d75c66e7ba47a1231a973d88d33
[linuxjm/LDP_man-pages.git] / draft / man2 / getsid.2
1 .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond <esr@y\thyrsus.com>
24 .\" Modified 2001-12-17, aeb
25 .\"
26 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
27 .\"         all rights reserved.
28 .\" Translated Thu Dec 11 23:36:57 JST 1997
29 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
30 .\" Updated Thu Jan 17 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
31 .\"
32 .\"WORD:        session                 セッション
33 .\"WORD:        process                 プロセス
34 .\"
35 .TH GETSID 2 2010-09-26 "Linux" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .SH 名前
38 .\"O getsid \- get session ID
39 getsid \- セッション ID を取得する。
40 .\"O .SH SYNOPSIS
41 .SH 書式
42 .B #include <unistd.h>
43 .sp
44 .BI "pid_t getsid(pid_t" " pid" );
45 .sp
46 .in -4n
47 .\"O Feature Test Macro Requirements for glibc (see
48 .\"O .BR feature_test_macros (7)):
49 glibc 向けの機能検査マクロの要件
50 .RB ( feature_test_macros (7)
51 参照):
52 .in
53 .sp
54 .ad l
55 .PD 0
56 .BR getsid ():
57 .RS 4
58 _XOPEN_SOURCE\ >=\ 500 ||
59 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
60 .br
61 .\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L
62 || /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L
63 .RE
64 .PD
65 .ad
66 .\"O .SH DESCRIPTION
67 .SH 説明
68 .\"O .I getsid(0)
69 .\"O returns the session ID of the calling process.
70 .\"O .I getsid(p)
71 .\"O returns the session ID of the process with process ID
72 .\"O .IR p .
73 .I getsid(0)
74 は呼び出し元のプロセスのセッション ID を返す。
75 .I getsid(p)
76 はプロセス ID
77 .I p 
78 を持つプロセスのセッション ID を返す
79 .\"O (The session ID of a process is the process group ID of the
80 .\"O session leader.)
81 (プロセスのセッション ID は セッションリーダーのプロセスグループ ID である)。
82 .\"O .SH RETURN VALUE
83 .SH 返り値
84 .\"O On success, a session ID is returned.
85 .\"O On error, \fI(pid_t)\ \-1\fP will be returned, and
86 .\"O .I errno
87 .\"O is set appropriately.
88 成功すると、セッション ID が返される。
89 エラーの場合、\fI(pid_t) \-1\fP が返され、
90 .I errno
91 が適切に設定される。
92 .\"O .SH ERRORS
93 .SH エラー
94 .TP
95 .B EPERM
96 .\"O A process with process ID
97 .\"O .I p
98 .\"O exists, but it is not in the same session as the calling process,
99 .\"O and the implementation considers this an error.
100 プロセス ID
101 .I p
102 のプロセスは存在するが、呼び出し元のプロセスと同じセッションではなく、
103 さらに実装がこの状態をエラーと判断した場合。
104 .TP
105 .B ESRCH
106 .\"O No process with process ID
107 .\"O .I p
108 .\"O was found.
109 プロセス ID が
110 .I p
111 のプロセスがない。
112 .\"O .SH VERSIONS
113 .SH バージョン
114 .\"O This system call is available on Linux since version 2.0.
115 このシステムコールは Linux バージョン 2.0 以降で利用可能である。
116 .\" Linux has this system call since Linux 1.3.44.
117 .\" There is libc support since libc 5.2.19.
118 .\"O .SH "CONFORMING TO"
119 .SH 準拠
120 SVr4, POSIX.1-2001
121 .\"O .SH NOTES
122 .SH 注意
123 .\"O Linux does not return
124 .\"O .BR EPERM .
125 Linux は
126 .B EPERM
127 を返さない。
128 .\"O .SH "SEE ALSO"
129 .SH 関連項目
130 .BR getpgid (2),
131 .BR setsid (2),
132 .BR credentials (7)