[LCP] Is this reentrant?

Christopher Howard choward at indicium.us
Thu Jan 15 16:13:29 EST 2009


I'm trying to work on making my signal handling safer for my C app. Is 
this considered "reentrant"?:

void signal_handler_function(signal) {
    global_signal_variable = signal;
}

"global_signal_variable" is an integer, which is used in the regular 
code to handle the signal according to a switch statement.

If it isn't, what would be considered a safe way to handle the signal in 
the signal handler function, so it can be dealt with in the regular code?

-- 
Christopher Howard
http://indicium.us



More information about the linuxCprogramming mailing list