android: fix termux build (#5093)

Fixes: https://github.com/libuv/libuv/issues/5092
This commit is contained in:
BarryLhm 2026-03-24 16:59:50 +08:00 committed by GitHub
parent 8877568581
commit e3a27e0728
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include "internal.h"
#include <inttypes.h>
#include <limits.h>
#include <stdatomic.h>
#include <stddef.h> /* offsetof */
#include <stdint.h>
@ -56,6 +57,14 @@
#include <time.h>
#include <unistd.h>
/* android ndk workaround */
#ifndef LLONG_MAX
#define LLONG_MAX 9223372036854775807LL
#endif
#ifndef LLONG_MIN
#define LLONG_MIN (-9223372036854775807LL - 1)
#endif
#ifndef __NR_io_uring_setup
# define __NR_io_uring_setup 425
#endif

View File

@ -28,7 +28,9 @@
#include "uv.h"
/* Refs: https://github.com/libuv/libuv/issues/4369 */
#if defined(__ANDROID__)
/* Refs: https://github.com/libuv/libuv/issues/5092 */
#if defined(__ANDROID__) && __ANDROID_API__ >= __ANDROID_API_Q__
#define USE_FDSAN
#include <android/fdsan.h>
#endif
@ -149,7 +151,7 @@ void log_tap_result(int test_count,
void enable_fdsan(void) {
/* Refs: https://github.com/libuv/libuv/issues/4369 */
#if defined(__ANDROID__)
#if defined(USE_FDSAN)
android_fdsan_set_error_level(ANDROID_FDSAN_ERROR_LEVEL_WARN_ALWAYS);
#endif
}