From ab1af8d7092df656090eebe438f299bc09593496 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 20 Feb 2022 16:03:27 +0100 Subject: Some small changes to how cpuid is done (especially on core counts) --- src/wrapped/wrappedlibc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/wrapped') diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 2537a68b..a257cc07 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1297,6 +1297,12 @@ void grabNCpu() { if(!nCPU) nCPU=1; } } +int getNCpu() +{ + if(!nCPU) + grabNCpu(); + return nCPU; +} void CreateCPUInfoFile(int fd) { size_t dummy; @@ -1310,9 +1316,7 @@ void CreateCPUInfoFile(int fd) freq = r/1000.; fclose(f); } - if(!nCPU) - grabNCpu(); - int n = nCPU; + int n = getNCpu(); // generate fake CPUINFO int gigahertz=(freq>=1000.); #define P \ -- cgit 1.4.1