virprocess: Provide non-Linux stubs for virProcessGet{Stat,Sched}Info

Both virProcessGetStatInfo() and virProcessGetSchedInfo() are
Linux centric. Provide stubs for non-Linux platforms.

Fixes: d73852c499
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-01-06 20:13:08 +01:00
parent bfe7cd3d8a
commit d7c64453aa

View File

@ -1766,6 +1766,7 @@ virProcessGetStat(pid_t pid,
}
#ifdef __linux__
int
virProcessGetStatInfo(unsigned long long *cpuTime,
int *lastCpu,
@ -1873,3 +1874,26 @@ virProcessGetSchedInfo(unsigned long long *cpuWait,
return 0;
}
#else
int
virProcessGetStatInfo(unsigned long long *cpuTime G_GNUC_UNUSED,
int *lastCpu G_GNUC_UNUSED,
long *vm_rss G_GNUC_UNUSED,
pid_t pid G_GNUC_UNUSED,
pid_t tid G_GNUC_UNUSED)
{
errno = ENOSYS;
return -1;
}
int
virProcessGetSchedInfo(unsigned long long *cpuWait G_GNUC_UNUSED,
pid_t pid G_GNUC_UNUSED,
pid_t tid G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
_("scheduler information is not supported on this platform"));
return -1;
}
#endif /* __linux__ */