Here's the actual code:
sysctl_createv(clog, 0, &node, NULL,
CTLFLAG_PERMANENT,
CTLTYPE_STRING, "version", NULL,
NULL, 0, linux_version, sizeof(linux_version),
LINUX_KERN_VERSION, CTL_EOL);
^^^^^^^^^^^^^^^^^^
#if 0
#ifndef LINUX_UNAME_ARCH
#define LINUX_UNAME_ARCH machine
#endif
strlcpy(linux_machine, LINUX_UNAME_ARCH, sizeof(linux_machine));
sysctl_createv(clog, 0, &node, NULL,
CTLFLAG_PERMANENT,
CTLTYPE_STRING, "machine", NULL,
NULL, 0, linux_machine, sizeof(linux_machine),
LINUX_KERN_VERSION, CTL_EOL);
^^^^^^^^^^^^^^^^^^
#endif
The second sysctl_createv (which I commented out) always fails with EEXIST
so I don't see how it could be making a difference. The minimal fix is
to change LINUX_KERN_VERSION on the second create call to something else
(or allocate it dynamically). I did not see a "machine" sysctl in my linux
box.