Unix to Windows Porting Dictionary for HPC

RSS

Links

Function List

sigrelse


Unix

header file: signal.h

int sigrelse(int sig); 

Windows

Header file: none

Purpose

The sigrelse call removes the signal specified from the calling processes signal mask.

Discussion

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. The sigrelse routine will remove the specified signal from the system signal mask for the calling process and allow that signal to be acted upon.

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 unmask the signal itself and call the appropriate handler.

To get the same effect as sigrelse() in the running example, you would set the action for a given signal to SIG_DFL or USER in the signal mask array, depending on how you want to handle the signal in the future.

blog comments powered by Disqus
Valid HTML 4.01 Transitional Valid CSS!