-.\" Copyright (C) 2013, Heinrich Schuchardt <xypron.glpk@gmx.de>
+\" Copyright (C) 2013, Heinrich Schuchardt <xypron.glpk@gmx.de>
.\"
.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
directory entry events, such as
.BR FAN_CREATE ,
.BR FAN_ATTRIB ,
-.BR FAN_MOVE
+.BR FAN_MOVE ,
and
.BR FAN_DELETE
for example.
is required.
.TP
.B FAN_ONDIR
-Create events for directories \(em for example, when
+Create events for directories\(emfor example, when
.BR opendir (3),
.BR readdir (3)
(but see BUGS), and
In the context of directory entry events, such as
.BR FAN_CREATE ,
.BR FAN_DELETE ,
-.BR FAN_MOVED_FROM
+.BR FAN_MOVED_FROM ,
and
.BR FAN_MOVED_TO
for example, specifying the flag
.BR FAN_ONDIR
is required in order to create events when subdirectory entries are
-modified (i.e. mkdir/rmdir).
-Subdirectory entry modification events will never be merged with non
-subdirectory entry modification events.
+modified (i.e.,
+.BR mkdir (2)/
+.BR rmdir (2)).
+Subdirectory entry modification events will never be merged with
+nonsubdirectory entry modification events.
This flag is never reported individually within an event and is always
supplied in conjunction with another event type.
.TP
.B EXDEV
The object indicated by
.I pathname
-resides within a filesystem subvolume (e.g. btrfs) which uses a different
+resides within a filesystem subvolume (e.g.,
+.BR btrfs (5))
+which uses a different
.I fsid
than its root superblock.
-This error can only be returned when an fanotify file descriptor returned
+This error can be returned only when an fanotify file descriptor returned
by
.BR fanotify_init (2)
has been created with
.I pathname
is not associated with a filesystem that supports
.I fsid
-(e.g. tmpfs).
-This error can only be returned when an fanotify file descriptor returned
+(e.g.,
+.BR tmpfs (5)).
+This error can be returned only when an fanotify file descriptor returned
by
.BR fanotify_init (2)
has been created with
.I pathname
is associated with a filesystem that does not support the encoding of file
handles.
-This error can only be returned when an fanotify file descriptor returned
+This error can be returned only when an fanotify file descriptor returned
by
.BR fanotify_init (2)
has been created with
and require no action to be taken by
the receiving application with the exception being that the file
descriptor provided within a generic event must be closed.
-The closing of file descriptors for each event only applies to
+The closing of file descriptors for each event applies only to
applications that have initialized fanotify without using
.BR FAN_REPORT_FID
(see below).
.EE
.in
.PP
-In the instance that
+In the case where
.BR FAN_REPORT_FID
is supplied as one of the flags to
.BR fanotify_init (2),
It is a generic header that contains information used to describe
additional information attached to the event.
For example, when an fanotify file descriptor is created using
-.B FAN_REPORT_FID
+.BR FAN_REPORT_FID ,
the
.I info_type
field of this header is set to
.IR file_handle .
It is an opaque handle that corresponds to a specified object on a
filesystem as returned by
-.BR name_to_handle_at (2) .
+.BR name_to_handle_at (2).
It can be used to uniquely identify a file on a filesystem and can be
passed as an argument to
-.BR open_by_handle_at (2) .
+.BR open_by_handle_at (2).
Note that for directory entry events, such as
.BR FAN_CREATE ,
.BR FAN_DELETE ,
-.BR FAN_MOVE
+and
+.BR FAN_MOVE ,
the
.IR file_handle
describes the modified directory and not the created/deleted/moved child
object.
The events
.BR FAN_ATTRIB ,
-.BR FAN_DELETE_SELF
+.BR FAN_DELETE_SELF ,
and
.BR FAN_MOVE_SELF
will carry the
Execution of the program ends when the user presses the ENTER key.
.PP
The second example program output was captured from fanotify_fid.
-There are two discrete invocations to this program with each invocation
+There are two discrete invocations of this program, with each invocation
accommodating a different action performed on a watched object.
This first session shows a mark being placed on
.IR /home/user .
snprintf(procfd_path, sizeof(procfd_path), "/proc/self/fd/%d", event_fd);
- /* Retreive and print the path of the modified dentry */
+ /* Retrieve and print the path of the modified dentry */
path_len = readlink(procfd_path, path, sizeof(path) - 1);
if (path_len == -1) {
perror("readlink");