Skip to content

Commit

Permalink
Disable use of __NR_io_getevents when not defined
Browse files Browse the repository at this point in the history
Architectures like riscv32 do not define this syscall, therefore return
ENOSYS on such architectures

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
  • Loading branch information
kraj authored and smuellerDD committed Nov 22, 2020
1 parent d412845 commit 455c493
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/internal.h
Expand Up @@ -325,10 +325,17 @@ static inline int io_submit(aio_context_t ctx, long n, struct iocb **iocb)
return syscall(__NR_io_submit, ctx, n, iocb);
}

static inline int io_getevents(aio_context_t ctx, long min, long max,
struct io_event *events, struct timespec *timeout)
static inline int io_getevents(__attribute__((unused)) aio_context_t ctx,
__attribute__((unused)) long min,
__attribute__((unused)) long max,
__attribute__((unused)) struct io_event *events,
__attribute__((unused)) struct timespec *timeout)
{
#ifdef __NR_io_getevents
return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
#else
return -ENOSYS;
#endif
}

/************************************************************
Expand Down

0 comments on commit 455c493

Please sign in to comment.