/* * gethostname -- * */ #ifdef SVR4 #include #endif /* SVR4 */ .... char buf[MAXHOSTNAME] #ifdef SVR4 if (sysinfo(SI_HOSTNAME, buf, sizeof(buf)) <0) { perror("SI_HOSTNAME"); exit(BAD); } #else /* Assume BSD */ if (gethostname(buf, sizeof(buf)) < 0) { perror("gethostname"); exit(BAD); } #endif /* SVR4 */ /* buf has hostname here... */