SIGWAIT(2) BSD System Calls Manual SIGWAIT(2)NAME
sigwait -- select a set of signals
sigwait(const sigset_t *restrict set, int *restrict sig);
The sigwait() function selects a set of signals, specified by set. If none of the selected signals are pending, sigwait() waits until one or
more of the selected signals has been generated. Then sigwait() atomically clears one of the selected signals from the set of pending sig-
nals for the process and sets the location pointed to by sig to the signal number that was cleared.
The signals specified by set should be blocked, but not ignored, at the time of the call to sigwait().
Processes which call sigwait() on ignored signals will wait indefinitely. Ignored signals are dropped immediately by the system, before
delivery to a waiting process.
If successful, sigwait() returns 0 and sets the location pointed to by sig to the cleared signal number. Otherwise, an error number is
sigwait() will fail if:
[EINVAL] set specifies one or more invalid signal numbers.
SEE ALSO pthread_sigmask(2), sigaction(2), sigpending(2), sigsuspend(2), pause(3)STANDARDS
sigwait() conforms to ISO/IEC 9945-1:1996 (``POSIX.1'')
BSD April 27, 2000 BSD
Check Out this Related Man Page
SIGWAIT(3) Linux Programmer's Manual SIGWAIT(3)NAME
sigwait - wait for a signal
int sigwait(const sigset_t *set, int *sig);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
sigwait(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
The sigwait() function suspends execution of the calling thread until one of the signals specified in the signal set set becomes pending.
The function accepts the signal (removes it from the pending list of signals), and returns the signal number in sig.
The operation of sigwait() is the same as sigwaitinfo(2), except that:
* sigwait() returns only the signal number, rather than a siginfo_t structure describing the signal.
* The return values of the two functions are different.
On success, sigwait() returns 0. On error, it returns a positive error number (listed in ERRORS).
EINVAL set contains an invalid signal number.
For an explanation of the terms used in this section, see attributes(7).
|Interface | Attribute | Value |
|sigwait() | Thread safety | MT-Safe |
sigwait() is implemented using sigtimedwait(2).
SEE ALSO sigaction(2), signalfd(2), sigpending(2), sigsuspend(2), sigwaitinfo(2), sigsetops(3), signal(7)Linux 2015-03-02 SIGWAIT(3)
I am sure this info is somewhere on the web but have not been able to find it via google or by searching this site. On HPUX we have a model script that runs a command to capture the spool file to a repository and doesn't actually physically print the spool file. This has been working... (4 Replies)
I have gone through man of sigwait and new to UNIX signals. Could anyone explain me about the following lines mentioned in sigwait man help ?
"The selection of a signal in set is independent of the signal
mask of the calling thread or LWP. This means a thread or
LWP can ... (1 Reply)
I am using curses.h and signals.h to control output to screen. My code displays an unchanging prompt that waits for user input. Meanwhile alarm signals are being generated that cause other ancillary messages to appear at other locations on the screen at various times.
The problem I have is with... (2 Replies)
Too generic to post elsewhere, too advanced for the newbie forums. There are some applications within the unix/linux milieu that understand signals such as SIGHUP, etc as instructions to perform administrative tasks (clearing information out of this, disconnect users, etc.) I was just wondering if... (2 Replies)
when I compile above code under solaris 10,it raise following error:
error: too many arguments to function 'sigwait'
I look up signal... (4 Replies)
After an extensive search, I haven't found a definitive answer to my question. "And what is your question you frackking noob", you may ask. Ok, here goes: When using sigwait to wait for SIGUSR1 or SIGUSR2, can you have it trigger a signal handler? The following code did NOT, and the example I got... (2 Replies)
I have been reading Vahalia's Unix Internals book, which states the following in the chapter dedicated to signals:
Given that, my understanding is that processes running in user mode don't become aware of signals until they switch to kernel mode, where the issig() function is called... (3 Replies)
Hello and thanks in advance for any help anyone can offer me
I've been reading up on process signal calls (sighup, sigint, sigkill & sigterm) and I understand they all have different methods of terminating a running process. From what I've also read is a exit() actually terminates a process. ... (2 Replies)