summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorJoelle van Dyne2021-01-26 02:24:51 +0100
committerPeter Maydell2021-01-29 11:47:28 +0100
commit1ad27f7d93f1a0f76b9cdad1bea01bcebfc130bc (patch)
treec3db458332d4f14d3b784de690b69f67044f7763 /include/qemu
parentconfigure: cross-compiling with empty cross_prefix (diff)
downloadqemu-1ad27f7d93f1a0f76b9cdad1bea01bcebfc130bc.tar.gz
qemu-1ad27f7d93f1a0f76b9cdad1bea01bcebfc130bc.tar.xz
qemu-1ad27f7d93f1a0f76b9cdad1bea01bcebfc130bc.zip
osdep: build with non-working system() function
Build without error on hosts without a working system(). If system() is called, return -1 with ENOSYS. Signed-off-by: Joelle van Dyne <j@getutm.app> Message-id: 20210126012457.39046-6-j@getutm.app Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/osdep.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index b6ffdc15bf..ba15be9c56 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -710,4 +710,16 @@ static inline void qemu_thread_jit_write(void) {}
static inline void qemu_thread_jit_execute(void) {}
#endif
+/**
+ * Platforms which do not support system() return ENOSYS
+ */
+#ifndef HAVE_SYSTEM_FUNCTION
+#define system platform_does_not_support_system
+static inline int platform_does_not_support_system(const char *command)
+{
+ errno = ENOSYS;
+ return -1;
+}
+#endif /* !HAVE_SYSTEM_FUNCTION */
+
#endif