Using the HP-UX libIO Library
== IO_ERROR) {
io_error("ERROR:io_new_to_legacy_hwpath");
exit(1);
} else
printf("\nConversion of HP-UX 11i v3 hardware
path to pre-HP-UX 11i v3 hardware path Sucesses\n");
if(io_legacy_to_new_hwpath(&leg_path , &hw_path1)
== IO_ERROR) {
io_error("ERROR:io_legacy_to_new_hwpath");
exit(1);
} else if (io_hw_compare_ext(&hw_path,&hw_path1)
== IO_SUCCESS) {
printf("\nConversion of pre- HP-UX 11i v3
hardware path to HP-UX 11i v3 hardware path Sucesses \n");
}
}
/*Terminate libIO operation */
io_end();
Output
Conversion of HP-UX 11i v3 hardware path to pre-HP-UX 11i v3
hardware path Success
Conversion of pre-HP-UX 11i v3 hardware path to HP-UX 11i v3
hardware path Success
Example 3
Get the hardware path of a disk device from the agile and legacy views. Compare
these two hardware paths and print “same” if they are the same, or “different” if
they are not.
Algorithm
1. Initialize the libIO library.
2. Search for a disk device in the kernel data structures from legacy view.
3. Search for a disk device in the kernel data structures from agile view.
4. Get the hardware path of these nodes.
5. Compare the hardware paths.
6. Terminate the connection.
Solution
#include <sys/libIO.h>
#include <stdio.h>
main()