This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: realtime signals corrupted by pause() on ia64


On Mon, Feb 24, 2003 at 04:07:25PM +1100, Keith Owens wrote:
> What happens when NSIG > sizeof(int)*8?  Both mask and sigmask only
> handle ints.

Yes good point it probably needs an extra check in the for loop for
this.

But I think leaving the top bits of the set alone will be ok because
anything above sig 32 is the rt signals which we don't want to touch,
right?  In the previous version they are all getting cleared to zero.

-i

--- /home/ianw/libc/sysdeps/unix/sysv/linux/sigset-cvt-mask.h   2002-09-06 04:51:45.000000000 +1000
+++ sysdeps/unix/sysv/linux/sigset-cvt-mask.h   2003-02-24 16:37:28.000000000 +1100
@@ -22,19 +22,13 @@
 static inline int __attribute__ ((unused))
 sigset_set_old_mask (sigset_t *set, int mask)
 {
-  unsigned long int *ptr;
-  int cnt;
-
-  ptr = &set->__val[0];
-
-  *ptr++ = (unsigned int) mask;
-
-  cnt = _SIGSET_NWORDS - 2;
-  do
-    *ptr++ = 0ul;
-  while (--cnt >= 0);
-
-  return 0;
+       int __sig;
+       for ( __sig = 1 ; __sig < NSIG && __sig < sizeof(mask)*8 ; __sig++ ) {
+               if ( mask & sigmask(__sig) )
+                       if ( __sigaddset(set, __sig) < 0 )
+                               return -1;
+       }
+       return 0;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]