4.104.114.84.95
Last change
on this file since 6a3a81c was
e180a77e,
checked in by Joel Sherrill <joel.sherrill@…>, on 01/04/02 at 18:28:24
|
2002-01-04 Ralf Corsepius <corsepiu@…>
- src/clockgetres.c: Apply rtems_set_errno_and_return_minus_one.
- src/clockgettime.c: Apply rtems_set_errno_and_return_minus_one.
- src/clocksettime.c: Apply rtems_set_errno_and_return_minus_one.
- src/killinfo.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueueclose.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueuecreatesupp.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueuegetattr.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueuenotify.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueueopen.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueuerecvsupp.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueuesendsupp.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueuesetattr.c: Apply rtems_set_errno_and_return_minus_one.
- src/mqueueunlink.c: Apply rtems_set_errno_and_return_minus_one.
- src/nanosleep.c: Apply rtems_set_errno_and_return_minus_one.
- src/pthreadkill.c: Apply rtems_set_errno_and_return_minus_one.
- src/pthreadsigmask.c: Apply rtems_set_errno_and_return_minus_one.
- src/ptimer1.c: Apply rtems_set_errno_and_return_minus_one.
- src/sched.c: Apply rtems_set_errno_and_return_minus_one.
- src/semaphorecreatesupp.c: Apply rtems_set_errno_and_return_minus_one.
- src/semaphorewaitsupp.c: Apply rtems_set_errno_and_return_minus_one.
- src/semclose.c: Apply rtems_set_errno_and_return_minus_one.
- src/semdestroy.c: Apply rtems_set_errno_and_return_minus_one.
- src/semgetvalue.c: Apply rtems_set_errno_and_return_minus_one.
- src/seminit.c: Apply rtems_set_errno_and_return_minus_one.
- src/semopen.c: Apply rtems_set_errno_and_return_minus_one.
- src/sempost.c: Apply rtems_set_errno_and_return_minus_one.
- src/semunlink.c: Apply rtems_set_errno_and_return_minus_one.
- src/setpgid.c: Apply rtems_set_errno_and_return_minus_one.
- src/setsid.c: Apply rtems_set_errno_and_return_minus_one.
- src/sigaction.c: Apply rtems_set_errno_and_return_minus_one.
- src/sigaddset.c: Apply rtems_set_errno_and_return_minus_one.
- src/sigdelset.c: Apply rtems_set_errno_and_return_minus_one.
- src/sigemptyset.c: Apply rtems_set_errno_and_return_minus_one.
- src/sigfillset.c: Apply rtems_set_errno_and_return_minus_one.
- src/sigismember.c: Apply rtems_set_errno_and_return_minus_one.
- src/sigpending.c: Apply rtems_set_errno_and_return_minus_one.
- src/sigtimedwait.c: Apply rtems_set_errno_and_return_minus_one.
- src/utsname.c: Apply rtems_set_errno_and_return_minus_one.
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Line | |
---|
1 | /* |
---|
2 | * 3.3.5 Examine and Change Blocked Signals, P1003.1b-1993, p. 73 |
---|
3 | * |
---|
4 | * NOTE: P1003.1c/D10, p. 37 adds pthread_sigmask(). |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-1999. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.OARcorp.com/rtems/license.html. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | #if HAVE_CONFIG_H |
---|
17 | #include "config.h" |
---|
18 | #endif |
---|
19 | |
---|
20 | #include <pthread.h> |
---|
21 | #include <signal.h> |
---|
22 | #include <errno.h> |
---|
23 | |
---|
24 | #include <rtems/system.h> |
---|
25 | #include <rtems/posix/pthread.h> |
---|
26 | #include <rtems/posix/psignal.h> |
---|
27 | #include <rtems/seterr.h> |
---|
28 | |
---|
29 | int pthread_sigmask( |
---|
30 | int how, |
---|
31 | const sigset_t *set, |
---|
32 | sigset_t *oset |
---|
33 | ) |
---|
34 | { |
---|
35 | POSIX_API_Control *api; |
---|
36 | |
---|
37 | if ( !set && !oset ) |
---|
38 | rtems_set_errno_and_return_minus_one( EINVAL ); |
---|
39 | |
---|
40 | api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; |
---|
41 | |
---|
42 | if ( oset ) |
---|
43 | *oset = api->signals_blocked; |
---|
44 | |
---|
45 | if ( !set ) |
---|
46 | return 0; |
---|
47 | |
---|
48 | switch ( how ) { |
---|
49 | case SIG_BLOCK: |
---|
50 | api->signals_blocked |= *set; |
---|
51 | break; |
---|
52 | case SIG_UNBLOCK: |
---|
53 | api->signals_blocked &= ~*set; |
---|
54 | break; |
---|
55 | case SIG_SETMASK: |
---|
56 | api->signals_blocked = *set; |
---|
57 | break; |
---|
58 | default: |
---|
59 | rtems_set_errno_and_return_minus_one( EINVAL ); |
---|
60 | } |
---|
61 | |
---|
62 | /* XXX are there critical section problems here? */ |
---|
63 | |
---|
64 | /* XXX evaluate the new set */ |
---|
65 | |
---|
66 | if ( ~api->signals_blocked & |
---|
67 | (api->signals_pending | _POSIX_signals_Pending) ) { |
---|
68 | _Thread_Executing->do_post_task_switch_extension = TRUE; |
---|
69 | _Thread_Dispatch(); |
---|
70 | } |
---|
71 | |
---|
72 | return 0; |
---|
73 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.