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

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 14 Nov 2021 16:29:31 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259787

--- Comment #11 from Evgeniy Khramtsov <evgeniy@khramtsov.org> ---
14-CURRENT as of base 20aa35977 still can't build:

benchmarks/iperf3

[...]
iperf_api.c:4460:5: error: unknown type name 'cpu_set_t'; did you mean
'cpuset_t'?
    cpu_set_t cpu_set;
    ^~~~~~~~~
    cpuset_t
/usr/include/sys/_cpuset.h:50:24: note: 'cpuset_t' declared here
typedef struct _cpuset cpuset_t;
                       ^

graphics/cairo

[...]
cairo-perf-micro.c:418:5: error: unknown type name 'cp
u_set_t'; did you mean 'cpusetid_t'?
    cpu_set_t affinity;
    ^~~~~~~~~
    cpusetid_t
/usr/include/sys/types.h:86:22: note: 'cpusetid_t' declared here
typedef __cpusetid_t    cpusetid_t;
                        ^
cairo-perf-micro.c:421:9: error: implicit declaration of function
'sched_getaffinity' is inva
lid in C99 [-Werror,-Wimplicit-function-declaration]
    if (sched_getaffinity(0, sizeof(affinity), &affinity)) {
        ^
cairo-perf-micro.c:426:35: error: use of undeclared identifier 'CPU_SETSIZE'
    for(i = 0, cpu_count = 0; i < CPU_SETSIZE; ++i) {
                                  ^
cairo-perf-micro.c:427:6: error: implicit declaration of function 'CPU_ISSET'
is invalid in C
99 [-Werror,-Wimplicit-function-declaration]
        if (CPU_ISSET(i, &affinity))
            ^
4 errors generated.

graphics/mesa-devel

[...]
src/util/libmesa_util.a.p/u_cpu_detect.c.o -MF
src/util/libmesa_util.a.p/u_cpu_detect.c.o.d -o
src/util/libmesa_util.a.p/u_cpu_detect.c.o -c ../src/util/u_cpu_detect.c
../src/util/u_cpu_detect.c:613:11: error: implicit declaration of function
'sched_getaffinity' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      if (sched_getaffinity(getpid(), sizeof(affin), &affin) == 0)
          ^
../src/util/u_cpu_detect.c:613:11: note: did you mean 'cpuset_getaffinity'?
/usr/include/sys/cpuset.h:159:5: note: 'cpuset_getaffinity' declared here
int     cpuset_getaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, cpuset_t *);
        ^
1 error generated.

Passing -D_WITH_CPU_SET_T to port's CFLAGS resolves this, but is this the
intended behavior for porters to consider after base 90fa9705d ?

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