source: rtems/cpukit/posix/src/psignalclearsignals.c @ 1b074a1

4.104.114.84.95
Last change on this file since 1b074a1 was f42b726, checked in by Joel Sherrill <joel.sherrill@…>, on 01/24/01 at 14:17:28

2001-01-24 Ralf Corsepius <corsepiu@…>

  • configure.in: Add src/config.h
  • src/Makefile.am: Add INCLUDES += -I. to pickup config.h
  • src/.cvsignore: Add config.h and stamp-h
  • src/*.c: Add config.h support.
  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 *  $Id$
3 */
4
5#if HAVE_CONFIG_H
6#include "config.h"
7#endif
8
9#include <assert.h>
10#include <errno.h>
11#include <pthread.h>
12#include <signal.h>
13
14#include <rtems/system.h>
15#include <rtems/score/isr.h>
16#include <rtems/score/thread.h>
17#include <rtems/score/tqdata.h>
18#include <rtems/score/wkspace.h>
19#include <rtems/seterr.h>
20#include <rtems/posix/threadsup.h>
21#include <rtems/posix/psignal.h>
22#include <rtems/posix/pthread.h>
23#include <rtems/posix/time.h>
24#include <stdio.h>
25
26/*PAGE
27 *
28 *  _POSIX_signals_Clear_signals
29 */
30 
31boolean _POSIX_signals_Clear_signals(
32  POSIX_API_Control  *api,
33  int                 signo,
34  siginfo_t          *info,
35  boolean             is_global,
36  boolean             check_blocked
37)
38{
39  sigset_t                    mask;
40  sigset_t                    signals_blocked;
41  ISR_Level                   level;
42  boolean                     do_callout;
43  POSIX_signals_Siginfo_node *psiginfo;
44 
45  mask = signo_to_mask( signo );
46 
47  do_callout = FALSE;
48 
49  /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
50   * insures that no signals are blocked and all are checked.
51   */
52
53  if ( check_blocked )
54    signals_blocked = ~api->signals_blocked;
55  else
56    signals_blocked = SIGNAL_ALL_MASK;
57
58  /* XXX this is not right for siginfo type signals yet */
59  /* XXX since they can't be cleared the same way */
60 
61  _ISR_Disable( level );
62    if ( is_global ) {
63       if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
64         if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
65           psiginfo = (POSIX_signals_Siginfo_node *)
66             _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] );
67           if ( _Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
68             _POSIX_signals_Clear_process_signals( mask );
69           if ( psiginfo ) {
70             *info = psiginfo->Info;
71             _Chain_Append_unprotected(
72               &_POSIX_signals_Inactive_siginfo,
73               &psiginfo->Node
74             );
75           } else
76             do_callout = FALSE;
77         } else
78           _POSIX_signals_Clear_process_signals( mask );
79         do_callout = TRUE;
80       }
81    } else {
82      if ( mask & (api->signals_pending & signals_blocked) ) {
83        api->signals_pending &= ~mask;
84        do_callout = TRUE;
85      }
86    }
87  _ISR_Enable( level );
88  return do_callout;
89}
Note: See TracBrowser for help on using the repository browser.