.\" 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 .\" .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. .\" Translated 2003-03-05, Akihiro MOTOKI .\" Updated 2005-02-28, Akihiro MOTOKI .\" .TH TKILL 2 2008-10-01 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .\"O tkill, tgkill \- send a signal to a thread .SH 名前 tkill, tgkill \- スレッドにシグナルを送る .\"O .SH SYNOPSIS .SH 書式 .nf .BI "int tkill(int " tid ", int " sig ); .sp .BI "int tgkill(int " tgid ", int " tid ", int " sig ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O .BR tgkill () .\"O sends the signal .\"O .I sig .\"O to the thread with the thread ID .\"O .I tid .\"O in the thread group .\"O .IR tgid . .\"O (By contrast, .\"O .BR kill (2) .\"O can only be used to send a signal to a process (i.e., thread group) .\"O as a whole, and the signal will be delivered to an arbitrary .\"O thread within that process.) .BR tgkill () はスレッド・グループ .I tgid に属するスレッド ID が .I tid のスレッドにシグナル .I sig を送る。 (これに対し、 .BR kill (2) は一つのプロセス (すなわち、スレッド・グループ) にまとめてシグナルを 送るのにだけ利用できる。 .BR kill (2) で送信されたシグナルはプロセス内の任意のスレッドに配送される。) .\"O .BR tkill () .\"O is an obsolete predecessor to .\"O .BR tgkill (). .\"O It only allows the target thread ID to be specified, .\"O which may result in the wrong thread being signaled if a thread .\"O terminates and its thread ID is recycled. .\"O Avoid using this system call. .BR tkill () はもう使われなくなった .BR tgkill () の先祖である。 .BR tkill () ではシグナルの送り先のスレッド ID しか指定できない。 そのため、スレッドが終了して、そのスレッド ID が再利用される場合に、 意図しないスレッドにシグナルが送られる可能性がある。 このシステムコールの使用は避けること。 .\"O If .\"O .I tgid .\"O is specified as \-1, .\"O .BR tgkill () .\"O is equivalent to .\"O .BR tkill (). .I tgid に \-1 が指定された場合、 .BR tgkill () は .BR tkill () と等価である。 .\"O These are the raw system call interfaces, meant for internal .\"O thread library use. これらはシステムコールへの直接のインターフェースであり、 スレッド・ライブラリ内部での使用を意図したものである。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, zero is returned. .\"O On error, \-1 is returned, and \fIerrno\fP .\"O is set appropriately. 成功した場合、0 が返される。エラーが発生した場合、\-1 が返され、 \fIerrno\fP が適切に設定される。 .\"O .SH ERRORS .SH エラー .TP .B EINVAL .\"O An invalid thread ID, thread group ID, or signal was specified. 指定されたスレッド ID、スレッドグループ ID、シグナルが不正であった。 .TP .B EPERM .\"O Permission denied. .\"O For the required permissions, see .\"O .BR kill (2). 許可がなかった。どのような許可が必要かについては、 .BR kill (2) を参照のこと。 .TP .B ESRCH .\"O No process with the specified thread ID (and thread group ID) exists. 指定されたスレッドID (とスレッド・グループID) を持つプロセスが存在しない。 .\"O .SH VERSIONS .SH バージョン .\"O .BR tkill () .\"O is supported since Linux 2.4.19 / 2.5.4. .\"O .BR tgkill () .\"O was added in Linux 2.5.75. .BR tkill () は Linux 2.4.19 / 2.5.4 以降でサポートされ、 .BR tgkill () は Linux 2.5.75 で追加された。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O .BR tkill () .\"O and .\"O .BR tgkill () .\"O are Linux-specific and should not be used .\"O in programs that are intended to be portable. .BR tkill () と .BR tgkill () は Linux 固有であり、 移植を想定したプログラムでは使用すべきではない。 .\"O .SH NOTES .SH 注意 .\"O See the description of .\"O .B CLONE_THREAD .\"O in .\"O .BR clone (2) .\"O for an explanation of thread groups. スレッド・グループの説明については .BR clone (2) の .B CLONE_THREAD の説明を参照のこと。 .\"O Glibc does not provide wrappers for these system calls; call them using .\"O .BR syscall (2). glibc はこれらのシステムコールに対するラッパー関数を提供していない。 .BR syscall (2) を使って呼び出すこと。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR clone (2), .BR gettid (2), .BR kill (2)