darwin: fix crash on iOS(arm64)

Disable sendfile() on iOS with arm64 architecture
to avoid crashes caused by throwing SIGSYS signal.

Fixes: #3187
This commit is contained in:
郑苏波 (Super Zheng) 2024-05-20 20:17:06 +08:00 committed by Saúl Ibarra Corretgé
parent f279d9e6c6
commit ecc11611d3

View File

@ -1070,7 +1070,10 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) {
return -1;
}
#elif defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__)
/* sendfile() on iOS(arm64) will throw SIGSYS signal cause crash. */
#elif (defined(__APPLE__) && !TARGET_OS_IPHONE) \
|| defined(__DragonFly__) \
|| defined(__FreeBSD__)
{
off_t len;
ssize_t r;