Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2022 19:40:23 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 46be698d0fb0 - stable/13 - Fixed the value returned by sched_getaffinity().
Message-ID:  <202206171940.25HJeNn0025736@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=46be698d0fb0bfeb96914df5426d3a317314df67

commit 46be698d0fb0bfeb96914df5426d3a317314df67
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-05-12 17:06:13 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:35:16 +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
    
    (cherry picked from commit 3e11d3f61ae2b2b8a8ffeff4ef32067d95c065a1)
---
 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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206171940.25HJeNn0025736>