1
0
mirror of https://github.com/GOSTSec/ccminer synced 2025-03-09 20:11:11 +00:00

api: add kernel version for linux

This commit is contained in:
Tanguy Pruvot 2014-12-26 15:19:27 +00:00
parent b3188669e2
commit 5cbf239d8a

11
api.cpp
View File

@ -270,12 +270,21 @@ static void gpuhwinfos(int gpu_id)
strcat(buffer, buf);
}
#ifndef WIN32
static char os_version[64] = "linux ";
#endif
static const char* os_name()
{
#ifdef WIN32
return "windows";
#else
return "linux";
FILE *fd = fopen("/proc/version", "r");
if (!fd || !fscanf(fd, "Linux version %48s", &os_version[6]))
return "linux";
fclose(fd);
os_version[48] = '\0';
return (const char*) os_version;
#endif
}