listing .sl files for each process id in hp-ux 11i

Hi All,

I m trying to write a program similar to the ldd command. I have a list of process ids and for each of that process, I need to retrieve the list of libraries loaded for that particular process. Can we use pstat_getprocvm() to get the virtual address space of the process? How can i use the system call to get the .sl file listing for each PID. I am using hp-ux 11i system. I need to use only system calls and APIs to fetch the information that i require.

Like in Linux, if you go to /proc/PID/maps file it will give the shared library list with each pid and and by parsing i could get it. But in hp-ux there is no such file and only a buch of system calls to fetch those information. How can i get the similar infomation in hp-ux. Any suggestion or code snoppet is most welcome.

Thanks and Regards,
sanjay