diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 15 | ||||
-rw-r--r-- | lib/lib.h | 3 |
2 files changed, 18 insertions, 0 deletions
@@ -1043,3 +1043,18 @@ char *strnstr(char *line, char *str) return *s ? s : 0; } + +int dev_minor(int dev) +{ + return ((dev&0xfff00000)>>12)|(dev&0xff); +} + +int dev_major(int dev) +{ + return (dev&0xfff00)>>8; +} + +int dev_makedev(int major, int minor) +{ + return (minor&0xff)|((major&0xfff)<<8)|((minor&0xfff00)<<12); +} @@ -200,6 +200,9 @@ void create_uuid(char *uuid); char *show_uuid(char *uuid); char *next_printf(char *s, char **start); char *strnstr(char *line, char *str); +int dev_minor(int dev); +int dev_major(int dev); +int dev_makedev(int major, int minor); #define HR_SPACE 1 // Space between number and units #define HR_B 2 // Use "B" for single byte units |