#include <stdio.h>
#include <sys/utsname.h>

main()
{
        char *cpuname[ ]=
                {       "always illegal",
                        "C-1, with 4 or 6 MIP board set",
                        "C2",
                        "Multiprocessor version of C2",
                        "C34XX",
                        "C38XX"
                };
        struct utsname namep;
 
        uname(&namep);
 
        printf("sysname:\t%s\n", namep.sysname);
        printf("nodename:\t%s\n", namep.nodename);
        printf("release:\t%s\n", namep.release);
        printf("version:\t%s\n", namep.version);
        printf("machine:\t%s\n", namep.machine);
        printf("system_sn:\t%d\n", namep.si.system_sn);
        printf("cpu_type:\t%d (%s)\n", namep.si.cpu_type,
                                        cpuname[ namep.si.cpu_type]);
        printf("cpu_count:\t%d\n", namep.si.cpu_count);
        printf("IEEE hardware exists: %s\n",
        (namep.si.flags & SI_IEEE_SUPPORTED) ? "yes":"no");
        printf("IEEE is default FP mode for system: %s\n",
        (namep.si.flags & SI_IEEE_DEFAULT) ? "yes":"no");
        printf("Intrinsec instructions exists: %s\n",
        (namep.si.flags & SI_INTRINSICS) ? "yes":"no");
        printf("Parallel instructions exists: %s\n",
        (namep.si.flags & SI_PARALLEL) ? "yes":"no");
        printf("op. under mask instructions exist: %s\n",
        (namep.si.flags & SI_OP_UNDER_MASK) ? "yes":"no");
        printf("scalar accelerator hw exists: %s\n",
        (namep.si.flags & SI_SCALAR_ACC) ? "yes":"no");
        printf("secure microcode enabled: %s\n",
        (namep.si.flags & SI_SECURE_UCODE) ? "yes":"no");
}