aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch
blob: 6ed174113becf62479a7f6d6c4126637d8b866b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 0a3222338efc108c831fbdd719a47d35f4b0adcd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 18 Aug 2021 06:49:25 +0000
Subject: [PATCH] aio_linux: Check if syscall exists before using it

Return -ENOSYS if not implememented, fixes build on arches like RISCV32
Fixes
tpool/aio_linux.cc:63:20: error: '__NR_io_getevents' was not declared in this scope; did you mean 'io_getevents'?
   63 |   int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx),
      |                    ^~~~~~~~~~~~~~~~~
      |                    io_getevents

Upstream-Staus: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 tpool/aio_linux.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc
index 4abc213..da75411 100644
--- a/tpool/aio_linux.cc
+++ b/tpool/aio_linux.cc
@@ -58,6 +58,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
 */
 static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev)
 {
+#ifdef __NR_io_getevents
   int saved_errno= errno;
   int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx),
                    min_nr, nr, ev, 0);
@@ -67,6 +68,9 @@ static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev)
     errno= saved_errno;
   }
   return ret;
+#else
+  return -ENOSYS;
+#endif
 }
 
 
-- 
2.29.2