/*
This program is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose. You use
this program at your own risk. The author disclaims responsibility for
any damages that might result from the use of this program, even
if they result from negligence on the part of the author.

Also, please don't use this program to steal software. The intended
use is for emergency situations where an application has to be moved from
one computer to another (e.g. in the event of a hardware malfunction)
and licence keys cannot be obtained quickly from the vendor. Many
vendors will not supply licence keys outside of business hours.
*/

#include <stdio.h>
#include <sys/syscall.h>
#include <errno.h>
#include "sethostid.h"

main(argc, argv)
int argc;
char *argv[];
{
  unsigned hostid;

  if (argc<2) {
    fprintf(stderr, "%s <hostid>\n", argv[0]);
    exit(1);
  }
  hostid=strtoul(argv[1], NULL, 16);
  if (syscall(SYS_sethostid, hostid)==-1) {
    perror(argv[0]);
    exit(1);
  }
  return(0);
}  

