osdep: add getloadavg
commitdc864d3a3777424187280e50c9bfb84dced54f12
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 7 Nov 2023 09:20:55 +0000 (7 04:20 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 1 Dec 2023 13:53:04 +0000 (1 08:53 -0500)
treebeb14aa042607de7a6a9d7387fde104ab8a8eec7
parentabf635ddfe3242df907f58967f3c1e6763bbca2d
osdep: add getloadavg

getloadavg is supported on Linux, BSDs, Solaris.

Following man page:
RETURN VALUE
       If the load average was unobtainable, -1 is returned; otherwise,
       the number of samples actually retrieved is returned.

accordingly, make stub for systems which don't support this function return -1
for consistency.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
include/qemu/osdep.h
meson.build