Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp431811rwd; Wed, 7 Jun 2023 01:50:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BYuEG5DbMBjhfkse6d3CkkE6gVjXo9Y+lTAjosop+RzI4hO+8SXt6/twLk7zEb64udx1i X-Received: by 2002:a05:6a20:3d0e:b0:10b:b25d:3a9a with SMTP id y14-20020a056a203d0e00b0010bb25d3a9amr2847399pzi.3.1686127803039; Wed, 07 Jun 2023 01:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686127803; cv=none; d=google.com; s=arc-20160816; b=Im2r1zT+fv6KRIWAJOfgOwdx1KgOWl59dlrXwc5l5oNEKIJBVLfZ8DsoexHvEoBGm0 vpuT64+Q63lRtoeXdbtOA3T7NPCcNotx7T+9nalJdRXqzrgQXSJhQtbAe3S1btEYxw9i SB+3QTiEDan8HlpTBoVVGxPp7GURQKX8m1ff/fXqFSjjjay8L7td8ZGnBO68rzzrmUlB ZvIQLFaL+z7YxkRwQzf4Kh8r2b4L1BCGqrfv0Qpetbwiovbvko47UAEdLyZ05GF7Ff8X kZql6t3CO3045AsVgpvBm5NxZZJSibIdLv3TMfN7Qq/y3i5rksZTJRHtUZbGIOQMGqnb GKlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=IkDi7QwNx6iJE0bqHUZciVFMTfDlg3S9jqMA7XfZt1Y=; b=gvvkyp54ZidddBYooI6g37Sfe2Qn6UU6C7zXnWIH2KMFakm5ULfcdTLvMq1xEjvNhJ EB2B6Val6C4Je449Ev/Yh6aUVqywQtcklwBE766SRwt83Bqub256dxIw8lZIDcA/Qhcw FOl1NAHLq4+y6AxevifLkmqfFjHX2AHYWDycLf6F03spl1ZANTB8PTjl1ePfh9U9oBe7 A1QvTPLaamUnmzmeYSAB3R8acvaIwm97g/qNa9LOWfBwqEirgmBQ4wP7V/NFcqBURnbM nEd6YVhvWpGkKksfsAzv106p+Lkjj4l0ICnm1LQqjmpjElqw/NhkCjUWVUkV1guNrHPP HxpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=LhwJuMwo; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=f9d9nXP5; 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 l190-20020a6391c7000000b00543eef37092si2709462pge.442.2023.06.07.01.49.50; Wed, 07 Jun 2023 01:50:03 -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=@arndb.de header.s=fm1 header.b=LhwJuMwo; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=f9d9nXP5; 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 S239320AbjFGIpx (ORCPT + 99 others); Wed, 7 Jun 2023 04:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239240AbjFGIpu (ORCPT ); Wed, 7 Jun 2023 04:45:50 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA60011F; Wed, 7 Jun 2023 01:45:48 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 795C0320097A; Wed, 7 Jun 2023 04:45:44 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 07 Jun 2023 04:45:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1686127544; x=1686213944; bh=Ik Di7QwNx6iJE0bqHUZciVFMTfDlg3S9jqMA7XfZt1Y=; b=LhwJuMwo6RO/JlCi0P +/suC/ngoczAEQfZSyFCOKn/UT7JYT0X1wsCRDk4IPh7fgflAVHu3hCRAWXWgo2s Rwmsj2EjL7V2P/eD4xUhbnC91/5EHcEG4RKEUh6JqmWRIziGcYRS2u/71vSYjyU1 KKXCsk6bRqjFb0hBQn8Zh//3ryFo+tsIIzY+W9ksk1lnXeXz0SnP5GYpk/I339RR cAIwHt2zafobvBv/ReCk81clTVpQE5zYwV2nn/pdPM2crk2uhwf12sHqWOA82gNk KiW6EuD1nEKWcuLZd41DO89Hj8rwCZpVe0UxjoD62sUjB9XHGY9Hd0Tjm4H8M7WY wd0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1686127544; x=1686213944; bh=IkDi7QwNx6iJE 0bqHUZciVFMTfDlg3S9jqMA7XfZt1Y=; b=f9d9nXP5/Kr5sI/3jDd/+lOPV2am7 7/F5AiF+v15j6Y1FGJfAPpe2GmH6ha8aabo7ob5t+uR0XRtoFQ4CoDaL5VGPZ6kv FFkqhdtGV6G2KKf3b2qWQ90CJMyM7Ier8WY8grcixoi1PdaGpKFURLDX3CCm5a9Q 6aDsj8RlP5LgXWoUCHPV9uISYX32lzxZUlV5JxBczPTk2C7FheFKc8VMvz58NcFT sJ4BEc4Kk6SzJhNBhsLtBicO80DRNtkpU8+ZmJ/VkXLcX7B1PINhbPI2L4sb12S3 HG/DKPTmydRFeTepMML047gN1M2ecYoDbadmc427CtLq0IEGOA04MAdmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtgedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepjeeuieeuffefheeffeethfejhfefteeiueekudeihfegtdelveejuefhgfdt fedtnecuffhomhgrihhnpehmuhhslhdqlhhisggtrdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id D6E39B60086; Wed, 7 Jun 2023 04:45:42 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-447-ge2460e13b3-fm-20230525.001-ge2460e13 Mime-Version: 1.0 Message-Id: In-Reply-To: <20230607051914.667047-1-falcon@tinylab.org> References: <4fcdd08c-e6fb-40b7-9f2b-77f96e798b37@app.fastmail.com> <20230607051914.667047-1-falcon@tinylab.org> Date: Wed, 07 Jun 2023 10:45:22 +0200 From: "Arnd Bergmann" To: "Zhangjin Wu" , "Willy Tarreau" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Subject: Re: [PATCH v3 1/3] tools/nolibc: fix up #error compile failures with -ENOSYS Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,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 On Wed, Jun 7, 2023, at 07:19, Zhangjin Wu wrote: >> On Sat, Jun 3, 2023, at 11:01, Zhangjin Wu wrote: > > Yeah, agreed, we can clean up them one by one, If split them to their own > syscalls, I have two questions (for Arnd, and Willy too): > > 1. do we need to add the corresponding library routines at the same time? > > Use llseek() as an example, there will be llseek() and lsee64(). If off_t > would be converted to 64bit, then, they can be simply added as follows: > > #define lseek64 lseek > #define llseek lseek > > Or something like this: > > static __attribute__((unused)) > loff_t lseek(int fd, loff_t offset, int whence) > { > return lseek(fd, offset, whence); > } > > static __attribute__((unused)) > off64_t lseek(int fd, off64_t offset, int whence) > { > return lseek(fd, offset, whence); > } > > This one aligns with the other already added library routines. > > Which one do you like more? lseek() is probably not a good example, as the llseek and lseek64 library functions are both nonstandard, and I'd suggest leaving them out of nolibc altogether. Are there any examples of functions where we actually want mulitple versions? > 2. If so, how to cope with the new types when add the library routines? > > Still use the above llseek() as an example, If not use '#define' method, > We may need to declare loff_t and off64_t in std.h too: > > #define off64_t off_t > #define loff_t off_t > > Or align with the other new types, use 'typedef' instead of '#define'. If we do want to include the explicit off64_t interfaces from glibc, I'd suggest doing it the same way as musl: https://git.musl-libc.org/cgit/musl/tree/include/unistd.h#n201 > >> This patch is a step in that direction though, so I think that's >> totally fine. > > Thanks, so, can I pick your Reviewed-by for the first two patches? I'm ready to > send v4 now ;-) Yes, please do. Arnd