forked from enlightenment/efl
Fix for systems which do not have inotify support in glibc.
SVN revision: 29340
This commit is contained in:
parent
943b05a5d9
commit
bddb9be5cf
|
@ -511,7 +511,7 @@ if test "x$have_ecore_file" = "xyes"; then
|
||||||
#include <asm/unistd.h>
|
#include <asm/unistd.h>
|
||||||
#include <linux/inotify.h>
|
#include <linux/inotify.h>
|
||||||
],
|
],
|
||||||
[ 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 ])
|
AC_DEFINE(HAVE_INOTIFY, 1, [ File monitoring with Inotify ])
|
||||||
], [
|
], [
|
||||||
|
|
|
@ -14,13 +14,20 @@
|
||||||
|
|
||||||
#ifdef HAVE_INOTIFY
|
#ifdef HAVE_INOTIFY
|
||||||
|
|
||||||
# ifdef HAVE_SYS_INOTIFY
|
#ifdef HAVE_SYS_INOTIFY
|
||||||
# include <sys/inotify.h>
|
# include <sys/inotify.h>
|
||||||
#else
|
#else
|
||||||
# include <asm/unistd.h>
|
# include <asm/unistd.h>
|
||||||
# include <linux/inotify.h>
|
# include <linux/inotify.h>
|
||||||
#endif
|
#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;
|
typedef struct _Ecore_File_Monitor_Inotify Ecore_File_Monitor_Inotify;
|
||||||
|
|
||||||
#define ECORE_FILE_MONITOR_INOTIFY(x) ((Ecore_File_Monitor_Inotify *)(x))
|
#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;
|
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
|
#if 0
|
||||||
static void
|
static void
|
||||||
_ecore_file_monitor_inotify_print(char *file, int mask)
|
_ecore_file_monitor_inotify_print(char *file, int mask)
|
||||||
|
|
Loading…
Reference in New Issue