2003-08-12 17:32:16 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <sys/utsname.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main (void)
|
2022-04-17 14:07:20 +00:00
|
|
|
{
|
2003-08-12 17:32:16 +00:00
|
|
|
/* Get the uname data */
|
|
|
|
struct utsname buf;
|
|
|
|
if (uname (&buf) != 0) {
|
|
|
|
perror ("uname");
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
2022-04-17 14:07:20 +00:00
|
|
|
/* Print it */
|
2003-08-12 17:32:16 +00:00
|
|
|
printf ("sysname: \"%s\"\n", buf.sysname);
|
|
|
|
printf ("nodename: \"%s\"\n", buf.nodename);
|
|
|
|
printf ("release: \"%s\"\n", buf.release);
|
|
|
|
printf ("version: \"%s\"\n", buf.version);
|
|
|
|
printf ("machine: \"%s\"\n", buf.machine);
|
|
|
|
|
|
|
|
/* Done */
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|