Fixed the value returned by sched_getaffinity().
On success gnu libc sched_getaffinity() should return 0, unlike underlying Linux syscall which returns the size of CPU mask copied to user. PR: 263939 MFC after: 2 weeks
This commit is contained in:
parent
6987c47569
commit
3e11d3f61a
@ -39,9 +39,5 @@ sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset)
|
||||
pid == 0 ? -1 : pid, cpusetsz, cpuset);
|
||||
if (error == -1 && errno == ERANGE)
|
||||
errno = EINVAL;
|
||||
if (error == 0)
|
||||
return (cpusetsz < sizeof(cpuset_t) ? cpusetsz :
|
||||
sizeof(cpuset_t));
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user