From owner-freebsd-current@FreeBSD.ORG Thu Nov 8 14:17:03 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E06CD4A; Thu, 8 Nov 2012 14:17:03 +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 847768FC0C; Thu, 8 Nov 2012 14:17:01 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA17543; Thu, 08 Nov 2012 16:17:00 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <509BBEDC.4070103@FreeBSD.org> Date: Thu, 08 Nov 2012 16:17:00 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2 MIME-Version: 1.0 To: "Greg 'groggy' Lehey" Subject: Re: sysutils/lsof Author Question (for CLANG).... References: <5d4c4abe37bd6fffd0c206c1b7b68ce1@webmail.lerctr.org> <20121107213917.GD77848@eureka.lemis.com> <20121107230034.GF77848@eureka.lemis.com> In-Reply-To: <20121107230034.GF77848@eureka.lemis.com> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-current@FreeBSD.org, Larry Rosenman X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 14:17:03 -0000 on 08/11/2012 01:00 Greg 'groggy' Lehey said the following: > On Wednesday, 7 November 2012 at 16:35:22 -0600, Larry Rosenman wrote: >> On 2012-11-07 15:39, Greg 'groggy' Lehey wrote: >>> On Wednesday, 7 November 2012 at 10:32:23 -0500, Benjamin Kaduk >>> wrote: >>>> >>>> Once again, attempting to use kernel internals outside of the >>>> supported interfaces is just asking for trouble; I do not understand >>>> why this message is not sinking in over the course of your previous >>>> mails to these lists, so I will not try to belabor it further. >>> >>> IIRC lsof is a special case that always needs to be built with >>> intimate knowledge of the kernel. >> >> This is VERY true. Since some of the information lsof uses has >> no API/ABI/KPI/KBI to get, it grovels around in the kernel. > > And until those interfaces are provided, I think this is legitimate. > If there's anybody out there who hasn't used lsof, you should try it. > It's good. Just curious why lsof can't use interfaces that e.g. fstat/sockstat/etc use? Those base utilities do not seem to experience as much trouble as lsof. BTW, it is still beyond me why VOP_WRITE could be of any interest to userland code even for such a utility as lsof. -- Andriy Gapon