Rudiments
|
Inherits file.
Public Member Functions | |
device () | |
device (const device &d) | |
device & | operator= (const device &d) |
virtual | ~device () |
Static Public Member Functions | |
static bool | createDeviceNode (const char *filename, bool blockdevice, uint16_t major, uint16_t minor, mode_t perms) |
The device class provides methods for interacting with devices.
It is different from the file class only in that it provides a method to create a device node and that by default, the device class does not query the device for parameters (such as size) when it is opened but the file class does. Querying a device node for parameters can have unexpected effects.
device::device | ( | ) |
Creates an instance of the device class.
device::device | ( | const device & | d | ) |
Creates an instance of the device class that is a copy of "d".
virtual device::~device | ( | ) | [virtual] |
Deletes this instance of the device class.
static bool device::createDeviceNode | ( | const char * | filename, |
bool | blockdevice, | ||
uint16_t | major, | ||
uint16_t | minor, | ||
mode_t | perms | ||
) | [static] |
Creates device node "filename" with major number "major" and minor number "minor". The device node will be created as a block device if "blockdevice" is true, otherwise it will be created as a character device. The device node will be assigned permissions "perms". Returns true on success and false on failure.