Add the appropriate inline functions for dev_t manipulation

diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
new file mode 100644
index 0000000..7f1e082
--- /dev/null
+++ b/include/sys/sysmacros.h
@@ -0,0 +1,31 @@
+/*
+ * sys/sysmacros.h
+ *
+ * Constructs to create and pick apart dev_t.  This applies to the Linux 2.6
+ * 32-bit dev_t format.
+ */
+
+#ifndef _SYS_SYSMACROS_H
+#define _SYS_SYSMACROS_H
+
+#ifndef _SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+static __inline__ int major(dev_t __d)
+{
+  return (__d >> 8) & 0xfff;
+}
+
+static __inline__ int minor(dev_t __d)
+{
+  return (__d & 0xff) | ((__d >> 12) & 0xfff00);
+}
+
+static __inline__ dev_t makedev(int __ma, int __mi)
+{
+  return ((__ma & 0xfff) << 8) | (__mi & 0xff) | ((__mi & 0xfff00) << 12);
+}
+
+#endif /* _SYS_SYSMACROS_H */
+
diff --git a/include/sys/types.h b/include/sys/types.h
index 88523da..0aaeeb1 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -117,4 +117,9 @@
 	char			f_fpack[6];
 };
 
+/*
+ * Some apps want this in <sys/types.h>
+ */
+#include <sys/sysmacros.h>
+
 #endif
diff --git a/klibc/include/sys/sysmacros.h b/klibc/include/sys/sysmacros.h
new file mode 100644
index 0000000..7f1e082
--- /dev/null
+++ b/klibc/include/sys/sysmacros.h
@@ -0,0 +1,31 @@
+/*
+ * sys/sysmacros.h
+ *
+ * Constructs to create and pick apart dev_t.  This applies to the Linux 2.6
+ * 32-bit dev_t format.
+ */
+
+#ifndef _SYS_SYSMACROS_H
+#define _SYS_SYSMACROS_H
+
+#ifndef _SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+static __inline__ int major(dev_t __d)
+{
+  return (__d >> 8) & 0xfff;
+}
+
+static __inline__ int minor(dev_t __d)
+{
+  return (__d & 0xff) | ((__d >> 12) & 0xfff00);
+}
+
+static __inline__ dev_t makedev(int __ma, int __mi)
+{
+  return ((__ma & 0xfff) << 8) | (__mi & 0xff) | ((__mi & 0xfff00) << 12);
+}
+
+#endif /* _SYS_SYSMACROS_H */
+
diff --git a/klibc/include/sys/types.h b/klibc/include/sys/types.h
index 88523da..0aaeeb1 100644
--- a/klibc/include/sys/types.h
+++ b/klibc/include/sys/types.h
@@ -117,4 +117,9 @@
 	char			f_fpack[6];
 };
 
+/*
+ * Some apps want this in <sys/types.h>
+ */
+#include <sys/sysmacros.h>
+
 #endif