text
stringlengths
0
234
.br open_by_handle_at (2)
to get an open directory file descriptor and that file descriptor along with
the reported name can be used to call
.br fstatat (2).
the same rule that applies to record type
.br fan_event_info_type_dfid
also applies to record type
.br fan_event_info_type_dfid_name :
if a non-directory object has no parent, either the event will not be reported
or it will be reported without the directory entry information.
note that there is no guarantee that the filesystem object will be found at the
location described by the directory entry information at the time the event is
received.
see
.br fanotify (7)
for additional details.
.tp
.b fan_report_dfid_name
this is a synonym for
.rb ( fan_report_dir_fid | fan_report_name ).
.pp
the
.i event_f_flags
argument
defines the file status flags that will be set on the open file descriptions
that are created for fanotify events.
for details of these flags, see the description of the
.i flags
values in
.br open (2).
.i event_f_flags
includes a multi-bit field for the access mode.
this field can take the following values:
.tp
.b o_rdonly
this value allows only read access.
.tp
.b o_wronly
this value allows only write access.
.tp
.b o_rdwr
this value allows read and write access.
.pp
additional bits can be set in
.ir event_f_flags .
the most useful values are:
.tp
.b o_largefile
enable support for files exceeding 2\ gb.
failing to set this flag will result in an
.b eoverflow
error when trying to open a large file which is monitored by
an fanotify group on a 32-bit system.
.tp
.br o_cloexec " (since linux 3.18)"
.\" commit 0b37e097a648aa71d4db1ad108001e95b69a2da4
enable the close-on-exec flag for the file descriptor.
see the description of the
.b o_cloexec
flag in
.br open (2)
for reasons why this may be useful.
.pp
the following are also allowable:
.br o_append ,
.br o_dsync ,
.br o_noatime ,
.br o_nonblock ,
and
.br o_sync .
specifying any other flag in
.i event_f_flags
yields the error
.b einval
(but see bugs).
.sh return value
on success,
.br fanotify_init ()
returns a new file descriptor.
on error, \-1 is returned, and
.i errno
is set to indicate the error.
.sh errors
.tp
.b einval
an invalid value was passed in
.i flags
or
.ir event_f_flags .
.b fan_all_init_flags
(deprecated since linux kernel version 4.20)
.\" commit 23c9deeb3285d34fd243abb3d6b9f07db60c3cf4
defines all allowable bits for
.ir flags .
.tp
.b emfile
the number of fanotify groups for this user exceeds 128.
.tp
.b emfile
the per-process limit on the number of open file descriptors has been reached.