diff --git a/legacy/ecore/configure.in b/legacy/ecore/configure.in index ddb33ea3eb..07233ae533 100644 --- a/legacy/ecore/configure.in +++ b/legacy/ecore/configure.in @@ -511,7 +511,7 @@ if test "x$have_ecore_file" = "xyes"; then #include #include ], - [ int a = IN_MOVE_SELF; void *f = inotify_init(); ], + [ int a = __NR_inotify_init; int b = IN_IGNORED; ], [ AC_DEFINE(HAVE_INOTIFY, 1, [ File monitoring with Inotify ]) ], [ diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c index c5330a5542..179e500c15 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c @@ -14,13 +14,20 @@ #ifdef HAVE_INOTIFY -# ifdef HAVE_SYS_INOTIFY +#ifdef HAVE_SYS_INOTIFY # include #else # include # include #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)) @@ -281,6 +288,26 @@ _ecore_file_monitor_inotify_monitor(Ecore_File_Monitor *em, const char *path) 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 _ecore_file_monitor_inotify_print(char *file, int mask)