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

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 26 Nov 2021 16:37:23 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259787

--- Comment #30 from Trond.Endrestol@ximalas.info ---
Created attachment 229745
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=229745&action=edit
Patch for lang/ghc, for rts/posix/OSThreads.c

Should fix these errors:

rts/posix/OSThreads.c:314:5: error:
     error: unknown type name 'cpu_set_t'; did you mean 'cpuset_t'?
        cpu_set_t cs;
        ^~~~~~~~~
        cpuset_t
    |
314 |     cpu_set_t cs;
    |     ^

/usr/include/sys/_cpuset.h:50:24: error:
     note: 'cpuset_t' declared here
   |
50 | typedef struct _cpuset cpuset_t;
   |                        ^
typedef struct _cpuset cpuset_t;
                       ^

rts/posix/OSThreads.c:322:5: error:
     warning: implicit declaration of function 'sched_setaffinity' is invalid
in C99 [-Wimplicit-function-declaration]
        sched_setaffinity(0, sizeof(cpu_set_t), &cs);
        ^
    |
322 |     sched_setaffinity(0, sizeof(cpu_set_t), &cs);
    |     ^

rts/posix/OSThreads.c:322:33: error:
     error: use of undeclared identifier 'cpu_set_t'
        sched_setaffinity(0, sizeof(cpu_set_t), &cs);
                                    ^
    |
322 |     sched_setaffinity(0, sizeof(cpu_set_t), &cs);
    |                                 ^
1 warning and 2 errors generated.
`cc' failed in phase `C Compiler'. (Exit code: 1)
gmake[2]: *** [rts/ghc.mk:325: rts/dist/build/posix/OSThreads.p_o] Error 1

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