Re: [patch] fanotify.7: Fix description of FAN_EVENT_NEXT()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Michael,

the proposed new description of FAN_EVENT_NEXT is correct.

Should FAN_EVENT_METADATA_LEN also be put into the section with macros?

.B FAN_EVENT_METADATA_LEN
This macro returns the size of structure
.I fanotify_event_metadata
in bytes.
This is the minimum size (and currently the only size) of any event metadata.

Best regards

Heinrich

On 19.05.2014 07:20, Michael Kerrisk (man-pages) wrote:
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


--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux