Unix to Windows Porting Dictionary for HPC |
|
|
RSS
LinksFunction List
|
Table of Contents The sigset call allows the user to set the disposition of any signal to SIG_IGN, SIG_DFL or to point it to a user written handler for the calling process. The POSIX implementation of signals includes the ability to mask individual signals. A signal mask is maintained by the operating system for each process in the system. If sigset is used, and disp is the address of a signal handler, the system shall add sig to the calling process' signal mask before executing the signal handler. When the signal handler returns, the system shall restore the calling process' signal mask to its state prior to the delivery of the signal. If sigset is used, and disp is equal to SIG_HOLD, sig shall be added to the calling process' signal mask and sig's disposition shall remain unchanged. If sigset is used, and disp is not equal to SIG_HOLD, sig shall be removed from the calling process' signal mask. The Windows implementation of signals does not include a mask capability at the process level. To get around this limitation the user can implement masking in the handler itself after setting the handler up to accept all signals. Once the handler is invoked, it can inspect the number of the signal that has invoked it and decide whether to ignore it, process it or send it off to the default handler for that signal. Note: While this technique may work, it is not identical to having the operating system mask the signal itself and never call the handler. The replacement for sigset for our running example would change the action for the specified signal in the signal mask maintained by the process to the desired value (SIG_IGN, SIG-DFL or USER). Once this is done, the next occurrence of that signal will be handled appropriately by the master signal handler. If the value for the signal is SIG_IGN or USER, the handler will continue to ignore the signal until the value in the signal mask is changed. If the value is SIG_DFL, the default action (termination) will occur the next time the handler is invoked by that signal. |
|
|
|