summaryrefslogtreecommitdiff
path: root/src/inotify.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-05-26 09:07:50 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-05-26 10:53:35 -0700
commit4681fbac9061e887e355bf60f87226961db2cb89 (patch)
tree2a5e8d87444503dc77045ac9176ecbbc01cc3f0d /src/inotify.c
parentd02e8ab6d622546bf5bb6b728644ace7a8f5fc2d (diff)
downloademacs-4681fbac9061e887e355bf60f87226961db2cb89.tar.gz
emacs-4681fbac9061e887e355bf60f87226961db2cb89.tar.bz2
emacs-4681fbac9061e887e355bf60f87226961db2cb89.zip
* src/inotify.c: Add FIXME comments.
Diffstat (limited to 'src/inotify.c')
-rw-r--r--src/inotify.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/inotify.c b/src/inotify.c
index d43b959747c..1165293d24c 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -41,21 +41,21 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef IN_ONLYDIR
# define IN_ONLYDIR 0
#endif
+
+/* Events that inotify-add-watch waits for. This list has all the
+ events that any watcher could include, because we want to support
+ multiple watches on the same file even though inotify uses the same
+ descriptor for all watches to that file. This list omits
+ IN_ACCESS, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE, and IN_OPEN because
+ they would prevent other processes from reading; see Bug#26973.
+
+ FIXME: Explain why it is OK to omit these four bits here even
+ though a inotify-add-watch call might specify them. */
+
#define INOTIFY_DEFAULT_MASK \
- (IN_ATTRIB | \
- /* IN_ACCESS | */ \
- /* IN_CLOSE_WRITE | */ \
- /* IN_CLOSE_NOWRITE | */ \
- IN_CREATE | \
- IN_DELETE | \
- IN_DELETE_SELF | \
- IN_IGNORED | \
- IN_MODIFY | \
- IN_MOVE_SELF | \
- IN_MOVED_FROM | \
- IN_MOVED_TO | \
- /* IN_OPEN | */ \
- IN_EXCL_UNLINK)
+ (IN_ATTRIB | IN_CREATE | IN_DELETE | IN_DELETE_SELF \
+ | IN_IGNORED | IN_MODIFY | IN_MOVE_SELF | IN_MOVED_FROM \
+ | IN_MOVED_TO | IN_EXCL_UNLINK)
/* File handle for inotify. */
static int inotifyfd = -1;
@@ -74,6 +74,9 @@ static int inotifyfd = -1;
IN_ONESHOT
IN_ONLYDIR
+ FIXME: Explain why IN_ONLYDIR is in the list, as it seems to be
+ in the same category as IN_DONT_FOLLOW which is allowed.
+
Each element of this list is of the form (DESCRIPTOR . WATCHES)
where no two DESCRIPTOR values are the same. DESCRIPTOR represents
the inotify watch descriptor and WATCHES is a list with elements of
@@ -423,8 +426,8 @@ See inotify(7) and inotify_add_watch(2) for further information. The
inotify fd is managed internally and there is no corresponding
inotify_init. Use `inotify-rm-watch' to remove a watch.
-Also note, that the following inotify bit-masks can not be used, due
-to the fact that descriptors are shared across different callers.
+The following inotify bit-masks cannot be used because descriptors are
+shared across different callers.
IN_EXCL_UNLINK
IN_MASK_ADD