...
Code Block | ||
---|---|---|
| ||
void handler(int signum) { signal(signum, handler); /* Handle Signal */ } |
Wiki Markup |
---|
Unfortunately this solution still contains a race window, starting when the host environment resets the signal and ending when the handler calls {{signal()}}. During that time, a second signal sent to the program will trigger the default signal behavior, thereby defeating the persistent behavior (see \[[SIG34-C. Do not call signal() from within interruptible signal handlers]\]). |
A secure solution would prevent the environment from resetting the signal in the first place, and thereby guaranteeing persistence. Unfortunately, Windows does not provide a secure solution to this problem.
...