Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sigwait(2) [osx man page]

SIGWAIT(2)						      BSD System Calls Manual							SIGWAIT(2)

NAME
sigwait -- select a set of signals SYNOPSIS
#include <signal.h> int sigwait(const sigset_t *restrict set, int *restrict sig); DESCRIPTION
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. RETURN VALUES
If successful, sigwait() returns 0 and sets the location pointed to by sig to the cleared signal number. Otherwise, an error number is returned. ERRORS
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 SYNOPSIS
#include <signal.h> 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 DESCRIPTION
The sigwait() function suspends execution of the calling thread until the delivery of one of the signals specified in the signal set set. 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(), except that: * sigwait() only returns the signal number, rather than a siginfo_t structure describing the signal. * The return values of the two functions are different. RETURN VALUE
On success, sigwait() returns 0. On error, it returns a positive error number. ERRORS
EINVAL set contains an invalid signal number. CONFORMING TO
POSIX.1-2001. NOTES
sigwait() is implemented using sigtimedwait(2). EXAMPLES
See pthread_sigmask(3). SEE ALSO
sigaction(2), signalfd(2), sigpending(2), sigsuspend(2), sigwaitinfo(2), sigsetops(3), signal(7) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2009-02-10 SIGWAIT(3)
Man Page

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

lpsched signals

Hello, 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)
Discussion started by: TioTony
4 Replies

2. Programming

keypress signals

How-to use keypress action signals in C? Is there any nice select or poll functions for that? (1 Reply)
Discussion started by: Esaia
1 Replies

3. Programming

sigwait system call in UNIX signal

Hi Everybody, 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)
Discussion started by: md7ahuja
1 Replies

4. Programming

positioning cursor

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)
Discussion started by: enuenu
2 Replies

5. UNIX for Advanced & Expert Users

Process signals as administration

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)
Discussion started by: thmnetwork
2 Replies

6. Programming

Error: too many arguments to function 'sigwait'

#include <pthread.h> #include <signal.h> ... sigset_t mask; int err,signo; err=sigwait(&mask,&signo); switch(signo){ case SIGINT: ... } 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)
Discussion started by: konvalo
4 Replies

7. Programming

Signal Handlers using sigwait

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)
Discussion started by: bcfd36
2 Replies

8. UNIX for Dummies Questions & Answers

Do UNIX signals produce interrupts?

Hi folks! 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)
Discussion started by: Tru69
3 Replies

9. UNIX for Beginners Questions & Answers

Exit() system call verses process signals

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)
Discussion started by: bodisha
2 Replies

10. Shell Programming and Scripting

Parse the longest matching string

Hello experts, I am trying to unscramble a mixed signal into component signals. Let the list of known signals be $ cat tmplist DU DU4016 GFF GFF2010 GFF201019 G2115 G211 DU40 (1 Reply)
Discussion started by: senhia83
1 Replies