[klibc] signal handling broken on i386 (Re: fix i386 build)
H. Peter Anvin
hpa at zytor.com
Mon May 10 15:31:48 PDT 2010
On 05/10/2010 01:28 PM, Sergey Vlasov wrote:
>
> This compiles, but fails at runtime on i386, because
> arch/x86/include/asm/signal.h in the kernel does not provide the
> correct definition of sigset_t needed for klibc:
>
> | #ifdef __KERNEL__
> | #include <linux/linkage.h>
> |
> | /* Most things should be clean enough to redefine this at will, if care
> | is taken to make libc match. */
> |
> | #define _NSIG 64
> |
> | #ifdef __i386__
> | # define _NSIG_BPW 32
> | #else
> | # define _NSIG_BPW 64
> | #endif
> |
> | #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
> |
> | typedef unsigned long old_sigset_t; /* at least 32 bits */
> |
> | typedef struct {
> | unsigned long sig[_NSIG_WORDS];
> | } sigset_t;
> |
> | #else
> | /* Here we must cater to libcs that poke about in kernel headers. */
> |
> | #define NSIG 32
> | typedef unsigned long sigset_t;
> |
> | #endif /* __KERNEL__ */
>
> This gives sizeof(sigset_t) == 4, which is then rejected with EINVAL
> by rt_sigprocmask() and other syscalls. The subsequent definition of
> struct sigaction is also wrong for klibc.
>
> Looks like the libc5 crap is not really dead yet...
>
The above is, in fact, said libc5 crap.
-hpa
More information about the klibc
mailing list