From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 8 23:52:38 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 04501106566B for ; Wed, 8 Dec 2010 23:52:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 871128FC0A for ; Wed, 8 Dec 2010 23:52:34 +0000 (UTC) Received: by wyf19 with SMTP id 19so1762512wyf.13 for ; Wed, 08 Dec 2010 15:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=BU53yKdmtlaSinGA8hWrq5avXuxE1uRLn8l9VCXM2qc=; b=BdRFNUOAjmolztn6DSeJYRw4F2STYyo70+E6t5tA2H9VSaWnTMEiuDlbakXTWnMtw0 v5Mr1FKzeqKMUCKx8lVG1hzDdAHrN4Cx1OQ2A8XBDhkEsVqBUjOeXF2K1wSg3tf902AB wB0DeMwcBZghk08CYufOkDZEWV767y+RcERuQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=J9qHRZPEWH9Lin9glENR75TYv+aLmUlEZraQFyZ/ngO2o71aAQOzMvVk0ek7hvf6uC ofN9qx5PghxCJz8uDD+HSvUN8HrrsAF81icaPYIh3xmJnW66VQTcUiKBF9zoyGkPoWrq p0c7Fv1ilSuTKC6SibV3SGVuVfm3/R/IhTTv8= MIME-Version: 1.0 Received: by 10.216.168.78 with SMTP id j56mr1290784wel.45.1291852354016; Wed, 08 Dec 2010 15:52:34 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Wed, 8 Dec 2010 15:52:33 -0800 (PST) In-Reply-To: References: <4D000448.1050606@telenix.org> <20101208230139.2097c2e8@core.draftnet> Date: Wed, 8 Dec 2010 15:52:33 -0800 X-Google-Sender-Auth: 9GFfIB06aCYIWbmQtgNxFxct01U Message-ID: From: Garrett Cooper To: Matthew Fleming Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: Wed, 08 Dec 2010 23:52:38 -0000 On Wed, Dec 8, 2010 at 3:47 PM, Matthew Fleming wrote: > 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. =A0I 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. lsof prints out all open file descriptors whereas I thought that fstat had to be targeted to specific files / directories / vmcore files / etc. Thanks, -Garrett