dev_to_devname - determine the device name for the device
char* dev_to_devname (dev_t dev, char *buf, int *length);
dev_to_devname is useful to determine the canonical hardware graph path
name given the device identifier.
The dev_to_devname function provides a way to retrieve the path name for
Dev identifies the device, buf is the placeholder for the device name and
length is an input/output argument that on the call to dev_to_devname
should contain the maximum size of the name the process is willing to
accept. On return, the integer that the length argument points to will
have been modified to show the actual size of the device name returned.
dev_to_devname will fail if one or more of the following are true:
The device name is too large to fit into the buffer. The integer
that the length argument points to has been modified to show the
actual number of bytes that would be required to store the value of
The device does not exist.
The effective user ID does not match the owner of the file and the
effective user ID is not super-user.
Buf, or length points outside the allocated address space of the
Upon successful completion, the name is returned. Otherwise, a value of
NULL is returned and errno is set to indicate the error.
PPPPaaaaggggeeee 1111 [ Back ]