liveBook · Manning

Signal number

As explained in Modern C, Third Edition

A signal number is an integer identifier representing a particular signal in the C signal interface.

A signal number is an integer identifier for a signal in C’s <signal.h> interface. A signal handler receives that number as its argument, so it can distinguish which signal interrupted normal control flow. section 19.6

Branching on a signal

A handler can inspect its sig argument and provide separate branches for SIGTERM and SIGABRT. When the handler returns, control resumes where it was interrupted. section 19.6

TAKEAWAY: C specifies six signal numbers; platforms may define more SIG-prefixed identifiers. Using those additions depends on the platform and reduces portability. Each supported signal number also has a disposition: SIG_DFL selects its default handling, while SIG_IGN requests that it be ignored. These dispositions are not signal numbers. section 19.6

How Modern C, Third Edition covers it

How deep it goes
Defines the identifier and explains its handler argument and disposition, without giving numeric values or specifying platform additions.
Examples
Uses a handler that distinguishes SIGTERM from SIGABRT and a platform listing that includes other signal names.
What you can do after
Evaluate/understand which signal a handler receives and whether a signal identifier relies on a platform definition.
How it connects
Relates signal numbers to signal handlers, signal dispositions, SIG_DFL, SIG_IGN, and platform-specific extensions.

Also explained in

Compare how 2 books explain signal number →

This explainer was generated by Manning's knowledge graph from the text of Modern C, Third Edition. The section links point to the parts of the book it draws on.