This is solved by having thread-specific data areas for errno , rather than one global variable used by all threads. Many people find signal handling in C to be a bit tricky at the best of times. A quick re-cap of what signals are. Signals are the system's way of informing a process about various events. There are two types of signals, synchronous and asynchronous.
Synchronous signals are a result of a program action.
Asynchronous signals are independent of the program. For example, the signal sent when the user gives the kill command. If you choose the first option, then signals will have some default behavior. Typically, this default behavior will cause the program to exit or cause the program to ignore the signal, depending on what the signal is. In a multi-threaded application, there is always the question of which thread the signal will actually be delivered to.