Bug 230330

Summary: _SC_NPROCESSORS_ONLN reports offline CPUs
Product: Base System Reporter: Jan Beich <jbeich>
Component: standardsAssignee: freebsd-standards (Nobody) <standards>
Status: New ---    
Severity: Affects Only Me CC: kib
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
See Also: http://austingroupbugs.net/view.php?id=339
Attachments:
Description Flags
workaround
none
workaround none

Description Jan Beich freebsd_committer 2018-08-03 13:40:05 UTC
Created attachment 195818 [details]
workaround

FreeBSD unlike Linux (GNU libc), Solaris, NetBSD, OpenBSD, etc. has _SC_NPROCESSORS_ONLN being a synonym for _SC_NPROCESSORS_CONF. Also affects /sys/devices/system/cpu/cpu%d/online in linsysfs.
Comment 1 Jan Beich freebsd_committer 2018-08-03 13:44:29 UTC
Created attachment 195819 [details]
workaround
Comment 2 Konstantin Belousov freebsd_committer 2018-08-03 14:17:04 UTC
(In reply to Jan Beich from comment #1)
The libc part of the patch looks fine, please commit it.

The linsysfs better use CPU_FOREACH().