From owner-freebsd-hackers Wed Jun 19 5:52:19 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from apache.metrocom.ru (www.metrocom.ru [195.5.128.139]) by hub.freebsd.org (Postfix) with ESMTP id 4C8A837B40A for ; Wed, 19 Jun 2002 05:52:12 -0700 (PDT) Received: from apache.metrocom.ru (apache.metrocom.ru [195.5.128.150]) by apache.metrocom.ru (8.12.3/8.12.3) with ESMTP id g5JCq7vJ019054; Wed, 19 Jun 2002 16:52:07 +0400 (MSD) Date: Wed, 19 Jun 2002 16:52:07 +0400 (MSD) From: Varshavchick Alexander To: "Daan Vreeken [PA4DAN]" Cc: FreeBSD-Hackers@FreeBSD.ORG Subject: Re: Getting pid of listening process In-Reply-To: <02061914563400.02778@FreeBSD.Danovitsch.LAN> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG yes, sockstat works, however not expecially fast, but it seems to solve the matter. I don't know why lsof hangs but considering sockstat working it's not important. Thanks for helping. Alexander Varshavchick, Metrocom Joint Stock Company Phone: (812)118-3322, 118-3115(fax) On Wed, 19 Jun 2002, Daan Vreeken [PA4DAN] wrote: > Date: Wed, 19 Jun 2002 14:56:34 +0200 > From: "Daan Vreeken [PA4DAN]" > To: Varshavchick Alexander > Cc: FreeBSD-Hackers@FreeBSD.ORG > Subject: Re: Getting pid of listening process > > On Wednesday 19 June 2002 09:48, you wrote: > > Hi gurus, > > > > can anybody make a hint as how pid of a process listening on a specified > > tcp port can be determined? Of cause there are major utilities like lsof > > or sockstat but they gather a lot of extra information and work not too > > fast. What I need ideally would be a small C program which outputs pid > > given a port number as a parameter, can anybody help? > Try : > sockstat -4 > > grtz, > Daan > -- > Control the lights in my room: > http://www.Danovitsch.dnsq.org/webcam > > Moo, > ]:8) > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message