Why can’t Unix programs have signals with meaningful program defined names (rather than USR1, etc)?

The signals available on an OS are defined by the OS (usually following POSIX) – they’re not “strings” but rather integer constants with standard names. USR1 and USR2 are the two signals that have no attached specific meaning – intended for whatever arbitrary use the developer wants.

On your linux machine, read man 7 signal for an overview of signal handling and signals.

You can redefine the meaning of other signals if you’re prepared to deal with the OS issuing those signals in response to events. You can e.g. make HUP mean “reload configuration” – as long as you’re either certain that the process will never get a hangup (terminal loss), or you’re prepared to handle cases where the OS and not a user sends the HUP signal.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)