return devpath;
}
+char *get_devnode(void)
+{
+ char *devnode;
+
+ devnode = getenv("DEVNODE");
+ if (devnode != NULL && strlen(devnode) > NAME_SIZE)
+ devnode[NAME_SIZE-1] = '\0';
+
+ return devnode;
+}
+
char *get_seqnum(void)
{
char *seqnum;
return subsystem;
}
+char get_device_type(const char *path, const char *subsystem)
+{
+ if (strcmp(subsystem, "block") == 0 ||
+ strstr(path, "/block/") != NULL)
+ return 'b';
+
+ if (strcmp(subsystem, "net") == 0 ||
+ strstr(path, "/class/net/") != NULL)
+ return 'n';
+
+ if (strstr(path, "/class/") != NULL)
+ return 'c';
+
+ return '\0';
+}
+
int file_map(const char *filename, char **buf, size_t *bufsize)
{
struct stat stats;