Back to index

glibc  2.9
Functions
sigprocmask.c File Reference
#include <errno.h>
#include <sysdep.h>
#include <signal.h>

Go to the source code of this file.

Functions

int __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
 weak_alias (__sigprocmask, sigprocmask)

Function Documentation

int __sigprocmask ( int  how,
const sigset_t set,
sigset_t oset 
)

Definition at line 28 of file sigprocmask.c.

{
  unsigned long int setval;
  long result;

  if (set)
    setval = set->__val[0];
  else
    {
      setval = 0;
      how = SIG_BLOCK;      /* ensure blocked mask doesn't get changed */
    }

  result = INLINE_SYSCALL (osf_sigprocmask, 2, how, setval);
  if (result == -1)
    /* If there are ever more than 63 signals, we need to recode this
       in assembler since we wouldn't be able to distinguish a mask of
       all 1s from -1, but for now, we're doing just fine... */
    return result;

  if (oset)
    {
      oset->__val[0] = result;
      result = _SIGSET_NWORDS;
      while (--result > 0)
       oset->__val[result] = 0;
    }
  return 0;
}
weak_alias ( __sigprocmask  ,
sigprocmask   
)