'Updates the signal mask.
:param how: the "how" argument of sigprocmask (see manpage)
:param new_mask: the mask modification to apply
:param sigsetsize: the size (in *bytes* of the sigmask set)
:param valid_ptr: is set if the new_mask was not NULL'

def sigprocmask(self, how, new_mask, sigsetsize, valid_ptr=True):

    oldmask = self.sigmask(sigsetsize)
    self._sigmask = self.state.se.If(valid_ptr, self.state.se.If((how == self.SIG_BLOCK), (oldmask | new_mask), self.state.se.If((how == self.SIG_UNBLOCK), (oldmask & (~ new_mask)), self.state.se.If((how == self.SIG_SETMASK), new_mask, oldmask))), oldmask)
