From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 12 22:23:00 2007 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 0202A16A419; Mon, 12 Nov 2007 22:23:00 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from mail0.rawbw.com (mail0.rawbw.com [198.144.192.41]) by mx1.freebsd.org (Postfix) with ESMTP id DD97113C4B6; Mon, 12 Nov 2007 22:22:59 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from mail0.rawbw.com (localhost [127.0.0.1]) by mail0.rawbw.com (8.13.8/8.13.8) with ESMTP id lACMMgEU023320; Mon, 12 Nov 2007 14:22:42 -0800 (PST) Received: (from www@localhost) by mail0.rawbw.com (8.13.8/8.13.8/Submit) id lACMMgUL023317; Mon, 12 Nov 2007 14:22:42 -0800 (PST) X-Authentication-Warning: mail0.rawbw.com: www set sender to yuri@rawbw.com using -f Received: from sj-webwasher.Cadence.COM (sj-webwasher.Cadence.COM [158.140.1.25]) by webmail.rawbw.com (IMP) with HTTP for ; Mon, 12 Nov 2007 14:22:41 -0800 Message-ID: <1194906161.4738d231c0fe4@webmail.rawbw.com> Date: Mon, 12 Nov 2007 14:22:41 -0800 From: Yuri To: Robert Watson References: <1194896018.4738aa922f776@webmail.rawbw.com> <20071112214243.Y81124@fledge.watson.org> In-Reply-To: <20071112214243.Y81124@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 158.140.1.25 X-Mailman-Approved-At: Mon, 12 Nov 2007 22:25:11 +0000 Cc: freebsd-hackers@FreeBSD.org Subject: Re: How to get filename of an open file descriptor 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, 12 Nov 2007 22:23:00 -0000 I looked at the patch. It retrieves file description information through 'sysctl' calls with proprietary keys. Isn't it better architecturally to expose the same information through procfs interface? At least from the filesystem level and up standard tools like ls/cat will be able to show the the same information instead of the specialized utility. Thanks, Yuri Quoting Robert Watson : > You can give these patches a try: > > http://www.watson.org/~robert/freebsd/20071112-procstat.tgz > > They reflect a work-in-progress procstat(1) tool, which inspects process > state > in various ways. They are developed against 8-CURRENT, but likely still > apply > fairly easily to 7-STABLE. They suffer various deficiencies, such as relying > > on the name cache in-kernel to generate file paths for mapped files and open > > file descriptors, so don't currently work with devfs nodes (for example). > However, they may do what you need. Any feedback would be most welcome. > > Robert N M Watson > Computer Laboratory > University of Cambridge > --