Querying kernel features

John-Mark Gurney jmg at funkthat.com
Thu Jun 18 23:19:54 UTC 2020


Kristof Provost wrote this message on Thu, Jun 18, 2020 at 22:57 +0200:
> Say that I have a test for an optional kernel feature (say ALTQ, or 
> TMPFS) is there an elegant way of figuring out at runtime if it???s 
> available?
> 
> Doing `sysctl kern.conftxt | grep ALTQ` feels a little inelegant, and is 
> begging for issues with incorrect matches.
> 
> I???m tempted to add a sysctl node for ALTQ, but perhaps there???s a 
> better way. Or perhaps this should be a general feature (so we???d have 
> nodes like kernel.feature.tmpfs=1).

Look at kern.features...  There's a FEATURE macro to add entries to
that, but looks like there isn't any man page for it...

sys/geom/eli/g_eli.c:FEATURE(geom_eli, "GEOM crypto module");

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-testing mailing list