]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: fix cpuset_getaffinity() detection
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Tue, 23 Nov 2021 11:19:10 +0000 (15:19 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Wed, 24 Nov 2021 06:43:28 +0000 (10:43 +0400)
The cpuset_getaffinity() function is checked in sys/cpuset.h to see if
BSD CPU affinity APIs are available. This check requires including
sys/param.h to work properly, otherwise the test program fails with
unrelated errors like:

/usr/include/sys/cpuset.h:155:1: error: unknown type name
'__BEGIN_DECLS'
__BEGIN_DECLS
^
/usr/include/sys/cpuset.h:156:12: error: unknown type name 'cpusetid_t';
did you mean 'cpuset_t'?
int     cpuset(cpusetid_t *);

and so forth.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
meson.build

index e4f36e857449e372cd9e8630c47744b6bb35c70a..ad0cd44aca95162fb550651b9823d738580b38f1 100644 (file)
@@ -709,7 +709,7 @@ if (cc.has_header_symbol('net/if_bridgevar.h', 'BRDGSFD', prefix: brd_required_h
 endif
 
 # Check for BSD CPU affinity availability
-if cc.has_header_symbol('sys/cpuset.h', 'cpuset_getaffinity')
+if cc.has_header_symbol('sys/cpuset.h', 'cpuset_getaffinity', prefix: '#include <sys/param.h>')
   conf.set('WITH_BSD_CPU_AFFINITY', 1)
 endif