2

Why are several signal numbers architecture-dependent on Linux?

Here is a quote along with a list of signals and signal numbers from man 7 signal:

Linux supports the standard signals listed below. Several signal numbers are architecture-dependent, as indicated in the "Value" column. [...] Where three values are given, the first one is usually valid for alpha and sparc, the middle one for x86, arm, and most other architectures, and the last one for mips.

Signal     Value
──────────────────
SIGHUP        1
SIGINT        2
SIGQUIT       3
SIGILL        4
SIGABRT       6
SIGFPE        8
SIGKILL       9
SIGSEGV      11
SIGPIPE      13
SIGALRM      14
SIGTERM      15
SIGUSR1   30,10,16
SIGUSR2   31,12,17
SIGCHLD   20,17,18
SIGCONT   19,18,25
SIGSTOP   17,19,23
SIGTSTP   18,20,24
SIGTTIN   21,21,26
SIGTTOU   22,22,27
that other guy
  • 116,971
  • 11
  • 170
  • 194
3z3bggv6
  • 21
  • 2
  • Very interesting observation. I see that for Alpha, the kernel source has a comment: "Linux/AXP has different signal numbers that Linux/i386: I'm trying to make it OSF/1 binary compatible, at least for normal binaries" If it's all for binary compatibility, I would love to know which OS it is and how binary compatibility works when running on Linux – that other guy Jun 28 '17 at 01:42
  • @thatotherguy Tru64 Unix... is what would normally run on an Alpha. In the case of Sparc, it probably has the same values on Solaris (which has heritage with AT&T SRV4 Unix... which Tru64 probably also shares), MIPS running IRIX is probably just being weird like Linux. – cb88 Aug 17 '17 at 18:03

1 Answers1

1

They are arbitrary numbers unless you are wanting to be compatible with something else.

Namely Tru64 Unix for Alpha. Solaris for Sparc, they probably get these numbers from AT&T Unix SRV4 directly....

And IRIX for MIPS.... is just being weird like Linux.

Linux has it's own numbers for backwards compatibility with itself.

cb88
  • 447
  • 3
  • 18