android libuv use of undeclared identifier 'EPOLL_CLOEXEC'

1000 Views Asked by At

i'm trying to build libuv for android in android studio cmake and i get the following errors:

error: use of undeclared identifier 'EPOLL_CLOEXEC'

warning: implicit declaration of function 'epoll_pwait' [-Wimplicit-function-declaration]

warning: this function declaration is not a prototype [-Wstrict-prototypes]

how can i fix this? am i supposed to use libuv toolchain to build it?

1

There are 1 best solutions below

1
On BEST ANSWER

The issue is probably that your minSdkVersion is too low. That wasn't supported until Android L. Unfortunately because some other popular projects misused that constant to detect if epoll_create1 was available, the constant is not available until epoll_create1 is. See https://github.com/android-ndk/ndk/issues/394 for more details.