Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5846091rdb; Sun, 17 Sep 2023 15:31:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnjbSSVC0H4zjeWQWR0xMEw/6OKp05VrqEoom7Q6xPpcuuJGiqwoKrkI2NmtGvs1/V8UjX X-Received: by 2002:a17:903:2345:b0:1b2:5d5b:e871 with SMTP id c5-20020a170903234500b001b25d5be871mr7027377plh.59.1694989912385; Sun, 17 Sep 2023 15:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694989912; cv=none; d=google.com; s=arc-20160816; b=WL6OHVDqu5lHsxKdUyI//Xl1mtScmZwFXG4M3O2vqES+e+uhLrWRiSh2RhNcqUynOH sxbFbvWSSO3T5nYH+EkhLGUA4IN7/O19/CiCIw/s+Ewg6fcr2+lDUIIQU3DaAaXc31yC J2pO6o4b83RRsj9Ee8JqKykjg8g0qGGYE/VLnDsSRQepOaxGuxQxcrvl5OfxK8/589L1 OdwmVxiyI3lb/wHTuDGYSrborUnX61FeneM43J/g+P+j2ekZDy5at10Kk4gn4M609iLR zUVRGey6Phtq3SaXfYCMavl6Q3Dt/F4260u3WbtBEaL5kf21Fdc/L9D343kcwHxuNJC8 6TtA== 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=0kt75RLj2TlPfJSM2Tn9yigKoZH4k8Seo/hg9nc3SOc=; fh=azYK+WW57en7GGRdjKWjQOHkHDsNRqF/+6hheqDI200=; b=Fx+I+Fo49XW3mEkPqr/XAwnByWYSbqCUwlBXSIOlkCRAP9X+R6+xqEysdJt7vIQLSy SkCQKlm6rAVg/LmYU+ZlF3Qv7oFBblhxjp6djNqSxDvCZdSiIsaBNN7uYP1gBJU+Ee7m Dt+bUIQPGtTkPnsxs5eI1rc6dpiuTIJIyxZXGW21nihLcSTCx9hvPMx9Z611luROA+F1 QZGOeGTqBR96Lf3TLKUlOHdpLfDYV8k1Jcj3HPQ/K6Qxr8cGyvbeI468Jb8asmBjICIf ItsT59bnJ6ipHe7/szftQU4+OXeMu1NLUFnI9VTHBFQO9RzpBil8PZj+qsmlvGgR/UoS ZX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=PDYejELI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e15-20020a17090301cf00b001c3a05b0b67si7267612plh.566.2023.09.17.15.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 15:31:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=PDYejELI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id C6CD68194767; Sun, 17 Sep 2023 08:37:34 -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 S237255AbjIQPhL (ORCPT + 99 others); Sun, 17 Sep 2023 11:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236747AbjIQPgg (ORCPT ); Sun, 17 Sep 2023 11:36:36 -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 5BB1211F; Sun, 17 Sep 2023 08:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1694964988; bh=1NF2q2upNDj9/vMoCeQiX+AUEvsHPwNOqql4WRWM0Oo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PDYejELIHl1QbGAiIMk2tjDMYzW5D/26ieLRdJoDq4IaTyoVPh1QrNKnygwKUNiyQ Jyq+SfmCXjK1lWJGagf0A1MIMPRtCVraCZ4msErQL5i0VSvBxSvi3l0V196nHbXq8R /DTqZOqSbTaMg3kxexEOJoRNXkEGRbzQK9KDv0pA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 17 Sep 2023 17:36:18 +0200 Subject: [PATCH v2 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: <20230917-nolibc-syscall-nr-v2-3-03863d509b9a@weissschuh.net> References: <20230917-nolibc-syscall-nr-v2-0-03863d509b9a@weissschuh.net> In-Reply-To: <20230917-nolibc-syscall-nr-v2-0-03863d509b9a@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=1694964977; l=1312; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=1NF2q2upNDj9/vMoCeQiX+AUEvsHPwNOqql4WRWM0Oo=; b=HyWIKvOvEBDaT6rG3/p9D3aiZMZ5Ewl218rM+RUJeFdyJLTOV1Ab2odZNX32VYVmiMtWLk1w/ htVnUFszqpVBrAyuiLAygf5fExGiweKx2+F3qUtWHRT8SHuTrjU4bcw X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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]); Sun, 17 Sep 2023 08:37:35 -0700 (PDT) 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. Acked-by: Willy Tarreau 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 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.42.0