Search code examples
solarisdevice-driver

How to get the major number from device file


Is there any C system call for getting the major number and minor number from a device file in solaris?


Solution

  • You can use one of the stat family functions. The numbers are in the st_rdev field. Use the major/minor functions defined in sys/mkdev.h to retrieve them.