diff options
| author | Paul Eggert | 2017-05-26 09:07:50 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-05-26 10:53:35 -0700 |
| commit | 4681fbac9061e887e355bf60f87226961db2cb89 (patch) | |
| tree | 2a5e8d87444503dc77045ac9176ecbbc01cc3f0d /src | |
| parent | d02e8ab6d622546bf5bb6b728644ace7a8f5fc2d (diff) | |
| download | emacs-4681fbac9061e887e355bf60f87226961db2cb89.tar.gz emacs-4681fbac9061e887e355bf60f87226961db2cb89.zip | |
* src/inotify.c: Add FIXME comments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/inotify.c | 35 |
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/>. */ | |||
| 41 | #ifndef IN_ONLYDIR | 41 | #ifndef IN_ONLYDIR |
| 42 | # define IN_ONLYDIR 0 | 42 | # define IN_ONLYDIR 0 |
| 43 | #endif | 43 | #endif |
| 44 | |||
| 45 | /* Events that inotify-add-watch waits for. This list has all the | ||
| 46 | events that any watcher could include, because we want to support | ||
| 47 | multiple watches on the same file even though inotify uses the same | ||
| 48 | descriptor for all watches to that file. This list omits | ||
| 49 | IN_ACCESS, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE, and IN_OPEN because | ||
| 50 | they would prevent other processes from reading; see Bug#26973. | ||
| 51 | |||
| 52 | FIXME: Explain why it is OK to omit these four bits here even | ||
| 53 | though a inotify-add-watch call might specify them. */ | ||
| 54 | |||
| 44 | #define INOTIFY_DEFAULT_MASK \ | 55 | #define INOTIFY_DEFAULT_MASK \ |
| 45 | (IN_ATTRIB | \ | 56 | (IN_ATTRIB | IN_CREATE | IN_DELETE | IN_DELETE_SELF \ |
| 46 | /* IN_ACCESS | */ \ | 57 | | IN_IGNORED | IN_MODIFY | IN_MOVE_SELF | IN_MOVED_FROM \ |
| 47 | /* IN_CLOSE_WRITE | */ \ | 58 | | IN_MOVED_TO | IN_EXCL_UNLINK) |
| 48 | /* IN_CLOSE_NOWRITE | */ \ | ||
| 49 | IN_CREATE | \ | ||
| 50 | IN_DELETE | \ | ||
| 51 | IN_DELETE_SELF | \ | ||
| 52 | IN_IGNORED | \ | ||
| 53 | IN_MODIFY | \ | ||
| 54 | IN_MOVE_SELF | \ | ||
| 55 | IN_MOVED_FROM | \ | ||
| 56 | IN_MOVED_TO | \ | ||
| 57 | /* IN_OPEN | */ \ | ||
| 58 | IN_EXCL_UNLINK) | ||
| 59 | 59 | ||
| 60 | /* File handle for inotify. */ | 60 | /* File handle for inotify. */ |
| 61 | static int inotifyfd = -1; | 61 | static int inotifyfd = -1; |
| @@ -74,6 +74,9 @@ static int inotifyfd = -1; | |||
| 74 | IN_ONESHOT | 74 | IN_ONESHOT |
| 75 | IN_ONLYDIR | 75 | IN_ONLYDIR |
| 76 | 76 | ||
| 77 | FIXME: Explain why IN_ONLYDIR is in the list, as it seems to be | ||
| 78 | in the same category as IN_DONT_FOLLOW which is allowed. | ||
| 79 | |||
| 77 | Each element of this list is of the form (DESCRIPTOR . WATCHES) | 80 | Each element of this list is of the form (DESCRIPTOR . WATCHES) |
| 78 | where no two DESCRIPTOR values are the same. DESCRIPTOR represents | 81 | where no two DESCRIPTOR values are the same. DESCRIPTOR represents |
| 79 | the inotify watch descriptor and WATCHES is a list with elements of | 82 | 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 | |||
| 423 | inotify fd is managed internally and there is no corresponding | 426 | inotify fd is managed internally and there is no corresponding |
| 424 | inotify_init. Use `inotify-rm-watch' to remove a watch. | 427 | inotify_init. Use `inotify-rm-watch' to remove a watch. |
| 425 | 428 | ||
| 426 | Also note, that the following inotify bit-masks can not be used, due | 429 | The following inotify bit-masks cannot be used because descriptors are |
| 427 | to the fact that descriptors are shared across different callers. | 430 | shared across different callers. |
| 428 | 431 | ||
| 429 | IN_EXCL_UNLINK | 432 | IN_EXCL_UNLINK |
| 430 | IN_MASK_ADD | 433 | IN_MASK_ADD |