Sys::SigAction - Perl extension for Consistent Signal Handling :: Perl 5.8.0 and later versions implements 'safe' signal handling on platforms which support the POSIX sigaction() function. This is accomplished by having http://search.cpan.org/~lbaxter/Sys-SigAction/lib/Sys/SigAction.pmHOME | I have some doubt about signal when I read APUE2: Bug#66803: [PATCH] Problem with signals and LinuxThreads.:: One of them is in sysdeps/posix/signal.c: libpthread overrides glibc's sigaction () function (which is declared as a weak alias in glibc) and provides its http://lists.debian.org/debian-glibc/2000/07/msg00004.htmlHOME | The GNU C Library - Table of Contents:: POSIX and BSD Signal Facilities · BSD Function to Establish a Handler · BSD Functions for Blocking Signals · Using a Separate Signal Stack http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.htmlHOME |
1.whether we can use the sigaction()function instead of the signal() function when we need catch and handle the specific signal. SGI TPL View (2 sigaction):: SIGACTION(2) NAME sigaction - software signal facilities (POSIX) SYNOPSIS # include sig is passed as the first argument to the signal-catching function. http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?cmd=getdoc&coll=0650&db=man&fname=2 sigactionHOME |
2.what are the differences between the signal()function and the sigaction()function?
3.and what are the advantages of use the sigaction() functions comparing to the signal() function? The GNU C Library - Signal Handling:: The sigaction function has the same basic effect as signal : to specify how a It's possible to use both the signal and sigaction functions within a http://www.chemie.fu-berlin.de/chemnet/use/info/libc/libc_21.htmlHOME | 1. Yes. Using sigaction is preferred.
2/3. For one thing, sigaction implementations are more similar, while the behaviour of signal is implementation specific, so sigaction is more portable. For more info read their manpages.
Just my thoughts...
This was posted under the Threads section ( pthreads since we are talking about *NIX systems )...
Soooo...
The absolute proper way would be to use a sigmask ( ... ) call followed with sigwait or sigtimedwait in the thread handling the specific target signal... AND go ahead and do a sigaction install ( but make it part of the config / pre-compile process ) to make certain broken systems ( older linux - prethreads - etc ) don't choke...
Michael
Traditional University or MLM University? You Choose
15 Questions to Ask Your Software Vendor
|