public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	Caleb Sander <[email protected]>,
	Muhammad Rizki <[email protected]>,
	Kanna Scarlet <[email protected]>,
	io-uring Mailing List <[email protected]>,
	Linux Kernel Mailing List <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: [RFC PATCH liburing v1 0/4] Export io_uring syscall functions
Date: Mon, 29 Aug 2022 10:07:35 +0700	[thread overview]
Message-ID: <[email protected]> (raw)

From: Ammar Faizi <[email protected]>

Hi Jens,

The background story of this series comes from the recent conversation with
Caleb Sander at:

   https://github.com/axboe/liburing/pull/646#issuecomment-1229639532

What do you think of this series?

There are 4 patches in this series.

1) syscall: Add io_uring syscall functions

We have:

  man 2 io_uring_setup;
  man 2 io_uring_enter;
  man 2 io_uring_register;

Those entries say that io_uring syscall functions are declared in
`<linux/io_uring.h>`. But they don't actually exist and never existed.
This is causing confusion for people who read the manpage. Let's just
implement them in liburing so they exist.

This also allows the user to invoke io_uring syscalls directly instead
of using the full liburing provided setup.

2) Clarify "man 2" entry for io_uring.

io_uring_enter(), io_uring_register(), io_uring_setup() are not
declared in `<linux/io_uring.h>` and never were. Plus, these
functions don't intentionally set the `errno` variable. Reflect this
fact in the manpage.

Side note: On architectures other than x86, x86-64, and aarch64, those
functions _do_ set the `errno`, this is because the syscall is done via
libc as we don't yet have nolibc support for the mentioned archs. Users
should not rely on this behavior.

3) man: Alias `io_uring_enter2()` to `io_uring_enter()`.

We have a new function io_uring_enter2(), add the man page entry for it
by aliasing it to io_uring_enter(). This aliased man entry has already
explained it.

4) test/io_uring_{enter,setup,register}: Use the exported syscall functions.

These tests use the internal definition of __sys_io_uring* functions.
A previous commit exported new functions that do the same thing with
those __sys_io_uring* functions. Test the exported functions instead of
the internal functions.

No functional change is intended.

Signed-off-by: Ammar Faizi <[email protected]>
---

Ammar Faizi (4):
  syscall: Add io_uring syscall functions
  man: Clarify "man 2" entry for io_uring syscalls
  man: Alias `io_uring_enter2()` to `io_uring_enter()`
  test/io_uring_{enter,setup,register}: Use the exported syscall functions

 man/io_uring_enter.2     |  9 ++++-----
 man/io_uring_enter2.2    |  1 +
 man/io_uring_register.2  |  9 ++++-----
 man/io_uring_setup.2     |  8 +++-----
 src/Makefile             |  2 +-
 src/include/liburing.h   |  8 ++++++++
 src/liburing.map         |  4 ++++
 src/syscall.c            | 30 ++++++++++++++++++++++++++++++
 test/io_uring_enter.c    | 10 +++++-----
 test/io_uring_register.c | 34 ++++++++++++++++------------------
 test/io_uring_setup.c    |  4 ++--
 11 files changed, 78 insertions(+), 41 deletions(-)
 create mode 120000 man/io_uring_enter2.2
 create mode 100644 src/syscall.c


base-commit: bf248850dc2ae45d29d4fdde688e90d24f3dd6d2
-- 
Ammar Faizi


             reply	other threads:[~2022-08-29  3:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29  3:07 Ammar Faizi [this message]
2022-08-29  3:07 ` [RFC PATCH liburing v1 1/4] syscall: Add io_uring syscall functions Ammar Faizi
2022-08-29 19:46   ` Caleb Sander
2022-08-29 19:53   ` Caleb Sander
2022-08-29  3:07 ` [RFC PATCH liburing v1 2/4] man: Clarify "man 2" entry for io_uring syscalls Ammar Faizi
2022-08-29  3:07 ` [RFC PATCH liburing v1 3/4] man: Alias `io_uring_enter2()` to `io_uring_enter()` Ammar Faizi
2022-08-29 19:56   ` Caleb Sander
2022-08-29  3:07 ` [RFC PATCH liburing v1 4/4] test/io_uring_{enter,setup,register}: Use the exported syscall functions Ammar Faizi
2022-08-29 19:58   ` Caleb Sander

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] \
    [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