diff options
Diffstat (limited to 'lib/lib.c')
-rw-r--r-- | lib/lib.c | 15 |
1 files changed, 15 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); +} |