1 .\" Copyright (C) 2004 Andries Brouwer (aeb@cwi.nl)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Japanese Version Copyright (c) 2005 Yuichi SATO
24 .\" all rights reserved.
25 .\" Translated Wed Jan 26 07:21:01 JST 2005
26 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
28 .TH SET_TID_ADDRESS 2 2004-09-10 "Linux" "Linux Programmer's Manual"
31 .\"O set_tid_address \- set pointer to thread ID
32 set_tid_address \- スレッド ID へのポインタを設定する
36 .B #include <linux/unistd.h>
38 .BI "long set_tid_address(int *" tidptr );
42 .\"O The kernel keeps for each process two values called
45 .\"O .I clear_child_tid
46 .\"O that are NULL by default.
54 .\"O If a process is started using
57 .\"O .B CLONE_CHILD_SETTID
61 .\"O .IR child_tidptr ,
62 .\"O the fifth argument of that system call.
74 のシステムコールの 5 番目の引き数である。
76 .\"Osato: __syscall5 で __NR_clone を呼び出すときの
77 .\"Osato: 5 番目の引き数ということだろうか。
82 .\"O is set, the very first thing the new process does
83 .\"O is writing its PID at this address.
85 が設定された場合、一番最初に新しいプロセスが行うことは、
86 このアドレスに自身の PID を書き込むことである。
88 .\"O If a process is started using
91 .\"O .B CLONE_CHILD_CLEARTID
93 .\"O .I clear_child_tid
95 .\"O .IR child_tidptr ,
96 .\"O the fifth argument of that system call.
98 .B CLONE_CHILD_CLEARTID
108 のシステムコールの 5 番目の引き数である。
111 .\"O .BR set_tid_address ()
113 .\"O .I clear_child_tid
114 .\"O value for the calling process to
117 .BR set_tid_address ()
125 .\"O .I clear_child_tid
126 .\"O is set, and the process exits, and the process was sharing memory
127 .\"O with other processes or threads, then 0 is written at this address,
129 .\"O .I futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0);
131 .\"O (That is, wake a single process waiting on this futex.)
132 .\"O Errors are ignored.
134 が設定されているときにプロセスが終了すると、
135 そのプロセスは他のプロセスまたはスレッドとメモリを共有しているので、
137 .I futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0);
139 (つまり、この futex で待っている 1 つのプロセスを起こす (wake))。
141 .\"O .SH "RETURN VALUE"
143 .\"O .BR set_tid_address ()
144 .\"O always returns the PID of the calling process.
145 .BR set_tid_address ()
149 .\"O .BR set_tid_address ()
150 .\"O always succeeds.
151 .BR set_tid_address ()
155 .\"O This call is present since Linux 2.5.48.
156 .\"O Details as given here are valid since Linux 2.5.49.
157 この呼び出しは Linux 2.5.48 以降で存在する。
158 ここで書かれた詳細は Linux 2.5.49 以降で有効である。
159 .\"O .SH "CONFORMING TO"
161 .\"O This system call is Linux-specific.
162 このシステムコールは Linux 独自である。