X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev.h;h=d6dbd7c3325dcd00dbd47562fd22eeac52b47a3f;hb=b821330f0fce374902a1c8e32064196276006bca;hp=80eafb0d46a25e7318b67f38fe0529c50ad789a6;hpb=9f8dfa19cfd2b502bf794f39a421cbb7c4cc0404;p=elogind.git diff --git a/udev.h b/udev.h index 80eafb0d4..d6dbd7c33 100644 --- a/udev.h +++ b/udev.h @@ -23,8 +23,10 @@ #ifndef _UDEV_H_ #define _UDEV_H_ +#include #include #include "libsysfs/sysfs/libsysfs.h" +#include "list.h" #define ALARM_TIMEOUT 120 #define COMMENT_CHARACTER '#' @@ -45,6 +47,16 @@ #define HOTPLUGD_DIR "/etc/hotplug.d" #define HOTPLUG_SUFFIX ".hotplug" +#define DEFAULT_PARTITIONS_COUNT 15 + +enum device_type { + UNKNOWN, + CLASS, + BLOCK, + NET, + PHYSDEV, +}; + struct udevice { char devpath[DEVPATH_SIZE]; char subsystem[SUBSYSTEM_SIZE]; @@ -55,10 +67,10 @@ struct udevice { char group[USER_SIZE]; mode_t mode; char type; - int major; - int minor; + dev_t devt; char devname[NAME_SIZE]; + char tmp_node[NAME_SIZE]; int partitions; int ignore_remove; int config_line; @@ -75,15 +87,13 @@ extern int udev_remove_device(struct udevice *udev); extern void udev_init_config(void); extern int udev_start(void); extern void udev_multiplex_directory(struct udevice *udev, const char *basedir, const char *suffix); +extern int udev_make_node(struct udevice *udev, const char *file, dev_t devt, mode_t mode, uid_t uid, gid_t gid); extern char sysfs_path[SYSFS_PATH_MAX]; extern char udev_root[PATH_MAX]; extern char udev_db_path[PATH_MAX+NAME_MAX]; extern char udev_config_filename[PATH_MAX+NAME_MAX]; extern char udev_rules_filename[PATH_MAX+NAME_MAX]; -extern mode_t default_mode; -extern char default_owner[USER_SIZE]; -extern char default_group[USER_SIZE]; extern int udev_log; extern int udev_dev_d; extern int udev_hotplug_d;