Back to index

glibc  2.9
pthread_sigmask.c File Reference
#include <errno.h>
#include <signal.h>
#include <pthreadP.h>
#include <sysdep.h>

Go to the source code of this file.


int pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)

Function Documentation

int pthread_sigmask ( int  how,
const sigset_t newmask,
sigset_t oldmask 

Definition at line 27 of file pthread_sigmask.c.

  sigset_t local_newmask;

  /* The only thing we have to make sure here is that SIGCANCEL and
     SIGSETXID is not blocked.  */
  if (newmask != NULL
      && (__builtin_expect (__sigismember (newmask, SIGCANCEL), 0)
         || __builtin_expect (__sigismember (newmask, SIGSETXID), 0)))
      local_newmask = *newmask;
      __sigdelset (&local_newmask, SIGCANCEL);
      __sigdelset (&local_newmask, SIGSETXID);
      newmask = &local_newmask;

  /* We know that realtime signals are available if NPTL is used.  */
  int result = INTERNAL_SYSCALL (rt_sigprocmask, err, 4, how, newmask,
                             oldmask, _NSIG / 8);

  return (INTERNAL_SYSCALL_ERROR_P (result, err)
         ? INTERNAL_SYSCALL_ERRNO (result, err)
         : 0);
  return sigprocmask (how, newmask, oldmask) == -1 ? errno : 0;

Here is the call graph for this function: