Disable use of __NR_io_getevents when not defined

Architectures like riscv32 do not define this syscall, therefore return
ENOSYS on such architectures

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2020-11-16 10:36:43 -08:00 committed by Bjorn Andersson
parent 1716a44f82
commit 048dc8e78d

View File

@ -102,10 +102,17 @@ static long io_destroy(aio_context_t ctx)
return syscall(__NR_io_destroy, ctx);
}
static long io_getevents(aio_context_t ctx, long min_nr, long nr,
struct io_event *events, struct timespec *tmo)
static long io_getevents(__attribute__((unused)) aio_context_t ctx,
__attribute__((unused)) long min_nr,
__attribute__((unused)) long nr,
__attribute__((unused)) struct io_event *events,
__attribute__((unused)) struct timespec *tmo)
{
#ifdef __NR_io_getevents
return syscall(__NR_io_getevents, ctx, min_nr, nr, events, tmo);
#else
return -ENOSYS;
#endif
}
static long io_setup(unsigned nr_reqs, aio_context_t *ctx)