OSDN Git Service

(split) LDP: Update releases based on LDP 3.52 release
[linuxjm/LDP_man-pages.git] / release / man2 / tkill.2
index a2099f1..e31f658 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
+.\"
+.\"*******************************************************************
 .\"
-.\" 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
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.TH TKILL 2 2008-10-01 "Linux" "Linux Programmer's Manual"
-.SH Ì¾Á°
-tkill, tgkill \- ¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ë
-.SH ½ñ¼°
+.\"*******************************************************************
+.TH TKILL 2 2012\-07\-13 Linux "Linux Programmer's Manual"
+.SH 名前
+tkill, tgkill \- スレッドにシグナルを送る
+.SH 書式
 .nf
-.BI "int tkill(int " tid ", int " sig );
+\fBint tkill(int \fP\fItid\fP\fB, int \fP\fIsig\fP\fB);\fP
 .sp
-.BI "int tgkill(int " tgid ", int " tid ", int " sig );
+\fBint tgkill(int \fP\fItgid\fP\fB, int \fP\fItid\fP\fB, int \fP\fIsig\fP\fB);\fP
 .fi
-.SH ÀâÌÀ
-.BR tgkill ()
-¤Ï¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×
-.I tgid
-¤Ë°¤¹¤ë¥¹¥ì¥Ã¥É ID ¤¬
-.I tid
-¤Î¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë
-.I sig
-¤òÁ÷¤ë¡£
-(¤³¤ì¤ËÂФ·¡¢
-.BR kill (2)
-¤Ï°ì¤Ä¤Î¥×¥í¥»¥¹ (¤¹¤Ê¤ï¤Á¡¢¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×) ¤Ë¤Þ¤È¤á¤Æ¥·¥°¥Ê¥ë¤ò
-Á÷¤ë¤Î¤Ë¤À¤±ÍøÍѤǤ­¤ë¡£
-.BR kill (2)
-¤ÇÁ÷¿®¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹Æâ¤ÎǤ°Õ¤Î¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤ë¡£)
 
-.BR tkill ()
-¤Ï¤â¤¦»È¤ï¤ì¤Ê¤¯¤Ê¤Ã¤¿
-.BR tgkill ()
-¤ÎÀèÁĤǤ¢¤ë¡£
-.BR tkill ()
-¤Ç¤Ï¥·¥°¥Ê¥ë¤ÎÁ÷¤êÀè¤Î¥¹¥ì¥Ã¥É ID ¤·¤«»ØÄê¤Ç¤­¤Ê¤¤¡£
-¤½¤Î¤¿¤á¡¢¥¹¥ì¥Ã¥É¤¬½ªÎ»¤·¤Æ¡¢¤½¤Î¥¹¥ì¥Ã¥É ID ¤¬ºÆÍøÍѤµ¤ì¤ë¾ì¹ç¤Ë¡¢
-°Õ¿Þ¤·¤Ê¤¤¥¹¥ì¥Ã¥É¤Ë¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
-¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£
+\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 が再利用される場合に、 意図しないスレッドにシグナルが送られる可能性がある。
+このシステムコールの使用は避けること。
 
-.I tgid
-¤Ë \-1 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
-.BR tgkill ()
-¤Ï
-.BR tkill ()
-¤ÈÅù²Á¤Ç¤¢¤ë¡£
+\fItgid\fP に \-1 が指定された場合、 \fBtgkill\fP()  は \fBtkill\fP()  と等価である。
 
-¤³¤ì¤é¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ø¤ÎľÀܤΥ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ê¡¢
-¥¹¥ì¥Ã¥É¡¦¥é¥¤¥Ö¥é¥êÆâÉô¤Ç¤Î»ÈÍѤò°Õ¿Þ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£
-.SH ÊÖ¤êÃÍ
-À®¸ù¤·¤¿¾ì¹ç¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢
-\fIerrno\fP ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
-.SH ¥¨¥é¡¼
-.TP
-.B EINVAL
-»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É ID¡¢¥¹¥ì¥Ã¥É¥°¥ë¡¼¥× ID¡¢¥·¥°¥Ê¥ë¤¬ÉÔÀµ¤Ç¤¢¤Ã¤¿¡£
-.TP
-.B EPERM
-µö²Ä¤¬¤Ê¤«¤Ã¤¿¡£¤É¤Î¤è¤¦¤Êµö²Ä¤¬É¬Íפ«¤Ë¤Ä¤¤¤Æ¤Ï¡¢
-.BR kill (2)
-¤ò»²¾È¤Î¤³¤È¡£
-.TP
-.B ESRCH
-»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥ÉID (¤È¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×ID) ¤ò»ý¤Ä¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£
-.SH ¥Ð¡¼¥¸¥ç¥ó
-.BR tkill ()
-¤Ï Linux 2.4.19 / 2.5.4 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¡¢
-.BR tgkill ()
-¤Ï Linux 2.5.75 ¤ÇÄɲ䵤줿¡£
-.SH ½àµò
-.BR tkill ()
-¤È
-.BR tgkill ()
-¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ê¡¢
-°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
-.SH Ãí°Õ
-¥¹¥ì¥Ã¥É¡¦¥°¥ë¡¼¥×¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï
-.BR clone (2)
-¤Î
-.B CLONE_THREAD
-¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£
+これらはシステムコールへの直接のインターフェースであり、 スレッド・ライブラリ内部での使用を意図したものである。
+.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 ¤Ï¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£
-.BR syscall (2)
-¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£
-.SH ´ØÏ¢¹àÌÜ
-.BR clone (2),
-.BR gettid (2),
-.BR kill (2)
+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.52 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。