Bug 230330 - _SC_NPROCESSORS_ONLN reports offline CPUs
Summary: _SC_NPROCESSORS_ONLN reports offline CPUs
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-standards (Nobody)
Keywords: patch
Depends on:
Reported: 2018-08-03 13:40 UTC by Jan Beich
Modified: 2018-08-04 04:04 UTC (History)
1 user (show)

See Also:

workaround (1.18 KB, patch)
2018-08-03 13:40 UTC, Jan Beich
no flags Details | Diff
workaround (1.18 KB, patch)
2018-08-03 13:44 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2018-08-03 13:40:05 UTC
Created attachment 195818 [details]

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]
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().