Using the HP-UX libIO Library

printf("Block Special File Character Special
File\n");
printf("================== ===============\n");
printf("%s %s \n",blk_dsf ,retrieved_chr_dsf);
}
/*end of libio operations */
io_end();
}
Output
Character Special File Block Special File
====================== =====================
/dev/rdisk/disk14 /dev/disk/disk14
Block Special File Character Special File
=================== ========================
/dev/disk/disk14 /dev/rdisk/disk14
Example 2
Get a persistent special file from an agile disk device, find the corresponding legacy
special file(s) and print the mapping.
Algorithm
1. Initialize the libIO library.
2. Get the persistent special from an I/O node.
3. Get the legacy special file(s) from the persistent special file.
4. Print the mapping of device special file.
5. Terminate the connection.
Solution
#include <stdio.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/libIO.h>
#define MAXPATHLEN 1024
main()
{
io_token_t node=(io_token_t)NULL;
int dev_type=D_CHR, is_char=0, is_block=0;
dev_t dev;
int ret=0, count=1;
char dsf_path[MAXPATHLEN ];
char retrieved_new_dsf[MAXPATHLEN ];
char * dsf_array ;