Index: clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp =================================================================== --- clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp +++ clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp @@ -319,6 +319,8 @@ } // namespace +#include + std::unique_ptr clang::DirectoryWatcher::create( StringRef Path, std::function, bool)> Receiver, @@ -332,8 +334,12 @@ const int InotifyWD = inotify_add_watch( InotifyFD, Path.str().c_str(), - IN_CREATE | IN_DELETE | IN_DELETE_SELF | IN_EXCL_UNLINK | IN_MODIFY | - IN_MOVED_FROM | IN_MOVE_SELF | IN_MOVED_TO | IN_ONLYDIR | IN_IGNORED); + IN_CREATE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | + IN_MOVED_FROM | IN_MOVE_SELF | IN_MOVED_TO | IN_ONLYDIR | IN_IGNORED +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) + | IN_EXCL_UNLINK +#endif + ); if (InotifyWD == -1) return nullptr;