---
name: "pthread_main_np"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/pthread_main_np"
---

# pthread\_main\_np(3)

identify the initial thread

## NAME

**pthread\_main\_np** – identify the initial thread

## LIBRARY

POSIX Threads Library (libpthread, -lpthread)

## SYNOPSIS

**#include \<pthread\_np.h\>**

*int*\

**pthread\_main\_np**(*void*);

## DESCRIPTION

The **pthread\_main\_np**() function is used in userland threads environment to identify the initial thread. Its semantics is similar to the Solaris's **thr\_main**() function.

## RETURN VALUES

The **pthread\_main\_np**() function returns 1 if the calling thread is the initial thread, 0 if the calling thread is not the initial thread, and -1 if the thread's initialization has not yet completed.

## SEE ALSO

[pthread\_create(3)](/pthread_create/3.md), [pthread\_equal(3)](/pthread_equal/3.md), [pthread\_np(3)](/pthread_np/3.md), [pthread\_self(3)](/pthread_self/3.md)

## AUTHORS

This manual page was written by Alexey Zelkin ⟨*phantom@FreeBSD.org*⟩.
