From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 9 00:20:47 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62AC91065670 for ; Thu, 9 Dec 2010 00:20:47 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A6EC68FC18 for ; Thu, 9 Dec 2010 00:20:46 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id CAA02661; Thu, 09 Dec 2010 02:20:40 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PQUFU-000M3e-Dh; Thu, 09 Dec 2010 02:20:40 +0200 Message-ID: <4D0020D7.5080706@freebsd.org> Date: Thu, 09 Dec 2010 02:20:39 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Matthew Fleming References: <4D000448.1050606@telenix.org> <20101208230139.2097c2e8@core.draftnet> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Bruce Cran , FreeBSD-Hackers , Chuck Robey Subject: Re: getting a list of open files versus PID nos.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 00:20:47 -0000 on 09/12/2010 01:47 Matthew Fleming said the following: > On Wed, Dec 8, 2010 at 3:01 PM, Bruce Cran wrote: >> On Wed, 8 Dec 2010 14:54:57 -0800 >> Matthew Fleming wrote: >> >>> This is what lsof is for. I believe there's one in ports, but I have >>> never tried it. >> >> Is there any advantage to using lsof instead of fstat(1) (fstat -p pid)? > > I believe that lsof reports on all open files by all processes, > whereas fstat will only report on a specific provided pid. Just try running fstat without any options. Or procstat -a -f. -- Andriy Gapon