OBS-URL: https://build.opensuse.org/package/show/Base:System/procinfo?expand=0&rev=8
28 lines
846 B
Plaintext
28 lines
846 B
Plaintext
---
|
|
procinfo.c | 14 +-------------
|
|
1 file changed, 1 insertion(+), 13 deletions(-)
|
|
|
|
--- procinfo.c
|
|
+++ procinfo.c 2004-01-17 07:01:16.000000000 +0000
|
|
@@ -1058,19 +1058,7 @@ main (int ac, char **av)
|
|
}
|
|
|
|
/* Count number of CPUs */
|
|
- cpuinfofp = myfopen (PROC_DIR "cpuinfo");
|
|
- if (cpuinfofp) {
|
|
- while (fgets (line, sizeof (line), cpuinfofp))
|
|
- if (!strncmp ("processor", line, 9)) /* intel */
|
|
- nr_cpus++;
|
|
- else if (!strncmp ("ncpus ", line, 6)) /* sparc */
|
|
- nr_cpus = atoi(line+19);
|
|
- else if (!strncmp ("cpus detected", line, 13)) /* alpha */
|
|
- nr_cpus = atoi(line+27);
|
|
- fclose (cpuinfofp);
|
|
- }
|
|
- if (nr_cpus == 0)
|
|
- nr_cpus = 1;
|
|
+ nr_cpus = sysconf (_SC_NPROCESSORS_ONLN);
|
|
|
|
/* Gets called from winsz(), but in case stdout is redirected: */
|
|
version = make_version (versionfp);
|