It is currently Mon, 27 Jun 2022 12:03:28 GMT



 
Author Message
 Use "sigset" for correct "signal" semantics
It's amazing that there is so much misunderstanding about this.

If you want the old SunOS4.1 semantics of "signal", use "sigset" in
your Solaris 2.x programs.

i.e. sigset(SIGTERM, my_catch_it_fn);

This works just as "signal" used to in SunOX4.1.  Signal will be caught
"reliably", i.e. new instances will be held until the current when is
completely handled, i.e. until the handler function finishes.  At that
point, the hadnler will be automatically reinstalled.

If you are porting a SunOS4.1 program with 80,000 "signal" calls, just
#define signal(a, b) sigset(a, b)

Do NOT use "signal" in Solaris 2.x.  Even if you reinstall the handler within
the hadnler itself, it is possible to receive two signals in such quick
succession that you're program gets blown away before your handler is
reinstalled.

Phew!  By the way, this has been in SysV since 1987-ish.  Solaris 2.x is SysV.

NOW, if you want "fancier", signal handling, you can use the sigaction /
sigsetmask stuff instead.  Here you can automatically hold a whole set
of signals immediately upon receiving a single one.

Marc Rossner
Taos Mountain Software
m...@netcom.com



 Mon, 30 Dec 1996 02:08:54 GMT   
 
   [ 1 post ] 

Similar Threads

1. GETSERVBYNAME()????????????????????"""""""""""""

2. "Source Route Failed", "LOGIN FAIL..", "Malformed response", and "Lame server" messages in /var/log

3. "WaveRunner"/"Linux"/"OS/2 Warp"/"ISDN "

4. "caught signal 11" error using fvwm

5. What's different among "syscall", "syscall32", "syscall3264", "syscall64"?

6. Semantics of non-blocking "passive"-mode SOCK_STREAM sockets

7. "Invited", "Free Gift", and the English Language

8. section "screen", subsection "display"


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software