// file: sysinfo.c // // Synopsis: Simple illustration of system call // from [Jumpstart, p.89] // // This program prints the "hostname" of // current machine. On my solaris, it // prints "jinai". // // On Cygwin, cannot compile "SI_HOSTNAME" not declared. // Chee Yap #include #include main() { char buffer[BUFSIZ]; sysinfo(SI_HOSTNAME, buffer, BUFSIZ); printf("%s\n", buffer); exit(0); }