SIGNAL(7)
man page states:
The numeric value for each signal is given in the table below. As shown in the table, many signals have different numeric values on different architectures
...
Indeed. In Linux kernel source we can ensure f.e. with SIGTERM
- here is a bunch of signal.h files for different architectures.
So if it's OS level and there is no explicit relation with hardware, why is there such platform dependency? Why Linux can't handle it equally on all supported platforms?
P.S. This post didn't help.
The same is true of a lot of things that shouldn't be platform-dependent: ioctl
numbers, syscall numbers, fcntl
numbers, stat
and sysv ipc structures, mmap
flags, etc. etc. etc. The reason is historical mistakes.
Early on, Linux modeled each platform's definitions on the predominant existing proprietary unix used there. For some, there was an attempt to actually be able to run binaries from the proprietary unix, and in some rare cases, for a while, it kind of worked. For the rest of was just a colossal waste of effort and technical debt. Even where it did work, these old systems are long gone.
Modern Linux has somewhat remedied this, using unified numbering for all new syscalls, unified asm-generic
definitions for new types, etc. But all the legacy baggage still exists.