[RFC] inotify implementation
Dan Nicholson
dbn.lists at gmail.com
Tue Jan 16 13:06:02 PST 2007
On 1/16/07, Sergey Lapin <slapinid at gmail.com> wrote:
>
> 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).
In the Linuxfromscratch project, we simply installed the above
(roughly) as sys/inotify.h with glibc-2.3.6 and patched our older
kernel headers to include linux/inotify.h and add the necessary
syscalls. Everything has been working fine for me, and I have a few
programs using inotify such as gamin, gnome-vfs and dovecot. Here's
the exact patch we used for sys/inotify.h (you have to install it
yourself):
http://www.linuxfromscratch.org/patches/lfs/6.2/glibc-2.3.6-inotify-1.patch
--
Dan
More information about the hal
mailing list