(Network) Adapt POLL for 3DS platform (#14431)

This commit is contained in:
MrHuu 2022-09-25 17:15:56 +02:00 committed by GitHub
parent 440264778d
commit a878bd3f95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -469,6 +469,33 @@ done:
sceNetEpollDestroy(epoll_fd);
return ret;
#elif defined(_3DS)
int i;
int timeout_quotient;
int timeout_remainder;
int ret = -1;
#define TIMEOUT_DIVISOR 100
if (timeout <= TIMEOUT_DIVISOR)
return poll(fds, nfds, timeout);
timeout_quotient = timeout / TIMEOUT_DIVISOR;
for (i = 0; i < timeout_quotient; i++)
{
ret = poll(fds, nfds, TIMEOUT_DIVISOR);
/* Success or error. */
if (ret)
return ret;
}
timeout_remainder = timeout % TIMEOUT_DIVISOR;
if (timeout_remainder)
ret = poll(fds, nfds, timeout_remainder);
return ret;
#undef TIMEOUT_DIVISOR
#elif defined(GEKKO)
return net_poll(fds, nfds, timeout);
#else