Unix to Windows Porting Dictionary for HPC

RSS

Links

Function List

sigaddset


Unix

header file: signal.h

int sigaddset(sigset_t *set, int signo);

Windows

Header file: none

Purpose

The sigaddset call adds the individual signal specified to the signal set pointed to by set.

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 sigaddset routine allows the user to conveniently maintain a copy of the processes mask so it can be applied to the system copy with a single call (sigprocmask()).

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.

The sigaddset() call can be simulated in the running example by changing the signo entry in the signalmask array to SIG_IGN.

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