To defer or not? Working with SA_NODEFER

Lets recall how signals are handled by default:

  • A process traps a signal n.
  • Signal n is delivered to the process (either by another process or the OS).
  • The signal handler is dispatched; that is, it runs in response to the signal.
    • Signal n is now auto-masked; that is, blocked from delivery to the process.
    • Signal handling is completed.
    • Signal n is now auto-unmasked, that is, enabled for delivery to the process.

This is reasonable: while handling a particular signal, that signal is masked. This is the default behavior.

However, what if you are writing, say, an embedded real-time application, where the signal delivery implies some real-world event has occurred and the application must respond to this ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.