.BI "int fcntl(int " fd ", F_NOTIFY, int " arg );
.fi
.SH DESCRIPTION
-.TP
-.BR F_NOTIFY \~(\f[I]int\f[])
-(Linux 2.4 onward)
Provide notification when the directory referred to by
.I fd
or any of the files that it contains is changed.
.IR arg ,
which is a bit mask specified by ORing together zero or more of
the following bits:
-.P
-.RS
-.PD 0
.TP
.B DN_ACCESS
A file was accessed
.BR utime (2),
.BR utimensat (2),
and similar).
-.PD
-.RE
-.IP
+.P
(In order to obtain these definitions, the
.B _GNU_SOURCE
feature test macro must be defined before including
.I any
header files.)
-.IP
+.P
Directory notifications are normally "one-shot", and the application
must reregister to receive further notifications.
Alternatively, if
is included in
.IR arg ,
then notification will remain in effect until explicitly removed.
-.IP
+.P
.\" The following does seem a poor API-design choice...
A series of
.B F_NOTIFY
call specifying
.I arg
as 0.
-.IP
+.P
Notification occurs via delivery of a signal.
The default signal is
.BR SIGIO ,
field of this structure contains the file descriptor which
generated the notification (useful when establishing notification
on multiple directories).
-.IP
+.P
Especially when using
.BR DN_MULTISHOT ,
a real time signal should be used for notification,
so that multiple notifications can be queued.
-.IP
+.P
.B NOTE:
New applications should use the
.I inotify
.BR fcntl (2).
.TP
.B ENOTDIR
-.B F_NOTIFY
-was specified in
-.IR op ,
-but
.I fd
does not refer to a directory.
.SH STANDARDS
Linux.
.SH HISTORY
-Linux.
+Linux 2.4.
.SH SEE ALSO
.BR fcntl (2)