git: 3e11d3f61ae2 - main - Fixed the value returned by sched_getaffinity().
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 12 May 2022 17:06:36 UTC
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=3e11d3f61ae2b2b8a8ffeff4ef32067d95c065a1 commit 3e11d3f61ae2b2b8a8ffeff4ef32067d95c065a1 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2022-05-12 17:06:13 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2022-05-12 17:06:13 +0000 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 --- lib/libc/gen/sched_getaffinity.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c index 92135109156c..ed304c111985 100644 --- a/lib/libc/gen/sched_getaffinity.c +++ b/lib/libc/gen/sched_getaffinity.c @@ -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); }