diff options
author | Elliott Hughes <enh@google.com> | 2013-10-16 01:15:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-10-16 01:16:00 +0000 |
commit | 608c65f6955213179db4140cc57c40a2a88d5846 (patch) | |
tree | ec2188086f5ed45089a46e2e36ecf442f477bb69 /libc | |
parent | c100a10069a16eca57f5f9ab838ff98d7db6eb03 (diff) | |
parent | 1f5af926fa626734981d6b4dcc0ab54e520032a9 (diff) | |
download | bionic-608c65f6955213179db4140cc57c40a2a88d5846.zip bionic-608c65f6955213179db4140cc57c40a2a88d5846.tar.gz bionic-608c65f6955213179db4140cc57c40a2a88d5846.tar.bz2 |
Merge "Fix sigsuspend to use rt_sigsuspend on all platforms."
Diffstat (limited to 'libc')
-rw-r--r-- | libc/Android.mk | 2 | ||||
-rw-r--r-- | libc/SYSCALLS.TXT | 14 | ||||
-rw-r--r-- | libc/arch-arm/syscalls.mk | 4 | ||||
-rw-r--r-- | libc/arch-arm/syscalls/__rt_sigsuspend.S (renamed from libc/arch-arm/syscalls/__sigsuspend.S) | 6 | ||||
-rw-r--r-- | libc/arch-mips/syscalls.mk | 4 | ||||
-rw-r--r-- | libc/arch-mips/syscalls/__rt_sigsuspend.S (renamed from libc/arch-mips/syscalls/__sigsuspend.S) | 10 | ||||
-rw-r--r-- | libc/arch-x86/syscalls.mk | 4 | ||||
-rw-r--r-- | libc/arch-x86/syscalls/__rt_sigsuspend.S (renamed from libc/arch-x86/syscalls/__sigsuspend.S) | 13 | ||||
-rw-r--r-- | libc/arch-x86_64/syscalls.mk | 2 | ||||
-rw-r--r-- | libc/arch-x86_64/x86_64.mk | 1 | ||||
-rw-r--r-- | libc/bionic/signalfd.cpp | 2 | ||||
-rw-r--r-- | libc/bionic/sigsuspend.c | 43 | ||||
-rw-r--r-- | libc/bionic/sigsuspend.cpp (renamed from libc/arch-x86_64/bionic/sigsuspend.c) | 11 | ||||
-rw-r--r-- | libc/bionic/sigwait.cpp | 2 |
14 files changed, 36 insertions, 82 deletions
diff --git a/libc/Android.mk b/libc/Android.mk index b9db201..88be78d 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -184,7 +184,6 @@ libc_common_src_files += \ bionic/fstatfs.c \ bionic/__get_tls.cpp \ bionic/lseek64.c \ - bionic/sigsuspend.c \ bionic/statfs.c \ endif @@ -248,6 +247,7 @@ libc_bionic_src_files := \ bionic/setlocale.cpp \ bionic/signalfd.cpp \ bionic/sigprocmask.cpp \ + bionic/sigsuspend.cpp \ bionic/sigwait.cpp \ bionic/statvfs.cpp \ bionic/strerror.cpp \ diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index cea1878..0d1e808 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -233,14 +233,12 @@ int timerfd_gettime(int, struct itimerspec*) all # signals int sigaction(int, const struct sigaction*, struct sigaction*) arm,x86,mips -int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) arm,x86 -int __sigsuspend:sigsuspend(const sigset_t* mask) mips -int __rt_sigsuspend:rt_sigsuspend(const sigset_t *unewset, size_t sigset_size) x86_64 -int __rt_sigaction:rt_sigaction(int sig, const struct sigaction* act, struct sigaction* oact, size_t sigsetsize) all -int __rt_sigprocmask:rt_sigprocmask(int how, const sigset_t* set, sigset_t* oset, size_t sigsetsize) all -int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t* set, struct siginfo_t* info, struct timespec_t* timeout, size_t sigset_size) all int sigpending(sigset_t*) arm,x86,mips -int signalfd4(int fd, const sigset_t* mask, size_t sizemask, int flags) all +int __rt_sigaction:rt_sigaction(int, const struct sigaction*, struct sigaction*, size_t) all +int __rt_sigprocmask:rt_sigprocmask(int, const sigset_t*, sigset_t*, size_t) all +int __rt_sigsuspend:rt_sigsuspend(const sigset_t*, size_t) all +int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t*, struct siginfo_t*, struct timespec_t*, size_t) all +int signalfd4(int, const sigset_t*, size_t, int) all # sockets int socket(int, int, int) arm,mips,x86_64 @@ -296,7 +294,7 @@ int ioprio_get(int which, int who) all # other int uname(struct utsname*) all mode_t umask(mode_t) all -int __reboot:reboot(int, int, int, void*) all +int __reboot:reboot(int, int, int, void*) all int __syslog:syslog(int, char*, int) all int init_module(void*, unsigned long, const char*) all int delete_module(const char*, unsigned int) all diff --git a/libc/arch-arm/syscalls.mk b/libc/arch-arm/syscalls.mk index 3a66c1b..dc7e3df 100644 --- a/libc/arch-arm/syscalls.mk +++ b/libc/arch-arm/syscalls.mk @@ -152,11 +152,11 @@ syscall_src += arch-arm/syscalls/timerfd_create.S syscall_src += arch-arm/syscalls/timerfd_settime.S syscall_src += arch-arm/syscalls/timerfd_gettime.S syscall_src += arch-arm/syscalls/sigaction.S -syscall_src += arch-arm/syscalls/__sigsuspend.S +syscall_src += arch-arm/syscalls/sigpending.S syscall_src += arch-arm/syscalls/__rt_sigaction.S syscall_src += arch-arm/syscalls/__rt_sigprocmask.S +syscall_src += arch-arm/syscalls/__rt_sigsuspend.S syscall_src += arch-arm/syscalls/__rt_sigtimedwait.S -syscall_src += arch-arm/syscalls/sigpending.S syscall_src += arch-arm/syscalls/signalfd4.S syscall_src += arch-arm/syscalls/socket.S syscall_src += arch-arm/syscalls/socketpair.S diff --git a/libc/arch-arm/syscalls/__sigsuspend.S b/libc/arch-arm/syscalls/__rt_sigsuspend.S index dc519d2..2e63e89 100644 --- a/libc/arch-arm/syscalls/__sigsuspend.S +++ b/libc/arch-arm/syscalls/__rt_sigsuspend.S @@ -3,13 +3,13 @@ #include <linux/err.h> #include <machine/asm.h> -ENTRY(__sigsuspend) +ENTRY(__rt_sigsuspend) mov ip, r7 - ldr r7, =__NR_sigsuspend + ldr r7, =__NR_rt_sigsuspend swi #0 mov r7, ip cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 b __set_errno -END(__sigsuspend) +END(__rt_sigsuspend) diff --git a/libc/arch-mips/syscalls.mk b/libc/arch-mips/syscalls.mk index 740f91c..2704200 100644 --- a/libc/arch-mips/syscalls.mk +++ b/libc/arch-mips/syscalls.mk @@ -155,11 +155,11 @@ syscall_src += arch-mips/syscalls/timerfd_create.S syscall_src += arch-mips/syscalls/timerfd_settime.S syscall_src += arch-mips/syscalls/timerfd_gettime.S syscall_src += arch-mips/syscalls/sigaction.S -syscall_src += arch-mips/syscalls/__sigsuspend.S +syscall_src += arch-mips/syscalls/sigpending.S syscall_src += arch-mips/syscalls/__rt_sigaction.S syscall_src += arch-mips/syscalls/__rt_sigprocmask.S +syscall_src += arch-mips/syscalls/__rt_sigsuspend.S syscall_src += arch-mips/syscalls/__rt_sigtimedwait.S -syscall_src += arch-mips/syscalls/sigpending.S syscall_src += arch-mips/syscalls/signalfd4.S syscall_src += arch-mips/syscalls/socket.S syscall_src += arch-mips/syscalls/socketpair.S diff --git a/libc/arch-mips/syscalls/__sigsuspend.S b/libc/arch-mips/syscalls/__rt_sigsuspend.S index 2b6f6d7..a1a3fce 100644 --- a/libc/arch-mips/syscalls/__sigsuspend.S +++ b/libc/arch-mips/syscalls/__rt_sigsuspend.S @@ -1,14 +1,14 @@ /* autogenerated by gensyscalls.py */ #include <asm/unistd.h> .text - .globl __sigsuspend + .globl __rt_sigsuspend .align 4 - .ent __sigsuspend + .ent __rt_sigsuspend -__sigsuspend: +__rt_sigsuspend: .set noreorder .cpload $t9 - li $v0, __NR_sigsuspend + li $v0, __NR_rt_sigsuspend syscall bnez $a3, 1f move $a0, $v0 @@ -19,4 +19,4 @@ __sigsuspend: j $t9 nop .set reorder - .end __sigsuspend + .end __rt_sigsuspend diff --git a/libc/arch-x86/syscalls.mk b/libc/arch-x86/syscalls.mk index a704905..10970a6 100644 --- a/libc/arch-x86/syscalls.mk +++ b/libc/arch-x86/syscalls.mk @@ -156,11 +156,11 @@ syscall_src += arch-x86/syscalls/timerfd_create.S syscall_src += arch-x86/syscalls/timerfd_settime.S syscall_src += arch-x86/syscalls/timerfd_gettime.S syscall_src += arch-x86/syscalls/sigaction.S -syscall_src += arch-x86/syscalls/__sigsuspend.S +syscall_src += arch-x86/syscalls/sigpending.S syscall_src += arch-x86/syscalls/__rt_sigaction.S syscall_src += arch-x86/syscalls/__rt_sigprocmask.S +syscall_src += arch-x86/syscalls/__rt_sigsuspend.S syscall_src += arch-x86/syscalls/__rt_sigtimedwait.S -syscall_src += arch-x86/syscalls/sigpending.S syscall_src += arch-x86/syscalls/signalfd4.S syscall_src += arch-x86/syscalls/socket.S syscall_src += arch-x86/syscalls/bind.S diff --git a/libc/arch-x86/syscalls/__sigsuspend.S b/libc/arch-x86/syscalls/__rt_sigsuspend.S index 6a5c6aa..32b2134 100644 --- a/libc/arch-x86/syscalls/__sigsuspend.S +++ b/libc/arch-x86/syscalls/__rt_sigsuspend.S @@ -3,14 +3,12 @@ #include <linux/err.h> #include <machine/asm.h> -ENTRY(__sigsuspend) +ENTRY(__rt_sigsuspend) pushl %ebx pushl %ecx - pushl %edx - mov 16(%esp), %ebx - mov 20(%esp), %ecx - mov 24(%esp), %edx - movl $__NR_sigsuspend, %eax + mov 12(%esp), %ebx + mov 16(%esp), %ecx + movl $__NR_rt_sigsuspend, %eax int $0x80 cmpl $-MAX_ERRNO, %eax jb 1f @@ -20,8 +18,7 @@ ENTRY(__sigsuspend) addl $4, %esp orl $-1, %eax 1: - popl %edx popl %ecx popl %ebx ret -END(__sigsuspend) +END(__rt_sigsuspend) diff --git a/libc/arch-x86_64/syscalls.mk b/libc/arch-x86_64/syscalls.mk index 51c3646..6b72ca0 100644 --- a/libc/arch-x86_64/syscalls.mk +++ b/libc/arch-x86_64/syscalls.mk @@ -149,9 +149,9 @@ syscall_src += arch-x86_64/syscalls/utimensat.S syscall_src += arch-x86_64/syscalls/timerfd_create.S syscall_src += arch-x86_64/syscalls/timerfd_settime.S syscall_src += arch-x86_64/syscalls/timerfd_gettime.S -syscall_src += arch-x86_64/syscalls/__rt_sigsuspend.S syscall_src += arch-x86_64/syscalls/__rt_sigaction.S syscall_src += arch-x86_64/syscalls/__rt_sigprocmask.S +syscall_src += arch-x86_64/syscalls/__rt_sigsuspend.S syscall_src += arch-x86_64/syscalls/__rt_sigtimedwait.S syscall_src += arch-x86_64/syscalls/signalfd4.S syscall_src += arch-x86_64/syscalls/socket.S diff --git a/libc/arch-x86_64/x86_64.mk b/libc/arch-x86_64/x86_64.mk index f293b2d..13442c7 100644 --- a/libc/arch-x86_64/x86_64.mk +++ b/libc/arch-x86_64/x86_64.mk @@ -9,7 +9,6 @@ _LIBC_ARCH_COMMON_SRC_FILES := \ arch-x86_64/bionic/__set_tls.c \ arch-x86_64/bionic/sigaction.c \ arch-x86_64/bionic/sigsetjmp.S \ - arch-x86_64/bionic/sigsuspend.c \ arch-x86_64/bionic/syscall.S \ _LIBC_ARCH_STATIC_SRC_FILES := \ diff --git a/libc/bionic/signalfd.cpp b/libc/bionic/signalfd.cpp index b7e6474..36ef81d 100644 --- a/libc/bionic/signalfd.cpp +++ b/libc/bionic/signalfd.cpp @@ -28,7 +28,7 @@ #include <sys/signalfd.h> -#include <private/kernel_sigset_t.h> +#include "private/kernel_sigset_t.h" extern "C" int signalfd4(int fd, kernel_sigset_t* mask, size_t sizemask, int flags); diff --git a/libc/bionic/sigsuspend.c b/libc/bionic/sigsuspend.c deleted file mode 100644 index fd08631..0000000 --- a/libc/bionic/sigsuspend.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#include <signal.h> -#ifdef __mips__ -extern int __sigsuspend(const sigset_t *); -#else -extern int __sigsuspend(int, int, unsigned int); -#endif - -int sigsuspend(const sigset_t *_mask) -{ -#ifdef __mips__ - return __sigsuspend(_mask); -#else - unsigned int mask = (unsigned int)*_mask; - return __sigsuspend(0, 0, mask); -#endif -} diff --git a/libc/arch-x86_64/bionic/sigsuspend.c b/libc/bionic/sigsuspend.cpp index 40bfaea..fb846b8 100644 --- a/libc/arch-x86_64/bionic/sigsuspend.c +++ b/libc/bionic/sigsuspend.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 The Android Open Source Project + * Copyright (C) 2008 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +28,11 @@ #include <signal.h> -extern int __rt_sigsuspend(const sigset_t*, size_t); +#include "private/kernel_sigset_t.h" -int sigsuspend(const sigset_t* set) { - return __rt_sigsuspend(set, sizeof(sigset_t)); +extern "C" int __rt_sigsuspend(const kernel_sigset_t*, size_t); + +int sigsuspend(const sigset_t* bionic_set) { + kernel_sigset_t set(bionic_set); + return __rt_sigsuspend(&set, sizeof(set)); } diff --git a/libc/bionic/sigwait.cpp b/libc/bionic/sigwait.cpp index 1546fd6..873a368 100644 --- a/libc/bionic/sigwait.cpp +++ b/libc/bionic/sigwait.cpp @@ -31,7 +31,7 @@ #include <string.h> #include <time.h> -#include <private/kernel_sigset_t.h> +#include "private/kernel_sigset_t.h" extern "C" int __rt_sigtimedwait(const sigset_t* uthese, siginfo_t* uinfo, const struct timespec* uts, size_t sigsetsize); |