sigsetmask man page on Minix

Man page or keyword search:  
man Server   6208 pages
apropos Keyword Search (all sections)
Output format
Minix logo
[printable version]

SIGSETMASK(3)		 BSD Library Functions Manual		 SIGSETMASK(3)

NAME
     sigsetmask — set current signal mask

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <signal.h>

     int
     sigsetmask(int mask);

     sigmask(signum);

DESCRIPTION
     This interface is made obsolete by: sigprocmask(2).

     sigsetmask() sets the current signal mask Signals are blocked from deliv‐
     ery if the corresponding bit in mask is a 1; the macro sigmask() is pro‐
     vided to construct the mask for a given signum.

     The system quietly disallows SIGKILL or SIGSTOP to be blocked.

RETURN VALUES
     The previous set of masked signals is returned.

EXAMPLES
     The following example using sigsetmask():

	   int omask;

	   omask = sigblock(sigmask(SIGINT) | sigmask(SIGHUP));

	   ...

	   sigsetmask(omask & ~(sigmask(SIGINT) | sigmask(SIGHUP)));

     Could be converted literally to:

	   sigset_t set, oset;

	   sigemptyset(&set);
	   sigaddset(&set, SIGINT);
	   sigaddset(&set, SIGHUP);
	   sigprocmask(SIG_BLOCK, &set, &oset);

	   ...

	   sigdelset(&oset, SIGINT);
	   sigdelset(&oset, SIGHUP);
	   sigprocmask(SIG_SETMASK, &oset, NULL);

     Another, clearer, alternative is:

	   sigset_t set;

	   sigemptyset(&set);
	   sigaddset(&set, SIGINT);
	   sigaddset(&set, SIGHUP);
	   sigprocmask(SIG_BLOCK, &set, NULL);

	   ...

	   sigprocmask(SIG_UNBLOCK, &set, NULL);

     To completely clear the signal mask using sigsetmask() one can do:

	   (void) sigsetmask(0);

     Which can be expressed via sigprocmask(2) as:

	   sigset_t eset;

	   sigemptyset(&eset);
	   (void) sigprocmask(SIG_SETMASK, &eset, NULL);

SEE ALSO
     kill(2), sigaction(2), sigprocmask(2), sigsuspend(2), sigblock(3),
     sigsetops(3), sigvec(3)

HISTORY
     The sigsetmask() function call appeared in 4.2BSD and has been depre‐
     cated.

BSD				August 10, 2002				   BSD
[top]

List of man pages available for Minix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net