From d3bc229c79c7d5a94463f836707793331807b709 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 17 Nov 2025 18:20:19 +0100 Subject: [PATCH] qga/commands: Include proper Solaris header for getloadavg() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Solaris declares getloadavg() in : getloadavg(3C) Standard C Library Functions getloadavg(3C) NAME getloadavg - get system load averages SYNOPSIS #include int getloadavg(double loadavg[], int nelem); [...] Oracle Solaris 11.4 23 Jul 2020 getloadavg(3C) Include it in order to avoid: ../qga/commands-posix.c: In function 'qmp_guest_get_load': ../qga/commands-posix.c:1408:9: error: implicit declaration of function 'getloadavg' [-Wimplicit-function-declaration] 1408 | if (getloadavg(loadavg, G_N_ELEMENTS(loadavg)) < 0) { | ^~~~~~~~~~ ../qga/commands-posix.c:1408:9: warning: nested extern declaration of 'getloadavg' [-Wnested-externs] ../configure relevant output: C compiler for the host machine: gcc (gcc 14.2.0 "gcc (GCC) 14.2.0") C linker for the host machine: gcc ld.solaris 5.11-1.3315 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Kostiantyn Kostiuk Acked-by: Richard Henderson Message-Id: <20251117203834.83713-2-philmd@linaro.org> --- qga/commands-posix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index c7059857e4..66f3e6f673 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -43,6 +43,9 @@ #include #endif #ifdef CONFIG_SOLARIS +#ifdef CONFIG_GETLOADAVG +#include +#endif #include #endif #endif -- 2.47.3