OSDN Git Service

Update releases for LDP 3.68
[linuxjm/LDP_man-pages.git] / release / man2 / tkill.2
index f560924..41459c6 100644 (file)
@@ -1,8 +1,7 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (C) 2008 Michael Kerrisk <tmk.manpages@gmail.com>
 .\" and Copyright 2003 Abhijit Menon-Sen <ams@wiw.org>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" 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.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" 2004-05-31, added tgkill, ahu, aeb
-.\" 2008-01-15 mtk -- rewote DESCRIPTION
+.\" 2008-01-15 mtk -- rewrote DESCRIPTION
 .\"
 .\"*******************************************************************
 .\"
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH TKILL 2 2011\-09\-18 Linux "Linux Programmer's Manual"
+.\"
+.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved.
+.\" Translated 2003-03-05, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2005-02-28, Akihiro MOTOKI
+.\"
+.TH TKILL 2 2012\-07\-13 Linux "Linux Programmer's Manual"
 .SH 名前
 tkill, tgkill \- スレッドにシグナルを送る
 .SH 書式
@@ -40,11 +45,36 @@ tkill, tgkill \- スレッドにシグナルを送る
 .sp
 \fBint tgkill(int \fP\fItgid\fP\fB, int \fP\fItid\fP\fB, int \fP\fIsig\fP\fB);\fP
 .fi
+
+\fI注\fP: これらのシステムコールには、glibc のラッパー関数はない。「注意」の節を参照。
 .SH 説明
 \fBtgkill\fP()  はスレッド・グループ \fItgid\fP に属するスレッド ID が \fItid\fP のスレッドにシグナル \fIsig\fP を送る。
 (これに対し、 \fBkill\fP(2)  は一つのプロセス (すなわち、スレッド・グループ) にまとめてシグナルを 送るのにだけ利用できる。
 \fBkill\fP(2)  で送信されたシグナルはプロセス内の任意のスレッドに配送される。)
 
+.\" FIXME: Maybe say something about the following:
+.\" http://sourceware.org/bugzilla/show_bug.cgi?id=12889
+.\"     Rich Felker <bugdal@aerifal.cx>
+.\"     There is a race condition in pthread_kill: it is possible that,
+.\"     between the time pthread_kill reads the pid/tid from the target
+.\"     thread descriptor and the time it makes the tgkill syscall,
+.\"     the target thread terminates and the same tid gets assigned
+.\"     to a new thread in the same process.
+.\"
+.\"     (The tgkill syscall was designed to eliminate a similar race
+.\"     condition in tkill, but it only succeeded in eliminating races
+.\"     where the tid gets reused in a different process, and does not
+.\"     help if the same tid gets assigned to a new thread in the
+.\"     same process.)
+.\"
+.\"     The only solution I can see is to introduce a mutex that ensures
+.\"     that a thread cannot exit while pthread_kill is being called on it.
+.\"
+.\"     Note that in most real-world situations, like almost all race
+.\"     conditions, this one will be extremely rare. To make it
+.\"     measurable, one could exhaust all but 1-2 available pid values,
+.\"     possibly by lowering the max pid parameter in /proc, forcing
+.\"     the same tid to be reused rapidly.
 \fBtkill\fP()  はもう使われなくなった \fBtgkill\fP()  の先祖である。 \fBtkill\fP()  ではシグナルの送り先のスレッド ID
 しか指定できない。 そのため、スレッドが終了して、そのスレッド ID が再利用される場合に、 意図しないスレッドにシグナルが送られる可能性がある。
 このシステムコールの使用は避けること。
@@ -75,3 +105,6 @@ tkill, tgkill \- スレッドにシグナルを送る
 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.68 の一部である。
+プロジェクトの説明とバグ報告に関する情報は \%http://www.kernel.org/doc/man\-pages/ に書かれている。