Acho que o 2.4 suporta a chamada de sistema uname . Tente isto
/*
* Author: NagaChaitanya Vellanki
*/
#include <sys/utsname.h>
#include <stdio.h>
#include <errno.h>
int main() {
struct utsname buf;
if(uname(&buf) != -1) {
printf("Operating System name: %s\n", buf.sysname);
printf("Node name: %s\n", buf.nodename);
printf("Release: %s\n", buf.release);
printf("Version: %s\n", buf.version);
printf("Machine: %s\n", buf.machine);
} else {
printf("Error: %s\n", strerror(errno));
}
return 0;
}
Para compilar
gcc -o uname uname.c
Exemplo de saída no meu pi-framboesa
./uname
Operating System name: Linux
Node name: naga-playground
Release: 4.4.11-v7+
Version: #888 SMP Mon May 23 20:10:33 BST 2016
Machine: armv7l
Experimente-as, se disponíveis, conforme sugerido pela man-page
cat /proc/sys/kernel/osrelease
4.4.11-v7+
cat /proc/sys/kernel/ostype
Linux
cat /proc/sys/kernel/version
#888 SMP Mon May 23 20:10:33 BST 2016