Passing SIGWINCH on from a signal handler

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Feb 17 10:52:57 AEST 1990


In article <1525 at dinl.mmc.UUCP> noren at dinl.UUCP (Chuck Noren) writes:
>When we installed it, we found that signal() returns
>a NULL the first time it is invoked.  

No, you get SIG_DFL.

>We were hoping to get the default signal handler for
>SIGWINCH so we could use it to have the SunOS do its
>normal window processing.

You cannot use the address of kernel code in your process address space.
Besides, it is unlikely that the kernel even establishes a signal handler
function like you're thinking of for the process; much more probably it
handles default actions for signals with special-purpose in-line code.

>We were wondering if there is a way to pass the
>signal on to the SunOS default signal handler after we
>process the signal ourselves.

#include <signal.h>
void application_signal_handler(int sig) {
	...
	// following system call not necessary if the signal state was
	// reset to SIG_DFL upon entry to this function, as required by
	// standards but unlike 4BSD:
	signal(sig, SIG_DFL);
	// repost the signal for this process:
	kill(getpid(), sig);
}



More information about the Comp.unix.wizards mailing list