From nobody Tue Apr 7 03:49:03 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73313ECAAD3 for ; Wed, 31 Aug 2022 18:26:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbiHaS0M (ORCPT ); Wed, 31 Aug 2022 14:26:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232650AbiHaSZg (ORCPT ); Wed, 31 Aug 2022 14:25:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4639DFBA5C for ; Wed, 31 Aug 2022 11:21:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8C4C2B82275 for ; Wed, 31 Aug 2022 18:21:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B220C433B5; Wed, 31 Aug 2022 18:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661970110; bh=nNEzh9yptkWyGVGTNGnwj/QZ/DlDOZpEjF3yTgBo8vo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZMnDNVNxWh37xzFyn2SrR0BhE+uv0Vc4Uxki6au7y/gH1lspujGeOBnLqPIzK1Jjv Dn4GMm6dYqHJCxUTvZS18tUBCUADxMVrtUqAoUQVGIBIZCHCVfrC1Cm81W8DbmEfih 7ohz0ZrsCMYtcEY+WOuKhuKejvuGE0UqKynP+UctXusRUOsrFFBBsUjvaHCx3sVaXO o6I1mg1hRT7AltbA2/V8HUYVqhA13YOTsPrqASjCsqPfv0bfG75h8VPah12kFJ/idP +pAoeCaiwkeaDQMhiPzCkoQmy2jsPOcY2AbXNC2p0j0R63EXbF0WpO8dXQIcmMvK76 m1sFC6vRoVjcw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id D712E5C06A7; Wed, 31 Aug 2022 11:21:49 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@fb.com, w@lwt.eu, Willy Tarreau , "Paul E . McKenney" Subject: [PATCH nolibc 03/18] tools/nolibc: make sys_mmap() automatically use the right __NR_mmap definition Date: Wed, 31 Aug 2022 11:21:33 -0700 Message-Id: <20220831182148.2698489-5-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220831182113.GA2697286@paulmck-ThinkPad-P17-Gen-1> References: <20220831182113.GA2697286@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Willy Tarreau __NR_mmap2 was used for i386 but it's also needed for other archs such as RISCV32 or ARM. Let's decide to use it based on the __NR_mmap2 definition as it's not defined on other archs. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/include/nolibc/sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index b8c96878c9ce0..ce3ee03aa6794 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -697,7 +697,7 @@ void *sys_mmap(void *addr, size_t length, int prot, int= flags, int fd, =20 int n; =20 -#if defined(__i386__) +#if defined(__NR_mmap2) n =3D __NR_mmap2; offset >>=3D 12; #else --=20 2.31.1.189.g2e36527f23