mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
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:
parent
bfe7cd3d8a
commit
d7c64453aa
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user