1*16dce513Schristos /* Version of sigsetmask.c 2*16dce513Schristos Written by Steve Chamberlain (sac@cygnus.com). 3*16dce513Schristos Contributed by Cygnus Support. 4*16dce513Schristos This file is in the public doamin. */ 5*16dce513Schristos 6*16dce513Schristos /* 7*16dce513Schristos 8*16dce513Schristos @deftypefn Supplemental int sigsetmask (int @var{set}) 9*16dce513Schristos 10*16dce513Schristos Sets the signal mask to the one provided in @var{set} and returns 11*16dce513Schristos the old mask (which, for libiberty's implementation, will always 12*16dce513Schristos be the value @code{1}). 13*16dce513Schristos 14*16dce513Schristos @end deftypefn 15*16dce513Schristos 16*16dce513Schristos */ 17*16dce513Schristos 18*16dce513Schristos #include <ansidecl.h> 19*16dce513Schristos /* Including <sys/types.h> seems to be needed by ISC. */ 20*16dce513Schristos #include <sys/types.h> 21*16dce513Schristos #include <signal.h> 22*16dce513Schristos 23*16dce513Schristos extern void abort (void) ATTRIBUTE_NORETURN; 24*16dce513Schristos 25*16dce513Schristos #ifdef SIG_SETMASK 26*16dce513Schristos int sigsetmask(int set)27*16dce513Schristossigsetmask (int set) 28*16dce513Schristos { 29*16dce513Schristos sigset_t new_sig; 30*16dce513Schristos sigset_t old_sig; 31*16dce513Schristos 32*16dce513Schristos sigemptyset (&new_sig); 33*16dce513Schristos if (set != 0) { 34*16dce513Schristos abort(); /* FIXME, we don't know how to translate old mask to new */ 35*16dce513Schristos } 36*16dce513Schristos sigprocmask(SIG_SETMASK, &new_sig, &old_sig); 37*16dce513Schristos return 1; /* FIXME, we always return 1 as old value. */ 38*16dce513Schristos } 39*16dce513Schristos #endif 40