From e5e4b260606b2ffc3f1185aa58f4e7d9ab551173 Mon Sep 17 00:00:00 2001 From: Zifeng Deng Date: Wed, 22 Nov 2023 20:50:53 +0800 Subject: [PATCH] fix(uring): define __NR_io_uring if they are missing --- include/uring/syscall.hpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/uring/syscall.hpp b/include/uring/syscall.hpp index 0f5e5e5..7ec5015 100644 --- a/include/uring/syscall.hpp +++ b/include/uring/syscall.hpp @@ -10,6 +10,42 @@ #include #include +#ifdef __alpha__ +/* + * alpha and mips are the exceptions, all other architectures have + * common numbers for new system calls. + */ +#ifndef __NR_io_uring_setup +#define __NR_io_uring_setup 535 +#endif +#ifndef __NR_io_uring_enter +#define __NR_io_uring_enter 536 +#endif +#ifndef __NR_io_uring_register +#define __NR_io_uring_register 537 +#endif +#elif defined __mips__ +#ifndef __NR_io_uring_setup +#define __NR_io_uring_setup (__NR_Linux + 425) +#endif +#ifndef __NR_io_uring_enter +#define __NR_io_uring_enter (__NR_Linux + 426) +#endif +#ifndef __NR_io_uring_register +#define __NR_io_uring_register (__NR_Linux + 427) +#endif +#else /* !__alpha__ and !__mips__ */ +#ifndef __NR_io_uring_setup +#define __NR_io_uring_setup 425 +#endif +#ifndef __NR_io_uring_enter +#define __NR_io_uring_enter 426 +#endif +#ifndef __NR_io_uring_register +#define __NR_io_uring_register 427 +#endif +#endif + /* * Don't put this below the #include "arch/$arch/syscall.h", that * file may need it.