From owner-freebsd-current@FreeBSD.ORG Tue Oct 11 18:39:45 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 A35C4106564A; Tue, 11 Oct 2011 18:39:45 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (lrosenman-1-pt.tunnel.tserv8.dal1.ipv6.he.net [IPv6:2001:470:1f0e:3ad::2]) by mx1.freebsd.org (Postfix) with ESMTP id 677998FC13; Tue, 11 Oct 2011 18:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=hnluxXeIGIBBpgx2tySrTIqvUXPCOV3SzCR17OzsQCo=; b=U1faXiL0smTH7U/NIrrt8X42+8xxZl46VIL6RgjYWeBxIKIzwE5ydLjNFKLNkAHdNj8c3rtZtvszYJXCMAMyiLmWo1/DkpYN5JUwSKHXVXdFyXv+8XY6NScrIdmQzFvRA/TVpgI1a/lek7+pk3wXV0jdee9zBC7c9RLyoR3TVYk=; Received: from [32.97.110.60] (port=19403 helo=[9.41.58.142]) by thebighonker.lerctr.org with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RDhEt-000HxB-Gw; Tue, 11 Oct 2011 13:39:44 -0500 Message-ID: <4E948D59.5020006@lerctr.org> Date: Tue, 11 Oct 2011 13:39:21 -0500 From: Larry Rosenman Organization: LERCTR Consulting User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Arnaud Lacombe References: <4E942FF1.9000805@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-LERCTR-Spam-Score: -2.9 (--) X-Spam-Report: SpamScore (-2.9/5.0) ALL_TRUSTED=-1,BAYES_00=-1.9 X-LERCTR-Spam-Report: SpamScore (-2.9/5.0) ALL_TRUSTED=-1,BAYES_00=-1.9 Cc: =?ISO-8859-1?Q?Ren=E9_Ladan?= , freebsd-current@freebsd.org, Dimitry Andric 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 18:39:45 -0000 On 10/11/2011 1:36 PM, Arnaud Lacombe wrote: > Hi, > > On Tue, Oct 11, 2011 at 8:00 AM, Dimitry Andric 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