Index: c/src/exec/posix/src/psignal.c
===================================================================
--- c/src/exec/posix/src/psignal.c	(revision 8b1c1ae6f09435ca43a21411d3c5de4948b4eb95)
+++ c/src/exec/posix/src/psignal.c	(revision 567ac4579d3441bae26fae91a8127001c89bc7e0)
@@ -231,4 +231,5 @@
 {
   sigset_t                    mask;
+  sigset_t                    signals_blocked;
   ISR_Level                   level;
   boolean                     do_callout;
@@ -239,4 +240,13 @@
   do_callout = FALSE;
  
+  /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
+   * insures that no signals are blocked and all are checked.
+   */
+
+  if ( check_blocked )
+    signals_blocked = ~api->signals_blocked;
+  else
+    signals_blocked = SIGNAL_ALL_MASK;
+
   /* XXX this is not right for siginfo type signals yet */
   /* XXX since they can't be cleared the same way */
@@ -244,6 +254,5 @@
   _ISR_Disable( level );
     if ( is_global ) {
-       if ( mask & (_POSIX_signals_Pending & 
-                       (~api->signals_blocked & check_blocked) ) ) {
+       if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
          if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
            psiginfo = (POSIX_signals_Siginfo_node *)
@@ -264,6 +273,5 @@
        }
     } else {
-      if ( mask & (api->signals_pending & 
-                      (~api->signals_blocked & check_blocked) ) ) {
+      if ( mask & (api->signals_pending & signals_blocked) ) {
         api->signals_pending &= ~mask;
         do_callout = TRUE;
@@ -377,5 +385,7 @@
   }
 
-  for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
+/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
+
+  for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
 
     if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
@@ -522,4 +532,7 @@
     set_errno_and_return_minus_one( EFAULT );
 
+  if ( !signo )
+    return 0;
+
   if ( !is_valid_signo(signo) )
     set_errno_and_return_minus_one( EINVAL );
@@ -541,4 +554,7 @@
     set_errno_and_return_minus_one( EFAULT );
  
+  if ( !signo )
+    return 0;
+
   if ( !is_valid_signo(signo) )
     set_errno_and_return_minus_one( EINVAL );
@@ -560,4 +576,7 @@
     set_errno_and_return_minus_one( EFAULT );
  
+  if ( !signo )
+    return 0;
+
   if ( !is_valid_signo(signo) )
     set_errno_and_return_minus_one( EINVAL );
@@ -581,10 +600,13 @@
   ISR_Level     level;
 
+  if ( oact )
+    *oact = _POSIX_signals_Vectors[ sig ];
+
+  if ( !sig )
+    return 0;
+
   if ( !is_valid_signo(sig) )
     set_errno_and_return_minus_one( EINVAL );
   
-  if ( oact )
-    *oact = _POSIX_signals_Vectors[ sig ];
-
   /* 
    *  Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references.
@@ -674,5 +696,5 @@
  
   if ( !set )
-    set_errno_and_return_minus_one( EFAULT );
+    return 0;
 
   switch ( how ) {
@@ -738,5 +760,5 @@
   api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
 
-  saved_signals_blocked = api->signals_blocked;
+  status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
  
   (void) sigfillset( &all_signals );
@@ -744,5 +766,5 @@
   status = sigtimedwait( &all_signals, NULL, NULL );
 
-  api->signals_blocked = saved_signals_blocked;
+  (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
 
   return status;
@@ -780,5 +802,7 @@
   }
  
-  for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
+/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
+
+  for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
     if ( set & signo_to_mask( signo ) )
       return signo;
Index: cpukit/posix/src/psignal.c
===================================================================
--- cpukit/posix/src/psignal.c	(revision 8b1c1ae6f09435ca43a21411d3c5de4948b4eb95)
+++ cpukit/posix/src/psignal.c	(revision 567ac4579d3441bae26fae91a8127001c89bc7e0)
@@ -231,4 +231,5 @@
 {
   sigset_t                    mask;
+  sigset_t                    signals_blocked;
   ISR_Level                   level;
   boolean                     do_callout;
@@ -239,4 +240,13 @@
   do_callout = FALSE;
  
+  /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
+   * insures that no signals are blocked and all are checked.
+   */
+
+  if ( check_blocked )
+    signals_blocked = ~api->signals_blocked;
+  else
+    signals_blocked = SIGNAL_ALL_MASK;
+
   /* XXX this is not right for siginfo type signals yet */
   /* XXX since they can't be cleared the same way */
@@ -244,6 +254,5 @@
   _ISR_Disable( level );
     if ( is_global ) {
-       if ( mask & (_POSIX_signals_Pending & 
-                       (~api->signals_blocked & check_blocked) ) ) {
+       if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
          if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
            psiginfo = (POSIX_signals_Siginfo_node *)
@@ -264,6 +273,5 @@
        }
     } else {
-      if ( mask & (api->signals_pending & 
-                      (~api->signals_blocked & check_blocked) ) ) {
+      if ( mask & (api->signals_pending & signals_blocked) ) {
         api->signals_pending &= ~mask;
         do_callout = TRUE;
@@ -377,5 +385,7 @@
   }
 
-  for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
+/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
+
+  for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
 
     if ( _POSIX_signals_Check_signal( api, signo, FALSE ) )
@@ -522,4 +532,7 @@
     set_errno_and_return_minus_one( EFAULT );
 
+  if ( !signo )
+    return 0;
+
   if ( !is_valid_signo(signo) )
     set_errno_and_return_minus_one( EINVAL );
@@ -541,4 +554,7 @@
     set_errno_and_return_minus_one( EFAULT );
  
+  if ( !signo )
+    return 0;
+
   if ( !is_valid_signo(signo) )
     set_errno_and_return_minus_one( EINVAL );
@@ -560,4 +576,7 @@
     set_errno_and_return_minus_one( EFAULT );
  
+  if ( !signo )
+    return 0;
+
   if ( !is_valid_signo(signo) )
     set_errno_and_return_minus_one( EINVAL );
@@ -581,10 +600,13 @@
   ISR_Level     level;
 
+  if ( oact )
+    *oact = _POSIX_signals_Vectors[ sig ];
+
+  if ( !sig )
+    return 0;
+
   if ( !is_valid_signo(sig) )
     set_errno_and_return_minus_one( EINVAL );
   
-  if ( oact )
-    *oact = _POSIX_signals_Vectors[ sig ];
-
   /* 
    *  Some signals cannot be ignored (P1003.1b-1993, pp. 70-72 and references.
@@ -674,5 +696,5 @@
  
   if ( !set )
-    set_errno_and_return_minus_one( EFAULT );
+    return 0;
 
   switch ( how ) {
@@ -738,5 +760,5 @@
   api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
 
-  saved_signals_blocked = api->signals_blocked;
+  status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked );
  
   (void) sigfillset( &all_signals );
@@ -744,5 +766,5 @@
   status = sigtimedwait( &all_signals, NULL, NULL );
 
-  api->signals_blocked = saved_signals_blocked;
+  (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
 
   return status;
@@ -780,5 +802,7 @@
   }
  
-  for ( signo = SIGABRT ; signo <= __SIGLASTNOTRT ; signo++ ) {
+/* XXX - add __SIGFIRSTNOTRT or something like that to newlib siginfo.h */
+
+  for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
     if ( set & signo_to_mask( signo ) )
       return signo;
