[Bug 259787] sched.h: unknown type name 'cpu_set_t' after 160b4b922b6021848b6b48afc894d16b879b7af2

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 15 Nov 2021 21:23:11 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259787

--- Comment #14 from Jan Beich <jbeich@FreeBSD.org> ---
According to base 90fa9705d5cd _WITH_CPU_SET_T is supposed to enable the new
functionality. If many ports are broken without it the conditional is pointless
and all regressions should be fixed the hard way (a la Clang upgrades).

AC_CHECK_FUNC(sched_getaffinity) from autotools and
meson.get_compiler('c').has_function('sched_getaffinity') test symbol
visibility without using #include <sched.h>. Such behavior is allowed in C
unlike C++ but often warned via -Wimplicit-function-declaration. For example,
GNU libc hides extensions like sched_getaffinity by default. However, NetBSD
added sched_getaffinity_np in 2008-10-31 and DragonFly added sched_getaffinity
in 2017-01-14, both following the BSD convention of exposing all extensions
unless standard conformance (e.g., _POSIX_C_SOURCE) is requested.

https://www.man7.org/linux/man-pages/man2/sched_getaffinity.2.html
https://man.dragonflybsd.org/?command=sched_getaffinity&section=2
https://man.netbsd.org/sched_getaffinity_np.3

After FreeBSD finally got rid of _WITH_GETLINE and _WITH_DPRINTF we now have
_WITH_CPU_SET_T to deal with. It's as ugly as cheating _POSIX_C_SOURCE by
defining __BSD_VISIBLE.

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