OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / tcgetpgrp.3
1 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH TCGETPGRP 3 2003\-01\-28 GNU "Linux Programmer's Manual"
31 .SH 名前
32 tcgetpgrp, tcsetpgrp \- 端末のフォアグラウンド・プロセス・グループの 取得/設定を行う
33 .SH 書式
34 \fB#include <unistd.h>\fP
35 .sp
36 \fBpid_t tcgetpgrp(int \fP\fIfd\fP\fB);\fP
37 .sp
38 \fBint tcsetpgrp(int \fP\fIfd\fP\fB, pid_t \fP\fIpgrp\fP\fB);\fP
39 .SH 説明
40 .\" The process itself may be a background process.
41 関数 \fBtcgetpgrp\fP()  は、 \fIfd\fP に対応する端末のフォアグラウンド・プロセス・グループの プロセス・グループ ID を返す。
42 \fIfd\fP で指定された端末は、呼び出しを行うプロセスの制御端末でなければならない。
43 .LP
44 関数 \fBtcsetpgrp\fP()  は、プロセス・グループID が \fIpgrp\fP のプロセス・グループを \fIfd\fP
45 に対応する端末のフォアグラウンド・プロセス・グループにする。 このとき、 \fIfd\fP は \fBtcsetpgrp\fP()
46 を呼び出すプロセスの制御端末でなければならない。 さらに、 \fIpgrp\fP は、呼び出しを行うプロセスと同じセッションに 属する (メンバが空でない)
47 プロセス・グループでなければならない。
48 .LP
49 \fBtcsetpgrp\fP()  がセッションに属するバックグラウンド・グループ・プロセスのメンバから 呼び出され、かつ呼び出しを行うプロセスが
50 \fBSIGTTOU\fP をブロックしたり 無視したりするようになっていない場合、 \fBSIGTTOU\fP シグナルは
51 バックグラウンド・プロセス・グループの全てのメンバに送られる。
52 .SH 返り値
53 \fIfd\fP が呼び出しを行ったプロセスの制御端末を参照している場合、関数 \fBtcgetpgrp\fP()
54 は、その制御端末のフォアグラウンド・プロセス・グループがあれば そのプロセス・グループの ID を返す。
55 そのようなプロセス・グループがなければ、現在プロセス・グループ ID として使用されていない、1より大きな何らかの値が返される。 \fIfd\fP
56 が呼び出しを行ったプロセスの制御端末を参照していない場合、 \-1 が返され、 \fIerrno\fP が適切に設定される。
57 .LP
58 成功した場合、 \fBtcsetpgrp\fP()  は 0 を返す。そうでない場合、 \-1 を返し、 \fIerrno\fP を適切に設定する。
59 .SH エラー
60 .TP 
61 \fBEBADF\fP
62 \fIfd\fP が適切なファイル・ディスクリプターでない。
63 .TP 
64 \fBEINVAL\fP
65 \fIpgrp\fP が無効な値である。
66 .TP 
67 \fBENOTTY\fP
68 呼び出しを行ったプロセスが制御端末を持っていない、もしくは 制御端末を持っているが \fIfd\fP で参照されるものとは異なる、
69 \fBtcsetpgrp\fP()  の場合は、 \fIfd\fP で指定された制御端末がすでに呼び出しを行ったプロセスのセッション
70 と関係のないものになっている際にも、このエラーとなる。
71 .TP 
72 \fBEPERM\fP
73 \fIpgrp\fP が有効な値だが、呼び出しを行ったプロセスと同じセッションに属する プロセスのプロセス・グループ ID には該当するものがない。
74 .SH 準拠
75 POSIX.1\-2001.
76 .SH 注意
77 この関数は \fBTIOCGPGRP\fP と \fBTIOCGSID\fP の ioctl 経由で実現されている。
78 .SS 歴史
79 これらの ioctl は 4.2BSD で登場した。 これらの関数は POSIX で考案されたものである。
80 .SH 関連項目
81 \fBsetpgid\fP(2), \fBsetsid\fP(2), \fBcredentials\fP(7)
82 .SH この文書について
83 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
84 である。プロジェクトの説明とバグ報告に関する情報は
85 http://www.kernel.org/doc/man\-pages/ に書かれている。