Skip to content

Commit

Permalink
- Fix to print error when system does not have setaffinity.
Browse files Browse the repository at this point in the history
  • Loading branch information
wcawijngaards committed Mar 20, 2020
1 parent 6638394 commit d3825f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
20 March 2020: Wouter
- Merge PR #83 from noloader: Fix GNU HURD sched_setaffinity compile.
- Fix to print error when system does not have setaffinity.

19 March 2020: Wouter
- Fix #76: cpuid typedef for Hurd, DragonflyBSD compile.
Expand Down
12 changes: 10 additions & 2 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,16 @@ int number_of_cpus(void)
return -1;
}
#endif
#ifdef HAVE_SCHED_SETAFFINITY
/* Linux and HURD */
#ifdef __gnu_hurd__
/* HURD has no sched_setaffinity implementation, but links an always fail,
* with a linker error, we print an error when it is used */
int set_cpu_affinity(cpuset_t *ATTR_UNUSED(set))
{
log_err("sched_setaffinity: not available on this system");
return -1;
}
#elif defined(HAVE_SCHED_SETAFFINITY)
/* Linux */
int set_cpu_affinity(cpuset_t *set)
{
assert(set != NULL);
Expand Down

0 comments on commit d3825f5

Please sign in to comment.