add files
[idlebox.git] / device.h
blob18edcfc99fd7bce9db816d9f1d2c85707b2b1759
1 #ifndef _DEVICE_H
2 #define _DEVICE_H
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <fcntl.h>
7 #include <unistd.h>
8 #include <dirent.h>
10 struct uevent {
11 const char *action;
12 const char *path;
13 const char *subsystem;
14 const char *firmware;
15 int major;
16 int minor;
19 int device_init(void);
20 int open_uevent_socket(void);
21 void coldboot(int event_fd, const char *path);
22 void do_coldboot(int event_fd, DIR *d);
23 void handle_device_fd(int fd);
24 void parse_event(const char *msg, struct uevent *uevent);
25 void handle_device_event(struct uevent *uevent);
26 void make_device(const char *path, int block, int major, int minor);
27 mode_t get_device_perm(const char *path, unsigned *uid, unsigned *gid);
29 #endif