Gets the device number or channel number for a device.
#include <sys/types.h> #include <sys/errno.h> #include <sys/file.h> int fp_getdevno ( fp, devp, chanp) struct file *fp; dev_t *devp; chan_t *chanp;
Item | Description |
---|---|
fp | Points to a file structure returned by the fp_open or fp_opendev service. |
devp | Points to a location where the device number is to be returned. |
chanp | Points to a location where the channel number is to be returned. |
The fp_getdevno service finds the device number and channel number for an open device that is associated with the file pointer specified by the fp parameter. If the value of either devp or chanp parameter is null, this service does not attempt to return any value for the argument.
The fp_getdevno kernel service can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates a successful operation. |
EINVAL | Indicates that the pointer specified by the fp parameter does not point to a file structure for an open device. |