summaryrefslogtreecommitdiff
path: root/udev.h
diff options
context:
space:
mode:
Diffstat (limited to 'udev.h')
-rw-r--r--udev.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/udev.h b/udev.h
index 00f1361016..e615b4c8bb 100644
--- a/udev.h
+++ b/udev.h
@@ -24,6 +24,7 @@
#define UDEV_H
#include "libsysfs/libsysfs.h"
+#include <stddef.h>
#include <sys/param.h>
#define COMMENT_CHARACTER '#'
@@ -33,6 +34,9 @@
#define GROUP_SIZE 30
#define MODE_SIZE 8
+/* length of public data */
+#define UDEVICE_LEN (offsetof(struct udevice, bus_id))
+
struct udevice {
char name[NAME_SIZE];
char owner[OWNER_SIZE];
@@ -43,11 +47,11 @@ struct udevice {
unsigned int mode; /* not mode_t due to conflicting definitions in different libcs */
char symlink[NAME_SIZE];
- /* fields that help us in building strings */
- unsigned char bus_id[SYSFS_NAME_LEN];
- unsigned char program_result[NAME_SIZE];
- unsigned char kernel_number[NAME_SIZE];
- unsigned char kernel_name[NAME_SIZE];
+ /* private data that help us in building strings */
+ char bus_id[SYSFS_NAME_LEN];
+ char program_result[NAME_SIZE];
+ char kernel_number[NAME_SIZE];
+ char kernel_name[NAME_SIZE];
};
#define strfieldcpy(to, from) \