Date: Tue, 11 Oct 2011 13:39:21 -0500 From: Larry Rosenman <ler@lerctr.org> To: Arnaud Lacombe <lacombar@gmail.com> Cc: =?ISO-8859-1?Q?Ren=E9_Ladan?= <rene@freebsd.org>, freebsd-current@freebsd.org, Dimitry Andric <dim@freebsd.org> Subject: Re: System headers with clang? Message-ID: <4E948D59.5020006@lerctr.org> In-Reply-To: <CACqU3MV9vP%2BVUR%2B2Qpzc4mCS1w3R17yvMGNPT%2BxnsGUiYr8VFQ@mail.gmail.com> References: <alpine.BSF.2.00.1110091229550.43656@lrosenman.dyndns.org> <4E942FF1.9000805@FreeBSD.org> <CACqU3MV9vP%2BVUR%2B2Qpzc4mCS1w3R17yvMGNPT%2BxnsGUiYr8VFQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10/11/2011 1:36 PM, Arnaud Lacombe wrote: > Hi, > > On Tue, Oct 11, 2011 at 8:00 AM, Dimitry Andric<dim@freebsd.org> wrote: >> On 2011-10-09 19:32, Larry Rosenman wrote: >>> I had gotten a PR about sysutils/lsof not compiling with clang. I had >>> Vic Abell check it out, and the problem is NOT with lsof per se, but >>> with the system headers. >>> >>> Is there a project afoot to update the system headers to make them clang >>> compilable? >> The problem isn't that clang can't compile the system headers, but >> normally these don't get included from userspace. And they certainly >> won't work as expected when you define _KERNEL in userspace, as the lsof >> port foolishly does. It probably can't be avoided in such a tool, though. >> > #ifdef _KERNEL/#endif protected part of system headers shall NEVER be > accessed by userland. It is a fault to have them present in > /usr/include. Linux got it right there, all those part are removed > upon headers' installation. > > - Arnaud Then lsof would NOT be compilable / usable at all, as it delves into /dev/kmem to get information. And it **NEEDS** to know what the structures are. That is unless someone(tm) writes the Kernel interfaces to get the info. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 512-248-2683 E-Mail: ler@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3893
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E948D59.5020006>