OSDN Git Service

3d476af8ef94a359c75a13778bb723a4686168c3
[linuxjm/LDP_man-pages.git] / release / man2 / set_tid_address.2
1 .\" Copyright (C) 2004 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 SET_TID_ADDRESS 2 2012\-07\-19 Linux "Linux Programmer's Manual"
31 .SH 名前
32 set_tid_address \- スレッド ID へのポインタを設定する
33 .SH 書式
34 .nf
35 \fB#include <linux/unistd.h>\fP
36 .sp
37 \fBlong set_tid_address(int *\fP\fItidptr\fP\fB);\fP
38 .fi
39 .SH 説明
40 各プロセスについて、カーネルは \fIset_child_tid\fP と \fIclear_child_tid\fP という 2 つの属性を保持する。この 2
41 つの属性はデフォルトでは NULL である。
42 .TP 
43 \fIset_child_tid\fP
44 プロセスが \fBCLONE_CHILD_SETTID\fP フラグを指定した \fBclone\fP(2)  によって開始された場合、
45 \fIset_child_tid\fP は \fBclone\fP(2) のシステムコールの \fIctid\fP 引き数で渡された値に設定される。
46 .IP
47 \fIset_child_tid\fP が設定された場合、一番最初に新しいプロセスが行うことは、 このアドレスに自身の PID を書き込むことである。
48 .TP 
49 \fIclear_child_tid\fP
50 プロセスが \fBCLONE_CHILD_CLEARTID\fP フラグを指定した \fBclone\fP(2) によって開始された場合、
51 \fIclear_child_tid\fP は \fBclone\fP(2) のシステムコールの \fIctid\fP 引き数で渡された値に設定される。
52 .LP
53 システムコール \fBset_tid_address\fP()  は呼び出し元プロセスの \fIclear_child_tid\fP の値を \fItidptr\fP
54 に設定する。
55 .LP
56 When a process whose \fIclear_child_tid\fP is not NULL terminates, then, if the
57 process is sharing memory with other processes or threads, then 0 is written
58 at the address specified in \fIclear_child_tid\fP and the kernel performs the
59 following operation:
60
61     futex(clear_child_tid, FUTEX_WAKE, 1, NULL, NULL, 0);
62
63 The effect of this operation is to wake a single process that is performing
64 a futex wait on the memory location.  Errors from the futex wake operation
65 are ignored.
66 .SH 返り値
67 \fBset_tid_address\fP()  は常に現在のプロセスの PID を返す。
68 .SH エラー
69 \fBset_tid_address\fP()  は常に成功する。
70 .SH バージョン
71 この呼び出しは Linux 2.5.48 以降で存在する。 ここで書かれた詳細は Linux 2.5.49 以降で有効である。
72 .SH 準拠
73 このシステムコールは Linux 固有である。
74 .SH 関連項目
75 \fBclone\fP(2), \fBfutex\fP(2)
76 .SH この文書について
77 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.51 の一部
78 である。プロジェクトの説明とバグ報告に関する情報は
79 http://www.kernel.org/doc/man\-pages/ に書かれている。