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 it from said it did not. But WHY did it not? Can I make it call a signal handler?
A similar setup with sigsuspend DOES call the handler "catcher". If it is not supposed to be able to have a handler using sigwait, can you point me to the appropriate documentation?
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 ...)
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)
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)
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)
#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)
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)
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)
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)
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)