Subject: when to sysctl and when not to?
To: None <>
From: Simon Burge <>
List: tech-kern
Date: 06/16/2000 13:25:08
For the sysctl work I've been doing recently, I've used the following

	if (memf == NULL || nlistf == NULL)
		do sysctl stuff
		do kvm stuff

Should that first check be just

	if (memf == NULL)

?  If you want to use the default memory file, then the namelist
obviously doesn't matter at all to sysctl.

There's scope to go even further and use

	if (memf == NULL || strcmp(memf, _PATH_MEM) == 0)

but a lot of my testing for not breaking the kvm access is to use

	./foo -M /dev/mem

so from my selfish POV I'd not like to do this, even though it may be
desirable and perhaps should be done.  I guess I could just make a
symlink to /dev/mem and test against that...