about summary refs log tree commit diff stats
path: root/src/wrapped
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-02-20 16:03:27 +0100
committerptitSeb <sebastien.chev@gmail.com>2022-02-20 16:03:27 +0100
commitab1af8d7092df656090eebe438f299bc09593496 (patch)
treeea4d8ffcca206fa398a4ad5bf6af82807887116f /src/wrapped
parentffaae3ef39003a3ceffe8c6aea8307e28c03d807 (diff)
downloadbox64-ab1af8d7092df656090eebe438f299bc09593496.tar.gz
box64-ab1af8d7092df656090eebe438f299bc09593496.zip
Some small changes to how cpuid is done (especially on core counts)
Diffstat (limited to 'src/wrapped')
-rwxr-xr-xsrc/wrapped/wrappedlibc.c10
1 files changed, 7 insertions, 3 deletions
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 \