Skip to content

Commit

Permalink
Merge pull request #1189 from no92/sched
Browse files Browse the repository at this point in the history
options/linux: handle zero PID in sched_getaffinity correctly
  • Loading branch information
Dennisbonke authored Nov 18, 2024
2 parents d5feade + 7fb8ebe commit 3462fa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion options/linux/generic/sched.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int sched_getscheduler(pid_t) {

int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask) {
MLIBC_CHECK_OR_ENOSYS(mlibc::sys_getaffinity, -1);
if(int e = mlibc::sys_getaffinity(pid, cpusetsize, mask); e) {
if(int e = mlibc::sys_getaffinity(pid ? pid : mlibc::sys_getpid(), cpusetsize, mask); e) {
errno = e;
return -1;
}
Expand Down

0 comments on commit 3462fa7

Please sign in to comment.