4 * Constructs to create and pick apart dev_t. This applies to the Linux 2.6
8 #ifndef _SYS_SYSMACROS_H
9 #define _SYS_SYSMACROS_H
12 # include <sys/types.h>
15 static __inline__ int major(dev_t __d)
17 return (__d >> 8) & 0xfff;
20 static __inline__ int minor(dev_t __d)
22 return (__d & 0xff) | ((__d >> 12) & 0xfff00);
25 static __inline__ dev_t makedev(int __ma, int __mi)
27 return ((__ma & 0xfff) << 8) | (__mi & 0xff) | ((__mi & 0xfff00) << 12);
30 #endif /* _SYS_SYSMACROS_H */