- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to get hardware configuration info from in...
Operating System - HP-UX
1820553
Members
3851
Online
109626
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2001 08:52 AM
тАО09-19-2001 08:52 AM
How to get hardware configuration info from inside a C program?
Hi,
I need to get info about the hardware configuration (just like the data returned from ioscan )from inside a C/C++ program.I can't use system commands from inside the program as it can cause blocking issues. I think that there are two ways to get this infomation, one using some ioctl() call on the device drivers in /dev and other reading the data directly from some kernel table (called iotree i guess), but I can't find any documentation about this at all.
Does anyone know how I can get this info? Any info or ideas on this would be much appreciated.
Thanks,
Andr?
I need to get info about the hardware configuration (just like the data returned from ioscan )from inside a C/C++ program.I can't use system commands from inside the program as it can cause blocking issues. I think that there are two ways to get this infomation, one using some ioctl() call on the device drivers in /dev and other reading the data directly from some kernel table (called iotree i guess), but I can't find any documentation about this at all.
Does anyone know how I can get this info? Any info or ideas on this would be much appreciated.
Thanks,
Andr?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2001 02:04 PM
тАО09-19-2001 02:04 PM
Re: How to get hardware configuration info from inside a C program?
Hi Andre:
Rather than doing ioctls for all of the various devices and thus having to branch on each major device, I suggest that you indeed do an ioscan from within a pipe but include an alarm signal handler using setjmp and longjump to jump out out the ioscan call. You can also get some pretty good ideas if you look at /usr/sam/lib/ioparser.sh. I attached a sample piece of code that includes the setjmp stuff. I already had a standard function that was very close.
Clay
Rather than doing ioctls for all of the various devices and thus having to branch on each major device, I suggest that you indeed do an ioscan from within a pipe but include an alarm signal handler using setjmp and longjump to jump out out the ioscan call. You can also get some pretty good ideas if you look at /usr/sam/lib/ioparser.sh. I attached a sample piece of code that includes the setjmp stuff. I already had a standard function that was very close.
Clay
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2001 02:05 PM
тАО09-19-2001 02:05 PM
Re: How to get hardware configuration info from inside a C program?
Hi Andre:
Rather than doing ioctls for all of the various devices and thus having to branch on each major device, I suggest that you indeed do an ioscan from within a pipe but include an alarm signal handler using setjmp and longjump to jump out out the ioscan call. You can also get some pretty good ideas if you look at /usr/sam/lib/ioparser.sh. I attached a sample piece of code that includes the setjmp stuff. I already had a standard function that was very close.
Clay
Rather than doing ioctls for all of the various devices and thus having to branch on each major device, I suggest that you indeed do an ioscan from within a pipe but include an alarm signal handler using setjmp and longjump to jump out out the ioscan call. You can also get some pretty good ideas if you look at /usr/sam/lib/ioparser.sh. I attached a sample piece of code that includes the setjmp stuff. I already had a standard function that was very close.
Clay
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP