Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp527244rdg; Thu, 12 Oct 2023 12:33:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3vy4V1sX6CgsR6dC+7jwdAZEp2qyAIbgnRWTDcbUJOZj4ydZwnegPV43yTDeG1D6nTVzU X-Received: by 2002:a17:90b:1d03:b0:26b:5205:525e with SMTP id on3-20020a17090b1d0300b0026b5205525emr20889963pjb.42.1697139203434; Thu, 12 Oct 2023 12:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697139203; cv=none; d=google.com; s=arc-20160816; b=Iekk6ErCH4ieIpfpRsvYCmo6fwEP7qVgGJzL25IddYPGKn6PZtY3jKM4ipwTTbMzGD ZGO6SrJZDhwjJBb1hNbvW8Oru3BCIDbJsdBUAj6ysvSuDPyG4nSN/idda+ROZe7Kf6AQ cSUPGkACPYLQL61eqmlaot0KuzO2ejcOn/Skj/tJDK+VPVm8BB1EwlCYuP4jfTArg37s iMZjMFIvIQF9+bYAWZvoXO0QLfLo0fSDdUf9L/C40juWij5Kn9KmrTztMO/k+H8woHg9 CqKGFXhdA8SLa+MjjPXpiKPhXcbxGsfPK71tJj0HPgJg4HOtWtmorDC42YF2cgFhWPqp MnIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eRPIG5x2aeQk6yg602J540U7xzjBgNZQWYHpz3hImmE=; fh=n5S/AR14tYMsjDdXEOPrR3UbxswSa5eTzDqlfcgbnjE=; b=BTM8q5kh4xtRTZgk/d8RZzgn1R5Yv6DTt5FeFuGVsSxN0jwo/ixkOYUD8MzuW0boAB 5kjE/OGlWNPp1mNNXIElJOUKHkszV6ocWWYJms0N3xmZltKIuQbAKVtilRD5v0EMe9iV zxZzxtxxyaNme7flRKzyPUWVEhdI8Ox9ZIbA8uoFqnaVzDrijcxvWdjTGlNdAGBgBkR3 8bMeWE/F99w986NDLy2O0jLB2wfPyg6bib8Vk7Jm12ukPQ55K11uNHP1g5f8Ss63xmUf fZiF/gnO+AzA1oCeD71AydyT9UjI2MyduSXGuUp2nacVcKt9l2IwcHWHR4dUPk8/ePZI XqrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s4RZMiZm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id nl1-20020a17090b384100b0027d27512cd4si1543526pjb.81.2023.10.12.12.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:33:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s4RZMiZm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 768758282A21; Thu, 12 Oct 2023 12:33:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442502AbjJLTdI (ORCPT + 99 others); Thu, 12 Oct 2023 15:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442279AbjJLTck (ORCPT ); Thu, 12 Oct 2023 15:32:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90D2BE9 for ; Thu, 12 Oct 2023 12:32:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4563EC433AD; Thu, 12 Oct 2023 19:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697139156; bh=U8fkZeKWQAxeRz/DmSHJexH3yzP6c2P5T0N66hgyrCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s4RZMiZmrCkANuhqGb5vzkcuscOaDyTsLTZCo2BlSGScSyy5qFoZB1qtKnJUQE81f xCCHe59Vu67+k5+diQHgmaCzqV0SYxzlWfybZue8PJM+VVM7KnF9CyazJAW68Q3pJw 0JIUSUZ3qH6pyuuab6PRl58FrCeRmh9pCDCzOz8D+SGzNpyAQNAmclC0Il2R3nVS82 I+d6xzFIaxvjlKdxJivGqgof3SRfbb0IObuNptrOMieefBbz8BRrsxAV0yL15T6eTr +YcmG4bGcSz2UK/fvz8Yy0RJ4IUcYaOFpGpH7SPknGC4u1GqvEGAnIvIOiST1ZCY5e hvb3GCekooQMg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 5E063CE0DE3; Thu, 12 Oct 2023 12:32:35 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@meta.com, w@lwt.eu, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Willy Tarreau Subject: [PATCH nolibc 14/19] tools/nolibc: don't define new syscall number Date: Thu, 12 Oct 2023 12:32:28 -0700 Message-Id: <20231012193233.207857-14-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 12:33:22 -0700 (PDT) From: Thomas Weißschuh 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 Acked-by: Willy Tarreau Link: https://lore.kernel.org/r/20230917-nolibc-syscall-nr-v2-3-03863d509b9a@weissschuh.net --- 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 8389820e1928..f05144e46b67 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -938,11 +938,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 return __nolibc_enosys(__func__, nfds, rfds, wfds, efds, timeout); #endif -- 2.40.1