Both “reliable” and “real-time” signal generation, delivery, and default handling are specified by POSIX. This specification defines which events generate which signals. Linux adds a few signals corresponding to traditional signals from other Unix systems. If you want to add, remove, or modify an association between an event and a signal, you’d have to get it implemented in an operating system, and then make your case to the Austin Group (where POSIX is written).
The APIs available to control signal generation, delivery, and handling are extensive, see the links above for details. Some of these control how signals are handled (default action, ignored, or specific handler), but the association between an event and a signal itself can’t be controlled. Thus a floating-point exception will always result in SIGFPE
, which may be handled in different ways; a process can issue SIGFPE
manually in other circumstances too, but the connection between a floating-point exception and SIGFPE
can’t be disabled.
Some reliable signals are designed for user-defined purposes, SIGUSR1
and SIGUSR2
. There is no pre-established event corresponding to these signals, but there is a pre-established action (which terminates the receiving process). It is up to the generating process to determine which events result in one of these signals being generated; there is no way to tell the kernel to automatically generate such a signal in certain circumstances. (BPF programs can send signals, so signal-generating code can be hosted in the kernel, but that’s not quite the same.)
Real-time signals are all user-defined. As with user-defined reliable signals, they terminate the receiving process by default.
Your second question is already addressed in What causes various signals to be sent?
man -a signal; man -k signal
. – waltinator Dec 10 '20 at 00:33