1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! > /proc/[pid]/task (since Linux 2.6.0-test6)
//! > This is a directory that contains one subdirectory for each thread in the process. The name of each subdirectory is the numerical
//! > thread ID ([tid]) of the thread (see gettid(2)). Within each of these subdirectories, there is a set of files with the same names
//! > and contents as under the /proc/[pid] directories. For attributes that are shared by all threads, the contents for each of the
//! > files under the task/[tid] subdirectories will be the same as in the corresponding file in the parent /proc/[pid] directory (e.g.,
//! > in a multithreaded process, all of the task/[tid]/cwd files will have the same value as the /proc/[pid]/cwd file in the parent
//! > directory, since all of the threads in a process share a working directory). For attributes that are distinct for each thread, the
//! > corresponding files under task/[tid] may have different values (e.g., various fields in each of the task/[tid]/status files may be
//! > different for each thread).
//! >
//! > In a multithreaded process, the contents of the /proc/[pid]/task directory are not available if the main thread has already termi-
//! > nated (typically by calling pthread_exit(3)).
//! >
//! > -- https://www.unix.com/man-page/suse/5/proc/
type Result<T> = Result;
/// Return a Vector contains thread id whose contained in current process.
/// Return a Vector contains thread id whose contained in specified process.