1 .\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2 .\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
5 .\" SPDX-License-Identifier: GPL-3.0-or-later
7 .TH proc_pid_task 5 (date) "Linux man-pages (unreleased)"
9 /proc/pid/task/, /proc/tid/, /proc/thread\-self/ \- thread information
12 .IR /proc/ pid /task/ " (since Linux 2.6.0)"
13 .\" Precisely: Linux 2.6.0-test6
14 This is a directory that contains one subdirectory
15 for each thread in the process.
16 The name of each subdirectory is the numerical thread ID
21 Within each of these subdirectories, there is a set of
22 files with the same names and contents as under the
25 For attributes that are shared by all threads, the contents for
26 each of the files under the
28 subdirectories will be the same as in the corresponding
32 (e.g., in a multithreaded process, all of the
34 files will have the same value as the
36 file in the parent directory, since all of the threads in a process
37 share a working directory).
38 For attributes that are distinct for each thread,
39 the corresponding files under
41 may have different values (e.g., various fields in each of the
43 files may be different for each thread),
44 .\" in particular: "children" :/
45 or they might not exist in
49 .\" The following was still true as at kernel 2.6.13
50 In a multithreaded process, the contents of the
52 directory are not available if the main thread has already terminated
54 .BR pthread_exit (3)).
57 There is a numerical subdirectory for each running thread
58 that is not a thread group leader
59 (i.e., a thread whose thread ID is not the same as its process ID);
60 the subdirectory is named by the thread ID.
61 Each one of these subdirectories contains files and subdirectories
62 exposing information about the thread with the thread ID
64 The contents of these directories are the same as the corresponding
65 .IR /proc/ pid /task/ tid
72 visible when iterating through
80 to view the contents of
82 However, the pathnames of these directories are visible to
83 (i.e., usable as arguments in)
84 system calls that operate on pathnames.
86 .IR /proc/thread\-self/ " (since Linux 3.17)"
87 .\" commit 0097875bd41528922fb3bb5f348c53f17e00e2fd
88 This directory refers to the thread accessing the
91 and is identical to the
92 .IR /proc/self/task/ tid
93 directory named by the process thread ID