OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / gettid.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 2003 Abhijit Menon-Sen <ams@wiw.org>
4 .\" and Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\"
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.
9 .\"
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.
14 .\"
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
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
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
31 .\"
32 .TH GETTID 2 2008-04-14 "Linux" "Linux Programmer's Manual"
33 .\"O .SH NAME
34 .SH 名前
35 .\"O gettid \- get thread identification
36 gettid \- スレッドID を取得する
37 .\"O .SH SYNOPSIS
38 .SH 書式
39 .nf
40 .B #include <sys/types.h>
41 .sp
42 .B pid_t gettid(void);
43 .fi
44 .\"O .SH DESCRIPTION
45 .SH 説明
46 .\"O .BR gettid ()
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
50 .\"O .BR getpid (2)).
51 .\"O In a multithreaded process, all threads
52 .\"O have the same PID, but each one has a unique TID.
53 .BR gettid ()
54 は呼び出し元のスレッド ID (TID) を返す。
55 シングルスレッドのプロセスでは、スレッド ID は
56 .RB ( getpid (2)
57 が返すプロセス ID (PID) と等しい。
58 マルチスレッドのプロセスでは、全てのスレッドは同じ PID を持つが、
59 それぞれのスレッドは一意な TID を持つ。
60 .\"O For further details, see the discussion of
61 .\"O .BR CLONE_THREAD
62 .\"O in
63 .\"O .BR clone (2).
64 さらなる詳細は、
65 .BR clone (2)
66
67 .BR CLONE_THREAD
68 についての議論を参照すること。
69 .\"O .SH "RETURN VALUE"
70 .SH 返り値
71 .\"O On success, returns the thread ID of the calling process.
72 成功の場合、呼び出し元のプロセスのスレッドID を返す。
73 .\"O .SH ERRORS
74 .SH エラー
75 .\"O This call is always successful.
76 このコールは常に成功する。
77 .\"O .SH VERSIONS
78 .SH バージョン
79 .\"O The
80 .\"O .BR gettid ()
81 .\"O system call first appeared on Linux in kernel 2.4.11.
82 .BR gettid ()
83 システムコールは、カーネル 2.4.11 の Linux で初めて登場した。
84 .\"O .SH "CONFORMING TO"
85 .SH 準拠
86 .\"O .BR gettid ()
87 .\"O is Linux-specific and should not be used in programs that
88 .\"O are intended to be portable.
89 .BR gettid ()
90 は Linux 固有であり、
91 移植を想定したプログラムでは使用すべきではない。
92 .\"O .SH NOTES
93 .SH 注意
94 .\"O Glibc does not provide a wrapper for this system call; call it using
95 .\"O .BR syscall (2).
96 glibc はこのシステムコールに対するラッパー関数を提供していない。
97 .BR syscall (2)
98 を使って呼び出すこと。
99 .\" See http://sourceware.org/bugzilla/show_bug.cgi?id=6399
100 .\" "gettid() should have a wrapper"
101
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 は
106 POSIX スレッド ID
107 .RB ( pthread_self (3)
108 が返す曖昧な値) と同じものではない。
109 .\"O .SH "SEE ALSO"
110 .SH 関連項目
111 .BR clone (2),
112 .BR fork (2),
113 .BR getpid (2)