Using the HP-UX libIO Library
io_error ("ERROR:io_query");
exit (1);
}
if (io_hw_path_to_str(my_string, &hw_path)
== IO_ERROR) {
io_error("io_hw_path_to_str");
exit(1);
}
printf("%s is from LEGACY view\n ",my_string);
exit(0);
}
if (ret==IO_TOKEN_NEW) {
if (io_query (node, S_IOTREE, "hw_path", &hw_path)
==IO_ERROR ){
io_error("ERROR:io_query");
exit(1);
}
if (io_hw_path_to_str(my_string, &hw_path)
== IO_ERROR){
io_error("io_hw_path_to_str");
exit(1);
}
printf(" %s is from AGILE view ",my_string);
exit(0);
}
if (ret==IO_ERROR) {
io_error("io_is_legacy_token");
exit(1);
}
/*terminate the connection*/
io_end();
}
Output
1/0/0/3/0.6.0 is from LEGACY view
Example 2
Get an I/O node of the following:
1. Disk device from the legacy kernel I/O data structure and print its
corresponding node in the agile view,
2. Disk device from the agile kernel I/O data structure and print its
corresponding legacy and lunpath nodes,
3. Lunpath from the agile kernel I/O data structure and print its corresponding
node in the agile view.
Algorithm