This is the mail archive of the glibc-bugs@sourceware.org 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]
Other format: [Raw text]

[Bug libc/21542] New: Use conservative default for sysconf (_SC_NPROCESSORS_ONLN)


https://sourceware.org/bugzilla/show_bug.cgi?id=21542

            Bug ID: 21542
           Summary: Use conservative default for sysconf
                    (_SC_NPROCESSORS_ONLN)
           Product: glibc
           Version: 2.25
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Currently, if running in a chroot environment without /proc and /sys, sysconf
(_SC_NPROCESSORS_ONLN) can return 1 on a multi-processor system.  This breaks
applications which use the return value to recognize uniprocessor systems and
apply optimizations based on that.

ysconf (_SC_NPROCESSORS_ONLN) should return 2 instead, which is a more
conservative approximation.  It can be inefficient, but at least it will not be
completely incorrect.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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