I forgot to commit ChangeLogs with darwin ld tests and documentation patch.
[official-gcc.git] / libiberty / sigsetmask.c
blobf705fbb2df2b02c7964ea1f8f39fff56d1e3a377
1 /* Version of sigsetmask.c
2 Written by Steve Chamberlain (sac@cygnus.com).
3 Contributed by Cygnus Support.
4 This file is in the public doamin. */
6 /*
8 @deftypefn Supplemental int sigsetmask (int @var{set})
10 Sets the signal mask to the one provided in @var{set} and returns
11 the old mask (which, for libiberty's implementation, will always
12 be the value @code{1}).
14 @end deftypefn
18 #define _POSIX_SOURCE
19 #include <ansidecl.h>
20 /* Including <sys/types.h> seems to be needed by ISC. */
21 #include <sys/types.h>
22 #include <signal.h>
24 extern void abort PARAMS ((void)) ATTRIBUTE_NORETURN;
26 #ifdef SIG_SETMASK
27 int
28 DEFUN(sigsetmask,(set),
29 int set)
31 sigset_t new;
32 sigset_t old;
34 sigemptyset (&new);
35 if (set != 0) {
36 abort(); /* FIXME, we don't know how to translate old mask to new */
38 sigprocmask(SIG_SETMASK, &new, &old);
39 return 1; /* FIXME, we always return 1 as old value. */
41 #endif