From: Alejandro Colomar <colomar.6.4.3@gmail.com>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH] io_setup.2: SYNOPSIS: return long
Date: Mon, 2 Nov 2020 13:20:12 +0100 [thread overview]
Message-ID: <4de611f0-27e7-164a-bd40-21d276c015be@gmail.com> (raw)
In-Reply-To: <6362993f-88d7-5dd4-91b2-03d31ebc8bab@gmail.com>
On 2020-11-02 08:37, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
>
> On 11/1/20 2:59 PM, Alejandro Colomar wrote:
>> The Linux kernel uses a long as the return type for this syscall.
>> As glibc provides no wrapper, use the same types the kernel uses.
>
> I think we need this patch for all of the io* pages, right?
Hi Michael,
For some reason, no. AFAICS, only io_setup() really uses 'long'.
Then there's io_submit(), which also declares a 'long', but gets that
value from io_submit_one(), which returns an 'int';
we could use either 'long' or 'int'
in the manual page too for this one.
And then there are the others, which use plain 'int'.
See at the end of this email the sources for this answer.
Cheers,
Alex
>
> Thanks,
>
> Michael
fs/aio.c:1312:
SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp)
{
struct kioctx *ioctx = NULL;
unsigned long ctx;
long ret;
...
return ret;
}
fs/aio.c:1381:
SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
{
struct kioctx *ioctx = lookup_ioctx(ctx);
if (likely(NULL != ioctx)) {
struct ctx_rq_wait wait;
int ret;
...
return ret;
}
pr_debug("EINVAL: invalid context id\n");
return -EINVAL;
}
fs/aio.c:1855:
static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
bool compat)
fs/aio.c:1914:
SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, long, nr,
struct iocb __user * __user *, iocbpp)
{
struct kioctx *ctx;
long ret = 0;
int i = 0;
struct blk_plug plug;
...
ret = io_submit_one(ctx, user_iocb, false);
...
return i ? i : ret;
}
fs/aio.c:2008:
SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *,
iocb,
struct io_event __user *, result)
{
struct kioctx *ctx;
struct aio_kiocb *kiocb;
int ret = -EINVAL;
...
return ret;
}
fs/aio.c:2084:
SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id,
long, min_nr,
long, nr,
struct io_event __user *, events,
struct __kernel_timespec __user *, timeout)
{
struct timespec64 ts;
int ret;
...
return ret;
}
next prev parent reply other threads:[~2020-11-02 12:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-01 13:59 [PATCH] io_setup.2: SYNOPSIS: return long Alejandro Colomar
2020-11-02 7:37 ` Michael Kerrisk (man-pages)
2020-11-02 12:20 ` Alejandro Colomar [this message]
2020-11-02 13:09 ` Michael Kerrisk (man-pages)
2020-11-02 13:12 ` Alejandro Colomar
2020-11-11 15:39 ` Ping: " Alejandro Colomar
2020-11-13 9:23 ` Michael Kerrisk (man-pages)
2020-11-13 9:24 ` Michael Kerrisk (man-pages)
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=4de611f0-27e7-164a-bd40-21d276c015be@gmail.com \
--to=colomar.6.4.3@gmail.com \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
/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