Rev 5191 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5191 | Rev 6324 | ||
---|---|---|---|
1 | /* Version of sigsetmask.c |
1 | /* Version of sigsetmask.c |
2 | Written by Steve Chamberlain (sac@cygnus.com). |
2 | Written by Steve Chamberlain (sac@cygnus.com). |
3 | Contributed by Cygnus Support. |
3 | Contributed by Cygnus Support. |
4 | This file is in the public doamin. */ |
4 | This file is in the public doamin. */ |
5 | 5 | ||
6 | /* |
6 | /* |
7 | 7 | ||
8 | @deftypefn Supplemental int sigsetmask (int @var{set}) |
8 | @deftypefn Supplemental int sigsetmask (int @var{set}) |
9 | 9 | ||
10 | Sets the signal mask to the one provided in @var{set} and returns |
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 |
11 | the old mask (which, for libiberty's implementation, will always |
12 | be the value @code{1}). |
12 | be the value @code{1}). |
13 | 13 | ||
14 | @end deftypefn |
14 | @end deftypefn |
15 | 15 | ||
16 | */ |
16 | */ |
17 | - | ||
18 | #define _POSIX_SOURCE |
17 | |
19 | #include |
18 | #include |
20 | /* Including |
19 | /* Including |
21 | #include |
20 | #include |
22 | #include |
21 | #include |
23 | 22 | ||
24 | extern void abort (void) ATTRIBUTE_NORETURN; |
23 | extern void abort (void) ATTRIBUTE_NORETURN; |
25 | 24 | ||
26 | #ifdef SIG_SETMASK |
25 | #ifdef SIG_SETMASK |
27 | int |
26 | int |
28 | sigsetmask (int set) |
27 | sigsetmask (int set) |
29 | { |
28 | { |
30 | sigset_t new_sig; |
29 | sigset_t new_sig; |
31 | sigset_t old_sig; |
30 | sigset_t old_sig; |
32 | 31 | ||
33 | sigemptyset (&new_sig); |
32 | sigemptyset (&new_sig); |
34 | if (set != 0) { |
33 | if (set != 0) { |
35 | abort(); /* FIXME, we don't know how to translate old mask to new */ |
34 | abort(); /* FIXME, we don't know how to translate old mask to new */ |
36 | } |
35 | } |
37 | sigprocmask(SIG_SETMASK, &new_sig, &old_sig); |
36 | sigprocmask(SIG_SETMASK, &new_sig, &old_sig); |
38 | return 1; /* FIXME, we always return 1 as old value. */ |
37 | return 1; /* FIXME, we always return 1 as old value. */ |
39 | } |
38 | } |
40 | #endif |
39 | #endif |