server: Use sys/inotify.h if it exists instead of hardcoding the system calls.
diff --git a/configure b/configure
index a6b0a60..0af4b6b 100755
--- a/configure
+++ b/configure
Binary files differ
diff --git a/configure.ac b/configure.ac
index 60bd78e..c696cb2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -347,6 +347,7 @@
 	sys/event.h \
 	sys/exec_elf.h \
 	sys/filio.h \
+	sys/inotify.h \
 	sys/ioctl.h \
 	sys/ipc.h \
 	sys/limits.h \
diff --git a/include/config.h.in b/include/config.h.in
index b2642c9..e12aa1a 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -828,6 +828,9 @@
 /* Define to 1 if you have the <sys/filio.h> header file. */
 #undef HAVE_SYS_FILIO_H
 
+/* Define to 1 if you have the <sys/inotify.h> header file. */
+#undef HAVE_SYS_INOTIFY_H
+
 /* Define to 1 if you have the <sys/ioctl.h> header file. */
 #undef HAVE_SYS_IOCTL_H
 
diff --git a/server/change.c b/server/change.c
index 63985f4..773fa1c 100644
--- a/server/change.c
+++ b/server/change.c
@@ -65,7 +65,10 @@
 
 /* inotify support */
 
-#if defined(__linux__) && defined(__i386__)
+#ifdef HAVE_SYS_INOTIFY_H
+#include <sys/inotify.h>
+#define USE_INOTIFY
+#elif defined(__linux__) && defined(__i386__)
 
 #define SYS_inotify_init	291
 #define SYS_inotify_add_watch	292
@@ -114,7 +117,7 @@
     return ret;
 }
 
-static inline int inotify_remove_watch( int fd, int wd )
+static inline int inotify_rm_watch( int fd, int wd )
 {
     int ret;
     __asm__ __volatile__( "pushl %%ebx;\n\t"
@@ -568,7 +571,7 @@
 
     if (inode->wd != -1)
     {
-        inotify_remove_watch( get_unix_fd( inotify_fd ), inode->wd );
+        inotify_rm_watch( get_unix_fd( inotify_fd ), inode->wd );
         list_remove( &inode->wd_entry );
     }
     list_remove( &inode->ino_entry );