Skip to content

Commit

Permalink
Use uname -m to get CPU architecture (#2222)
Browse files Browse the repository at this point in the history
Use uname -m to get CPU architecture is simplier than lscpu
  • Loading branch information
4Darmygeometry authored Dec 28, 2024
1 parent 809b663 commit b7c5ada
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/my_cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const char* getCpuName()
}
}
// failled, try to get architecture at least
f = popen("LC_ALL=C lscpu | grep -i \"architecture:\" | head -n 1 | sed -r 's/(architecture:)\\s{1,}//gi'", "r");
f = popen("uname -m", "r");
if(f) {
char tmp[200] = "";
ssize_t s = fread(tmp, 1, 200, f);
Expand Down

0 comments on commit b7c5ada

Please sign in to comment.