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 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
27 .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2
29 .TH SIGSUSPEND 2 2021-03-22 "Linux" "Linux Programmer's Manual"
31 sigsuspend, rt_sigsuspend \- wait for a signal
34 .B #include <signal.h>
36 .BI "int sigsuspend(const sigset_t *" mask );
40 Feature Test Macro Requirements for glibc (see
41 .BR feature_test_macros (7)):
50 temporarily replaces the signal mask of the calling thread with the
53 and then suspends the thread until delivery of a signal whose
54 action is to invoke a signal handler or to terminate a process.
56 If the signal terminates the process, then
59 If the signal is caught, then
61 returns after the signal handler returns,
62 and the signal mask is restored to the state before the call to
65 It is not possible to block
69 specifying these signals in
71 has no effect on the thread's signal mask.
74 always returns \-1, with
76 set to indicate the error (normally,
82 points to memory which is not a valid part of the process address space.
85 The call was interrupted by a signal;
88 POSIX.1-2001, POSIX.1-2008.
92 is used in conjunction with
94 in order to prevent delivery of a signal during the execution of a
95 critical code section.
96 The caller first blocks the signals with
98 When the critical code has completed, the caller then waits for the
101 with the signal mask that was returned by
109 for details on manipulating signal sets.
111 .SS C library/kernel differences
112 The original Linux system call was named
114 However, with the addition of real-time signals in Linux 2.2,
115 the fixed-size, 32-bit
117 type supported by that system call was no longer fit for purpose.
118 Consequently, a new system call,
119 .BR rt_sigsuspend (),
120 was added to support an enlarged
123 The new system call takes a second argument,
124 .IR "size_t sigsetsize" ,
125 which specifies the size in bytes of the signal set in
127 This argument is currently required to have the value
134 wrapper function hides these details from us, transparently calling
136 when the kernel provides it.