Querying kernel features

Kristof Provost kp at FreeBSD.org
Thu Jun 18 20:57:54 UTC 2020


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).

Regards,
Kristof


More information about the freebsd-testing mailing list