---
name: "pthread_kill_other_threads_np"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pthread_kill_other_threads_np"
---

# pthread\_kill\_other\_threads\_np(3)

terminate all other threads in process

## NAME

pthread\_kill\_other\_threads\_np - terminate all other threads in process

## LIBRARY

POSIX threads library (*libpthread*, *-lpthread*)

## SYNOPSIS

```
#include <pthread.h>
```

**void pthread\_kill\_other\_threads\_np(void);**

## DESCRIPTION

**pthread\_kill\_other\_threads\_np**() has an effect only in the LinuxThreads threading implementation. On that implementation, calling this function causes the immediate termination of all threads in the application, except the calling thread. The cancelation state and cancelation type of the to-be-terminated threads are ignored, and the cleanup handlers are not called in those threads.

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **pthread\_kill\_other\_threads\_np**() | Thread safety | MT-Safe |

## VERSIONS

In the NPTL threading implementation, **pthread\_kill\_other\_threads\_np**() exists, but does nothing. (Nothing needs to be done, because the implementation does the right thing during an [**execve**(2)](/execve/2.md).)

## STANDARDS

GNU; hence the suffix "\_np" (nonportable) in the name.

## HISTORY

glibc 2.0

## NOTES

**pthread\_kill\_other\_threads\_np**() is intended to be called just before a thread calls [**execve**(2)](/execve/2.md) or a similar function. This function is designed to address a limitation in the obsolete LinuxThreads implementation whereby the other threads of an application are not automatically terminated (as POSIX.1-2001 requires) during [**execve**(2)](/execve/2.md).

## SEE ALSO

[**execve**(2)](/execve/2.md), [**pthread\_cancel**(3)](/pthread_cancel/3.md), [**pthread\_setcancelstate**(3)](/pthread_setcancelstate/3.md), [**pthread\_setcanceltype**(3)](/pthread_setcanceltype/3.md), [**pthreads**(7)](/pthreads/7.md)
