This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

glibc-2.2.3 alphaev6 sysconf(_SC_NPROCESSORS_CONF) returns 0


glibc-2.2.3 sysconf(_SC_NPROCESSORS_CONF) returns 0 on my system.
Admittedly, my system is broken, since my /proc/cpuinfo includes:
cpus detected          : 0
So, you could make a case that glibc-2.2.3 is correctly returning what my
system is reporting.

However, glibc-2.1.3's sysconf(_SC_NPROCESSORS_CONF) on this same 
system returns 1.  Since if sysconf is able to run at all, there must
be at least 1 cpu running, one could make a case that it should always
return at least 1.

The routines in question are sysdeps/unix/sysv/linux/getsysstats.c:
__get_nproc() and __get_nproc_conf().   I replaced "return result"
with  "return (result == 0) ? 1 : result;"

Ken


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]