[RFC] Consider adding a function to convert error name to errno

Rocket Ma marocketbd@gmail.com
Mon May 25 08:58:51 GMT 2026


I ran into some problems when trying to implement str2sig. Since I
want to write efficient code, I would like to reuse __sys_sigabbrev to
map common signals like "ABRT" to SIGABRT, however, I noticed that
some signals have aliases, for example, SIGABRT == SIGIOT. As I can't
lookup __sys_sigabbrev[SIGIOT] to get "IOT", it's hard not to write
some work around to accept signal aliases. I also noticed that on
Linux, glibc takes 32 and 33 as SIGCANCEL and SIGSETXID, and increases
RTMIN by 2.

For the first question, the alias one, I would ask is there a graceful
solution when constructing array with X-macro but some indexes are
conflict? I got no idea on how to put SIGIOT and SIGABRT in the same
array and separate them when needed. Some ugly work around like
applying `SIGIOT | 0x40` as index increases array size.

For the second question, the glibc private signal, I would ask shall
we map 32 to SIGCANCEL and map "CANCEL" back to 32 in sig2str/str2sig?
If we don't do this, user may observe that RTMIN starts from 34
instead of 32 and oddly find that 2 signals are undefined.

Rocket


More information about the Libc-alpha mailing list