* 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.4 (Berkeley) 5/19/86";
extern unsigned long inet_addr();
printf("%#x\n", gethostid());
if (hp
= gethostbyname(id
)) {
bcopy(hp
->h_addr
, &addr
, sizeof(addr
));
} else if (index(id
, '.')) {
if ((hostid
= inet_addr(id
)) == -1)
if (id
[0] == '0' && (id
[1] == 'x' || id
[1] == 'X'))
if (sscanf(id
, "%x", &hostid
) != 1) {
"usage: %s [hexnum or internet address]\n",
if (sethostid(hostid
) < 0) {