From owner-svn-src-all@freebsd.org Wed Jan 17 23:14:39 2018 Return-Path: Delivered-To: svn-src-all@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 2E88AEBE9D2; Wed, 17 Jan 2018 23:14:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 11FB963817; Wed, 17 Jan 2018 23:14:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w0HNEb4r017362 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Jan 2018 15:14:37 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w0HNEbG7017361; Wed, 17 Jan 2018 15:14:37 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 17 Jan 2018 15:14:37 -0800 From: Gleb Smirnoff To: John Baldwin Cc: Julian Elischer , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r327447 - head/sys/sys Message-ID: <20180117231437.GQ8113@FreeBSD.org> References: <201712312100.vBVL0L0a038783@repo.freebsd.org> <8492136.94UhKCrmBg@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8492136.94UhKCrmBg@ralph.baldwin.cx> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:14:39 -0000 On Tue, Jan 02, 2018 at 09:56:09AM -0800, John Baldwin wrote: J> > this is a recurring issue. Program that want to look into the J> > internals of files such as mount.h J> > and define _KERNEL to allow themselves to do so. It eventualy leads J> > to all sorts of confusion and pollution. J> > Maybe we should make a policy on how to do this. At $JOB I had to hack J> > it to define a J> > #ifdef _NOTREALLYKERNEL to split out parts we really wanted, but it J> > would be better to have specific ones for J> > various specific 'rule breakers'.. J> > e.g. J> > #if defined( _KERNEL ) || defined (WANT_TO_LOOK_AT_something) J> > J> > kdump seems ot do the right thing with: J> > J> > kdump/kdump.c:#define _WANT_KERNEL_ERRNO J> > errno.h:#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) J> J> The past few years we have been using _WANT_FOO when new things need to be J> exposed and that is our current pattern. However, that doesn't fix existing J> code for old things. As one who added a lot of _WANT_FOOs, I must admit that I don't consider that a final and clean solution. But this seems to be a lesser evil when dealing with old code that has multiple dependencies. New code needs to be written in a fashion that clearly separates kernel structures from user visible structures, so that no tricks with preprocessor are needed. -- Gleb Smirnoff