[RFC] inotify implementation
Sergey Lapin
slapinid at gmail.com
Tue Jan 16 02:01:40 PST 2007
Hi,
As I understand inotify API first appeared in glibc-2.4.
As it is well known, many ARM machines still use glibc-2.3.5
(probably for good reason), so have no such implementation.
So, in this situation I'm just scratching my head about
how to implement check for inotify existence.
1. Just stupidly check for existence of header sys/inotify.h
and functions in library, use hese in case if it exists,
perform runtime check with inotify_init(), and use it on
success, otherwise on failure.
2. As with 1. alongside with adding configure option for
kernel headers and check there in case there's no API
in libc, create own header with direct API calls like these:
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);
}
(taken from inotail Debian package).
or #define them (same effect but less type checking).
3. As with 2 but never use libc's headers, just use kernel
headers or inotail's approach (#define __NR_... ourselves).
Also, should we fall back to dnotyfy in case intoify is
not found?
Any thoughts?
S.
More information about the hal
mailing list