Using the HP-UX libIO Library

io_hw_compare_ext()
This routine compares two hardware path structures used on HP-UX 11i v3 or later.
If they are equivalent, it returns success. Otherwise, it returns an error. The function
prototype for this routine is:
int io_hw_compare_ext(hw_path_t *path1, hw_path_t *path2);
Examples
Example 1
Get a disk device I/O node from the kernel I/O data structure and:
1. Map the I/O node to its hardware path,
2. Map the hardware path to its I/O node,
3. Validate the two nodes.
Algorithm
1. Initialize the libIO library.
2. Search for a disk device in the kernel data structures from legacy view.
3. Get the hardware path of that node.
4. Convert the hardware path to I/O node.
5. Reconvert the I/O node to hardware path.
6. Validate the two nodes.
7. Terminate the connection.
Solution
#include <sys/libIO.h>
#include <stdio.h>
main()
{
hw_path_t hw_path, hw_path1 ;
io_token_t node, io_token_t h_node;
char path[
MAX_HW_PATH_STR
];
/*initialise libIO operations */
if (io_init(O_RDONLY) != IO_SUCCESS) {
io_error("ERROR:io_init");
exit(1);
}
/* get the node of class "disk" */
if ((node = io_search ((io_token_t)NULL, S_IOTREE, Q_SW,