From: Alejandro Colomar <alx@kernel.org>
To: linux-man@vger.kernel.org
Cc: Alejandro Colomar <alx@kernel.org>,
Guillem Jover <guillem@debian.org>,
linux-aio@kvack.org
Subject: [PATCH v1 6/6] man/man*/io_setup.[23]: Split io_setup(3) from io_setup.2
Date: Wed, 8 Apr 2026 11:18:51 +0200 [thread overview]
Message-ID: <c6fcae43d95ef9d96e156d295ee72a2b5563dbce.1775639353.git.alx@kernel.org> (raw)
In-Reply-To: <cover.1775639353.git.alx@kernel.org>
This simplifies the documentation of the system call.
Let the wrapper be documented as io_setup(3).
Cc: Guillem Jover <guillem@debian.org>
Cc: <linux-aio@kvack.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
man/man2/io_setup.2 | 60 ++++++++++++---------------------------------
man/man3/io_setup.3 | 40 ++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 44 deletions(-)
create mode 100644 man/man3/io_setup.3
diff --git a/man/man2/io_setup.2 b/man/man2/io_setup.2
index 398101fb..f58cb45b 100644
--- a/man/man2/io_setup.2
+++ b/man/man2/io_setup.2
@@ -9,10 +9,6 @@ .SH NAME
.SH LIBRARY
Standard C library
.RI ( libc ,\~ \-lc )
-.P
-Alternatively, Asynchronous I/O library
-.RI ( libaio ,\~ \-laio );
-see VERSIONS.
.SH SYNOPSIS
.nf
.B #include <linux/aio_abi.h>
@@ -21,19 +17,13 @@ .SH SYNOPSIS
.P
.BI "long\~syscall(SYS_io_setup, unsigned int " n ", aio_context_t *" ctx_idp );
.fi
-.P
-.IR Note :
-There is no glibc wrapper for this system call;
-see VERSIONS.
.SH DESCRIPTION
.IR Note :
-this page describes the raw Linux system call interface.
-The wrapper function provided by
-.I libaio
-uses a different type for the
-.I ctx_idp
-argument.
-See VERSIONS.
+you probably want to use the
+.BR io_setup (3)
+wrapper function provided by
+.IR libaio ;
+see VERSIONS.
.P
The
.BR io_setup ()
@@ -53,7 +43,11 @@ .SH RETURN VALUE
On success,
.BR io_setup ()
returns 0.
-For the failure return, see VERSIONS.
+On error,
+\-1 is returned,
+and
+.I errno
+is set to indicate the error.
.SH ERRORS
.TP
.B EAGAIN
@@ -87,35 +81,12 @@ .SH ERRORS
.BR io_setup ()
is not implemented on this architecture.
.SH VERSIONS
-glibc does not provide a wrapper for this system call.
-You could invoke it using
-.BR syscall (2).
-But instead, you probably want to use the
-.BR io_setup ()
-wrapper function provided by
-.\" http://git.fedorahosted.org/git/?p=libaio.git
-.IR libaio .
-.P
-Note that the
+.UR https://pagure.io/libaio
.I libaio
-wrapper function uses a different type
-.RI ( "io_context_t\ *" )
-.\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
-.\" the system call.
-for the
-.I ctx_idp
-argument.
-Note also that the
-.I libaio
-wrapper does not follow the usual C library conventions for indicating errors:
-on error it returns a negated error number
-(the negative of one of the values listed in ERRORS).
-If the system call is invoked via
-.BR syscall (2),
-then the return value follows the usual conventions for
-indicating an error: \-1, with
-.I errno
-set to a (positive) value that indicates the error.
+.UE
+provides a wrapper function with the same name,
+but different prototype and return value.
+You probably want to use that wrapper.
.SH STANDARDS
Linux.
.SH HISTORY
@@ -125,6 +96,7 @@ .SH SEE ALSO
.BR io_destroy (2),
.BR io_getevents (2),
.BR io_submit (2),
+.BR io_setup (3),
.BR aio (7)
.\" .SH AUTHOR
.\" Kent Yoder.
diff --git a/man/man3/io_setup.3 b/man/man3/io_setup.3
new file mode 100644
index 00000000..28b59550
--- /dev/null
+++ b/man/man3/io_setup.3
@@ -0,0 +1,40 @@
+.\" Copyright, the authors of the Linux man-pages project
+.\"
+.\" SPDX-License-Identifier: GPL-2.0-or-later
+.\"
+.TH io_setup 3 (date) "Linux man-pages (unreleased)"
+.SH NAME
+io_setup \- create an asynchronous I/O context
+.SH LIBRARY
+Asynchronous I/O library
+.RI ( libaio ,\~ \-laio )
+.SH SYNOPSIS
+.nf
+.B #include <libaio.h>
+.P
+.BI "long\~io_setup(unsigned int " n ", io_context_t *" ctx_idp );
+.fi
+.SH DESCRIPTION
+.BR io_setup ()
+creates an asynchronous I/O context suitable for concurrently processing
+.I n
+operations.
+.SH RETURN VALUE
+On success,
+.BR io_setup ()
+returns 0.
+On error,
+a negative error code is returned to indicate the error.
+.SH ERRORS
+See
+.BR io_setup (2).
+.SH STANDARDS
+libaio.
+.SH HISTORY
+libaio.
+.SH SEE ALSO
+.BR io (3),
+.BR io_setup (2),
+.BR aio (7)
+.\" .SH AUTHOR
+.\" Kent Yoder.
--
2.53.0
next prev parent reply other threads:[~2026-04-08 9:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 9:18 [PATCH v1 0/6] Split io_setup(3) from io_setup.2 Alejandro Colomar
2026-04-08 9:18 ` [PATCH v1 1/6] man/man2/io_setup.2: Reduce parameter name Alejandro Colomar
2026-04-08 9:18 ` [PATCH v1 2/6] man/man2/io_setup.2: Update reference (proc(5) => proc_sys_fs(5)) Alejandro Colomar
2026-04-08 9:18 ` [PATCH v1 3/6] man/man2/io_setup.2: ERRORS: Split EINVAL Alejandro Colomar
2026-04-08 9:18 ` [PATCH v1 4/6] man/man2/io_setup.2: ERRORS: It is *ctx_idp that must be initialized Alejandro Colomar
2026-04-08 9:18 ` [PATCH v1 5/6] man/man2/io_setup.2: Use syscall(2) in the SYNOPSIS Alejandro Colomar
2026-04-08 9:18 ` Alejandro Colomar [this message]
2026-04-09 16:50 ` [PATCH v1 6/6] man/man*/io_setup.[23]: Split io_setup(3) from io_setup.2 Guillem Jover
2026-04-09 20:39 ` Alejandro Colomar
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 \
--in-reply-to=c6fcae43d95ef9d96e156d295ee72a2b5563dbce.1775639353.git.alx@kernel.org \
--to=alx@kernel.org \
--cc=guillem@debian.org \
--cc=linux-aio@kvack.org \
--cc=linux-man@vger.kernel.org \
/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