From a7658d5b8ccdc25c2d4291573ca2a5840112519d Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 7 Mar 2012 18:06:23 +0100 Subject: [PATCH] uname(1) now uses kernelinfo(2) to determine kernel version. --- utils/uname.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/utils/uname.cpp b/utils/uname.cpp index ad7746c7..d19f12b6 100644 --- a/utils/uname.cpp +++ b/utils/uname.cpp @@ -1,7 +1,18 @@ +#include +#include #include +#include +#include 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; } +