Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Leap:15.0:Rings:1-MinimalX
procps
procps-ng-3.3.10-bnc634071_procstat2.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File procps-ng-3.3.10-bnc634071_procstat2.diff of Package procps
--- proc/libprocps.sym | 1 + proc/sysinfo.c | 13 +++++++++++-- proc/sysinfo.h | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) --- proc/libprocps.sym +++ proc/libprocps.sym 2016-07-11 13:11:10.857365085 +0000 @@ -54,6 +54,7 @@ global: signal_name_to_number; signal_number_to_name; smp_num_cpus; + __smp_num_cpus; sprint_uptime; strtosig; tty_to_dev; --- proc/sysinfo.c +++ proc/sysinfo.c 2016-07-11 13:11:10.857365085 +0000 @@ -37,7 +37,8 @@ #include <netinet/in.h> /* htons */ #endif -long smp_num_cpus; /* number of CPUs */ +#undef smp_num_cpus +long smp_num_cpus=-1; /* number of CPUs */ long page_bytes; /* this architecture's page size */ #define BAD_OPEN_MESSAGE \ @@ -1076,7 +1077,11 @@ out: /////////////////////////////////////////////////////////////////////////// -void cpuinfo (void) { +long __smp_num_cpus (void) { + + if (smp_num_cpus != -1) + return(smp_num_cpus); + // ought to count CPUs in /proc/stat instead of relying // on glibc, which foolishly tries to parse /proc/cpuinfo // note: that may have been the case but now /proc/stat @@ -1091,4 +1096,8 @@ void cpuinfo (void) { smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN); if (smp_num_cpus<1) /* SPARC glibc is buggy */ smp_num_cpus=1; + + return smp_num_cpus; } + +void cpuinfo (void) { (void)__smp_num_cpus(); } --- proc/sysinfo.h +++ proc/sysinfo.h 2016-07-11 13:11:10.857365085 +0000 @@ -8,6 +8,8 @@ EXTERN_C_BEGIN extern unsigned long long Hertz; /* clock tick frequency */ extern long smp_num_cpus; /* number of CPUs */ +extern long __smp_num_cpus(void); +#define smp_num_cpus __smp_num_cpus() extern int have_privs; /* boolean, true if setuid or similar */ extern long page_bytes; /* this architecture's bytes per page */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor