Bug 1889091 - Part 4: Remove extra stack pointer move. r=jandem
[gecko.git] / mozglue / build / BionicGlue.cpp
blob8cc21b54e507d094cd3cd6c2e1aa90ab560a1b5f
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include <sys/types.h>
7 #include <unistd.h>
8 #include <sys/syscall.h>
10 #define NS_EXPORT __attribute__((visibility("default")))
12 extern "C" NS_EXPORT int raise(int sig) {
13 // Bug 741272: Bionic incorrectly uses kill(), which signals the
14 // process, and thus could signal another thread (and let this one
15 // return "successfully" from raising a fatal signal).
17 // Bug 943170: POSIX specifies pthread_kill(pthread_self(), sig) as
18 // equivalent to raise(sig), but Bionic also has a bug with these
19 // functions, where a forked child will kill its parent instead.
21 extern pid_t gettid(void);
22 return syscall(__NR_tgkill, getpid(), gettid(), sig);
25 /* Flash plugin uses symbols that are not present in Android >= 4.4 */
26 namespace android {
27 namespace VectorImpl {
28 NS_EXPORT void reservedVectorImpl1(void) {}
29 NS_EXPORT void reservedVectorImpl2(void) {}
30 NS_EXPORT void reservedVectorImpl3(void) {}
31 NS_EXPORT void reservedVectorImpl4(void) {}
32 NS_EXPORT void reservedVectorImpl5(void) {}
33 NS_EXPORT void reservedVectorImpl6(void) {}
34 NS_EXPORT void reservedVectorImpl7(void) {}
35 NS_EXPORT void reservedVectorImpl8(void) {}
36 } // namespace VectorImpl
37 } // namespace android