* aio_return(3): misleading RETURN VALUE
@ 2015-03-18 8:03 Alexander Holler
[not found] ` <5509315A.1040103-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Holler @ 2015-03-18 8:03 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
Hello,
I've just typed in the following commit message:
--
The man page was misleading and I must have had a bad moment
mechanically coding what the man page says without thinking about it.
So I seem to have assumed that aio_return() might return EINVAL which
can't be the case. In fact the error is returned in errno which isn't
mentioned by the Linux man page for aio_return.
--
I suggest to use the same wording as in write(2) in the paragraph RETURN
VALUE:
"On error, -1 is returned, and errno is set appropriately."
I've verified it by looking at the source for aio_return of glibc.
Regards,
Alexander Holler
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread[parent not found: <5509315A.1040103-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>]
* Re: aio_return(3): misleading RETURN VALUE [not found] ` <5509315A.1040103-SXC+2es9fhnfWeYVQQPykw@public.gmane.org> @ 2015-03-18 12:14 ` Stéphane Aulery [not found] ` <20150318121446.GA5160-GANU6spQydw@public.gmane.org> 2015-03-18 19:51 ` [PATCH] aio_return.3: Specifies the return values for errors Stéphane Aulery 1 sibling, 1 reply; 6+ messages in thread From: Stéphane Aulery @ 2015-03-18 12:14 UTC (permalink / raw) To: Alexander Holler Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA Hello Alexander, Le mercredi 18 mars 2015 à 09:03:38, Alexander Holler a écrit : > > I suggest to use the same wording as in write(2) in the paragraph RETURN > VALUE: > > "On error, -1 is returned, and errno is set appropriately." Like that ? If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read(2), write(2), fsync(2) or fdatasync(2), call. On error, -1 is returned, and errno is set appropriately. If the asynchronous I/O operation has not yet completed, the return value and effect of aio_return() are undefined. I think that's what you meant. What will happen if the asynchronous I/O operation has not yet completed please ? Regards, -- Stéphane Aulery -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20150318121446.GA5160-GANU6spQydw@public.gmane.org>]
* Re: aio_return(3): misleading RETURN VALUE [not found] ` <20150318121446.GA5160-GANU6spQydw@public.gmane.org> @ 2015-03-18 19:21 ` Alexander Holler [not found] ` <5509D038.7020907-SXC+2es9fhnfWeYVQQPykw@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Alexander Holler @ 2015-03-18 19:21 UTC (permalink / raw) To: Stéphane Aulery Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA Am 18.03.2015 um 13:14 schrieb Stéphane Aulery: > Hello Alexander, > > Le mercredi 18 mars 2015 à 09:03:38, Alexander Holler a écrit : >> >> I suggest to use the same wording as in write(2) in the paragraph RETURN >> VALUE: >> >> "On error, -1 is returned, and errno is set appropriately." > > Like that ? > > If the asynchronous I/O operation has completed, this function > returns the value that would have been returned in case of a > synchronous read(2), write(2), fsync(2) or fdatasync(2), call. On > error, -1 is returned, and errno is set appropriately. > > If the asynchronous I/O operation has not yet completed, the return > value and effect of aio_return() are undefined. Exactly. Thanks a lot if you change that. > I think that's what you meant. What will happen if the asynchronous I/O > operation has not yet completed please ? It is still undefined, but I haven't looked that up in the source of glibc. The reason is that aio_return() should only be called if the operation before has completed, which must be checked with calling aio_error() before calling aio_return(). That's how I've understood all that and how it currently seems to work in the SW in question I've fixed a problem. Regards, Alexander Holler -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <5509D038.7020907-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>]
* Re: aio_return(3): misleading RETURN VALUE [not found] ` <5509D038.7020907-SXC+2es9fhnfWeYVQQPykw@public.gmane.org> @ 2015-03-18 19:57 ` Stéphane Aulery 0 siblings, 0 replies; 6+ messages in thread From: Stéphane Aulery @ 2015-03-18 19:57 UTC (permalink / raw) To: Alexander Holler Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA Hello Alexander, Le mercredi 18 mars 2015 à 08:21:28, Alexander Holler a écrit : > Am 18.03.2015 um 13:14 schrieb Stéphane Aulery: > >Le mercredi 18 mars 2015 à 09:03:38, Alexander Holler a écrit : > >> > >>I suggest to use the same wording as in write(2) in the paragraph RETURN > >>VALUE: > >> > >>"On error, -1 is returned, and errno is set appropriately." > > > >Like that ? > > > > If the asynchronous I/O operation has completed, this function > > returns the value that would have been returned in case of a > > synchronous read(2), write(2), fsync(2) or fdatasync(2), call. On > > error, -1 is returned, and errno is set appropriately. > > > > If the asynchronous I/O operation has not yet completed, the return > > value and effect of aio_return() are undefined. > > Exactly. Thanks a lot if you change that. Patch is pending for review by Michael. > >I think that's what you meant. What will happen if the asynchronous I/O > >operation has not yet completed please ? > > It is still undefined, but I haven't looked that up in the source of glibc. > > The reason is that aio_return() should only be called if the operation > before has completed, which must be checked with calling aio_error() before > calling aio_return(). > > That's how I've understood all that and how it currently seems to work in > the SW in question I've fixed a problem. Thank you for yours clarifications. Regards, -- Stéphane Aulery -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] aio_return.3: Specifies the return values for errors [not found] ` <5509315A.1040103-SXC+2es9fhnfWeYVQQPykw@public.gmane.org> 2015-03-18 12:14 ` Stéphane Aulery @ 2015-03-18 19:51 ` Stéphane Aulery [not found] ` <1426708273-9475-1-git-send-email-saulery-GANU6spQydw@public.gmane.org> 1 sibling, 1 reply; 6+ messages in thread From: Stéphane Aulery @ 2015-03-18 19:51 UTC (permalink / raw) To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w Cc: holler-SXC+2es9fhnfWeYVQQPykw, Stéphane Aulery, linux-man-u79uwXL29TY76Z2rM5mHXA Reported by Alexander Holler <holler-SXC+2es9fhnfWeYVQQPykw@public.gmane.org> Signed-off-by: Stéphane Aulery <saulery-GANU6spQydw@public.gmane.org> --- man3/aio_return.3 | 1 + 1 file changed, 1 insertion(+) diff --git a/man3/aio_return.3 b/man3/aio_return.3 index 3e6f334..37d735c 100644 --- a/man3/aio_return.3 +++ b/man3/aio_return.3 @@ -55,6 +55,7 @@ the value that would have been returned in case of a synchronous or .BR fdatasync (2), call. +On error, \-1 is returned, and \fIerrno\fP is set appropriately. If the asynchronous I/O operation has not yet completed, the return value and effect of -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1426708273-9475-1-git-send-email-saulery-GANU6spQydw@public.gmane.org>]
* Re: [PATCH] aio_return.3: Specifies the return values for errors [not found] ` <1426708273-9475-1-git-send-email-saulery-GANU6spQydw@public.gmane.org> @ 2015-03-22 15:19 ` Michael Kerrisk (man-pages) 0 siblings, 0 replies; 6+ messages in thread From: Michael Kerrisk (man-pages) @ 2015-03-22 15:19 UTC (permalink / raw) To: Stéphane Aulery Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, holler-SXC+2es9fhnfWeYVQQPykw, linux-man-u79uwXL29TY76Z2rM5mHXA On 03/18/2015 08:51 PM, Stéphane Aulery wrote: > Reported by Alexander Holler <holler-SXC+2es9fhnfWeYVQQPykw@public.gmane.org> > > Signed-off-by: Stéphane Aulery <saulery-GANU6spQydw@public.gmane.org> > --- > man3/aio_return.3 | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/man3/aio_return.3 b/man3/aio_return.3 > index 3e6f334..37d735c 100644 > --- a/man3/aio_return.3 > +++ b/man3/aio_return.3 > @@ -55,6 +55,7 @@ the value that would have been returned in case of a synchronous > or > .BR fdatasync (2), > call. > +On error, \-1 is returned, and \fIerrno\fP is set appropriately. > > If the asynchronous I/O operation has not yet completed, > the return value and effect of Hi Stéphane, Thanks! Patch applied. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-22 15:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-18 8:03 aio_return(3): misleading RETURN VALUE Alexander Holler
[not found] ` <5509315A.1040103-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2015-03-18 12:14 ` Stéphane Aulery
[not found] ` <20150318121446.GA5160-GANU6spQydw@public.gmane.org>
2015-03-18 19:21 ` Alexander Holler
[not found] ` <5509D038.7020907-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2015-03-18 19:57 ` Stéphane Aulery
2015-03-18 19:51 ` [PATCH] aio_return.3: Specifies the return values for errors Stéphane Aulery
[not found] ` <1426708273-9475-1-git-send-email-saulery-GANU6spQydw@public.gmane.org>
2015-03-22 15:19 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).