Signals differ between implementation. There are some nice tables in APUE (Advanced Programming in the Unix Environment), such as "Figure 10.1 UNIX System signals" on page 292 of the 2nd edition.
So let's take the exemplary SIGWAITING
. Signals appear in the documentation as int
, but most implementations seem to use a #define
instead of a const int
.
However, does the standard stipulate anywhere that one can rely on signals being #define
d? Or can I assume it based on the fact that, say, virtually every existing implementation uses #define
. Or is this a bad assumption altogether?
The rationale is this: if I can rely on #define
being used, I can use #ifdef
to hide the more exotic signals from implementations that don't use it. For const int
constant names I am not aware of a similar mechanism that would allow this compile time decision to be made.