uname(1) now uses kernelinfo(2) to determine kernel version.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-03-07 18:06:23 +01:00
parent 8a9a0c58ea
commit a7658d5b8c
1 changed files with 12 additions and 1 deletions

View File

@ -1,7 +1,18 @@
#include <sys/kernelinfo.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <error.h>
int main(int argc, char* argv[])
{
printf("Sortix %zu bit\n", sizeof(size_t) * 8UL);
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);
return 0;
}