virprocess: Provide non-Linux stubs for virProcessGet{Stat,Sched}Info
Both virProcessGetStatInfo() and virProcessGetSchedInfo() are Linux centric. Provide stubs for non-Linux platforms. Fixes: d73852c49962fbfe652fc7bec595a3f242faf847 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:
parent
bfe7cd3d8a
commit
d7c64453aa
@ -1766,6 +1766,7 @@ virProcessGetStat(pid_t pid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
int
|
int
|
||||||
virProcessGetStatInfo(unsigned long long *cpuTime,
|
virProcessGetStatInfo(unsigned long long *cpuTime,
|
||||||
int *lastCpu,
|
int *lastCpu,
|
||||||
@ -1873,3 +1874,26 @@ virProcessGetSchedInfo(unsigned long long *cpuWait,
|
|||||||
|
|
||||||
return 0;
|
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__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user