--- /dev/null
+inline SigAction * Action(int signo, SigAction *func)
+{
+ struct sigaction new_handl, old_handl;
+ new_handl.sa_flags=SA_SIGINFO; /* we use sa_sigaction handler */
+ new_handl.sa_sigaction = func; /* set signal handler */
+ /* clear signal mask: no signal blocked during execution of func */
+ if (sigemptyset(&new_handl.sa_mask)!=0){ /* initialize signal set */
+ return NULL;
+ }
+ /* change action for signo signal */
+ if (sigaction(signo, &new_handl, &old_handl)){
+ return NULL;
+ }
+ return (old_handl.sa_sigaction);
+}