Quote:
Originally Posted by
matrixmadhan
... list of function calls that should not be called in a signal handler ?
Different operating systems have different implementations of functions, so it is better to err on the side of safety. It would be simpler to have a list of functions that can be called.
Quote:
Originally Posted by
matrixmadhan
I have been thinking write () is uninterrupted until it is done - this is something new from the statement that it is ' partially ' atomic.
Also depends if you are using non-blocking IO.
Is there any way I could test this behavior by some kind of simulation ?
Here is one more point / question ,
with newer signal semantics - using sigaction
Quote:
Originally Posted by
matrixmadhan
kernel guarantees the binary that when executing the handler registered for a possible signal, within that block another signal of the same kind would not be delivered until it returns - in such case why shouldn't a fflush operation be used ?
Good point, except alot of memory management his handled inside libc, not the kernel, so a signal can occur in the middle of, say, malloc or free, while the routine is updating a list of free memory pointers, if you interrupt and call in the middle another memory allocation routine you could upset the apple cart. Basically, those routines not being reentrant.
If you move onto threaded code, you don't use signal handlers at all, you use sigwait() to return you a signal once it occurs.