siginfo broken in glibc

Andreas Jaeger aj@suse.de
Tue Jan 18 10:40:00 GMT 2000


With the 32bit UID patches the siginfo type has been changed.  But it
seems that this was always broken :-(.

On ix86 and m68k, we've got the following struct as part of struct siginfo:
         /* kill().  */
        struct
          {
            __pid_t si_pid;     /* Sending process ID.  */
            __uid_t si_uid;     /* Real user ID of sending process.  */
          } _kill;

Please note that __uid_t is 32bit.  This worked before on a little
endian machine - by accident, I suppose.

The kernel has now:
		struct {
			pid_t _pid;		/* sender's pid */
			old_uid_t _uid;		/* backwards compatibility */
			uid_t _uid32;		/* sender's uid */
		} _kill;

Since the kernel delivers siginfo directly to the process without
going through glibc, this will break old programs.  I don't see
directly a way to fix this so that a program using struct siginfo can
access the uid both under Linux 2.3.39+ and on older kernels.

Please note that ix86 aligns on 32bit but m68k aligns on 16bit so that
the kernel and glibc declarations are different.

Any ideas?

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de


More information about the Libc-alpha mailing list