Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!bloom-beacon!jik From: jik@pit-manager.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.wizards Subject: Re: ps and netstat Message-ID: <1990Jul23.091019.18652@athena.mit.edu> Date: 23 Jul 90 12:09:59 GMT References: <1990Jul20.160919.16955@ux1.cso.uiuc.edu> Sender: daemon@athena.mit.edu (Mr Background) Distribution: comp Organization: /mit/jik/.organization Lines: 20 In-Reply-To: bob@uxa.cso.uiuc.edu's message of 20 Jul 90 16:09:19 GMT In article <1990Jul20.160919.16955@ux1.cso.uiuc.edu> bob@uxa.cso.uiuc.edu (Bob Foertsch) writes: every open socket has some process running but there seems to be no way of getting the pid of a socket or the socket number of a pid. anyone have a 'tool' for this? ideas? Check out the "ofiles" program, available in the comp.sources.unix archives. It can determine open file descriptors for specified process ID's, or processes which currently have open file descriptors on any specified device, or processes which have specific files open. I don't think it can determine a PID given an open network socket, especially since not all active network sockets are guaranteed to be associated with a PID (for example, if a program using a socket terminates prematurely, its socket may hang around for a while before it goes away). Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710