Opened 15 years ago
Closed 9 years ago
#8 closed defect (fixed)
coreutils: hostid does not support setting host id
| Reported by: | Yuri Dario | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | coreutils | Version: | |
| Severity: | highest | Keywords: | |
| Cc: | fbakan |
Description
From http://svn.netlabs.org/rpm/ticket/14, OS/2 hostid.exe support setting the current host id, while coreutils hostid can only report current value.
This code should work:
#include <sys/param.h>
#include <sys/sysctl.h>
#if __STDC__
long
sethostid(long hostid)
#else
long
sethostid(hostid)
long hostid;
#endif
{
int mib[2];
mib[0] = CTL_KERN;
mib[1] = KERN_HOSTID;
if (sysctl(mib, 2, NULL, NULL, &hostid, sizeof hostid) == -1)
return (-1);
return (0);
}
Change History (2)
comment:1 by , 15 years ago
| Cc: | added |
|---|
comment:2 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Severity: | → highest |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

This is obsolete, as hostid is moved to usr/libexec/bin and only a symlink is in usr/bin. So no conflicts anymore as described in the http://svn.netlabs.org/rpm/ticket/14