Using the HP-UX libIO Library

int io_new_to_legacy_dsfs(char *new_dsf, char *legacy_dsf,
int *count);
Callers allocate the array and specify the size of the array (number of legacy DSFs
expected) in count. If the array is big enough, the service will return successfully and
the count will indicate the actual count. If the array is not big enough:
1. no data will be returned,
2. the count will be set to represent the needed size,
3. the service will return IO_ERROR,and
4. io_errno will be set to IO_E_BUF_TOO_SMALL. In this case, the caller must
reallocate a bigger buffer and call the service again.
io_legacy_to_new_dsf()
This routine maps a given legacy device special file to persistent device special file.
The function prototype of this routine is:
int io_legacy_to_new_dsf(char *legacy_dsf, char *new_dsf);
Examples
Example 1
Find a character special file from an I/O node, find the corresponding block special
file and vice versa.
Algorithm
1. Initialize the libIO library.
2. Get a character special file from an I/O node.
3. Get the block special file from the character special file.
4. Get the character special file from the block special file.
5. Print the mapping.
6. Terminate the connection.
Solution
#include <stdio.h>
#include <stdlib.h>
#include <devnm.h>
#include <sys/libIO.h>
#define MAXPATHLEN 1024
main()