1 .\" Copyright Michael Haardt (michael@cantor.informatik.rwth-aachen.de)
2 .\" Sat Aug 27 20:43:50 MET DST 1994
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, write to the Free
21 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
24 .\" Modified Sun Sep 11 19:19:05 1994 <faith@cs.unc.edu>
25 .\" Modified Mon Mar 25 10:19:00 1996 <aeb@cwi.nl> (merged a few
26 .\" tiny changes from a man page by Charles Livingston).
27 .\" Modified Sun Jul 21 14:45:46 1996 <aeb@cwi.nl>
29 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
30 .\" all rights reserved.
31 .\" Translated Sat Mar 1 16:46:43 JST 1997
32 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
33 .\" Modified Mon May 5 19:43:49 JST 1997
34 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Updated & Modified Thu Feb 10 22:45:24 JST 2005
36 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
38 .\"WORD: session セッション
39 .\"WORD: process group ID プロセス・グループID
40 .\"WORD: process group leader プロセス・グループ・リーダー
42 .TH SETSID 2 2008-12-03 "Linux" "Linux Programmer's Manual"
44 setsid \- セッション (session) を作成し、プロセス・グループ ID を設定する
47 .B #include <unistd.h>
49 .B pid_t setsid(void);
54 は呼び出したプロセスがプロセス・グループ・リーダー
55 (process group leader) でなければ、新しいセッションを作成する。
56 呼び出したプロセスは新しいセッションのリーダー、新しいプロセス・グループの
57 プロセス・グループ・リーダーとなり、tty の制御を持たない。
58 呼び出したプロセスのプロセス・グループ ID とセッション ID には、
59 呼び出したプロセスの PID が設定される。呼び出したプロセスはこの
60 新しいプロセス・グループ、この新しいセッションの唯一のプロセスとなる。
62 成功すると、呼び出したプロセスの (新しい) セッション ID が返される。
71 いずれかのプロセスのプロセス・グループ ID が、
73 これは、呼び出したプロセスが既にプロセス・リーダーの場合には
80 で作成された子プロセスは、親プロセスのセッション ID を継承する。
84 プロセス・グループ・リーダーとは、そのプロセスのプロセス・グループ ID が