Make the sysctlbyname stuff look like the 2-level MIB stuff. This

means actually setting 'len', for example.  Which will make uname -i
work on some systems where it did not.  Anywhere where it did work,
it was a matter of coincidence.

Submitted by:	redpixel on EFnet.
This commit is contained in:
jmallett 2003-07-01 20:15:28 +00:00
parent e95ec1f864
commit a10a3eab32

View File

@ -199,6 +199,7 @@ native_##var(void) \
static char buf[1024]; \
char **varp = &(var); \
\
len = sizeof buf; \
if (sysctlbyname(name, &buf, &len, NULL,\
0) == -1) \
err(1, "sysctlbyname");