blob: 885b6e5dd9363d5a746b6753bee90e394d81bfbd [file] [log] [blame]
// +build linux freebsd
package devices
This code provides support for manipulating linux device numbers. It should be replaced by normal syscall functions once is solved.
You can read what they are here:
Note! These are NOT the same as the MAJOR(dev_t device);, MINOR(dev_t device); and MKDEV(int major, int minor); functions as defined in <linux/kdev_t.h> as the representation of device numbers used by go is different than the one used internally to the kernel! -
func Major(devNumber int) int64 {
return int64((devNumber >> 8) & 0xfff)
func Minor(devNumber int) int64 {
return int64((devNumber & 0xff) | ((devNumber >> 12) & 0xfff00))