"Fossies" - the Fresh Open Source Software Archive

Member "buildroot-2021.05/package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch" (6 Jun 2021, 1596 Bytes) of package /linux/privat/buildroot-2021.05.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 From 455c4938f5822c017c7ff79dd2dca638b6410923 Mon Sep 17 00:00:00 2001
    2 From: Khem Raj <raj.khem@gmail.com>
    3 Date: Sun, 15 Nov 2020 18:05:48 -0800
    4 Subject: [PATCH] Disable use of __NR_io_getevents when not defined
    5 
    6 Architectures like riscv32 do not define this syscall, therefore return
    7 ENOSYS on such architectures
    8 
    9 Upstream-Status: Pending
   10 Signed-off-by: Khem Raj <raj.khem@gmail.com>
   11 Signed-off-by: Stephan Mueller <smueller@chronox.de>
   12 [Retrieved from:
   13 https://github.com/smuellerDD/libkcapi/commit/455c4938f5822c017c7ff79dd2dca638b6410923]
   14 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
   15 ---
   16  lib/internal.h | 11 +++++++++--
   17  1 file changed, 9 insertions(+), 2 deletions(-)
   18 
   19 diff --git a/lib/internal.h b/lib/internal.h
   20 index 1237827..f765461 100644
   21 --- a/lib/internal.h
   22 +++ b/lib/internal.h
   23 @@ -325,10 +325,17 @@ static inline int io_submit(aio_context_t ctx, long n,  struct iocb **iocb)
   24      return syscall(__NR_io_submit, ctx, n, iocb);
   25  }
   26  
   27 -static inline int io_getevents(aio_context_t ctx, long min, long max,
   28 -            struct io_event *events, struct timespec *timeout)
   29 +static inline int io_getevents(__attribute__((unused)) aio_context_t ctx,
   30 +            __attribute__((unused)) long min,
   31 +            __attribute__((unused)) long max,
   32 +            __attribute__((unused)) struct io_event *events,
   33 +            __attribute__((unused)) struct timespec *timeout)
   34  {
   35 +#ifdef __NR_io_getevents
   36      return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
   37 +#else
   38 +    return -ENOSYS;
   39 +#endif
   40  }
   41  
   42  /************************************************************