# How to check whether signal handlers remain installed?



## fonz (Jun 19, 2011)

From signal(3) (bold face removed because I don't want to look like I'm yelling):


> Unlike previous signal facilities, the handler func() remains installed after a signal has been delivered.


Although I personally find this much more convenient than the old way, I was wondering if there is a simple and portable way to check whether this is the case, e.g. something along the lines of

```
void
sighandler(int sig)
{
    do_something();
    ...
#ifdef SOMETHING_OR_OTHER
    signal(SIGTHIS,&sighandler); /* reinstall the handler */
#endif
}
```

Fonz


----------



## jilles@ (Jun 19, 2011)

Use sigaction(2)() and it is fully defined and portable that the handler remains installed.


----------



## fonz (Jun 19, 2011)

*Sounds like a plan*



			
				jilles@ said:
			
		

> Use sigaction(2)()


Thanks, I'll look into that. I'm still used to the simpler signal(3) system, but maybe it's time to switch over.

Fonz


----------

