linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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,
	Eric Paris <eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>,
	"linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [patch] fanotify.7: Fix description of FAN_EVENT_NEXT()
Date: Mon, 19 May 2014 07:20:20 +0200	[thread overview]
Message-ID: <53799494.2080609@gmail.com> (raw)

Hi Heinrich,

I realized that the description of FAN_EVENT_NEXT() is not quite correct.
It does not update 'meta', but instead returns a pointer to the next
structure. I tried also to add a bit more detail to the description.
Does the following patch look okay to you?

Cheers,

Michael


--- a/man7/fanotify.7
+++ b/man7/fanotify.7
@@ -309,13 +309,24 @@ against the length of the metadata structure and the
 field of the first metadata structure in the buffer.
 .TP
 .B FAN_EVENT_NEXT(meta, len)
-This macro sets the pointer
-.I meta
-to the next metadata structure using the length indicated in the
+This macro uses the length indicated in the
 .I event_len
-field of the metadata structure and reduces the remaining length of the
-buffer
-.IR len .
+field of the metadata structure pointed to by
+.IR meta
+to calculate the address of the next metadata structure that follows
+.IR meta .
+.I len
+is the number of bytes of metadata that currently remain in the buffer.
+The macro returns a pointer to the next metadata structure that follows
+.IR meta ,
+and reduces
+.I len
+by the number of bytes in the the metadata structure that
+has been skipped over (i.e., it subtracts
+.IR meta\->event_len
+from
+.IR len ).
+.\"
 .SS Monitoring an fanotify file descriptor for events
 When an fanotify event occurs, the fanotify file descriptor indicates as
 readable when passed to

-- 
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

             reply	other threads:[~2014-05-19  5:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19  5:20 Michael Kerrisk (man-pages) [this message]
     [not found] ` <53799494.2080609-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-19 18:58   ` [patch] fanotify.7: Fix description of FAN_EVENT_NEXT() Heinrich Schuchardt
     [not found]     ` <537A5454.2040707-Mmb7MZpHnFY@public.gmane.org>
2014-05-20  7:36       ` Michael Kerrisk (man-pages)
     [not found]         ` <537B05F5.7010800-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-21  6:19           ` Heinrich Schuchardt
     [not found]             ` <537C456D.5090005-Mmb7MZpHnFY@public.gmane.org>
2014-05-21 10:47               ` 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=53799494.2080609@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jack-AlSwsSmVLrQ@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).