Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4291673rdb; Thu, 14 Sep 2023 19:12:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLylUG5HXW9Oy9XznvsZkEvp4Et//dEwzrjUMeU8BsM5DK3FT9BOem06zbTXUz8ExSDp5y X-Received: by 2002:a17:903:22c7:b0:1bc:edd:e891 with SMTP id y7-20020a17090322c700b001bc0edde891mr5137886plg.1.1694743928819; Thu, 14 Sep 2023 19:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694743928; cv=none; d=google.com; s=arc-20160816; b=kmJwKwXIhfA13TSrXDZUcTJLZ2h9X3drOoaOApy0E6gfi83OIHPiqN21L6MlVO4StU Uyh+M+NYI5oKPawN+MYhajofzii67Sngncme+BpE/U3iCOyQm2PI9oxm9L8f390H6hTp bSysQOswyDyQzCw1m2uLm/K7yXFmnKm3RWn4zT87HdFWcQpUSY0aaJPhokN9XoFoBJ83 mTkfNG7UmNKCuBuFUPoTHJEVkTrLDWZNX+qDK9nodcqoAJsJUfuuKWU6qWZzhsVDm59E ROIEqu4SjhdkNuH6SdpjU2x3k2QqXdRouLCric0Pj8njeZRWkAgrB5ywZB5uA87BUZfZ BAIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=dxkdN82OQPZWSIi/R5RnFnxBkFSgvugw29WpRg5bIqE=; fh=azYK+WW57en7GGRdjKWjQOHkHDsNRqF/+6hheqDI200=; b=yFEPE6QufdNDazh6vYaezDMJiez+mkVQvh/ZWlh43iV3xUDtMLm5BzhNiqBW1CdiFa go30R+bRa8HFKLMhJtOw/kf1OZsnWw+KtchtMxCglXV+5+T+QPQiMWxjZWtggkWynUuc OdzH+uAPxvn6VD4NZ3cTjzfVk+6a9kFUtlCa2PEvZewP5Kt2yXHjxAjXzdh3YEPC0efr ARGELT+hC+qpuYipPTuYirO+X11GuJAwCJZ6UUaobm8N4rXSS9YprQbbuih5zc/9CLXR lu51VhRc0vxbpvI38irCXytMQjGMQd+XlctVivg4mfEmVqk/4JOlVVZCMEaumu8eIm6u fYIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=nJXJ1xXH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id k71-20020a636f4a000000b005697ed9a479si2288902pgc.73.2023.09.14.19.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 19:12:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=nJXJ1xXH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 6E84F8325FED; Thu, 14 Sep 2023 09:02:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241748AbjINQC0 (ORCPT + 99 others); Thu, 14 Sep 2023 12:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241679AbjINQCB (ORCPT ); Thu, 14 Sep 2023 12:02:01 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39953272A; Thu, 14 Sep 2023 09:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1694707293; bh=Cu53Z9oyo5nGu95h1+MArmP5k33gYn4AQCWOgwsV/Ac=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nJXJ1xXHesT1KczhMwLWfm4v2NTSTPtV6KAFS2C4/pVvhrkdw5iJnNuZPfzcNH81X EtTjjm+ZcV9Z7OFkbIZxH8hQi/WlF1z44FUARs5NxJ4SAmGq+cjERWC0zZPVi655jx B+V7D+nxIi6ovzre3715c/cC7TfgIxPeombwOIp4= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 14 Sep 2023 18:01:19 +0200 Subject: [PATCH 3/4] tools/nolibc: don't define new syscall number MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230914-nolibc-syscall-nr-v1-3-e50df410da11@weissschuh.net> References: <20230914-nolibc-syscall-nr-v1-0-e50df410da11@weissschuh.net> In-Reply-To: <20230914-nolibc-syscall-nr-v1-0-e50df410da11@weissschuh.net> To: Willy Tarreau , Paul Walmsley , Palmer Dabbelt , Albert Ou , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694707292; l=1227; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=Cu53Z9oyo5nGu95h1+MArmP5k33gYn4AQCWOgwsV/Ac=; b=gJVRysrB+1Fm++kEZkA6QvwJaFYmt27QWy1msKjd+eJjR2FaQgck9iIwYB4bxpA6by3xzT2p2 PzfnrKof6pvBVVTgIWWtMX9cfqisWMmTH2n3Am9bIT64PWNQbOqeho2 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 14 Sep 2023 09:02:38 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email All symbols created by nolibc are also visible to user code. Syscall constants are expected to come from the kernel headers and should not be made up by nolibc. Refactor the logic to avoid defining syscall numbers. Also the new code is easier to understand. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/sys.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index bc56310c6bdf..d96f2aa7d987 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -954,11 +954,10 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva t.tv_nsec = timeout->tv_usec * 1000; } return my_syscall6(__NR_pselect6, nfds, rfds, wfds, efds, timeout ? &t : NULL, NULL); -#elif defined(__NR__newselect) || defined(__NR_select) -#ifndef __NR__newselect -#define __NR__newselect __NR_select -#endif +#elif defined(__NR__newselect) return my_syscall5(__NR__newselect, nfds, rfds, wfds, efds, timeout); +#elif defined(__NR_select) + return my_syscall5(__NR_select, nfds, rfds, wfds, efds, timeout); #else (void)nfds; (void)rfds; -- 2.42.0