xref: /openbsd-src/lib/libpthread/man/pthread_main_np.3 (revision a28daedfc357b214be5c701aa8ba8adb29a7f1c2)
1.\" $OpenBSD: pthread_main_np.3,v 1.5 2007/05/31 19:19:36 jmc Exp $
2.\"
3.\" Peter Valchev <pvalchev@openbsd.org> Public Domain, 2001
4.\"
5.Dd $Mdocdate: May 31 2007 $
6.Dt PTHREAD_MAIN_NP 3
7.Os
8.Sh NAME
9.Nm pthread_main_np
10.Nd identify the main thread
11.Sh SYNOPSIS
12.Fd #include <pthread.h>
13.Fd #include <pthread_np.h>
14.Ft int
15.Fn pthread_main_np "void"
16.Sh DESCRIPTION
17The
18.Fn pthread_main_np
19function identifies the main thread.
20.Sh RETURN VALUES
21The
22.Fn pthread_main_np
23function returns:
24.Bl -tag -width hrmf
25.It 1
26if the calling thread is the main thread
27.It 0
28if the calling thread is not the main thread
29.It -1
30if the thread initialization has not completed
31.El
32.Sh SEE ALSO
33.Xr pthread_self 3 ,
34.Xr pthreads 3
35.Sh STANDARDS
36The
37.Fn pthread_main_np
38function is non-portable and may not be supported with the above
39semantics on other POSIX systems.
40