Beispiel #1
0
func DeviceFromDevNum(u Udev, t DeviceType, num DevNum) Device {
	return Device{C.udev_device_new_from_devnum(u.ptr, C.char(t), C.dev_t(num))}
}
Beispiel #2
0
// NewDeviceFromDevnum returns a pointer to a new device identified by its Devnum, and nil on error
// deviceType is 'c' for a character device and 'b' for a block device
func (u *Udev) NewDeviceFromDevnum(deviceType uint8, n Devnum) *Device {
	u.lock()
	defer u.unlock()
	return u.newDevice(C.udev_device_new_from_devnum(u.ptr, C.char(deviceType), n.d))
}