From owner-svn-src-head@freebsd.org Tue Jan 2 03:56:43 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 474FCEAF1E2; Tue, 2 Jan 2018 03:56:43 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 633326C958; Tue, 2 Jan 2018 03:56:42 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (203-206-51-137.dyn.iinet.net.au [203.206.51.137] (may be forged)) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id w023ubYG027745 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 1 Jan 2018 19:56:40 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r327447 - head/sys/sys To: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712312100.vBVL0L0a038783@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Tue, 2 Jan 2018 11:56:31 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201712312100.vBVL0L0a038783@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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 03:56:43 -0000 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) > > Reported by: Michael Butler, Herbert J. Skuhra > > Modified: > head/sys/sys/tslog.h > > Modified: head/sys/sys/tslog.h > ============================================================================== > --- head/sys/sys/tslog.h Sun Dec 31 20:30:51 2017 (r327446) > +++ head/sys/sys/tslog.h Sun Dec 31 21:00:21 2017 (r327447) > @@ -29,8 +29,10 @@ > #ifndef _TSLOG_H_ > #define _TSLOG_H_ > > +#ifdef TSLOG > #include > #include > +#endif > > #define TS_ENTER 0 > #define TS_EXIT 1 > >