From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Eric Paris <eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 1/1] fanotify: read(2) error handling
Date: Sat, 03 May 2014 21:21:41 +0200 [thread overview]
Message-ID: <536541C5.40001@gmail.com> (raw)
In-Reply-To: <1399136269-7930-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
[CC += Eric]
Hello Heinrich,
On 05/03/2014 06:57 PM, Heinrich Schuchardt wrote:
> The last lines of fanotify_read() in fanotify_user.c are:
> if (start != buf && ret != -EFAULT)
> ret = buf - start;
> return ret;
>
> This implies that an error code is only returned, if reading the first
> event on the queue fails or if EFAULT occurs.
I'm not quite sure if this text is needed. What sort of errors
are we talking about here that are not reported?
Cheers,
Michael
> Signed-off-by: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
> ---
> man7/fanotify.7 | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/man7/fanotify.7 b/man7/fanotify.7
> index 083244f..6936b88 100644
> --- a/man7/fanotify.7
> +++ b/man7/fanotify.7
> @@ -131,6 +131,14 @@ until either a file event occurs or the call is interrupted by a signal
> The return value of
> .BR read (2)
> is the length of the filled buffer, or \-1 in case of an error.
> +If multiple events are on the fanotify queue,
> +.BR read (2)
> +will only report an error, if reading the first event fails or an error
> +.B EFAULT
> +occurs.
> +If reading the first event is successful but reading any further event fails,
> +.BR read (2)
> +returns the length of the buffer filled with all prior events.
> After a successful
> .BR read (2),
> the read buffer contains one or more of the following structures:
>
--
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
next prev parent reply other threads:[~2014-05-03 19:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-03 16:57 [PATCH 1/1] fanotify: read(2) error handling Heinrich Schuchardt
[not found] ` <1399136269-7930-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-05-03 19:21 ` Michael Kerrisk (man-pages) [this message]
[not found] ` <536541C5.40001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-04 8:31 ` Heinrich Schuchardt
[not found] ` <5365FAE1.7020602-Mmb7MZpHnFY@public.gmane.org>
2014-05-04 9:19 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkjfYRWfWZYUvq1RRp00dXCe5p5KJWCu4PapHdJcf6n0Fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-13 8:37 ` Michael Kerrisk (man-pages)
2014-05-14 17:38 ` [PATCH 1/1] fanotify.7: BUGS, error handling in fanotify_read Heinrich Schuchardt
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=536541C5.40001@gmail.com \
--to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=xypron.glpk-Mmb7MZpHnFY@public.gmane.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;
as well as URLs for NNTP newsgroup(s).