From nobody Fri Jun 17 19:40:23 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F18E585CFAC; Fri, 17 Jun 2022 19:40:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPqBv73SLz3hMs; Fri, 17 Jun 2022 19:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4YqPPRE8/Py3/ZZ/Ne1s5lcy3qqnKgpm23ccQiIdLI=; b=W8ML/b7YbZS3mFztl7d2z8bJ0TarCReCmM9ldfsavc0QNPMPc6VseQSLypQVCMOBs8j4cE 1uUn+cs3w7qCYEiZ5fk3PDETtTS3F+rVRYrkMp3M+tq58TSK9JP6ChEQALKZOZcREO+s78 C9fJRA9LtsD1tUFPA/71bkZyuWIUoE2OKlN37rExKF3+80wCCGp1J71ErZA8IZh269jLHy O8+tBqyZ8xY9W+NlR8aHaKyIkfdnWCjxLjq8Coq+X4cUFZSzHl7nzIYZjxSfOIKq4HrHwO l0Fpn/KphgLfy7SB+APtLT3lkzxMkNo2pNpbhhYZObu5Mfx6YixDSRpKObUPaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64C4225D9E; Fri, 17 Jun 2022 19:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJeN1R025738; Fri, 17 Jun 2022 19:40:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJeNn0025736; Fri, 17 Jun 2022 19:40:23 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:40:23 GMT Message-Id: <202206171940.25HJeNn0025736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 46be698d0fb0 - stable/13 - Fixed the value returned by sched_getaffinity(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 46be698d0fb0bfeb96914df5426d3a317314df67 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4YqPPRE8/Py3/ZZ/Ne1s5lcy3qqnKgpm23ccQiIdLI=; b=sHzvne3FQxYJeVXg5zHXA4oneQMxgjMcFt0abOYEhF2MR7rX08I9LuR6tCciXyGkxBI14S vC9zD8xPWtyjGXdoAQs8kowKVVjNORfmnnklMgLUYJisCA4fiUBXkZ+k6ra+QWrEJx4dgZ O9kEMO5r/BGL3Ef0HybK9hIp9obTPGTse+y3FgXQL04k5oAovH9cw+1UF52XER7Q//aU5w lVBIozc+XdmoTeIZyP3Keo0wtusB3vyQyji3QmPTiwRHl92HABJ995SDoOQbHIIoqYSwf6 ReSau2hPOda+eTqwSBLv+Pxdiu9ik4DLrdeZwEyXpQcGkpEh5JBqEw8ZTnPfgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494824; a=rsa-sha256; cv=none; b=ZZmMZRbidVOQx3fXDqaRAXopEgt7ivv0XjsYIEnRWckddAj4U6CnqgyhJ0rG5/B2LSQKqS g1ljzHCDaVw1f/719msy8LHw07a0Sp/v2YUrXOYljY8sumU2t4yNBb8l+Et2ImnhVYXKWL a7fLS1h8QKBzo/eYMUvzlkeB/joq9sREyWiHcWBfJ5oNR8EUCaCnZjVgdtj1Q3XAASTuYh MZJXxT+b1yHBcTVY7eBwuRppX0iLZ0xH5fxZgO0ylTP9lP7KbbnOhGnT+DRMWRYwQRkYGY +MPzL1wScb40sLZ6iMsA1shaAkyK4fqBq1N+K4j7rD2drXAtMAOh9QCA5GK+Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=46be698d0fb0bfeb96914df5426d3a317314df67 commit 46be698d0fb0bfeb96914df5426d3a317314df67 Author: Dmitry Chagin AuthorDate: 2022-05-12 17:06:13 +0000 Commit: Dmitry Chagin 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); }