pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Making x11/qt4-libs use kqueue to monitor files on NetBSD



Hi,

Is there any reason not to use kqueue in src/corelib/io/qfilesystemwatcher.cpp 
to monitor files on NetBSD too? Without this patch, QFileSystemWatcher loops, 
once per second, over all files being monitored, resulting in significant CPU 
load when using, e.g., kmail2.

The attached patch enables kqueue on NetBSD. It compiles and appears to run OK 
with KDE (however, I have not verified correct operation with any test case).

Regards,
Sverre

--- src/corelib/io/qfilesystemwatcher.cpp.orig  2012-01-18 21:56:18.000000000 
-0700
+++ src/corelib/io/qfilesystemwatcher.cpp       2012-01-18 10:00:36.000000000 
-0700
@@ -57,7 +57,7 @@
 #elif defined(Q_OS_LINUX)
 #  include "qfilesystemwatcher_inotify_p.h"
 #  include "qfilesystemwatcher_dnotify_p.h"
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) || defined(Q_OS_NETBSD)
 #  if (defined Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_5)
 #  include "qfilesystemwatcher_fsevents_p.h"
 #  endif //MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
@@ -253,7 +253,7 @@ QFileSystemWatcherEngine *QFileSystemWat
     if(!eng)
         eng = QDnotifyFileSystemWatcherEngine::create();
     return eng;
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) || defined(Q_OS_NETBSD)
 #  if 0 && defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_5)
     if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5)
         return QFSEventsFileSystemWatcherEngine::create();

--- src/corelib/io/io.pri.orig  2012-01-18 21:58:20.000000000 -0700
+++ src/corelib/io/io.pri       2012-01-18 13:59:20.000000000 -0700
@@ -103,7 +103,7 @@ win32 {
         }
 
         !nacl {
-            freebsd-*|macx-*|darwin-*|openbsd-*:{
+            freebsd-*|macx-*|darwin-*|openbsd-*|netbsd-*:{
                 SOURCES += io/qfilesystemwatcher_kqueue.cpp
                 HEADERS += io/qfilesystemwatcher_kqueue_p.h
             }



Home | Main Index | Thread Index | Old Index