* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
"@(#) Copyright (c) 1983 Regents of the University of California.\n\
static char sccsid
[] = "@(#)hostid.c 5.1 (Berkeley) %G%";
extern unsigned long inet_addr();
printf("%#x\n", gethostid());
if (index(id
, '.') != NULL
)
hostid
= (int) inet_addr(id
);
if (*id
== '0' && (id
[1] == 'x' || id
[1] == 'X'))
if (sscanf(id
, "%x", &hostid
) != 1) {
fprintf(stderr
, "usage: %s [hexnum or internet address]\n", argv
[0]);
if (sethostid(hostid
) < 0) {