From owner-dev-commits-src-all@freebsd.org Fri Mar 12 15:34:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29CFD57CA93; Fri, 12 Mar 2021 15:34:41 +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 4Dxqcd0ktGz4S0r; Fri, 12 Mar 2021 15:34:41 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 0827E1A48E; Fri, 12 Mar 2021 15:34:41 +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 12CFYec4093956; Fri, 12 Mar 2021 15:34:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CFYeiJ093955; Fri, 12 Mar 2021 15:34:40 GMT (envelope-from git) Date: Fri, 12 Mar 2021 15:34:40 GMT Message-Id: <202103121534.12CFYeiJ093955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 0dfbdd9fc269 - main - linux(4): make getcwd(2) return ERANGE instead of ENOMEM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0dfbdd9fc269f0438ffcc31632d35234a90584ad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2021 15:34:41 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=0dfbdd9fc269f0438ffcc31632d35234a90584ad commit 0dfbdd9fc269f0438ffcc31632d35234a90584ad Author: Edward Tomasz Napierala AuthorDate: 2021-03-12 15:31:37 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-03-12 15:31:45 +0000 linux(4): make getcwd(2) return ERANGE instead of ENOMEM For native FreeBSD binaries, the return value from __getcwd(2) doesn't really matter, as the libc wrapper takes over and returns the proper errno. PR: kern/254120 Reported By: Alex S Reviewed By: kib Sponsored By: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29217 --- sys/compat/linux/linux_getcwd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c index c39e69c4e707..4917641be5e5 100644 --- a/sys/compat/linux/linux_getcwd.c +++ b/sys/compat/linux/linux_getcwd.c @@ -74,6 +74,8 @@ linux_getcwd(struct thread *td, struct linux_getcwd_args *uap) buf = malloc(buflen, M_TEMP, M_WAITOK); error = vn_getcwd(buf, &retbuf, &buflen); + if (error == ENOMEM) + error = ERANGE; if (error == 0) { error = copyout(retbuf, uap->buf, buflen); if (error == 0)