tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

BionicGlue.cpp (1464B)


      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/. */
      5 
      6 #include <sys/types.h>
      7 #include <unistd.h>
      8 #include <sys/syscall.h>
      9 
     10 #define NS_EXPORT __attribute__((visibility("default")))
     11 
     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).
     16  //
     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.
     20 
     21  extern pid_t gettid(void);
     22  return syscall(__NR_tgkill, getpid(), gettid(), sig);
     23 }
     24 
     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