Steve Reid <stever@qnx.com> wrote:
Here are a few numbers, thanks to grep and wc:
Yes No N/A See Caveats
Cancellation point 362 859 0 9
Interrupt handler 220 1003 0 7
My vote is that a list of 220 interrupt-safe functions is more useful
than a list of 1003 interrupt-unsafe functions.
BTW I must say 220 is much more than I expected. I’m surprised that
functions like chroot(), confstr(), gethostname(), modem_read(),
sethostname(), and sigblock() are interrupt-safe. Maybe some of those
are mistakes?
And I really don’t think the list of functions that we OFFICIALLY
APPROVE for use in interrupt handlers should contain such functions as
alloca(), alphasort(), basename(), bsearch(), cmdfd(), crypt(),
dn_comp(), dn_expand(), fnmatch(), hstrerror(), inet…(), isalpha()
and friends, rand(), regerror(), the various RESMGR… macros,
sigaddset() and friends, sigmask(), srand(), strcasecmp() and all the
other locale-sensitive functions, strcoll(), vsnprintf() (how come
snprintf() isn’t interrupt-safe?) – just to name a few…
Signal handler 407 814 2 7
Thread 1106 120 0 4
The two N/A entries for the signal handler are abort() and _exit().
Why? According to POSIX, _exit() is signal-safe and abort() is not.
–
Wojtek Lerch QNX Software Systems Ltd.