Opened 13 years ago

Closed 8 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 Changed 13 years ago by Yuri Dario

Cc: fbakan added

comment:2 Changed 8 years ago by Silvan Scherrer

Resolution: fixed
Severity: highest
Status: newclosed

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

Note: See TracTickets for help on using tickets.