Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
sigprocmask(2)		      System Calls Manual		sigprocmask(2)

NAME
       sigprocmask - change and/or examine caller's signal mask

SYNOPSIS
       #include	<signal.h>

       int sigprocmask(int how,	const sigset_t *set,
	    sigset_t *oset);

MT-LEVEL
       Async-Signal-Safe

DESCRIPTION
       The  sigprocmask()  function  is	 used  to  examine  and/or  change the
       caller's	signal mask.  If the value is SIG_BLOCK, the set pointed to by
       the  argument set is added to the current signal	mask.  If the value is
       SIG_UNBLOCK, the	set pointed by the argument set	is  removed  from  the
       current	signal	mask.  If the value is SIG_SETMASK, the	current	signal
       mask is replaced	by the set pointed to by the argument set.  If the ar-
       gument  oset  is	 not  NULL,  the  previous mask	is stored in the space
       pointed to by oset.  If the value of the	 argument  set	is  NULL,  the
       value how is not	significant and	the caller's signal mask is unchanged;
       thus, the call can be used to inquire about currently blocked signals.

       If there	are any	pending	unblocked signals after	the call  to  sigproc-
       mask(), at least	one of those signals will be delivered before the call
       to sigprocmask()	returns.

       It is not possible to block those signals that cannot be	 ignored  (see
       sigaction(2)); this restriction is silently imposed by the system.

       If sigprocmask()	fails, the caller's signal mask	is not changed.

RETURN VALUES
       On  success, sigprocmask() returns zero.	 On failure, it	returns	-1 and
       sets errno to indicate the error.

ERRORS
       sigprocmask() fails if any of the following is true:

       EFAULT	      set or oset points to an illegal address.

       EINVAL	      The value	of the how argument is not equal to one	of the
		      defined values.

SEE ALSO
       sigaction(2), signal(3C), sigsetops(3C),	signal(5)

NOTES
       The  language  in  the main body	above should indicate that in a	multi-
       threaded	program, the call to sigpromask()  impacts  only  the  calling
       thread's	 signal	mask.  Hence, it is identical to a call	to thr_sigset-
       mask(3t), in a multi-threaded program.

				  21 Sep 1995			sigprocmask(2)

NAME | SYNOPSIS | MT-LEVEL | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO | NOTES

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=sigprocmask&sektion=2&manpath=SunOS+5.5.1>

home | help