O'Reilly logo

Advanced UNIX Programming by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling Signals

The previous sections demonstrate how you can define actions for signals and process them within your programs. Sometimes it is necessary to control more closely when a signal is allowed to be raised. The following sections will show you how this is accomplished under UNIX.

Blocking Signals

When the sigaction(2) function was discussed, it was noted that certain signals could be blocked during the call to the signal handler. For example, when SIGINT is handled by the signal handler, further SIGINT signals are prevented from taking place until the present handler returns (unless flag SA_NOMASK or SA_NODEFER is used).

In a similar fashion, your application can enter a critical piece of code where signals could cause it problems. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required