4 * Calling signal() is a non-portable, as it varies in meaning between
5 * platforms and depending on feature macros, and has stupid semantics
6 * at least some of the time.
8 * This function provides the same interface as the libc function, but
9 * provides consistent semantics. It assumes POSIX semantics for
10 * sigaction() (so you might need to do some more work if you port to
11 * something ancient like SunOS 4)
13 void (*putty_signal(int sig, void (*func)(int)))(int) {
18 if(sigemptyset(&sa.sa_mask) < 0)
20 sa.sa_flags = SA_RESTART;
21 if(sigaction(sig, &sa, &old) < 0)
23 return old.sa_handler;