finding what processes owns a socket

Tom Christiansen tchrist at convex.COM
Wed Dec 5 16:43:16 AEST 1990


In article <2784 at redstar.cs.qmw.ac.uk> liam at cs.qmw.ac.uk (William Roberts) writes:
>In <1990Nov30.150350.10483 at maverick.ksu.ksu.edu> brtmac at maverick.ksu.ksu.edu 
>(Brett McCoy) writes:
>
>
>>I need to find what processes owns a given socket.  Specificially, given
>>the output from netstat how do I find what processes owns each of the
>>sockets shown.  I am running SunOS 4.0.3.  Pointers to the correct kernal
>>structures and header files would be good.  Actual code would be great.
>
>There is a utility called "ofiles", which we obtained from Vic Abell, 

I also received a copy of fstat, a standard BSD release utility,
from Vic Abell, that he made work for Sun file systems.  It's nicer
than ofiles.  I use it all the time. 

It doesn't give very good information on rnodes.  I modified it to chase
these down by following kernel pointers and print out the same device as
stat would give you, and to find the right inum as well.  Unfortunately,
my kernel looks different on the inside, so my changes won't help anyone
else much, unless they're on a Convex, in which case they should already
have fstat.  It's a worthwhile exercise for someone who wants to learn
about how vnodes, inodes, snodes, and rnodes are all connected.

--tom
--
Tom Christiansen		tchrist at convex.com	convex!tchrist
"With a kernel dive, all things are possible, but it sure makes it hard
 to look at yourself in the mirror the next morning."  -me



More information about the Comp.unix.internals mailing list