From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
Pavel Begunkov <[email protected]>,
io-uring Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>,
Kanna Scarlet <[email protected]>,
Muhammad Rizki <[email protected]>
Subject: [PATCH liburing v2] liburing: Export `__NR_io_uring_{setup,enter,register}` to user
Date: Sun, 4 Sep 2022 14:38:45 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
These macros are not defined in an old <sys/syscall.h> file. Allow
liburing users to get io_uring syscall numbers by including
<liburing.h>.
Signed-off-by: Ammar Faizi <[email protected]>
---
v2:
- Fix typo in the commit message:
s/in a old/in an old/
src/include/liburing.h | 38 ++++++++++++++++++++++++++++++++++++++
src/syscall.h | 37 -------------------------------------
2 files changed, 38 insertions(+), 37 deletions(-)
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 6040a06..cceab6b 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -33,6 +33,44 @@
#define uring_likely(cond) __builtin_expect(!!(cond), 1)
#endif
+
+#ifdef __alpha__
+/*
+ * alpha and mips are exception, 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
+
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/src/syscall.h b/src/syscall.h
index ba008ea..f750782 100644
--- a/src/syscall.h
+++ b/src/syscall.h
@@ -10,45 +10,8 @@
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/resource.h>
-
#include <liburing.h>
-#ifdef __alpha__
-/*
- * alpha and mips are exception, 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.
base-commit: 42ee2bdb76022fc11d7a0ad8ec5cca6de73501e9
--
Ammar Faizi
next reply other threads:[~2022-09-04 7:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-04 7:38 Ammar Faizi [this message]
2022-09-04 12:34 ` [PATCH liburing v2] liburing: Export `__NR_io_uring_{setup,enter,register}` to user Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox