OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / draft / man2 / setsid.2
index fa6b6f7..b52b92c 100644 (file)
@@ -54,17 +54,15 @@ setsid \- セッション (session) を作成し、プロセスグループ ID 
 .br
 .ad b
 .SH 説明
-\fBsetsid\fP()  creates a new session if the calling process is not a process
-group leader.  The calling process is the leader of the new session (i.e.,
-its session ID is made the same as it process ID).  The calling process also
-becomes the process group leader of a new process group in the session
-(i.e., its process group ID is made the same as it process ID).
+\fBsetsid\fP() は、 呼び出したプロセスがプロセスグループリーダー (process group leader) でなければ、
+新しいセッションを作成する。 呼び出したプロセスは、 新しいセッションのリーダーとなる (すなわち、そのセッション ID がプロセス ID
+と同じ値になる)。 また、呼び出したプロセスは、 そのセッションの新しいプロセスグループのプロセスグループリーダーにもなる (すなわち、プロセスグループ
+ID がプロセス ID と同じ値になる)。
 
-The calling process will be the only process in the new process group and in
-the new session.  The new session has no controlling terminal.
+呼び出したプロセスは、 新しいプロセスグループと新しいセッションの唯一のプロセスとなる。 新しいセッションは制御端末を持たない。
 .SH 返り値
 成功すると、呼び出したプロセスの (新しい) セッション ID が返される。 エラーの場合は、 \fI(pid_t)\ \-1\fP が返され、
-\fIerror\fP にエラーを示す値が設定される。
+\fIerrno\fP にエラーを示す値が設定される。
 .SH エラー
 .TP 
 \fBEPERM\fP
@@ -76,17 +74,15 @@ SVr4, POSIX.1\-2001.
 \fBfork\fP(2)  で作成された子プロセスは、親プロセスのセッション ID を継承する。 \fBexecve\fP(2)  の前後でセッション ID
 は保存される。
 
-A process group leader is a process whose process group ID equals its PID.
-Disallowing a process group leader from calling \fBsetsid()\fP prevents the
-possibility that a process group leader places itself in a new session while
-other processes in the process group remain in the original session; such a
-scenario would break the strict two\-level hierarchy of sessions and process
-groups.  In order to be sure that \fBsetsid\fP()  will succeed, \fBfork\fP(2)  and
-\fB_exit\fP(2), and have the child do \fBsetsid\fP().
+プロセスグループリーダーは、 プロセスグループ ID がその PID と同じ値のプロセスである。 プロセスグループリーダーが \fBsetsid\fP()
+を呼び出すことを許可しないと、 そのプロセスグループ内の他のプロセスを元のセッションに残したまま、
+プロセスグループリーダーが自分自身を新しいセッションに入れるということができなくなる。 このようなシナリオは、 セッションとプロセスグループという厳密な
+2 階層モデルを壊すことになる。 \fBsetsid\fP() が成功することを保証するには、 \fBfork\fP(2) と \fB_exit\fP(2) を行い、
+その子プロセスに \fBsetsid\fP() をさせればよい。
 .SH 関連項目
 \fBsetsid\fP(1), \fBgetsid\fP(2), \fBsetpgid\fP(2), \fBsetpgrp\fP(2), \fBtcgetsid\fP(3),
 \fBcredentials\fP(7)
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.76 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。