1sigwait(3)                 Library Functions Manual                 sigwait(3)
2
3
4

NAME

6       sigwait - wait for a signal
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <signal.h>
13
14       int sigwait(const sigset_t *restrict set, int *restrict sig);
15
16   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
17
18       sigwait():
19           Since glibc 2.26:
20               _POSIX_C_SOURCE >= 199506L
21           glibc 2.25 and earlier:
22               _POSIX_C_SOURCE
23

DESCRIPTION

25       The  sigwait()  function suspends execution of the calling thread until
26       one of the signals specified in the signal  set  set  becomes  pending.
27       The  function  accepts  the signal (removes it from the pending list of
28       signals), and returns the signal number in sig.
29
30       The operation of sigwait() is the same as sigwaitinfo(2), except that:
31
32sigwait() returns only the signal number, rather  than  a  siginfo_t
33          structure describing the signal.
34
35       •  The return values of the two functions are different.
36

RETURN VALUE

38       On success, sigwait() returns 0.  On error, it returns a positive error
39       number (listed in ERRORS).
40

ERRORS

42       EINVAL set contains an invalid signal number.
43

ATTRIBUTES

45       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
46       tributes(7).
47
48       ┌────────────────────────────────────────────┬───────────────┬─────────┐
49Interface                                   Attribute     Value   
50       ├────────────────────────────────────────────┼───────────────┼─────────┤
51sigwait()                                   │ Thread safety │ MT-Safe │
52       └────────────────────────────────────────────┴───────────────┴─────────┘
53

VERSIONS

55       sigwait() is implemented using sigtimedwait(2).
56
57       The glibc implementation of sigwait() silently ignores attempts to wait
58       for the two real-time signals that are  used  internally  by  the  NPTL
59       threading implementation.  See nptl(7) for details.
60

STANDARDS

62       POSIX.1-2008.
63

HISTORY

65       POSIX.1-2001.
66

EXAMPLES

68       See pthread_sigmask(3).
69

SEE ALSO

71       sigaction(2),      signalfd(2),      sigpending(2),      sigsuspend(2),
72       sigwaitinfo(2), sigsetops(3), signal(7)
73
74
75
76Linux man-pages 6.05              2023-07-20                        sigwait(3)
Impressum