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

# PR\_SET\_PDEATHSIG(2const)

set the parent-death signal of the calling process

## NAME

PR\_SET\_PDEATHSIG - set the parent-death signal of the calling process

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <linux/prctl.h>  /* Definition of PR_* constants */
#include <sys/prctl.h>
```

**int prctl(PR\_SET\_PDEATHSIG, long** *sig***);**

## DESCRIPTION

Set the parent-death signal of the calling process to *sig* (either a signal value in the range \[**1**, *NSIG - 1*\], or **0** to clear). This is the signal that the calling process will get when its parent dies.

The parent-death signal is sent upon subsequent termination of the parent thread and also upon termination of each subreaper process (see [**PR\_SET\_CHILD\_SUBREAPER**(2const)](/PR_SET_CHILD_SUBREAPER/2const.md)) to which the caller is subsequently reparented. If the parent thread and all ancestor subreapers have already terminated by the time of the **PR\_SET\_PDEATHSIG** operation, then no parent-death signal is sent to the caller.

The parent-death signal is process-directed (see [**signal**(7)](/signal/7.md)) and, if the child installs a handler using the [**sigaction**(2)](/sigaction/2.md) **SA\_SIGINFO** flag, the *si\_pid* field of the *siginfo\_t* argument of the handler contains the PID of the terminating parent process.

The parent-death signal setting is cleared for the child of a [**fork**(2)](/fork/2.md). It is also (since Linux 2.4.36 / 2.6.23) cleared when executing a set-user-ID or set-group-ID binary, or a binary that has associated capabilities (see [**capabilities**(7)](/capabilities/7.md)); otherwise, this value is preserved across [**execve**(2)](/execve/2.md). The parent-death signal setting is also cleared upon changes to any of the following thread credentials: effective user ID, effective group ID, filesystem user ID, or filesystem group ID.

## RETURN VALUE

On success, 0 is returned. On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **EINVAL**

  *sig* is not a valid signal number.

## STANDARDS

Linux.

## HISTORY

Linux 2.1.57.

## CAVEATS

The "parent" in this case is considered to be the *thread* that created this process. In other words, the signal will be sent when that thread terminates (via, for example, [**pthread\_exit**(3)](/pthread_exit/3.md)), rather than after all of the threads in the parent process terminate.

## SEE ALSO

[**prctl**(2)](/prctl/2.md), [**PR\_GET\_PDEATHSIG**(2const)](/PR_GET_PDEATHSIG/2const.md)
