---
name: "pthread_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_np"
---

# pthread\_np(3)

FreeBSD extensions to POSIX thread functions

## NAME

**pthread\_np** – FreeBSD extensions to POSIX thread functions

## LIBRARY

POSIX Threads Library (libpthread, -lpthread)

## SYNOPSIS

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

## DESCRIPTION

This manual page documents extensions to the POSIX thread functions. These extensions may or may not be portable to other operating systems.

The POSIX thread functions are summarized in this section in the following groups:

- Thread Routines

- Attribute Object Routines

- Mutex Routines

### Thread Routines

-

  *int* **pthread\_getaffinity\_np**(*pthread\_t td*, *size\_t cpusetsize*, *cpuset\_t \*cpusetp*) Get the CPU affinity of a specified thread.

-

  *int* **pthread\_get\_name\_np**(*pthread\_t thread*, *char \*name*, *size\_t len*) Get the name of a specified thread.

-

  *int* **pthread\_getname\_np**(*pthread\_t thread*, *char \*name*, *size\_t len*) Get the name of a specified thread.

-

  *int* **pthread\_getthreadid\_np**(*void*) Get the calling thread's integral ID.

-

  *int* **pthread\_main\_np**(*void*) Identify the initial thread.

-

  *int* **pthread\_multi\_np**(*void*) Sets the thread's scheduling mode to multi-threaded.

-

  *int* **pthread\_peekjoin\_np**(*pthread\_t thread*, *void \*\*value\_ptr*) Peek into the exit status of a specified thread.

-

  *int* **pthread\_resume\_all\_np**(*void*) Resume all suspended threads.

-

  *int* **pthread\_setaffinity\_np**(*pthread\_t td*, *size\_t cpusetsize*, *const cpuset\_t \*cpusetp*) Set the CPU affinity of a specified thread.

-

  *int* **pthread\_set\_name\_np**(*pthread\_t thread*, *char \*name*) Sets the specified thread's name.

-

  *int* **pthread\_setname\_np**(*pthread\_t thread*, *char \*name*) Sets the specified thread's name.

-

  *void* **pthread\_signals\_block\_np**(*void*) Blocks all asynchronous signals, quickly.

-

  *int* **pthread\_single\_np**(*void*) Sets the thread's scheduling mode to single-threaded.

-

  *int* **pthread\_suspend\_np**(*pthread\_t tid*) Suspend the specified thread.

-

  *int* **pthread\_suspend\_all\_np**(*void*) Suspend all active threads.

-

  *int* **pthread\_timedjoin\_np**(*pthread\_t thread*, *void \*\*value\_ptr*, *const struct timespec \*abstime*) A variant of **pthread\_join**() with a timeout.

### Attribute Object Routines

-

  *int* **pthread\_attr\_get\_np**(*pthread\_t pid*, *pthread\_attr\_t \*dst*) Get the attributes of an existent thread.

-

  *int* **pthread\_attr\_getaffinity\_np**(*const pthread\_attr\_t \*pattr*, *size\_t cpusetsize*, *cpuset\_t \*cpusetp*) Get the CPU affinity mask from the thread attribute object.

-

  *int* **pthread\_attr\_setaffinity\_np**(*pthread\_attr\_t \*pattr*, *size\_t cpusetsize*, *const cpuset\_t \*cpusetp*) Set the CPU affinity mask for the thread attribute object.

-

  *int* **pthread\_attr\_setcreatesuspend\_np**(*pthread\_attr\_t \*attr*) Permit creation of suspended threads.

### Mutex Routines

-

  *int* **pthread\_mutexattr\_getkind\_np**(*pthread\_mutexattr\_t attr*) Deprecated, use [pthread\_mutexattr\_gettype(3)](/pthread_mutexattr_gettype/3.md) instead.

-

  *int* **pthread\_mutexattr\_setkind\_np**(*pthread\_mutexattr\_t \*attr*) Deprecated, use [pthread\_mutexattr\_settype(3)](/pthread_mutexattr_settype/3.md) instead.

## SEE ALSO

[libthr(3)](/libthr/3.md), [pthread(3)](/pthread/3.md), [pthread\_affinity\_np(3)](/pthread_affinity_np/3.md), [pthread\_attr\_affinity\_np(3)](/pthread_attr_affinity_np/3.md), [pthread\_attr\_get\_np(3)](/pthread_attr_get_np/3.md), [pthread\_attr\_setcreatesuspend\_np(3)](/pthread_attr_setcreatesuspend_np/3.md), [pthread\_getthreadid\_np(3)](/pthread_getthreadid_np/3.md), [pthread\_join(3)](/pthread_join/3.md), [pthread\_main\_np(3)](/pthread_main_np/3.md), [pthread\_multi\_np(3)](/pthread_multi_np/3.md), [pthread\_mutexattr\_getkind\_np(3)](/pthread_mutexattr_getkind_np/3.md), [pthread\_resume\_all\_np(3)](/pthread_resume_all_np/3.md), [pthread\_resume\_np(3)](/pthread_resume_np/3.md), [pthread\_set\_name\_np(3)](/pthread_set_name_np/3.md), [pthread\_signals\_block\_np(3)](/pthread_signals_block_np/3.md), [pthread\_suspend\_all\_np(3)](/pthread_suspend_all_np/3.md), [pthread\_suspend\_np(3)](/pthread_suspend_np/3.md), pthread\_switch\_add\_np(3)

## STANDARDS

All of these functions are non-portable extensions to POSIX threads.
