From owner-freebsd-current@FreeBSD.ORG Tue Oct 11 19:42:39 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25A55106566B for ; Tue, 11 Oct 2011 19:42:39 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id EC8A78FC1D for ; Tue, 11 Oct 2011 19:42:34 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p9BJgPLb017753 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 11 Oct 2011 12:42:27 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4E949C26.4070105@freebsd.org> Date: Tue, 11 Oct 2011 12:42:30 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.23) Gecko/20110920 Thunderbird/3.1.15 MIME-Version: 1.0 To: Arnaud Lacombe References: <4E942FF1.9000805@FreeBSD.org> <4E9449F2.2000801@FreeBSD.org> <4E944BA5.4080506@lerctr.org> <83FC19FA-BD52-4383-9ABE-708161597B85@mac.com> <589d032a-7b71-4ff1-8adf-f5e49e87696c@email.android.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: Garrett Cooper , =?ISO-8859-1?Q?Ren=E9_Ladan?= , Matt Thyer , FreeBSD current , Larry Rosenman Subject: Re: System headers with clang? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 11 Oct 2011 19:42:39 -0000 On 10/11/11 12:36 PM, Arnaud Lacombe wrote: > Hi, > > On Tue, Oct 11, 2011 at 3:21 PM, René Ladan wrote: >> 2011/10/11 Garrett Cooper: >>> On Tue, Oct 11, 2011 at 10:55 AM, Larry Rosenman wrote: >>>> On Wed, 12 Oct 2011, Matt Thyer wrote: >>>> >>>>> On Oct 12, 2011 3:25 AM, "Larry Rosenman" wrote: >>>>>> I didn't say bug for bug, just not generate stupid errors like the ffs >>>>> one. >>>>>> -- >>>>>> Sent from my Android phone with K-9 Mail. Please excuse my brevity. >>>>>> >>>>>> Chuck Swiger wrote: >>>>>> >>>>>> On Oct 11, 2011, at 6:59 AM, Larry Rosenman wrote: >>>>>>> We will NOT support clang as the compiler for lsof unless the system >>>>> headers work the same way as gcc's do. >>>>>> That apparently means you won't support clang then, because it's not >>>>> intended to be (or ever going to be) fully bug-for-bug "compatible" with >>>>> GCC. In this case, at least, clang is reporting legitimate issues which >>>>> should be fixed, even if folks continue to build lsof with GCC from now >>>>> until the end of days. >>>>> >>>>> The elegant solution would be to avoid this problem altogether by >>>>> re-implementation of lsof using interfaces into the kernel that provide >>>>> the >>>>> required information. >>>>> >>>>> bsdof anyone? >>>>> >>>> lsof is PORTABLE and available on LOTS of platforms. >>>> >>>> We have fstat, but lsof can be used between differing OS's. >>>> >>>> We've also asked for Kernel interfaces before, but no one volunteered >>>> to make the KPI for them. >>>> >>>> I'm sure if someone(tm) (not me, insufficient knowledge) was >>>> to make interfaces for ALL that lsof needs, Vic would implement it >>>> as it would make his life easier. >>> It would be nice in general if there were sysctls for accessing this >>> data as even utilities in base have libkvm magic sprinkled around with >>> pointer magic by default instead of using the sysctl analogs (I'm >>> referring to ifconfig, netstat, etc), and as noted by some.. using >>> libkvm on live memory could be potentially; the only valid usage I can >>> really think of is when dealing with . >>> >>> What data does Vic need to grab from the kernel in order to get the >>> file descriptor data? >>> >> Just a quick note that FreeBSD 9 and later also have libprocstat which >> could be a nice interface. I haven't looked at the details yet though. >> > libprocstat is _itself_ a problem: > > % git grep 'define _KERNEL' . > [...] > lib/libprocstat/cd9660.c:#define _KERNEL > lib/libprocstat/nwfs.c:#define _KERNEL > lib/libprocstat/smbfs.c:#define _KERNEL > lib/libprocstat/udf.c:#define _KERNEL > lib/libprocstat/zfs.c:#define _KERNEL > [...] > > ok, I admit this is all FS related stuff :) but at least it comes with the system so it matches. we've been looking for the 'right' way to do this since, hmmm, 1988 that I remember and I bet before that too.