Enable affinity support for non-Linux

sched_getaffinity() and sched_setaffinity() are also available on BSDs.
Remove the Linux restraint.
This commit is contained in:
Christian Göttsche
2021-06-13 11:29:39 +02:00
committed by Benny Baumann
parent adcedf87f5
commit 1fb0c720fe
6 changed files with 59 additions and 56 deletions

View File

@ -22,7 +22,7 @@ in the source distribution for its full text.
#else
#define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_PROCESS
#endif
#elif defined(HAVE_LINUX_AFFINITY)
#elif defined(HAVE_AFFINITY)
#include <sched.h>
#endif
@ -84,7 +84,7 @@ bool Affinity_set(Process* proc, Arg arg) {
return ok;
}
#elif defined(HAVE_LINUX_AFFINITY)
#elif defined(HAVE_AFFINITY)
Affinity* Affinity_get(const Process* proc, ProcessList* pl) {
cpu_set_t cpuset;