Operating System - HP-UX
1834272 Members
91389 Online
110066 Solutions
New Discussion

How to retrieve list of sockets owned by a process

 
Bruno DESQUESNE
Advisor

How to retrieve list of sockets owned by a process

Hi all,

I have several servers in Service Guard cluster. I would like to be know which IP alias a telnet client or an Omniback script is connecting through.

By examining lsof output, I see it is possible to get the information I wish through sockets information (specially on fd 0, 1 and 2). Therefore I wrote a small C program to retrieve the list of file descriptor attached to a process, using pstat_getfile.

Unfortunatelly, pstat_getfile provides me only regular files. Does someone has a simple way to retrieve the list of sockets for a process (ideally using a pstat like interface) ?

Thanks in advance

Bruno