resetting signals to SIG_DFL

William Ahern william@25thandClement.com
Mon Jul 21 21:07:00 GMT 2003


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



More information about the Libc-alpha mailing list