blob: ed3b25d78a5054c3c5d11dcb2ea72aadcfbee4e7 (
plain) (
tree)
|
|
#include "hostname.h"
int main(void) {
struct utsname *name;
name = malloc(sizeof(struct utsname));
if (uname(name) == -1) {
perror("uname");
exit(EXIT_FAILURE);
}
fprintf(stdout, "%s\n", name->nodename);
exit(EXIT_SUCCESS);
}
|