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

# pthread\_getthreadid\_np(3)

get the calling thread's integral ID

## NAME

**pthread\_getthreadid\_np** – get the calling thread's integral ID

## LIBRARY

POSIX Threads Library (libpthread, -lpthread)

## SYNOPSIS

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

*int*\

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

## DESCRIPTION

The **pthread\_getthreadid\_np**() function returns the unique integral ID of the calling thread. Its semantics is similar to the AIX's **pthread\_getthreadid\_np**() function.

## RETURN VALUES

The **pthread\_getthreadid\_np**() function returns the thread integral ID of the calling thread.

## ERRORS

None.

## SEE ALSO

[pthread\_np(3)](/pthread_np/3.md), [pthread\_self(3)](/pthread_self/3.md)

## AUTHORS

This manual page was written by Jung-uk Kim ⟨*jkim@FreeBSD.org*⟩.
