I realize this is kind of a silly question that I'm pretty sure I will be able to. But, if I were to install a signal handler in a function other than main, is it safe to assume the signal handler will remain after returning from the method?
Asked
Active
Viewed 41 times
1 Answers
1
Yes, you can do it in a separate function, signal()
does not have to be done in the main()
function, it can be done anywhere in the call stack.
The call to signal()
associates a signal number to an action, and the action may be a function address. There is no transient information (like stack variables or dynamic memory) that needs to be kept around after the association.

paxdiablo
- 854,327
- 234
- 1,573
- 1,953