From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.devel Subject: Re: kqueue in Emacs 25.1? Date: Sat, 07 Nov 2015 15:52:33 +0100 Message-ID: <85pozlj1wp.fsf@iznogoud.viz> References: <56259FDD.8040401@dancol.org> <87zizeme8k.fsf@tromey.com> <5625B166.3080104@dancol.org> <86zizdczhp.fsf@stephe-leake.org> <871tc315y3.fsf@lifelogs.com> <83k2pvqg0l.fsf@gnu.org> <87io5ddh7c.fsf_-_@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1446908088 25214 80.91.229.3 (7 Nov 2015 14:54:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Nov 2015 14:54:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 07 15:54:39 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zv4t4-0000DF-9l for ged-emacs-devel@m.gmane.org; Sat, 07 Nov 2015 15:54:38 +0100 Original-Received: from localhost ([::1]:44145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zv4t3-0005yz-IR for ged-emacs-devel@m.gmane.org; Sat, 07 Nov 2015 09:54:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zv4so-0005yu-Ns for emacs-devel@gnu.org; Sat, 07 Nov 2015 09:54:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zv4sl-0007mz-Gy for emacs-devel@gnu.org; Sat, 07 Nov 2015 09:54:22 -0500 Original-Received: from b2bfep16.mx.upcmail.net ([62.179.121.61]:42304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zv4sl-0007mt-6u for emacs-devel@gnu.org; Sat, 07 Nov 2015 09:54:19 -0500 Original-Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep16.mx.upcmail.net (InterMail vM.8.01.05.18 201-2260-151-151-20140610) with ESMTP id <20151107145415.IACA9629.b2bfep16-int.chello.at@edge11.upcmail.net> for ; Sat, 7 Nov 2015 15:54:15 +0100 Original-Received: from iznogoud.viz ([91.119.133.190]) by edge11.upcmail.net with edge id eeuF1r00F46eDrP0BeuFVh; Sat, 07 Nov 2015 15:54:15 +0100 X-SourceIP: 91.119.133.190 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1Zv4sg-0000Nu-Uh; Sat, 07 Nov 2015 15:54:14 +0100 Mail-Followup-To: Michael Albinus , emacs-devel@gnu.org User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (berkeley-unix) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 62.179.121.61 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:193540 Archived-At: On Sat, Nov 07 2015, Michael Albinus wrote: > The topic itself has been discussed a while ago: shall kqueue support be > added to the file notification backends? I'd say it depends on how you implement it: if you are trying to emulate the inotify API it might be better to just link with libinotify-kqueue https://github.com/dmatveev/libinotify-kqueue On the other hand, if you are writing "native" support for kqueue, that would be awesome :-) As for emacs with libinotify-kqueue, I've tried this on FreeBSD 10-STABLE (before your recent changes to the notify stuff, though) and it seems to work well when watching small directories, but emacs somehow locks up for directories with more than 1500 files or so (while using, say, inotifywait from inotify-tools seems to work without problems for larger directories). Here's the trivial patch for libinotify support, by the way: -- >8 -- Subject: [PATCH] Tentative libinotify support. --- configure.ac | 13 +++++++++---- src/Makefile.in | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 83d45a9..4216821 100644 --- a/configure.ac +++ b/configure.ac @@ -2696,19 +2696,24 @@ case $with_file_notification,$opsys in fi ;; esac -dnl inotify is available only on GNU/Linux. +dnl inotify is available on GNU/Linux, and on *BSD via libinotify. case $with_file_notification,$NOTIFY_OBJ in inotify, | yes,) AC_CHECK_HEADER(sys/inotify.h) if test "$ac_cv_header_sys_inotify_h" = yes ; then - AC_CHECK_FUNC(inotify_init1) - if test "$ac_cv_func_inotify_init1" = yes; then + AC_SEARCH_LIBS(inotify_init1, inotify) + if test "$ac_cv_search_inotify_init1" != no; then AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.]) NOTIFY_OBJ=inotify.o - NOTIFY_SUMMARY="yes -lglibc (inotify)" + LIB_INOTIFY= + if test "$ac_cv_search_inotify_init1" != "none required"; then + LIB_INOTIFY="$ac_cv_search_inotify_init1" + fi + NOTIFY_SUMMARY="yes $LIB_INOTIFY (inotify)" fi fi ;; esac +AC_SUBST(LIB_INOTIFY) dnl g_file_monitor exists since glib 2.18. G_FILE_MONITOR_EVENT_MOVED dnl has been added in glib 2.24. It has been tested under diff --git a/src/Makefile.in b/src/Makefile.in index 9c0a3bb..bb9c003 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -153,6 +153,8 @@ DBUS_OBJ = @DBUS_OBJ@ LIB_EXECINFO=@LIB_EXECINFO@ +LIB_INOTIFY=@LIB_INOTIFY@ + SETTINGS_CFLAGS = @SETTINGS_CFLAGS@ SETTINGS_LIBS = @SETTINGS_LIBS@ @@ -468,7 +470,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) \ - $(GFILENOTIFY_LIBS) $(LIB_MATH) $(LIBZ) + $(GFILENOTIFY_LIBS) $(LIB_INOTIFY) $(LIB_MATH) $(LIBZ) $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT) $(MAKE) -C ../leim leim-list.el EMACS="$(bootstrap_exe)" -- 2.6.2