Re: System headers with clang?

看板FB_current作者時間14年前 (2011/10/12 03:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串20/28 (看更多)
On Tue, Oct 11, 2011 at 11:36 AM, Arnaud Lacombe <lacombar@gmail.com> 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. =A0I ha= d >>> 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 clan= g >>> compilable? >> >> The problem isn't that clang can't compile the system headers, but >> normally these don't get included from userspace. =A0And they certainly >> won't work as expected when you define _KERNEL in userspace, as the lsof >> port foolishly does. =A0It probably can't be avoided in such a tool, tho= ugh. >> > #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. Yes, but instead Linux encourages mucking around with /proc and /sys, which have varying levels of formatting and provided output. The data needs to be exported properly via sysctl. If it's not done that way to userland, then the API/KPI is flawed and needs to be revised. Thanks, -Garrett _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1Eb9cuLj (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1Eb9cuLj (FB_current)