• akpm@osdl.org's avatar
    [PATCH] N32 sigset and __COMPAT_ENDIAN_SWAP__ · 838cd153
    akpm@osdl.org authored
    I'm testing glibc on MIPS64, little-endian, N32, O32 and N64 multilibs.
    
    Among the NPTL test failures seen are some arising from sigsuspend problems
    for N32: it blocks the wrong signals, so SIGCANCEL (SIGRTMIN) is blocked
    despite glibc's carefully excluding it from sets of signals to block.
    Specifically, testing suggests it blocks signal N^32 instead of signal N,
    so (in the example tested) blocking SIGUSR1 (17) blocks signal 49 instead.
    
    glibc's sigset_t uses an array of unsigned long, as does the kernel.
    In both cases, signal N+1 is represented as
    (1UL << (N % (8 * sizeof (unsigned long)))) in word number
    (N / (8 * sizeof (unsigned long))).
    
    Thus the N32 glibc uses an array of 32-bit words and the N64 kernel uses an
    array of 64-bit words.  For little-endian, the layout is the same, with
    signals 1-32 in the first 4 bytes, signals 33-64 in the second, etc.; for
    big-endian, userspace has that layout while in the kernel each 8 bytes have
    the two halves swapped fr...
    838cd153
compat.c 24.3 KB