1thr_main(3C) Standard C Library Functions thr_main(3C)
2
3
4
6 thr_main - identify the main thread
7
9 cc -mt [ flag... ] file... [ library... ]
10 #include <thread.h>
11
12 int thr_main(void);
13
14
16 The thr_main() function returns one of the following:
17
18 1 if the calling thread is the main thread
19
20
21 0 if the calling thread is not the main thread
22
23
24 -1 if libthread is not linked in or thread initialization has not
25 completed
26
27
29 /lib/libthread
30
31
33 See attributes(5) for descriptions of the following attributes:
34
35
36
37
38 ┌─────────────────────────────┬─────────────────────────────┐
39 │ATTRIBUTE TYPE │ATTRIBUTE VALUE │
40 ├─────────────────────────────┼─────────────────────────────┤
41 │MT-Level │MT-Safe │
42 └─────────────────────────────┴─────────────────────────────┘
43
45 thr_self(3C), attributes(5)
46
47
48
49SunOS 5.11 11 May 1998 thr_main(3C)