From: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
To: "Michael Kerrisk (man-pages)"
<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Eric Paris <eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
Subject: Re: fanotify API: FMODE_NONOTIFY, FMODE_EXEC, FMODE_NOCMTIME
Date: Sun, 13 Apr 2014 16:05:24 +0200 [thread overview]
Message-ID: <534A99A4.7000003@gmx.de> (raw)
In-Reply-To: <5341461A.3090405-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 06.04.2014 14:18, Michael Kerrisk (man-pages) wrote:
>> ==
>> >
>> > >> I notice that the FDs returned by read()s from the FAN FD have the
>> > >> FMODE_NONOTIFY flag (fcntl(F_GETFL)) flag set. If you know what that's
>> > >> about, it would be good to say something about. But, if not, do not
>> > >> worry--just place a FIXME in the page source of fanotify(7)
>> >
>> >Fixed in fanotify.7
>> >If the listener accesses the file through the file descriptor provided
>> >no additional events are created.
> Ahh -- thanks for filling in that piece. I see that you refer to
> fcntl(2) when discussing that flag. But fcntl(2) does not
> mention that flag. I would rather see an explanation of this flag
> in the fanotify pages.
>
I wrote a small test program and found:
The flag FMODE_NONOTIFY can be read by function fcntl from userspace.
int flag = fcntl(fd, F_GETFL)
In include/uapi/asm-generic/fcntl.h I found the following comment:
/*
* FMODE_EXEC is 0x20
* FMODE_NONOTIFY is 0x1000000
* These cannot be used by userspace O_* until internal and external open
* flags are split.
* -Eric Paris
*/
The definition of FMODE_NONOTIFY is in include/linux/fs.h but this
include is only used to compile the Kernel and not supposed to be used
by userspace.
I think it is quite annoying that fcntl can return a flag that is not
described in the manpage of fcntl and that is not defined in fcntl.h.
But FMODE_NONOTIFY is not the only flag:
I was able to pass
0x20 (FMODE_EXEC), and
0x800 (FMODE_NOCMTIME)
to fanotify_init and received them as flag in the file descriptors for
the fanotify events.
I wonder why fanotify_init does not check import parameter event_f_flags
and return an error if any inappropriate value is set.
Should I put this into the BUGS section?
Should the name of the flag FMODE_NONOTIFY be mentioned at all in the
man pages?
Or should we write:
.I fd
This is an open file descriptor for the object being accessed or
.B FAN_NOFD
if a queue overflow occurred.
The file descriptor can be used to access the contents of the monitored
file or
directory.
It has an internal flag set, that suppresses fanotify event generation.
Hence when the receiver of the fanotify event accesses the notified file or
directory using this file descriptor no additional events will be created.
The reading application is responsible for closing the file descriptor.
Best regards
Heinrich Schuchardt
--
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-04-13 14:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 19:53 [PATCH 1/1] Man pages for the fanotify API xypron.glpk-Mmb7MZpHnFY
[not found] ` <1393444390-16012-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-03-14 16:42 ` Michael Kerrisk (man-pages)
[not found] ` <53233160.9000106-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-16 15:32 ` xypron.glpk-Mmb7MZpHnFY
[not found] ` <1394983959-5392-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-03-17 15:45 ` Michael Kerrisk (man-pages)
[not found] ` <53271880.4090100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-22 16:42 ` xypron.glpk-Mmb7MZpHnFY
[not found] ` <1395506528-10026-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-03-24 21:23 ` Michael Kerrisk (man-pages)
[not found] ` <5330A257.9080100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-25 15:39 ` Man pages for the fanotify API: merging of events Heinrich Schuchardt
[not found] ` <5331A343.9070403-Mmb7MZpHnFY@public.gmane.org>
2014-03-25 16:37 ` Jan Kara
2014-03-26 19:09 ` [PATCH 1/1] Man pages for the fanotify API Eric Paris
2014-04-06 0:01 ` [PATCH 0/1] Manpages " xypron.glpk-Mmb7MZpHnFY
[not found] ` <1396742468-4752-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-04-06 12:18 ` Michael Kerrisk (man-pages)
[not found] ` <5341461A.3090405-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-07 8:48 ` Jan Kara
2014-04-13 14:05 ` Heinrich Schuchardt [this message]
2014-04-20 11:56 ` [PATCH 1/1] " Heinrich Schuchardt
[not found] ` <1397994990-9068-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-04-22 14:29 ` Michael Kerrisk (man-pages)
[not found] ` <53567CC2.6050708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-23 17:40 ` [PATCH 1/1] fanotify: add manpages Heinrich Schuchardt
[not found] ` <1398274809-6107-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-04-23 20:24 ` [PATCH] fanotify: add man pages Heinrich Schuchardt
[not found] ` <1398284672-7410-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-04-24 16:25 ` Michael Kerrisk (man-pages)
2014-04-07 8:56 ` [PATCH 0/1] Manpages for the fanotify API Jan Kara
[not found] ` <20140407085624.GB14927-+0h/O2h83AeN3ZZ/Hiejyg@public.gmane.org>
2014-04-07 18:16 ` [PATCH 0/1] Manpages for the fanotify API: FAN_ACCESS_PERM for readdir Heinrich Schuchardt
[not found] ` <5342EB7B.4010201-Mmb7MZpHnFY@public.gmane.org>
2014-04-07 20:13 ` Jan Kara
2014-04-06 0:01 ` [PATCH 1/1] Manpages for the fanotify API xypron.glpk-Mmb7MZpHnFY
-- strict thread matches above, loose matches on Subject: below --
2014-04-29 13:29 fanotify API: FMODE_NONOTIFY, FMODE_EXEC, FMODE_NOCMTIME Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkiq+yA7_tnvCVXemFy6P5F0eMccw18-GdqFthuzagvF5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-29 20:10 ` Jan Kara
[not found] ` <20140429201006.GD29634-+0h/O2h83AeN3ZZ/Hiejyg@public.gmane.org>
2014-04-29 20:55 ` Eric Paris
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=534A99A4.7000003@gmx.de \
--to=xypron.glpk-mmb7mzphnfy@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=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@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).