Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | From cb350a8989adbd65db574325d9a86d5437d800da Mon Sep 17 00:00:00 2001 |
| 2 | From: Guillem Jover <guillem@hadrons.org> |
| 3 | Date: Mon, 13 Sep 2021 23:56:08 +0200 |
| 4 | Subject: [PATCH] test: Use syscall wrappers instead of using syscall(2) directly |
| 5 | |
| 6 | Some of these syscalls have different entry points depending on the |
| 7 | architecture. Use the wrappers to avoid having to reimplement them |
| 8 | portably. |
| 9 | |
| 10 | Fixes build failures on Debian armel and armhf builds. |
| 11 | |
| 12 | Upstream-Status: Backport [https://github.com/kraj/liburing/commit/cb350a8989adbd65db574325d9a86d5437d800da] |
| 13 | Signed-off-by: Guillem Jover <guillem@hadrons.org> |
| 14 | --- |
| 15 | test/sqpoll-cancel-hang.c | 7 ++----- |
| 16 | 1 file changed, 2 insertions(+), 5 deletions(-) |
| 17 | |
| 18 | diff --git a/test/sqpoll-cancel-hang.c b/test/sqpoll-cancel-hang.c |
| 19 | index c9032c8..e561478 100644 |
| 20 | --- a/test/sqpoll-cancel-hang.c |
| 21 | +++ b/test/sqpoll-cancel-hang.c |
| 22 | @@ -4,7 +4,6 @@ |
| 23 | #include <stdlib.h> |
| 24 | #include <string.h> |
| 25 | #include <sys/mman.h> |
| 26 | -#include <sys/syscall.h> |
| 27 | #include <sys/wait.h> |
| 28 | #include <time.h> |
| 29 | #include <unistd.h> |
| 30 | @@ -29,8 +28,6 @@ static uint64_t current_time_ms(void) |
| 31 | |
| 32 | #define IORING_OFF_SQES 0x10000000ULL |
| 33 | |
| 34 | -#define sys_io_uring_setup 425 |
| 35 | - |
| 36 | static void kill_and_wait(int pid, int* status) |
| 37 | { |
| 38 | kill(-pid, SIGKILL); |
| 39 | @@ -53,7 +50,7 @@ a5) |
| 40 | void* vma2 = (void*)a3; |
| 41 | void** ring_ptr_out = (void**)a4; |
| 42 | void** sqes_ptr_out = (void**)a5; |
| 43 | - uint32_t fd_io_uring = syscall(sys_io_uring_setup, entries, setup_params); |
| 44 | + uint32_t fd_io_uring = __sys_io_uring_setup(entries, setup_params); |
| 45 | uint32_t sq_ring_sz = setup_params->sq_off.array + |
| 46 | setup_params->sq_entries * sizeof(uint32_t); |
| 47 | uint32_t cq_ring_sz = setup_params->cq_off.cqes + |
| 48 | @@ -135,7 +132,7 @@ void trigger_bug(void) |
| 49 | } |
| 50 | int main(void) |
| 51 | { |
| 52 | - syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); |
| 53 | + mmap((void *)0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); |
| 54 | int pid = fork(); |
| 55 | if (pid < 0) |
| 56 | exit(1); |
| 57 | -- |
| 58 | 2.33.1 |
| 59 | |