This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
resetting signals to SIG_DFL
- From: William Ahern <william at 25thandClement dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 21 Jul 2003 13:39:52 -0700
- Subject: resetting signals to SIG_DFL
I want to fork+exec and setup a default environment, including closing all
descriptors and setting all signals to SIG_DFL. However, LinuxThreads
makes use of some real-time signals, so if I were to . . .
for (sig = 0; sig < _NSIG; sig++)
signal(sig,SIG_DFL);
. . . I'd clobber those signals. I could skip the signals between __SIGRTMIN
and SIGRTMIN. Will __SIGRTMIN always be available?
OTOH, even if I do clobber these signals, since I've already fork'd and am
about to execl and am only in a single thread, does it even matter? Won't
those signals be set pre-main after execl?
I'm trying to be reasonably portable. Are there other platforms
or issues where the idea of blindly resetting signals like this should
be thrown out?
Curious,
Bill