Using the HP-UX libIO Library
"class","disk",NULL)) == (io_token_t)NULL){
io_error("ERROR:io_search:class:disk");
exit(1);
}
/* get the hw_path from the I/O node */
if (io_node_to_hw_path (node, &hw_path) == IO_ERROR) {
io_error("ERROR:io_node_to_hw_path");
exit(1);
}
/*get the hw_path in string format of driver */
if ((io_hw_path_to_str (path, &hw_path)) == IO_ERROR) {
io_error("ERROR:io_hw_path_to_str");
exit(1);
}
/* get the node of driver */
if ((h_node = io_hw_path_to_node (&hw_path))
== (io_token_t)NULL) {
io_error("ERROR:io_hw_path_to_node");
exit(1);
}
if (h_node==node)
printf("\nMapping of node to hardware path succeeded
\n");
/*end of libIO operation */
io_end();
}
Output
Mapping of node to hardware path succeeded
Example 2
Get an I/O node of class “ext_bus” from the agile kernel I/O data structure and:
1. Find the corresponding hardware path of this node,
2. Convert it to pre-HP-UX 11i v3 hardware path data structure,
3. Convert the pre-HP-UX 11i v3 hardware path to the HP-UX 11i v3 hardware
path data structure.
Algorithm
1. Initialize the libIO library.
2. Search for class “ext_bus” node in the kernel data structures from agile view.
3. Get the hardware path of that node.
4. Check the hardware path if legacy or agile.