Instructions:

You need to do everything below as root.

1. Add an entry to /etc/name_to_sysnum for the sethostid system call.
For instance, I use the following line.
sethostid		177

Do not put any leading whitespace on the line in /etc/name_to_sysnum.

The important thing is to pick an unused syscall number. There
is also a limit on the number you can pick, which is determined
by the size of the sysent table. To find out what the limit is
you can use adb (only in Solaris 2.3 - for 2.4 just be reasonable)

adb -k /dev/ksyms /dev/mem
sysentsize/D
^D        #  i.e. control-D

Look at the define NSYSCALL in /usr/include/sys/systm.h under 2.5

You should be able to pick any unused syscall number between 1 and the
number output by adb above minus 1. Alternatively just use an unused
number which is less than the largest number which occurs in
/etc/name_to_sysnum

After modifying /etc/name_to_sysnum you must reboot for the change
to take effect. If you fail to do this, you'll get a message like:
can't load module: Out of memory or no room in system tables
when you try to load the module

2. Look at the makefile and check that the location of the C compiler is
right for your system. Also if you are running Solaris 2.3 or 2.4 you
must uncomment the define -DPRE_SOLARIS_2_5 in the makefile (otherwise
the result will be unpredictable)

You do NOT want to get /usr/ucb/cc. gcc should be OK.

3. Type
make load

This should load the sethostid call. 

4. Type 
make sid

This makes the program that allows you to modify the hostid for
a particular group.

e.g. Now you can modify the hostid to be 23000000 by typing
./sid 23000000

6. You can unload the system call as follows.

Type
/usr/sbin/modinfo

 You'll get output which includes a line which looks something like
76 fc42d000   621 177   1  sethostid (kern_hostid v1.0)

To remove the module type
/usr/sbin/modunload -i 76
Replace 76 by the first number in the line output by modinfo.

7. If you like you can install sid and sethostid by typing
make install

If you do this, when you reboot, the sethostid module will be
automatically loaded when sethostid is called (i.e. when you run sid).

setting the hostid to 0 with the sethostid call will restore the default.
