diff options
author | Elliott Hughes <enh@google.com> | 2013-01-10 14:42:14 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-01-10 14:42:14 -0800 |
commit | c5d028fc913de84a781bd61084bf7ae2182fd48e (patch) | |
tree | 9086acc9c039dad30feca8a8d80ca7af04b061e1 /libc/bionic/signalfd.cpp | |
parent | 2bbb8fac61e482dd96386620cc6f7f193e9c6840 (diff) | |
download | android_bionic-c5d028fc913de84a781bd61084bf7ae2182fd48e.tar.gz android_bionic-c5d028fc913de84a781bd61084bf7ae2182fd48e.tar.bz2 android_bionic-c5d028fc913de84a781bd61084bf7ae2182fd48e.zip |
Only have one copy of the kernel_sigset_t hack, and add more tests.
Change-Id: I377522fcba6fb4b5fd2754ab15b091014bd7c16f
Diffstat (limited to 'libc/bionic/signalfd.cpp')
-rw-r--r-- | libc/bionic/signalfd.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/libc/bionic/signalfd.cpp b/libc/bionic/signalfd.cpp index 51fae8361..b7e647412 100644 --- a/libc/bionic/signalfd.cpp +++ b/libc/bionic/signalfd.cpp @@ -28,27 +28,11 @@ #include <sys/signalfd.h> -/* Despite the fact that our kernel headers define sigset_t explicitly - * as a 32-bit integer, the kernel system call really expects a 64-bit - * bitmap for the signal set, or more exactly an array of two-32-bit - * values (see $KERNEL/arch/$ARCH/include/asm/signal.h for details). - * - * Unfortunately, we cannot fix the sigset_t definition without breaking - * the C library ABI, so perform a little runtime translation here. - */ -typedef union { - sigset_t bionic; - uint32_t kernel[2]; -} kernel_sigset_t; - -extern "C" int signalfd4(int fd, kernel_sigset_t *mask, size_t sizemask, int flags); - -int signalfd(int fd, const sigset_t *mask, int flags) -{ - kernel_sigset_t in_set; - in_set.kernel[0] = in_set.kernel[1] = 0; +#include <private/kernel_sigset_t.h> - in_set.bionic = *mask; +extern "C" int signalfd4(int fd, kernel_sigset_t* mask, size_t sizemask, int flags); - return signalfd4(fd, &in_set, sizeof(in_set), flags); +int signalfd(int fd, const sigset_t* mask, int flags) { + kernel_sigset_t in_set(mask); + return signalfd4(fd, &in_set, sizeof(in_set), flags); } |