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

# sigset(3)

System V signal API

## NAME

sigset, sighold, sigrelse, sigignore - System V signal API

## LIBRARY

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

## SYNOPSIS

```
#include <signal.h>
```

**typedef typeof(void (int))  \*sighandler\_t;**

**\[\[deprecated\]\] sighandler\_t sigset(int** *sig***, sighandler\_t** *disp***);**

**\[\[deprecated\]\] int sighold(int** *sig***);** **\[\[deprecated\]\] int sigrelse(int** *sig***);** **\[\[deprecated\]\] int sigignore(int** *sig***);**

Feature Test Macro Requirements for glibc (see [**feature\_test\_macros**(7)](/feature_test_macros/7.md)):

**sigset**(), **sighold**(), **sigrelse**(), **sigignore**():

```
    _XOPEN_SOURCE >= 500
```

## DESCRIPTION

These functions are provided in glibc as a compatibility interface for programs that make use of the historical System V signal API. This API is obsolete: new applications should use the POSIX signal API ([**sigaction**(2)](/sigaction/2.md), [**sigprocmask**(2)](/sigprocmask/2.md), etc.)

The **sigset**() function modifies the disposition of the signal *sig*. The *disp* argument can be the address of a signal handler function, or one of the following constants:

- **SIG\_DFL**

  Reset the disposition of *sig* to the default.

- **SIG\_IGN**

  Ignore *sig*.

- **SIG\_HOLD**

  Add *sig* to the process's signal mask, but leave the disposition of *sig* unchanged.

If *disp* specifies the address of a signal handler, then *sig* is added to the process's signal mask during execution of the handler.

If *disp* was specified as a value other than **SIG\_HOLD**, then *sig* is removed from the process's signal mask.

The dispositions for **SIGKILL** and **SIGSTOP** cannot be changed.

The **sighold**() function adds *sig* to the calling process's signal mask.

The **sigrelse**() function removes *sig* from the calling process's signal mask.

The **sigignore**() function sets the disposition of *sig* to **SIG\_IGN**.

## RETURN VALUE

On success, **sigset**() returns **SIG\_HOLD** if *sig* was blocked before the call, or the signal's previous disposition if it was not blocked before the call. On error, **sigset**() returns -1, with *errno* set to indicate the error. (But see BUGS below.)

The **sighold**(), **sigrelse**(), and **sigignore**() functions return 0 on success; on error, these functions return -1 and set *errno* to indicate the error.

## ERRORS

For **sigset**() see the ERRORS under [**sigaction**(2)](/sigaction/2.md) and [**sigprocmask**(2)](/sigprocmask/2.md).

For **sighold**() and **sigrelse**() see the ERRORS under [**sigprocmask**(2)](/sigprocmask/2.md).

For **sigignore**(), see the errors under [**sigaction**(2)](/sigaction/2.md).

## ATTRIBUTES

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

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **sigset**(), **sighold**(), **sigrelse**(), **sigignore**() | Thread safety | MT-Safe |

## STANDARDS

POSIX.1-2008.

- *sighandler\_t*

  GNU. POSIX.1 uses the same type but without a *typedef*.

## HISTORY

glibc 2.1. SVr4, POSIX.1-2001. POSIX.1-2008 marks these functions as obsolete, recommending the use of [**sigaction**(2)](/sigaction/2.md), [**sigprocmask**(2)](/sigprocmask/2.md), [**pthread\_sigmask**(3)](/pthread_sigmask/3.md), and [**sigsuspend**(2)](/sigsuspend/2.md) instead.

## NOTES

The **sigset**() function provides reliable signal handling semantics (as when calling [**sigaction**(2)](/sigaction/2.md) with *sa\_mask* equal to 0).

On System V, the **signal**() function provides unreliable semantics (as when calling [**sigaction**(2)](/sigaction/2.md) with *sa\_mask* equal to *SA\_RESETHAND \| SA\_NODEFER*). On BSD, **signal**() provides reliable semantics. POSIX.1-2001 leaves these aspects of **signal**() unspecified. See [**signal**(2)](/signal/2.md) for further details.

In order to wait for a signal, BSD and System V both provided a function named [**sigpause**(3)](/sigpause/3.md), but this function has a different argument on the two systems. See [**sigpause**(3)](/sigpause/3.md) for details.

## BUGS

Before glibc 2.2, **sigset**() did not unblock *sig* if *disp* was specified as a value other than **SIG\_HOLD**.

Before glibc 2.5, **sigset**() does not correctly return the previous disposition of the signal in two cases. First, if *disp* is specified as **SIG\_HOLD**, then a successful **sigset**() always returns **SIG\_HOLD**. Instead, it should return the previous disposition of the signal (unless the signal was blocked, in which case **SIG\_HOLD** should be returned). Second, if the signal is currently blocked, then the return value of a successful **sigset**() should be **SIG\_HOLD**. Instead, the previous disposition of the signal is returned. These problems have been fixed since glibc 2.5.

## SEE ALSO

[**kill**(2)](/kill/2.md), [**pause**(2)](/pause/2.md), [**sigaction**(2)](/sigaction/2.md), [**signal**(2)](/signal/2.md), [**sigprocmask**(2)](/sigprocmask/2.md), [**raise**(3)](/raise/3.md), [**sigpause**(3)](/sigpause/3.md), [**sigvec**(3)](/sigvec/3.md), [**signal**(7)](/signal/7.md)
