qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] linux-user: Add missing /proc/cpuinfo fields for sparc


From: Helge Deller
Subject: Re: [PATCH] linux-user: Add missing /proc/cpuinfo fields for sparc
Date: Thu, 9 Jan 2025 03:33:44 +0100
User-agent: Mozilla Thunderbird

On 1/9/25 01:40, Richard Henderson wrote:
On 1/8/25 15:21, Helge Deller wrote:
My suggestion:
I change my patch to just add:

+    dprintf(fd, "ncpus probed\t: %d\n", num_cpus);
+    dprintf(fd, "ncpus active\t: %d\n", num_cpus);
+    dprintf(fd, "State:\n");
+    for (i = 0; i < num_cpus; i++) {
+        dprintf(fd, "CPU%d:\t\t: online\n", i);
+    }

Those were the lines which I was mostly interested in since
I found one application which wants to parse /proc/cpuinfo
to get number of CPUs in system.
Would that be acceptable (for now) ?

Yes, thanks.  If only linux had added a prctl or something to not require 
parsing...

True, but most people forget about glibc providing sysconf(_SC_NPROCESSORS_ONLN)
as portable function so that people do not need to implement parsing
/proc/cpuinfo for each architecture themselves.

I'll respin the patch.

Helge



reply via email to

[Prev in Thread] Current Thread [Next in Thread]