Skip to content

Instantly share code, notes, and snippets.

@mortymacs
Created January 30, 2017 21:35
Show Gist options
  • Save mortymacs/b3996c59f241af43c6032876cafcb02a to your computer and use it in GitHub Desktop.
Save mortymacs/b3996c59f241af43c6032876cafcb02a to your computer and use it in GitHub Desktop.
Showing system info
#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