* [PATCH] Fix sigevent_t stuff @ 2003-08-31 14:59 Ralf Baechle 2003-08-31 16:12 ` Ralf Baechle 0 siblings, 1 reply; 3+ messages in thread From: Ralf Baechle @ 2003-08-31 14:59 UTC (permalink / raw) To: Ulrich Drepper, Glibc hackers, linux-mips; +Cc: jsun Uli, below patch fixes a mismatch between glibc and the kernel header's definition on MIPS. Please apply. Thanks, Ralf 2003-08-31 Ralf Baechle <ralf@linux-mips.org> * sysdeps/unix/sysv/linux/mips/bits/siginfo.h: Delete comment obsoleted by this patch. (__SIGEV_PAD_SIZE: Change the definition such that it'll keep the size of sigevent_t at SIGEV_MAX_SIZE bytes for 64-bit also. (SIGEV_MAX_SIZE): Remove unused definition making this match the kernel definition. Index: sysdeps/unix/sysv/linux/mips/bits/siginfo.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/bits/siginfo.h,v retrieving revision 1.10 diff -u -r1.10 siginfo.h --- sysdeps/unix/sysv/linux/mips/bits/siginfo.h 22 May 2003 02:26:29 -0000 1.10 +++ sysdeps/unix/sysv/linux/mips/bits/siginfo.h 31 Aug 2003 14:31:00 -0000 @@ -255,12 +255,13 @@ /* Structure to transport application-defined values with signals. */ # define __SIGEV_MAX_SIZE 64 -# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) +# define __SIGEV_HEAD_SIZE (sizeof(long) + 2*sizeof(int)) +# define __SIGEV_PAD_SIZE \ + ((__SIGEV_MAX_SIZE-__SIGEV_HEAD_SIZE) / sizeof(int)) /* Forward declaration of the `pthread_attr_t' type. */ struct __pthread_attr_s; -/* XXX This one might need to change!!! */ typedef struct sigevent { sigval_t sigev_value; @@ -290,8 +291,6 @@ # define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ # define SIGEV_NONE SIGEV_NONE - SIGEV_CALLBACK, /* Deliver via thread creation. */ -# define SIGEV_CALLBACK SIGEV_CALLBACK SIGEV_THREAD /* Deliver via thread creation. */ # define SIGEV_THREAD SIGEV_THREAD }; ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix sigevent_t stuff 2003-08-31 14:59 [PATCH] Fix sigevent_t stuff Ralf Baechle @ 2003-08-31 16:12 ` Ralf Baechle [not found] ` <20030831164812.GB766@bogon.ms20.nix> 0 siblings, 1 reply; 3+ messages in thread From: Ralf Baechle @ 2003-08-31 16:12 UTC (permalink / raw) To: Ulrich Drepper, Glibc hackers, linux-mips; +Cc: jsun On Sun, Aug 31, 2003 at 04:58:54PM +0200, Ralf Baechle wrote: > below patch fixes a mismatch between glibc and the kernel header's > definition on MIPS. Please apply. Please ignore this patch. Digging through the history of the missmatch I came to the conclusion that this fix isn't the right one; I'll send an updated patch. Ralf ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20030831164812.GB766@bogon.ms20.nix>]
* More sigevent ... [not found] ` <20030831164812.GB766@bogon.ms20.nix> @ 2003-09-03 12:57 ` Ralf Baechle 0 siblings, 0 replies; 3+ messages in thread From: Ralf Baechle @ 2003-09-03 12:57 UTC (permalink / raw) To: linux-mips, GNU libc hackers, libc-alpha Looking into the problem a bit deeper here's my analysis of the whole missmatch of struct sigevent and the associated constants, including the entire history. - Linux 2.1.72 introduces sigevent. The definition used is the one taken from IRIX and different from what is used in other Linux ports. But that doesn't matter because there are no in-kernel users. I don't know why the structure was defined at all in kernel headers at all by that time. Maybe for the sake of libc 5? - Some of the >= libc 2.1 version circulating use the kernel definitions - Andreas Jaeger contributes sysdeps/unix/sysv/linux/mips/bits/siginfo.h for the FSF version of glibc 2.1. Markedrd as "XXX This one might need to change!!!" this header file uses the same structure as other Linux architectures but uses the same SIGEV_* constants as the kernel. - Linux 2.5.63 introduces the POSIX.1b timer API which uses the kernel's definition of sigevent. The userspace part of the POSIX.1b timer patch uses glibc's definition. But the code assumes both definitions are identical ... Time to resolve the mess. I see the following options: - Yet another syscall wrapper that does argument conversion. Imho the most icky solution. - Change the kernel to use the same definition as glibc. Not really an option, SIGEV_CALLBACK has to go. - Two part solution: - Change the kernel definition to what other architectures use (Done, may have to be undone depending on the outcome of this discussion). - Remove SIGEV_CALLBACK from glibc which would result in SIGEV_THREAD getting renumbered to the same value as in the kernel. (This is in my withdrawn libc patch from the weekend.) Grepping around in plenty of Linux code I've not found any users of SIGEV_THREAD so this would be my prefered solution. SIGEV_CALLBACK would have to be removed in any case; it's a dead definition with no functionality. Is it supposed to do what SIGEV_THREAD_ID does? I've been digging around in parts of the Redhat 9 source code and haven't found any users of SIGEV_THREAD, so it seems this is a very rarely used feature and we can change without any major compatibility issues. Comments? Ralf ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-09-03 12:57 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-08-31 14:59 [PATCH] Fix sigevent_t stuff Ralf Baechle 2003-08-31 16:12 ` Ralf Baechle [not found] ` <20030831164812.GB766@bogon.ms20.nix> 2003-09-03 12:57 ` More sigevent Ralf Baechle
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).