Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 2010 07:56:10 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Kostik Belousov <kostikbel@gmail.com>, Alexander Leidinger <Alexander@leidinger.net>, Adrian Chadd <adrian@freebsd.org>, Garrett Cooper <yaneurabeya@gmail.com>, Ilya Bakulin <webmaster@kibab.com>
Subject:   Re: GSoC: registration of optional kernel features via sysctl: a question to the community
Message-ID:  <201006110756.10287.jhb@freebsd.org>
In-Reply-To: <AANLkTimTVmKz2b50GWTDktRTqJaKMsxOz4Uuo6wJP2Rj@mail.gmail.com>
References:  <20100609121453.095d92b4@kibab.com> <20100610160109.19585782fyr3buw4@webmail.leidinger.net> <AANLkTimTVmKz2b50GWTDktRTqJaKMsxOz4Uuo6wJP2Rj@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 11 June 2010 12:28:58 am Adrian Chadd wrote:
> How about exposing a simple userspace API for doing this, rather than
> doing it via sysctl?
> 
> That way you could "simply" tie alternative overrides in as needed for
> builds (eg, environment variables setting overrides; and/or pointing
> to a configuration file with such) but not affect any runtime
> detection the rest of the system is doing.

man 3 feature_present

I don't see much practical use for spoofing.  If there really was a desire for 
such a thing, then perhaps you could implement it in libc keyed off 
environment variables.

It would perhaps be useful to have a feature_present(1) for ports that uses 
the API instead of using the sysctls directly, but I really don't think there 
are any useful cases for spoofing.

At Y! we used kern.features.pae in kmod.mk to automatically enable PAE in 
standalone kernel module builds if the running kernel was using PAE since PAE 
alters the kernel ABI.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006110756.10287.jhb>