summaryrefslogtreecommitdiff
path: root/udev/udev.h
diff options
context:
space:
mode:
authorScott James Remnant <scott@ubuntu.com>2009-02-11 17:38:56 +0000
committerScott James Remnant <scott@ubuntu.com>2009-02-11 17:38:56 +0000
commitbd284db142c1d3fb6e2a709678c8828c12c52466 (patch)
tree955c71b48e38c2bcc99a8a422b0b7c8548ea9501 /udev/udev.h
parent10b2d011e70ddf9361c61f6147dc88f670d28abd (diff)
udevd: optionally watch device nodes with inotify
This allows you to re-process the rules if the content of the device has been changed, most useful for block subsystem to cause vol_id to be run again.
Diffstat (limited to 'udev/udev.h')
-rw-r--r--udev/udev.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/udev/udev.h b/udev/udev.h
index d1b207196e..57e2d73c2e 100644
--- a/udev/udev.h
+++ b/udev/udev.h
@@ -75,9 +75,16 @@ struct udev_event {
unsigned int devlink_final:1;
unsigned int run_final:1;
unsigned int ignore_device:1;
+ unsigned int inotify_watch:1;
unsigned int trace:1;
};
+struct udev_watch {
+ struct udev_list_node node;
+ int handle;
+ char *name;
+};
+
/* udev-rules.c */
struct udev_rules;
extern struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names);
@@ -93,6 +100,15 @@ extern void udev_event_apply_format(struct udev_event *event, char *string, size
extern int udev_event_apply_subsys_kernel(struct udev_event *event, const char *string,
char *result, size_t maxsize, int read_value);
+/* udev-watch.c */
+extern int inotify_fd;
+extern void udev_watch_init(struct udev *udev);
+extern void udev_watch_restore(struct udev *udev);
+extern void udev_watch_begin(struct udev *udev, struct udev_device *dev);
+extern void udev_watch_clear(struct udev *udev, struct udev_device *dev);
+extern void udev_watch_end(struct udev *udev, int wd);
+extern const char *udev_watch_lookup(struct udev *udev, int wd);
+
/* udev-node.c */
extern int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mode_t mode, uid_t uid, gid_t gid);
extern int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid);