IV_INOTIFY_INIT, iv_inotify_register, iv_inotify_unregister, IV_INOTIFY_WATCH_INIT,
Contents
Description
The iv_inotify_register function registers an iv_inotify instance with the iv_inotify(3) module. The
inotify parameter is a pointer to the iv_inotify structure to be registered.
The iv_inotify_unregister function unregisters an iv_inotify instance from the iv_inotify(3) module. The
inotify parameter is a pointer to the iv_inotify structure to be unregistered.
The iv_inotify_watch_register function adds a watch to the registered iv_inotify instance specified by
the ->inotify member.
The iv_inotify_watch_unregister function removes a watch from the iv_inotify instance specified by the
->inotify member.
In the iv_inotify_watch structure used in these functions, the ->pathname and ->mask members correspond
to the members of struct inotify_watch as described in inotify(7). ->handler is the event handler called
when this watch triggers. The arguments to this handler function are the pointer stored in the ->cookie
member of the iv_inotify_watch structure and a pointer to an inotify_event structure as described in
inotify(7).
Errors
iv_inotify will return errors returned by inotify_init(3) and inotify_add_watch(3).
Name
IV_INOTIFY_INIT, iv_inotify_register, iv_inotify_unregister, IV_INOTIFY_WATCH_INIT,
iv_inotify_watch_register, iv_inotify_watch_unregister - ivykis inotify(7) wrapper
Return Value
iv_inotify_register and iv_inotify_watch_register return zero on success. On error, -1 is returned, and
errno is set appropriately.
See Also
ivykis(3), inotify(7), inotify_init(3), inotify_add_watch(3), inotify_rm_watch(3) ivykis 2009-02-07 iv_inotify(3)
Synopsis
#include<iv_inotify.h>
struct iv_inotify {
};
voidIV_INOTIFY_INIT(structiv_inotify*inotify);intiv_inotify_register(structiv_inotify*inotify);voidiv_inotify_unregister(structiv_inotify*inotify);
struct iv_inotify_watch {
struct iv_inotify *inotify;
const char *pathname;
uint32_t mask;
void *cookie;
void (*handler)(void *, struct inotify_event *);
};
voidIV_INOTIFY_WATCH_INIT(structiv_inotify_watch*watch);intiv_inotify_watch_register(structiv_inotify_watch*watch);intiv_inotify_watch_unregister(structiv_inotify_watch*watch);