System headers with clang?

Julian Elischer julian at
Tue Oct 11 19:42:39 UTC 2011

On 10/11/11 12:36 PM, Arnaud Lacombe wrote:
> Hi,
> On Tue, Oct 11, 2011 at 3:21 PM, René Ladan<rene at>  wrote:
>> 2011/10/11 Garrett Cooper<yanegomi at>:
>>> On Tue, Oct 11, 2011 at 10:55 AM, Larry Rosenman<ler at>  wrote:
>>>> On Wed, 12 Oct 2011, Matt Thyer wrote:
>>>>> On Oct 12, 2011 3:25 AM, "Larry Rosenman"<ler at>  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<cswiger at>  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.

More information about the freebsd-current mailing list