#include <sys/time.h>
#include <unistd.h>
+#include <async_safe/log.h>
+
#include "private/KernelArgumentBlock.h"
#include "private/WriteProtected.h"
#include "private/bionic_auxv.h"
#include "private/bionic_globals.h"
#include "private/bionic_tls.h"
-#include "private/libc_logging.h"
#include "private/thread_private.h"
#include "pthread_internal.h"
char** environ;
#if defined(__i386__)
-__LIBC_HIDDEN__ void* __libc_sysinfo = nullptr;
+__attribute__((__naked__)) static void __libc_int0x80() {
+ __asm__ volatile("int $0x80; ret");
+}
+
+__LIBC_HIDDEN__ void* __libc_sysinfo = reinterpret_cast<void*>(__libc_int0x80);
__LIBC_HIDDEN__ void __libc_init_sysinfo(KernelArgumentBlock& args) {
__libc_sysinfo = reinterpret_cast<void*>(args.getauxval(AT_SYSINFO));
#if !defined(__LP64__)
static void __check_max_thread_id() {
if (gettid() > 65535) {
- __libc_fatal("Limited by the size of pthread_mutex_t, 32 bit bionic libc only accepts "
- "pid <= 65535, but current pid is %d", gettid());
+ async_safe_fatal("Limited by the size of pthread_mutex_t, 32 bit bionic libc only accepts "
+ "pid <= 65535, but current pid is %d", gettid());
}
}
#endif
// of executing a setuid program or the result of an SELinux
// security transition.
static constexpr const char* UNSAFE_VARIABLE_NAMES[] = {
+ "ANDROID_DNS_MODE",
"GCONV_PATH",
"GETCONF_DIR",
"HOSTALIASES",
#if !defined(__LP64__)
int old_value = personality(0xffffffff);
if (old_value == -1) {
- __libc_fatal("error getting old personality value: %s", strerror(errno));
+ async_safe_fatal("error getting old personality value: %s", strerror(errno));
}
if (personality((static_cast<unsigned int>(old_value) & ~PER_MASK) | PER_LINUX32) == -1) {
- __libc_fatal("error setting PER_LINUX32 personality: %s", strerror(errno));
+ async_safe_fatal("error setting PER_LINUX32 personality: %s", strerror(errno));
}
#endif
}