blocking signals in signal handler -- True or False quiz

blocking signals in signal handler -- True or False quiz

Post by Marc Rochkin » Thu, 24 Apr 2003 02:29:46



Is the following statement true or false and, if false, why:

"If, when sigaction is called to establish a signal handler for signal S,
the sa_mask member of the sigaction structure is filled and the SA_SIGINFO
flag is clear, no other signal handler can execute concurrently when signal
S is caught."

--Marc

 
 
 

blocking signals in signal handler -- True or False quiz

Post by Bjorn Rees » Thu, 24 Apr 2003 03:29:32



> Is the following statement true or false and, if false, why:

> "If, when sigaction is called to establish a signal handler for signal S,
> the sa_mask member of the sigaction structure is filled and the SA_SIGINFO
> flag is clear, no other signal handler can execute concurrently when signal
> S is caught."

I believe that the following from SUSv3 applies:

 "If SA_SIGINFO is not set in sa_flags, then the disposition of
  subsequent occurrences of sig when it is already pending is
  implementation-defined; the signal-catching function shall be
  invoked with a single argument."

 
 
 

blocking signals in signal handler -- True or False quiz

Post by Valentin Nechaye » Thu, 24 Apr 2003 03:35:11


MR> "If, when sigaction is called to establish a signal handler for signal S,
MR> the sa_mask member of the sigaction structure is filled and the SA_SIGINFO
MR> flag is clear, no other signal handler can execute concurrently when signal
MR> S is caught."

"True", if "filled" means "filled with all signals", i.e. after sigfillset().
SA_SIGINFO doesn't matter.

-netch-

 
 
 

blocking signals in signal handler -- True or False quiz

Post by Andrew Giert » Sat, 26 Apr 2003 08:58:10


 Marc> Is the following statement true or false and, if false, why:

 Marc> "If, when sigaction is called to establish a signal handler for
 Marc> signal S, the sa_mask member of the sigaction structure is
 Marc> filled and the SA_SIGINFO flag is clear, no other signal
 Marc> handler can execute concurrently when signal S is caught."

no other signal handler can _interrupt_ the one for signal S unless
the handler expressly unmasks a signal. In a multithreaded program,
another thread can (in some implementations) take a signal while the
handler is still executing in the first thread.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>

 
 
 

1. Blocking Signals in Signal Handlers

Is it possible to block signals while in a signal handler?  I'm using SunOS
4.1.3, and in my SIGIO signal handler I try to block SIGIO's as follows.

                sigblock(sigmask(SIGIO));

However,  even after I return from the signal handler, I find myself
continually getting SIGIO's.  When I check the blocking mask, using

                mask = sigsetmask(oldmask);

I find that SIGIO indeed was not blocked.  So to reiterate, is it possible
to block signals within signal handler?

                                                        Thanks,
                                                        Edward

2. Netscape 4.7 for AIX 4.3.3

3. Signal handlers inside signal handlers

4. Prob again: unwanted blank page print out

5. Signal handlers are not reset after signal delivery

6. Net card

7. Registering signal inside signal handler

8. term(inal) challenge: Mutt, SecureCRT, and color

9. Registering client data on signal manager side andreceiving it in signal handler

10. --- called from signal handler with signal -24242176 (SIG Unknown)

11. signal mask and signal handler

12. Setting a Signal handler to signal the input on a socket

13. signals, signal handlers, glibc reentrant?