Using the HP-UX libIO Library

instance, my_string, driver_name , state, type);
/*end of libIO operations */
io_end();
}
Output
class instance hardware path driver name state type
disk 25 1/0/1/0/0/1/1.6.0 sdisk CLAIMED DEVICE
Example 3
Get all disk devices from the legacy kernel I/O data structure and print the class
name, instance, hardware path and driver names.
Algorithm
1. Initialize the libIO library.
2. Search for all disk devices in the legacy kernel I/O data structures.
3. Get the class name, instance number, hardware path, and driver name of this
disk device and print them.
4. Terminate the connection.
Solution
#include <sys/libIO.h>
#include <stdio.h>
#define RETURN_NODE_NUMBER 500
main()
{
io_token_t token, ret_token[RETURN_NODE_NUMBER];
io_token_t node;
hw_path_t hw_path;
int instance;
char *key[12];
void *ptr[12];
int i=0;
char state[MAX_NAME_LEN];
char *driver_name;
char *class_name;
char type[MAX_NAME_LEN];
char my_string[MAX_HW_PATH_STR];
driver_name=(char *)malloc(MAX_NAME_LEN);
class_name=(char *)malloc(MAX_NAME_LEN);
strcpy(driver_name, "sdisk");
strcpy(class_name , "disk");