Changeset 567ac45 in rtems


Ignore:
Timestamp:
Aug 8, 1996, 6:24:29 PM (25 years ago)
Author:
Mark Johannes <Mark.Johannes@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
2a9a479
Parents:
8b1c1ae
Message:

_POSIX_signals_Clear_signals: added this routine
_POSIX_signals_Get_highest: changed initial starting signal to SIGHUP, still needs SIGFIRSTNOTRT

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/src/psignal.c

    r8b1c1ae r567ac45  
    231231{
    232232  sigset_t                    mask;
     233  sigset_t                    signals_blocked;
    233234  ISR_Level                   level;
    234235  boolean                     do_callout;
     
    239240  do_callout = FALSE;
    240241 
     242  /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
     243   * insures that no signals are blocked and all are checked.
     244   */
     245
     246  if ( check_blocked )
     247    signals_blocked = ~api->signals_blocked;
     248  else
     249    signals_blocked = SIGNAL_ALL_MASK;
     250
    241251  /* XXX this is not right for siginfo type signals yet */
    242252  /* XXX since they can't be cleared the same way */
     
    244254  _ISR_Disable( level );
    245255    if ( is_global ) {
    246        if ( mask & (_POSIX_signals_Pending &
    247                        (~api->signals_blocked & check_blocked) ) ) {
     256       if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
    248257         if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
    249258           psiginfo = (POSIX_signals_Siginfo_node *)
     
    264273       }
    265274    } else {
    266       if ( mask & (api->signals_pending &
    267                       (~api->signals_blocked & check_blocked) ) ) {
     275      if ( mask & (api->signals_pending & signals_blocked) ) {
    268276        api->signals_pending &= ~mask;
    269277        do_callout = TRUE;
     
    377385  }
    378386
    379   for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
     387/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
     388
     389  for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
    380390
    381391    if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
     
    522532    set_errno_and_return_minus_one( EFAULT );
    523533
     534  if ( !signo )
     535    return 0;
     536
    524537  if ( !is_valid_signo(signo) )
    525538    set_errno_and_return_minus_one( EINVAL );
     
    541554    set_errno_and_return_minus_one( EFAULT );
    542555 
     556  if ( !signo )
     557    return 0;
     558
    543559  if ( !is_valid_signo(signo) )
    544560    set_errno_and_return_minus_one( EINVAL );
     
    560576    set_errno_and_return_minus_one( EFAULT );
    561577 
     578  if ( !signo )
     579    return 0;
     580
    562581  if ( !is_valid_signo(signo) )
    563582    set_errno_and_return_minus_one( EINVAL );
     
    581600  ISR_Level     level;
    582601
     602  if ( oact )
     603    *oact = _POSIX_signals_Vectors[ sig ];
     604
     605  if ( !sig )
     606    return 0;
     607
    583608  if ( !is_valid_signo(sig) )
    584609    set_errno_and_return_minus_one( EINVAL );
    585610 
    586   if ( oact )
    587     *oact = _POSIX_signals_Vectors[ sig ];
    588 
    589611  /*
    590612   *  Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references.
     
    674696 
    675697  if ( !set )
    676     set_errno_and_return_minus_one( EFAULT );
     698    return 0;
    677699
    678700  switch ( how ) {
     
    738760  api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
    739761
    740   saved_signals_blocked = api->signals_blocked;
     762  status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
    741763 
    742764  (void) sigfillset( &all_signals );
     
    744766  status = sigtimedwait( &all_signals, NULL, NULL );
    745767
    746   api->signals_blocked = saved_signals_blocked;
     768  (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
    747769
    748770  return status;
     
    780802  }
    781803 
    782   for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
     804/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
     805
     806  for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
    783807    if ( set & signo_to_mask( signo ) )
    784808      return signo;
  • cpukit/posix/src/psignal.c

    r8b1c1ae r567ac45  
    231231{
    232232  sigset_t                    mask;
     233  sigset_t                    signals_blocked;
    233234  ISR_Level                   level;
    234235  boolean                     do_callout;
     
    239240  do_callout = FALSE;
    240241 
     242  /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
     243   * insures that no signals are blocked and all are checked.
     244   */
     245
     246  if ( check_blocked )
     247    signals_blocked = ~api->signals_blocked;
     248  else
     249    signals_blocked = SIGNAL_ALL_MASK;
     250
    241251  /* XXX this is not right for siginfo type signals yet */
    242252  /* XXX since they can't be cleared the same way */
     
    244254  _ISR_Disable( level );
    245255    if ( is_global ) {
    246        if ( mask & (_POSIX_signals_Pending &
    247                        (~api->signals_blocked & check_blocked) ) ) {
     256       if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
    248257         if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
    249258           psiginfo = (POSIX_signals_Siginfo_node *)
     
    264273       }
    265274    } else {
    266       if ( mask & (api->signals_pending &
    267                       (~api->signals_blocked & check_blocked) ) ) {
     275      if ( mask & (api->signals_pending & signals_blocked) ) {
    268276        api->signals_pending &= ~mask;
    269277        do_callout = TRUE;
     
    377385  }
    378386
    379   for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
     387/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
     388
     389  for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
    380390
    381391    if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
     
    522532    set_errno_and_return_minus_one( EFAULT );
    523533
     534  if ( !signo )
     535    return 0;
     536
    524537  if ( !is_valid_signo(signo) )
    525538    set_errno_and_return_minus_one( EINVAL );
     
    541554    set_errno_and_return_minus_one( EFAULT );
    542555 
     556  if ( !signo )
     557    return 0;
     558
    543559  if ( !is_valid_signo(signo) )
    544560    set_errno_and_return_minus_one( EINVAL );
     
    560576    set_errno_and_return_minus_one( EFAULT );
    561577 
     578  if ( !signo )
     579    return 0;
     580
    562581  if ( !is_valid_signo(signo) )
    563582    set_errno_and_return_minus_one( EINVAL );
     
    581600  ISR_Level     level;
    582601
     602  if ( oact )
     603    *oact = _POSIX_signals_Vectors[ sig ];
     604
     605  if ( !sig )
     606    return 0;
     607
    583608  if ( !is_valid_signo(sig) )
    584609    set_errno_and_return_minus_one( EINVAL );
    585610 
    586   if ( oact )
    587     *oact = _POSIX_signals_Vectors[ sig ];
    588 
    589611  /*
    590612   *  Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references.
     
    674696 
    675697  if ( !set )
    676     set_errno_and_return_minus_one( EFAULT );
     698    return 0;
    677699
    678700  switch ( how ) {
     
    738760  api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
    739761
    740   saved_signals_blocked = api->signals_blocked;
     762  status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
    741763 
    742764  (void) sigfillset( &all_signals );
     
    744766  status = sigtimedwait( &all_signals, NULL, NULL );
    745767
    746   api->signals_blocked = saved_signals_blocked;
     768  (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
    747769
    748770  return status;
     
    780802  }
    781803 
    782   for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
     804/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
     805
     806  for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
    783807    if ( set & signo_to_mask( signo ) )
    784808      return signo;
Note: See TracChangeset for help on using the changeset viewer.