Using the HP-UX libIO Library

"class", "disk", "driver_name", "esdisk", NULL))
==(io_token_t)NULL) {
io_error("ERROR:io_search:class:disk");
exit(1);
}
/*call io_get_devs to get the agile dev_ts */
if (io_get_devs(node, dev_array, &count) != IO_SUCCESS)
if (io_errno == IO_E_BUF_TOO_SMALL) {
dev_array=(io_dev_info_t*)
malloc(count*sizeof(io_dev_info_t));
if (io_get_devs(node, dev_array, &count)
!=IO_SUCCESS) {
io_error("io_get_devs");
exit(1);
}
}
printf("%d agile dev_t’s were found\n", count);
/*end of libIO operations */
io_end();
}
Output
10 agile dev_t’s were found
Example 3
Get a disk device in the agile kernel I/O data structure and print the disk options,
dev_t and hardware path of this I/O node.
Algorithm
1. Initialize the libIO library.
2. Search for a disk device in the agile kernel I/O data structures.
3. Get the device option, hardware path and dev_t of this I/O node.
4. Print the device option, hardware path and dev_t of this I/O node.
5. Terminate the connection.
Solution
#include <sys/libIO.h>
#include <sys/libIO.h>
#include <stdio.h>
main()
{
io_token_t node;
uint64_t options=0;