.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (C) 2008 Michael Kerrisk .\" and Copyright 2003 Abhijit Menon-Sen .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" 2004-05-31, added tgkill, ahu, aeb .\" 2008-01-15 mtk -- rewote DESCRIPTION .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH TKILL 2 2011\-09\-18 Linux "Linux Programmer's Manual" .SH 名前 tkill, tgkill \- スレッドにシグナルを送る .SH 書式 .nf \fBint tkill(int \fP\fItid\fP\fB, int \fP\fIsig\fP\fB);\fP .sp \fBint tgkill(int \fP\fItgid\fP\fB, int \fP\fItid\fP\fB, int \fP\fIsig\fP\fB);\fP .fi .SH 説明 \fBtgkill\fP() はスレッド・グループ \fItgid\fP に属するスレッド ID が \fItid\fP のスレッドにシグナル \fIsig\fP を送る。 (これに対し、 \fBkill\fP(2) は一つのプロセス (すなわち、スレッド・グループ) にまとめてシグナルを 送るのにだけ利用できる。 \fBkill\fP(2) で送信されたシグナルはプロセス内の任意のスレッドに配送される。) \fBtkill\fP() はもう使われなくなった \fBtgkill\fP() の先祖である。 \fBtkill\fP() ではシグナルの送り先のスレッド ID しか指定できない。 そのため、スレッドが終了して、そのスレッド ID が再利用される場合に、 意図しないスレッドにシグナルが送られる可能性がある。 このシステムコールの使用は避けること。 \fItgid\fP に \-1 が指定された場合、 \fBtgkill\fP() は \fBtkill\fP() と等価である。 これらはシステムコールへの直接のインターフェースであり、 スレッド・ライブラリ内部での使用を意図したものである。 .SH 返り値 成功した場合、0 が返される。エラーが発生した場合、\-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー .TP \fBEINVAL\fP 指定されたスレッド ID、スレッドグループ ID、シグナルが不正であった。 .TP \fBEPERM\fP 許可がなかった。どのような許可が必要かについては、 \fBkill\fP(2) を参照のこと。 .TP \fBESRCH\fP 指定されたスレッドID (とスレッド・グループID) を持つプロセスが存在しない。 .SH バージョン \fBtkill\fP() は Linux 2.4.19 / 2.5.4 以降でサポートされ、 \fBtgkill\fP() は Linux 2.5.75 で追加された。 .SH 準拠 \fBtkill\fP() と \fBtgkill\fP() は Linux 固有であり、 移植を想定したプログラムでは使用すべきではない。 .SH 注意 スレッド・グループの説明については \fBclone\fP(2) の \fBCLONE_THREAD\fP の説明を参照のこと。 glibc はこれらのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 .SH 関連項目 \fBclone\fP(2), \fBgettid\fP(2), \fBkill\fP(2), \fBrt_sigqueueinfo\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。