Real time signals and priority

The POSIX standard, and the Linux documentation, states that when multiple real time signals of different types are pending delivery to a process (that is the process is blocking them); then, at some point, when the process's signal mask is unblocked (thereby allowing the signals to be delivered), the signals are indeed delivered in priority order: lowest signal number to highest signal number.

Let's test this: we write a program that traps and blocks upon the delivery of three real time signals: {SIGRTMAX-5, SIGRTMAX, SIGRTMIN+5}. (Have a look at the output of kill -l; their integer values are {59, 64, 39} respectively.)

Importantly, our program will, at the time of sigaction(2), use the sigfillset(3) convenience ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.