Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18102rwd; Wed, 24 May 2023 13:26:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ457Y1o9XQPapc9+XgKK0JcAZRNVkuTzEoAj8ieCcIKCXOt/J4TlUCIJIs7g2WcFjnqjs2W X-Received: by 2002:a17:90a:cb05:b0:253:4e54:6761 with SMTP id z5-20020a17090acb0500b002534e546761mr17749079pjt.34.1684959969336; Wed, 24 May 2023 13:26:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684959969; cv=none; d=google.com; s=arc-20160816; b=clsV65xDldtdDcb2Z9SzLv3zAt8tTk7yKyIbbDI7rWhvZ3fGtDGSD9IdGy9t/k/Epo Q2udX8wq+l1OlNXIaQT79Kz/E1wicSuOFDz0KTr8VSpoqXbbPqkQjVaUtgx2IFNV8lOD ggSOzEUoqdWssBUXk/+xl6gL1SoMcMt2wNmwPd6Akh306Mk0wHvnns2zkT3paHzcAvLY CI9LgCeH4Bu5/oD9naDy6rm6y6iHyEyfZ7J1w6aQPoFUPU9HM0qify9q8dONI1ueY71Q kmr1Ts1lt/FqIDPXUW1pCXModZ+zFi7NWztCUz9VYB7vjhdsqdaoWG/6gQMWVtwJf1Dp V9AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=UpvxnWnNEcAHSw0jNAu5MdQawS3r4020pRTUKfEXLGs=; b=JVBdj1WGzSeqCt6vdZgsPxw60AuIFFV21w/E2bm6+yvnoh1xAyG8/B73y+50hJp8se /QxwJSSAo1FZuU9BqCufrouRIY72W1uAaoLCdfz98z/3qNcC1jvNdq2rNe480dCg4txk 3vkh+XCu+PuY/kQ+CLvNocvN3HCoqHT9wMDdbOe88nHjQ2AZV/3a1Q1EZ71rSVOOI+nm O6W4RY4sgfW1hfdvkzqaUXTBPQ3+4i9HoOplvU2+ykT75+EAl5VdyqIWFljQ1iV0c60J GxVT4Lq5A4fhLWTnmmqP8SvS9CuyDRaQWs/fynjnPssncnXU2P5sozSnkg/x+1ih7vhS 2zmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=QjChkd23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q23-20020a17090aa01700b00252733f522asi1934362pjp.109.2023.05.24.13.25.37; Wed, 24 May 2023 13:26:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=QjChkd23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236416AbjEXUW3 (ORCPT + 99 others); Wed, 24 May 2023 16:22:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234154AbjEXUW2 (ORCPT ); Wed, 24 May 2023 16:22:28 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFE86113; Wed, 24 May 2023 13:22:26 -0700 (PDT) Date: Wed, 24 May 2023 22:22:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1684959744; bh=EZ62Sf3mRrrPLSec0HPbs+OLV5rrKu4uVLhKELY8M5g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QjChkd239g3RKukdNJOfd4jriqUOjWg6EsxNpjJouusbCRUq1ohoACpbDzB4CYPJE /b2S1nQ5oF+NE0YA7lESkIYRuHZYf0jazv61JOm7P1ro1uzDo7b+fcjAL3aPLEzrwg 1CTfm7DDfvwSbUeJ9IPSeVj1Hns6GkOTyJ5Csi8M= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Zhangjin Wu Cc: w@1wt.eu, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, paul.walmsley@sifive.com Subject: Re: [PATCH 11/13] tools/nolibc: sys_select: riscv: use __NR_pselect6_time64 for rv32 Message-ID: <83339ea6-6653-41fe-af75-e0d51a4fa920@t-8ch.de> References: <9359ab11b52ef7c1799337f475e1e27c0cb00e3b.1684949268.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9359ab11b52ef7c1799337f475e1e27c0cb00e3b.1684949268.git.falcon@tinylab.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On 2023-05-25 01:59:55+0800, Zhangjin Wu wrote: > rv32 uses the generic include/uapi/asm-generic/unistd.h and it has no > __NR_pselect6 after kernel commit d4c08b9776b3 ("riscv: Use latest > system call ABI"), use __NR_pselect6_time64 instead. > > Signed-off-by: Zhangjin Wu > --- > tools/include/nolibc/sys.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h > index c0335a84f880..00c7197dcd50 100644 > --- a/tools/include/nolibc/sys.h > +++ b/tools/include/nolibc/sys.h > @@ -1041,8 +1041,13 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva > struct timeval *t; > } arg = { .n = nfds, .r = rfds, .w = wfds, .e = efds, .t = timeout }; > return my_syscall1(__NR_select, &arg); > -#elif defined(__ARCH_WANT_SYS_PSELECT6) && defined(__NR_pselect6) > +#elif defined(__ARCH_WANT_SYS_PSELECT6) && (defined(__NR_pselect6) || defined(__NR_pselect6_time64)) > +#ifdef __NR_pselect6 > struct timespec t; > +#else > + struct timespec64 t; > +#define __NR_pselect6 __NR_pselect6_time64 Wouldn't this #define leak to the users of nolibc and lead to calls to pselect6_time64 with the ABI of the __NR_pselect6 if userspace is doing its own raw syscalls? > +#endif > > if (timeout) { > t.tv_sec = timeout->tv_sec; > -- > 2.25.1 >