[PATCH 5/5] Factor out shared definitions from bits/signum.h.

Florian Weimer fweimer@redhat.com
Wed Jun 7 07:08:00 GMT 2017


On 06/05/2017 03:45 PM, Zack Weinberg wrote:
> +* The obsolete signal constants SIGSTKFLT and SIGUNUSED are no longer
> +  defined by <signal.h>.  No supported version of the Linux kernel
> +  generates these signals, on any architecture.

But can't you use these signals like SIGUSR1 and SIGUSR2?  It certainly
works this way:

rt_sigaction(SIGSTKFLT, {sa_handler=0x4006f0, sa_mask=[],
sa_flags=SA_RESTORER, sa_restorer=0x7ff27215d990}, NULL, 8) = 0
getpid()                                = 28291
kill(28291, SIGSTKFLT)                  = 0
--- SIGSTKFLT {si_signo=SIGSTKFLT, si_code=SI_USER, si_pid=28291,
si_uid=1000} ---
write(1, "handler called\n", 15handler called
)        = 15

If we can reserve yet another signal, we could abuse the blocked/not
blocked flag as an indicator whether we are running in a signal handler
or not.  But I'm not sure if this is a good idea.

Florian



More information about the Libc-alpha mailing list