Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jan 2018 11:56:31 +0800
From:      Julian Elischer <julian@freebsd.org>
To:        Colin Percival <cperciva@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r327447 - head/sys/sys
Message-ID:  <c6194248-8229-b46e-f9c6-0e96bcfeab5a@freebsd.org>
In-Reply-To: <201712312100.vBVL0L0a038783@repo.freebsd.org>
References:  <201712312100.vBVL0L0a038783@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/_types.h>
>   #include <sys/pcpu.h>
> +#endif
>   
>   #define TS_ENTER	0
>   #define TS_EXIT		1
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c6194248-8229-b46e-f9c6-0e96bcfeab5a>