Subj : Re: async signal safety? To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Tue Jan 11 2005 08:32 pm Alexander Terekhov writes: > Marcin 'Qrczak' Kowalczyk wrote: > > [... errno ...] >> > Is it okay to save it on signal handler entry and restore on exit? >> >> Yes. > > Sez who? http://www.opengroup.org/onlinepubs/007904875/functions/sigaction.html "Note in particular that even the "safe" functions may modify errno; the signal-catching function, if not executing as an independent thread, may want to save and restore its value." This suggests that this usage was indeed intended. If it works in practice, it should have been specified more clearly. If it doesn't, this paragraph should be removed, but then it should be clarified what happens when you call an async-signal-safe function which modifies errno from a signal handler. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .