/* * gethostid * * This example has a combination of high-level * (SVR4) and (SI_HW_SERIAL) feature declarations. */ #if defined(SVR4) && defined(SI_HW_SERIAL) long gethostid() { char buf[128]; if (sysinfo(SI_HW_SERIAL, buf, 128) == -1) { perror("sysinfo"); exit(1); } return(strtoul(buf,NULL,0)); } #endif /* SVR4 && SI_HW_SERIAL */