From owner-svn-src-head@freebsd.org Tue Jan 2 19:17:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11DC9EB4617; Tue, 2 Jan 2018 19:17:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3D886E322; Tue, 2 Jan 2018 19:17:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-202-155.ca.astound.net [66.234.202.155]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8C32310AC13; Tue, 2 Jan 2018 14:17:55 -0500 (EST) From: John Baldwin To: Julian Elischer Cc: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327447 - head/sys/sys Date: Tue, 02 Jan 2018 09:56:09 -0800 Message-ID: <8492136.94UhKCrmBg@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201712312100.vBVL0L0a038783@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 02 Jan 2018 14:17:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jan 2018 19:17:57 -0000 On Tuesday, January 02, 2018 11:56:31 AM Julian Elischer wrote: > On 1/1/18 5:00 am, Colin Percival wrote: > > Author: cperciva > > Date: Sun Dec 31 21:00:21 2017 > > New Revision: 327447 > > URL: https://svnweb.freebsd.org/changeset/base/327447 > > > > Log: > > Wrap includes in sys/tslog.h with #ifdef TSLOG. > > > > This is necessary because some non-kernel code #defines _KERNEL and then > > includes kernel headers; as a result, it was getting conflicting versions > > of curthread and curproc. Non-kernel code should probably refrain from > > defining _KERNEL, but for now hiding these indirect inclusions fixes the > > build. > > this is a recurring issue. Program that want to look into the > internals of files such as mount.h > and define _KERNEL to allow themselves to do so. It eventualy leads > to all sorts of confusion and pollution. > Maybe we should make a policy on how to do this. At $JOB I had to hack > it to define a > #ifdef _NOTREALLYKERNEL to split out parts we really wanted, but it > would be better to have specific ones for > various specific 'rule breakers'.. > e.g. > #if defined( _KERNEL ) || defined (WANT_TO_LOOK_AT_something) > > kdump seems ot do the right thing with: > > kdump/kdump.c:#define _WANT_KERNEL_ERRNO > errno.h:#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) The past few years we have been using _WANT_FOO when new things need to be exposed and that is our current pattern. However, that doesn't fix existing code for old things. -- John Baldwin