Sponsored Content
Top Forums Programming Signal Handlers using sigwait Post 302447174 by gendaox on Saturday 21st of August 2010 03:48:47 PM
Old 08-21-2010
Here is something that may help you - sigwait
It says:
Quote:
The sigwait() function selects a pending signal from set, atomically clears it from the system's set of pending signals ...
So it may be that the system checks for any process (/thread) waiting on a signal (via sigwait(2)) and if it finds one it returns after deleting the pending signal (from system's set), and after doing this operation it looks for the handler of the remaining signals.
But I am sure this is implementation dependent (try it on more variants - HP-UX, BSD ...)
 

8 More Discussions You Might Find Interesting

1. 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

2. Programming

RLIMIT_STACK signal's

I'am expecting a signal, but no signal is received when the stack-size reaches 10 bytes. Here in this code i'am setting rlim_cur=10bytes. To be more precise, when it reaches 10 bytes the process must receive a SIGSEGV signal? But i find no signal being received. Am i missing something in this... (0 Replies)
Discussion started by: prajwalps97
0 Replies

3. Programming

Signal processing

We have written a deamon which have many threads. We are registering for the SIGTERM and trying to close main thread in this signal handling. Actually these are running on Mac OS X ( BSD unix). When we are unloading the deamon with command launchctl, it's sending SIGTERM signal to our process... (1 Reply)
Discussion started by: Akshay4u
1 Replies

4. Programming

Signal handling

I am trying to write a small program where I can send signals and then ask for an action to be triggered if that signal is received. For example, here is an example where I am trying to write a programme that will say you pressed ctrl*c when someone presses ctrl+c. My questions are what you would... (1 Reply)
Discussion started by: #moveon
1 Replies

5. 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

6. Solaris

Exiting signal 6

Hello all, I have a problem when installing Solaris 10 on Enterprise 450. I booted from dvd, then the installation was started. The error appeared after determining the installation method, F2-Standard, F?-Flash...... The error was Exiting signal 6. Please, need help. Thank you (4 Replies)
Discussion started by: Hardono
4 Replies

7. Programming

Signal function

Hello I want to know how can i use signal function in c for keyboard interrupt handling. what i exactly want is : my program is processing and if i press any key while processing , the program should call the interrupt and displays/prints that key and now goes back to processing. I added the... (5 Replies)
Discussion started by: Jahanzeb
5 Replies

8. Programming

How is it work the event handlers!?

I just have started studying perl and I can not figure out what is the exact strategy used in the following script to handle events. Precisely, what I do not understand is if the loop that is in charge to control the state of the socket, is managed at the system level (where the process will be... (2 Replies)
Discussion started by: flaviofachin
2 Replies
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 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. RETURN VALUE
On success, sigwait() returns 0. On error, it returns a positive error number (listed in ERRORS). ERRORS
EINVAL set contains an invalid signal number. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +----------+---------------+---------+ |Interface | Attribute | Value | +----------+---------------+---------+ |sigwait() | Thread safety | MT-Safe | +----------+---------------+---------+ CONFORMING TO
POSIX.1-2001. NOTES
sigwait() is implemented using sigtimedwait(2). EXAMPLE
See pthread_sigmask(3). SEE ALSO
sigaction(2), signalfd(2), sigpending(2), sigsuspend(2), sigwaitinfo(2), sigsetops(3), signal(7) Linux 2015-03-02 SIGWAIT(3)
All times are GMT -4. The time now is 06:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy