summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorMichal Privoznik2022-10-26 09:30:24 +0200
committerDaniel P. Berrangé2022-10-26 14:32:58 +0200
commit73422d9524376526ab5950b3be3098901cd605d6 (patch)
tree9624968f625979d7ea9d0243ca6b6597baf97512 /meson.build
parentio/channel-watch: Fix socket watch on Windows (diff)
downloadqemu-73422d9524376526ab5950b3be3098901cd605d6.tar.gz
qemu-73422d9524376526ab5950b3be3098901cd605d6.tar.xz
qemu-73422d9524376526ab5950b3be3098901cd605d6.zip
seccomp: Get actual errno value from failed seccomp functions
Upon failure, a libseccomp API returns actual errno value very rarely. Fortunately, after its commit 34bf78ab (contained in 2.5.0 release), the SCMP_FLTATR_API_SYSRAWRC attribute can be set which makes subsequent APIs return true errno on failure. This is especially critical when seccomp_load() fails, because generic -ECANCELED says nothing. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build9
1 files changed, 9 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index b686dfef75..5f114c89d9 100644
--- a/meson.build
+++ b/meson.build
@@ -636,10 +636,16 @@ if vmnet.found() and not cc.has_header_symbol('vmnet/vmnet.h',
endif
seccomp = not_found
+seccomp_has_sysrawrc = false
if not get_option('seccomp').auto() or have_system or have_tools
seccomp = dependency('libseccomp', version: '>=2.3.0',
required: get_option('seccomp'),
method: 'pkg-config', kwargs: static_kwargs)
+ if seccomp.found()
+ seccomp_has_sysrawrc = cc.has_header_symbol('seccomp.h',
+ 'SCMP_FLTATR_API_SYSRAWRC',
+ dependencies: seccomp)
+ endif
endif
libcap_ng = not_found
@@ -1849,6 +1855,9 @@ config_host_data.set('CONFIG_RDMA', rdma.found())
config_host_data.set('CONFIG_SDL', sdl.found())
config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
config_host_data.set('CONFIG_SECCOMP', seccomp.found())
+if seccomp.found()
+ config_host_data.set('CONFIG_SECCOMP_SYSRAWRC', seccomp_has_sysrawrc)
+endif
config_host_data.set('CONFIG_SNAPPY', snappy.found())
config_host_data.set('CONFIG_TPM', have_tpm)
config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())