2012-03-07 18:06:23 +01:00
|
|
|
#include <sys/kernelinfo.h>
|
|
|
|
#include <stdlib.h>
|
2011-08-27 23:03:39 +02:00
|
|
|
#include <stdio.h>
|
2012-03-07 18:06:23 +01:00
|
|
|
#include <errno.h>
|
|
|
|
#include <error.h>
|
2011-08-27 23:03:39 +02:00
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
2012-03-07 18:06:23 +01:00
|
|
|
size_t VERSIONSIZE = 256UL;
|
|
|
|
char version[VERSIONSIZE];
|
|
|
|
if ( kernelinfo("version", version, VERSIONSIZE) )
|
|
|
|
{
|
|
|
|
error(1, errno, "kernelinfo(\"version\")");
|
|
|
|
}
|
|
|
|
printf("Sortix %zu bit (%s)\n", sizeof(size_t) * 8UL, version);
|
2011-08-27 23:03:39 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2012-03-07 18:06:23 +01:00
|
|
|
|