mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
uname(1) now uses kernelinfo(2) to determine kernel version.
This commit is contained in:
parent
8a9a0c58ea
commit
a7658d5b8c
1 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue