Avoid using procfs.

TODO: add actual HAVE_PROCFS checks; or add HAVE_SYSCTL checks and
change the patch to use it instead.