Return to sethostid.c CVS log | Up to [cvs.NetBSD.org] / src / lib / libc / compat-43 |
Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. |
version 1.6, 2003/08/07 16:42:39 | version 1.7, 2004/04/19 13:16:42 | ||
---|---|---|---|
|
|
||
int | int | ||
sethostid(long hostid) | sethostid(long hostid) | ||
{ | { | ||
int mib[2]; | int mib[2], value; | ||
mib[0] = CTL_KERN; | mib[0] = CTL_KERN; | ||
mib[1] = KERN_HOSTID; | mib[1] = KERN_HOSTID; | ||
if (sysctl(mib, 2, NULL, NULL, &hostid, sizeof hostid) == -1) | value = (int)hostid; | ||
if (sysctl(mib, 2, NULL, NULL, &value, sizeof(value)) == -1) | |||
return (-1); | return (-1); | ||
return (0); | return (0); | ||
} | } |