From mboxrd@z Thu Jan 1 00:00:00 1970 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 29EC8C43334 for ; Tue, 19 Jul 2022 21:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240421AbiGSVp4 (ORCPT ); Tue, 19 Jul 2022 17:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240074AbiGSVpr (ORCPT ); Tue, 19 Jul 2022 17:45:47 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 557F7193D7; Tue, 19 Jul 2022 14:45:34 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 26JLj4Tr002583; Tue, 19 Jul 2022 23:45:04 +0200 From: Willy Tarreau To: "Paul E . McKenney" Cc: Pranith Kumar , Alviro Iskandar Setiawan , Ammar Faizi , David Laight , Mark Brown , Linus Torvalds , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH 03/17] tools/nolibc: make sys_mmap() automatically use the right __NR_mmap definition Date: Tue, 19 Jul 2022 23:44:34 +0200 Message-Id: <20220719214449.2520-4-w@1wt.eu> X-Mailer: git-send-email 2.17.5 In-Reply-To: <20220719214449.2520-1-w@1wt.eu> References: <20220719214449.2520-1-w@1wt.eu> Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org __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 --- 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 b8c96878c9ce..ce3ee03aa679 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, int n; -#if defined(__i386__) +#if defined(__NR_mmap2) n = __NR_mmap2; offset >>= 12; #else -- 2.17.5