Why only async-safe functions should be called from a signal handler?
I understand that, from a signal handler function sigaction() I should only call those functions that are "async-safe". But why is so? Calling an unsafe function may lead to undefined behavior. The Open Group Base Specifications Issue 7 (POSIX.1-2008), in its treatment of "Signal Concepts" , says: [W]hen a signal interrupts an unsafe function ... and the signal-catching function calls an unsafe function, the behavior is undefined. As to why unsafe functions are unsafe, there may be many reasons in a given implementation. However, a previous version of the standard, Issue 6 (POSIX.1-2004),