1 .\" Copyright (c) 2005 Michael Kerrisk
2 .\" based on earlier work by faith@cs.unc.edu and
3 .\" Mike Battersby <mib@deakin.edu.au>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2
9 .TH SIGSUSPEND 2 2021-03-22 "Linux man-pages (unreleased)"
11 sigsuspend, rt_sigsuspend \- wait for a signal
14 .RI ( libc ", " \-lc )
17 .B #include <signal.h>
19 .BI "int sigsuspend(const sigset_t *" mask );
23 Feature Test Macro Requirements for glibc (see
24 .BR feature_test_macros (7)):
33 temporarily replaces the signal mask of the calling thread with the
36 and then suspends the thread until delivery of a signal whose
37 action is to invoke a signal handler or to terminate a process.
39 If the signal terminates the process, then
42 If the signal is caught, then
44 returns after the signal handler returns,
45 and the signal mask is restored to the state before the call to
48 It is not possible to block
52 specifying these signals in
54 has no effect on the thread's signal mask.
57 always returns \-1, with
59 set to indicate the error (normally,
65 points to memory which is not a valid part of the process address space.
68 The call was interrupted by a signal;
71 POSIX.1-2001, POSIX.1-2008.
75 is used in conjunction with
77 in order to prevent delivery of a signal during the execution of a
78 critical code section.
79 The caller first blocks the signals with
81 When the critical code has completed, the caller then waits for the
84 with the signal mask that was returned by
92 for details on manipulating signal sets.
94 .SS C library/kernel differences
95 The original Linux system call was named
97 However, with the addition of real-time signals in Linux 2.2,
98 the fixed-size, 32-bit
100 type supported by that system call was no longer fit for purpose.
101 Consequently, a new system call,
102 .BR rt_sigsuspend (),
103 was added to support an enlarged
106 The new system call takes a second argument,
107 .IR "size_t sigsetsize" ,
108 which specifies the size in bytes of the signal set in
110 This argument is currently required to have the value
117 wrapper function hides these details from us, transparently calling
119 when the kernel provides it.