Skip to content

Instantly share code, notes, and snippets.

@Arkham
Created April 14, 2013 08:31
Show Gist options
  • Save Arkham/5381928 to your computer and use it in GitHub Desktop.
Save Arkham/5381928 to your computer and use it in GitHub Desktop.
#include "../apue.h"
#include "sys/utsname.h"
int
main(void)
{
struct utsname *ptr;
if (uname(ptr) < 0)
err_sys("uname failed");
printf("%s %s ", ptr->sysname, ptr->nodename);
printf("%s %s ", ptr->release, ptr->version);
printf("%s\n", ptr->machine);
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment