1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 2003 Abhijit Menon-Sen <ams@wiw.org>
4 .\" and Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved.
27 .\" Translated Mon Mar 5 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
28 .\" Updated Sun Sep 14 JST 2003 by Akihiro MOTOKI
29 .\" Updated 2008-02-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.77
30 .\" Updated 2008-08-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
32 .TH GETTID 2 2008-04-14 "Linux" "Linux Programmer's Manual"
35 .\"O gettid \- get thread identification
36 gettid \- スレッドID を取得する
40 .B #include <sys/types.h>
42 .B pid_t gettid(void);
47 .\"O returns the caller's thread ID (TID).
48 .\"O In a single-threaded process, the thread ID
49 .\"O is equal to the process ID (PID, as returned by
51 .\"O In a multithreaded process, all threads
52 .\"O have the same PID, but each one has a unique TID.
54 は呼び出し元のスレッド ID (TID) を返す。
55 シングルスレッドのプロセスでは、スレッド ID は
57 が返すプロセス ID (PID) と等しい。
58 マルチスレッドのプロセスでは、全てのスレッドは同じ PID を持つが、
59 それぞれのスレッドは一意な TID を持つ。
60 .\"O For further details, see the discussion of
69 .\"O .SH "RETURN VALUE"
71 .\"O On success, returns the thread ID of the calling process.
72 成功の場合、呼び出し元のプロセスのスレッドID を返す。
75 .\"O This call is always successful.
81 .\"O system call first appeared on Linux in kernel 2.4.11.
83 システムコールは、カーネル 2.4.11 の Linux で初めて登場した。
84 .\"O .SH "CONFORMING TO"
87 .\"O is Linux-specific and should not be used in programs that
88 .\"O are intended to be portable.
91 移植を想定したプログラムでは使用すべきではない。
94 .\"O Glibc does not provide a wrapper for this system call; call it using
96 glibc はこのシステムコールに対するラッパー関数を提供していない。
99 .\" See http://sourceware.org/bugzilla/show_bug.cgi?id=6399
100 .\" "gettid() should have a wrapper"
102 .\"O The thread ID returned by this call is not the same thing as a
103 .\"O POSIX thread ID (i.e., the opaque value returned by
104 .\"O .BR pthread_self (3)).
105 このシステムコールが返すスレッド ID は
107 .RB ( pthread_self (3)