aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 43db2e37..1c1f2248 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -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);
+}