You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
659 B
30 lines
659 B
#ifndef INOTIFY_H
|
|
#define INOTIFY_H
|
|
|
|
#include <sys/syscall.h>
|
|
#include <asm/unistd.h>
|
|
#include <linux/inotify.h>
|
|
|
|
#define IN_NEXT_EVENT(ev) \
|
|
(struct inotify_event *) \
|
|
((char *)(ev) + sizeof (struct inotify_event) + (ev)->len)
|
|
|
|
#define IN_NO_EVENT(ev) ((ev)->mask|IN_ALL_EVENTS) == IN_ALL_EVENTS
|
|
|
|
|
|
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 /* INOTIFY_H */
|