From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 9 18:44:30 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BC2B16A401 for ; Mon, 9 Apr 2007 18:44:30 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout2.cac.washington.edu (mxout2.cac.washington.edu [140.142.33.4]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2DD13C4C3 for ; Mon, 9 Apr 2007 18:44:30 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from hymn09.u.washington.edu (hymn09.u.washington.edu [140.142.12.183]) by mxout2.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l39IiTox025884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Apr 2007 11:44:29 -0700 Received: from localhost (localhost [127.0.0.1]) by hymn09.u.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l39IiSvr027513; Mon, 9 Apr 2007 11:44:28 -0700 X-Auth-Received: from [134.134.136.2] by hymn09.u.washington.edu via HTTP; Mon, 09 Apr 2007 11:44:28 PDT Date: Mon, 9 Apr 2007 11:44:28 -0700 (PDT) From: youshi10@u.washington.edu To: David Malone In-Reply-To: <20070409081500.GA5325@walton.maths.tcd.ie> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-PMX-Version: 5.3.0.289146, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.4.9.113033 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='NO_REAL_NAME 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' Cc: freebsd-hackers@freebsd.org Subject: Re: Discovering list of open files from "kernel level" without using utils like lsof 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: Mon, 09 Apr 2007 18:44:30 -0000 On Mon, 9 Apr 2007, David Malone wrote: > On Sun, Apr 08, 2007 at 11:05:48AM -0700, Garrett Cooper wrote: >> I'm trying to see whether it's possible to grab the list of files open >> from a kernel level on FreeBSD, using a userland library interface as >> opposed to lsof. > > Have a look at the source code for the fstat utility. It does this > in a relatively clean way. > > David. > Will do. Thanks a lot! -Garrett