Subject: sigset_t32 broken?

From: Andrew Clausen <[email-masked]>
Date: Thu, 23 Jan 2003 18:17:53 +1100

Hi all,

Cut&paste from linux/asm/mips64/signal.h:

#define _NSIG           128
#define _NSIG_BPW       64
#define _NSIG_WORDS     (_NSIG / _NSIG_BPW)

typedef struct {
        long sig[_NSIG_WORDS];
} sigset_t;

#define _NSIG32         128
#define _NSIG_BPW32     32
#define _NSIG_WORDS32   (_NSIG32 / _NSIG_BPW32)

typedef struct {
        long sig[_NSIG_WORDS32];
} sigset_t32;

Shouldn't those two long's be replaced with u64 and u32
respectively?  Is the second struct really meant to be twice the
size the first?

Cheers,
Andrew

---

From: Vivien Chappelier <[email-masked]>
Date: Thu, 23 Jan 2003 10:59:29 +0100 (CET)

> respectively?  Is the second struct really meant to be twice the

They should be the same size, otherwise sys32_rt_sigsuspend and
sys32_rt_sigaction will return EINVAL. As the comment says:
/* XXX: Don't preclude handling different sized sigset_t's.  */

I've posted a patch to fix that earlier this month (Monday 13 Jan
2003 "[2.5 PATCH] signal handling").

BTW, anyone working on mips64 2.5 kernel should have a look at my patch
set (http://www.linux-mips.org/~glaurung/O2/linux-2.5.47/patches-2.5.47.tar.gz)
for patches named "linux-mips-*.diff" as they might be relevant for other
machines than just the O2, and the more they are tested the better. A
README is provided to explain briefly what they (try to) fix.

regards,
Vivien.

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 24 Jan 2003 02:48:54 +0100

> 2003 "[2.5 PATCH] signal handling").

Most of what your patch does is undoing an accidental commit of a signal
rework that wasn't yet supposed to go out.

  Ralf

---

From: Vivien Chappelier <[email-masked]>
Date: Mon, 27 Jan 2003 01:44:12 +0100 (CET)

> rework that wasn't yet supposed to go out.

Maybe.. but current version is still wrong :) The type of the sig
array in the 32-bit compatibility struct sigset_t32 must be 32bit long,
i.e. unsigned int not unsigned long.
And I think unsigned describes the data better than signed, but that's a
matter of taste :) (coherent with the choice in asm-mips/signal.h).

Vivien.

--- include/asm-mips64/signal.h	2003-01-26 02:41:48.000000000 +0100
+++ include/asm-mips64/signal.h	2003-01-27 01:28:13.000000000 +0100
@@ -16,7 +16,7 @@
 #define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
 
 typedef struct {
-	long sig[_NSIG_WORDS];
+	unsigned long sig[_NSIG_WORDS];
 } sigset_t;
 
 #define _NSIG32		128
@@ -24,7 +24,7 @@
 
 typedef struct {
-	long sig[_NSIG_WORDS32];
+	unsigned int sig[_NSIG_WORDS32];
 } sigset_t32;
 
 typedef unsigned long old_sigset_t;		/* at least 32 bits */

---

From: Geert Uytterhoeven <[email-masked]>
Date: Mon, 27 Jan 2003 10:19:26 +0100 (MET)

> matter of taste :) (coherent with the choice in asm-mips/signal.h).

Why not make it u32?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email-masked]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

---

From: Juan Quintela <[email-masked]>
Date: Mon, 27 Jan 2003 23:30:15 +0100

>>>>> "geert" == Geert Uytterhoeven <[email-masked]> writes:

>> matter of taste :) (coherent with the choice in asm-mips/signal.h).

geert> Why not make it u32?

Nahh, that will make it clear indeed to stupid's like me :p

Later ,Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy