Luna/apps/src/uname.c
apio 2c813f5901 apps: Add more simple apps
Now that we can start them at will from the command line, bring them on!!
2022-10-19 21:11:38 +02:00

26 lines
385 B
C

#include <stdio.h>
int main()
{
FILE* fp = fopen("/dev/version", "r");
if (!fp)
{
perror("fopen");
return 1;
}
char buf[4096];
size_t nread = fread(buf, sizeof(buf) - 1, 1, fp);
if (ferror(fp))
{
perror("fread");
return 1;
}
buf[nread] = 0; // null terminate it :)
printf("%s\n", buf);
fclose(fp);
}