OSDN Git Service

3b26bc9922e7565106cd8e5fc371cc447c056960
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / gettid.2
1 .\" Copyright 2003 Abhijit Menon-Sen <ams@wiw.org>
2 .\" and Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved.
33 .\" Translated Mon Mar  5 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
34 .\" Updated Sun Sep 14 JST 2003 by Akihiro MOTOKI
35 .\" Updated 2008-02-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.77
36 .\" Updated 2008-08-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
37 .\"
38 .TH GETTID 2 2020\-04\-11 Linux "Linux Programmer's Manual"
39 .SH 名前
40 gettid \- スレッドID を取得する
41 .SH 書式
42 .nf
43 \fB#define _GNU_SOURCE\fP
44 \fB#include <unistd.h>\fP
45 \fB#include <sys/types.h>\fP
46 .PP
47 \fBpid_t gettid(void);\fP
48 .fi
49 .SH 説明
50 \fBgettid\fP()  は呼び出し元のスレッド ID (TID) を返す。 シングルスレッドのプロセスでは、スレッド ID は
51 (\fBgetpid\fP(2)  が返すプロセス ID (PID) と等しい。 マルチスレッドのプロセスでは、全てのスレッドは同じ PID を持つが、
52 それぞれのスレッドは一意な TID を持つ。 さらなる詳細は、 \fBclone\fP(2)  の \fBCLONE_THREAD\fP
53 についての議論を参照すること。
54 .SH 返り値
55 On success, returns the thread ID of the calling thread.
56 .SH エラー
57 このコールは常に成功する。
58 .SH バージョン
59 The \fBgettid\fP()  system call first appeared on Linux in kernel 2.4.11.
60 Library support was added in glibc 2.30.  (Earlier glibc versions did not
61 provide a wrapper for this system call, necessitating the use of
62 \fBsyscall\fP(2).)
63 .SH 準拠
64 \fBgettid\fP()  は Linux 固有であり、 移植を想定したプログラムでは使用すべきではない。
65 .SH 注意
66 このシステムコールが返すスレッド ID は POSIX スレッド ID (\fBpthread_self\fP(3)  が返す曖昧な値) と同じものではない。
67 .PP
68 In a new thread group created by a \fBclone\fP(2)  call that does not specify
69 the \fBCLONE_THREAD\fP flag (or, equivalently, a new process created by
70 \fBfork\fP(2)), the new process is a thread group leader, and its thread group
71 ID (the value returned by \fBgetpid\fP(2))  is the same as its thread ID (the
72 value returned by \fBgettid\fP()).
73 .SH 関連項目
74 .\" .BR kcmp (2),
75 .\" .BR move_pages (2),
76 .\" .BR migrate_pages (2),
77 .\" .BR process_vm_readv (2),
78 .\" .BR ptrace (2),
79 \fBcapget\fP(2), \fBclone\fP(2), \fBfcntl\fP(2), \fBfork\fP(2), \fBget_robust_list\fP(2),
80 \fBgetpid\fP(2), \fBioprio_set\fP(2), \fBperf_event_open\fP(2),
81 \fBsched_setaffinity\fP(2), \fBsched_setparam\fP(2), \fBsched_setscheduler\fP(2),
82 \fBtgkill\fP(2), \fBtimer_create\fP(2)
83 .SH この文書について
84 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
85 \%https://www.kernel.org/doc/man\-pages/ に書かれている。