skeleton C library for calling kqueue

This commit is contained in:
Joey Hess 2012-06-18 12:25:20 -04:00
parent 0ecc7dc892
commit 3c8a9043b6
6 changed files with 75 additions and 11 deletions

View file

@ -33,12 +33,15 @@ import qualified Data.ByteString.Lazy as L
import Utility.Inotify
import System.INotify
#endif
#ifdef WITH_KQUEUE
import Utility.Kqueue
#endif
type Handler = FilePath -> Maybe FileStatus -> DaemonStatusHandle -> Annex (Maybe Change)
checkCanWatch :: Annex ()
checkCanWatch = do
#ifdef WITH_INOTIFY
#if (WITH_INOTIFY || WITH_KQUEUE)
unlessM (liftIO (inPath "lsof") <||> Annex.getState Annex.force) $
needLsof
#else
@ -82,8 +85,13 @@ watchThread st dstatus changechan = withINotify $ \i -> do
, errHook = hook onErr
}
#else
#ifdef WITH_KQUEUE
watchThread st dstatus changechan = do
print =<< waitChange [stdError, stdOutput]
#else
watchThread = undefined
#endif
#endif /* WITH_KQUEUE */
#endif /* WITH_INOTIFY */
ignored :: FilePath -> Bool
ignored ".git" = True