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:
Dmitry Chagin 2022-05-12 20:06:13 +03:00
parent 6987c47569
commit 3e11d3f61a

View File

@ -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);
}