Created
January 30, 2017 21:35
-
-
Save mortymacs/b3996c59f241af43c6032876cafcb02a to your computer and use it in GitHub Desktop.
Showing system info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/utsname.h> | |
int main() { | |
struct utsname *x = malloc(sizeof(struct utsname)); | |
uname(x); | |
printf("SYS NAME: %s\n", x->sysname); | |
printf("NODE NAME: %s\n", x->nodename); | |
printf("RELEASE: %s\n", x->release); | |
printf("VERSION: %s\n", x->version); | |
printf("MACHINE: %s\n", x->machine); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment