Operating System - HP-UX
1752801 Members
5778 Online
108789 Solutions
New Discussion юеВ

C function that gives the device class depending on the major number of the device file

 
SOLVED
Go to solution
Navecric
Occasional Advisor

C function that gives the device class depending on the major number of the device file

Hi all,

Is there any C function/macro in HPUX that gives us the device file class depending on its major number.

lsdev gives us the major number and its corresponding device class. But, I'm looking for a C function that does the same rather than manipulating lsdev output string in my program.

Can some one please help me on this

Thanks,
Naveen

4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: C function that gives the device class depending on the major number of the device file

Hi Naveen:

Since 'lsdev' can do the heavy-lifting and "understands" driver information, I don't see anything wrong with using a 'popen()' library call to collect the information to parse. Why re-invent a wheel?

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: C function that gives the device class depending on the major number of the device file

Have you looked into any of the 11.31 libIO(3) functions?
Dennis Handly
Acclaimed Contributor
Solution

Re: C function that gives the device class depending on the major number of the device file

>ME: Have you looked into any of the 11.31 libIO(3) functions?

It looks like you were successful, see your previous thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1429017
Navecric
Occasional Advisor

Re: C function that gives the device class depending on the major number of the device file

Hi Dennis,

Sorry missed your reply. Yeah i was able to use libIO APIs to get the information.

Thanks for the suggestion