Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_file


Modified Files:
        ecore_file_monitor_inotify.c 


Log Message:
Fix for systems which do not have inotify support in glibc.

===================================================================
RCS file: 
/cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ecore_file_monitor_inotify.c        30 Mar 2007 12:24:19 -0000      1.18
+++ ecore_file_monitor_inotify.c        4 Apr 2007 11:10:44 -0000       1.19
@@ -14,13 +14,20 @@
 
 #ifdef HAVE_INOTIFY
 
-# ifdef HAVE_SYS_INOTIFY
+#ifdef HAVE_SYS_INOTIFY
 # include <sys/inotify.h>
 #else
 # include <asm/unistd.h>
 # include <linux/inotify.h>
 #endif
 
+#ifndef HAVE_SYS_INOTIFY
+static inline int inotify_init(void);
+static inline int inotify_add_watch(int fd, const char *name, __u32 mask);
+static inline int inotify_rm_watch(int fd, __u32 wd);
+#endif
+
+
 typedef struct _Ecore_File_Monitor_Inotify Ecore_File_Monitor_Inotify;
 
 #define ECORE_FILE_MONITOR_INOTIFY(x) ((Ecore_File_Monitor_Inotify *)(x))
@@ -280,6 +287,26 @@
      }
    return 1;
 }
+
+#ifndef HAVE_SYS_INOTIFY
+static inline int
+inotify_init(void)
+{
+   return syscall(__NR_inotify_init);
+}
+
+static inline int
+inotify_add_watch(int fd, const char *name, __u32 mask)
+{
+   return syscall(__NR_inotify_add_watch, fd, name, mask);
+}
+
+static inline int
+inotify_rm_watch(int fd, __u32 wd)
+{
+   return syscall(__NR_inotify_rm_watch, fd, wd);
+}
+#endif
 
 #if 0
 static void



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to