Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp521478rwd; Wed, 7 Jun 2023 03:24:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6VlFR31llI7lSjFQHswjXamc6/bmCG5hiwomXC8/32uP3j68F7k1BIIqj9k0dQZLU+Ad5T X-Received: by 2002:a05:6a00:b55:b0:661:fc6e:79eb with SMTP id p21-20020a056a000b5500b00661fc6e79ebmr1971253pfo.18.1686133480804; Wed, 07 Jun 2023 03:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686133480; cv=none; d=google.com; s=arc-20160816; b=eetAKbZaX0DwnhrhyqYTRQxEDH9+9fVR2wbNlso6qu/+g/oSCJ6+cTGZdzAqImI+/o Pf0vgEd1DDksULoSLDiSVKWHgb3IgRoasre4cQkvOi5t+VugDjZ3g062oqxi+2ePQjG/ Xr3lQ6NI6xBBukEUSAVhK4SeBxeWQ0bN3j6lrKOU4im3GamZWxbgNUDvz0by9aGjWlql rX6GtZ8tgFbe5wAAJcdKopaapBLPYmXtkt/sn/8KTqxQl0ZMuBovwSTfyH9ObjDGLCkX pvm6OXkUplstIiDB+aZ+Djad6OcQyzCpTgCfq5RYL8wKV5jbjn522N7RXuwF8nDIp/mP 4Tbw== 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=T0S94E2qLXmGs+N9sPOaQszP553BKZ2FJLocWfYPArs=; b=xammDTrBPoTq4dJKpqdjmbf5XrhcIgp15pCKQCmCc+fdehm4sLx1X1FEyEzhkdzksX wm+Io7iSsAshr8h5AJTzd60m13G38uV7pu8IfJdkKWsCoWqkFrJKvUKylRNeGcxP0EFZ 1B6HOX4/1MBiOmHJ0lg8uiuSKM7jlhloUzfxh3DDF4X3wLB/fY90swMKWV+CdV623JMo vzjYbguqKu50D89LVUOKWY/SjzFJrdQkDgI5BM4ohgTuEJeUwiQw56hvFNeolZgN5x9e M14TB3WKXC7zXz7gKyOpfBRz3WwZ2XSnXy5+xKKEkYcHsuO54Ys7NqvmYEPJn3/zoHSV g75g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=pFhjS116; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=t8ZZIgth; 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 f10-20020a63de0a000000b0053febd41e7esi8892205pgg.380.2023.06.07.03.24.26; Wed, 07 Jun 2023 03:24:40 -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=pFhjS116; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=t8ZZIgth; 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 S239922AbjFGKCq (ORCPT + 99 others); Wed, 7 Jun 2023 06:02:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238408AbjFGKCo (ORCPT ); Wed, 7 Jun 2023 06:02:44 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4303E19BD; Wed, 7 Jun 2023 03:02:43 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 89F633200907; Wed, 7 Jun 2023 06:02:40 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 07 Jun 2023 06:02:41 -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=1686132160; x=1686218560; bh=T0 S94E2qLXmGs+N9sPOaQszP553BKZ2FJLocWfYPArs=; b=pFhjS116As8+eGURjI zVHDXCcfMw2WiNMgh3caeu5W6Fpjv5Bo5arbt445G4Ii3l0NgiWci8HdkXDCbE7j RbuTQqfMjFMXWdjpo58NMN24tC84cBVnIBIEZBYZQnyvjU6xpAxyKHBd6K+oFd1O HYKnOwSH3S364eDp9K+YXhHnkb2ryLRIx1pbskIO3y0EHyyj0zSpwTuDzo8j8Gpm ALCYUqnfSIIr+mRw7NzfQE6V9jAZ8Qyg8QJ0bJdWIvVLzRDlsvL38xnaJQQ9k0my ck9peEuB/sSL9ZVv+FBjUtIFDuukdpR4EusWJmbu8InAzLKoVADG1iRjkxremr3J acPA== 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=1686132160; x=1686218560; bh=T0S94E2qLXmGs +N9sPOaQszP553BKZ2FJLocWfYPArs=; b=t8ZZIgthjGwEP1RH+BAH4u5JBRhm7 ZnXTWLnHptByfT2ahXyjN+BqgcKxWyELWKlp9hBk8Q0Bchj7u1copP+07bM4cYFO 47sm6ZPJo2RBXGGAOhYlcd8L82/mGxF3iImaWsF5WpVO3lefh1RmeLFC1Fz4opq3 d2Rhm+ooAoNRLUjASCToADEW7D3iOXIw2POZHMUeBaxUVBNlfyvunBTS754pcBtS DyMnXvvnIAR6HD5C2uDIEb5iqfqzfMjK58l5cWjjIohtmitJuIQhT3xqxBsAgfzv WwIEpYNcZ+qYJ4gNDZQIqHaof3ye7q4YkSXIAPCJSp3RhsHBt6A8dhoAg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtgedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffdtleeuheffgefggedugfelleeigfdukeegffeggefhveffgeekteduleel vdetnecuffhomhgrihhnpeguihgvrdhnvghtnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 14B58B60086; Wed, 7 Jun 2023 06:02:38 -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: <635d1aaf-3982-4404-9c05-05e51800691e@app.fastmail.com> In-Reply-To: <20230607094615.792013-1-falcon@tinylab.org> References: <20230607094615.792013-1-falcon@tinylab.org> Date: Wed, 07 Jun 2023 12:02:18 +0200 From: "Arnd Bergmann" To: "Zhangjin Wu" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , "Willy Tarreau" 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 11:46, Zhangjin Wu wrote: >> On Wed, Jun 7, 2023, at 07:19, Zhangjin Wu wrote: > > Ok, agree, as the 64bit version of lseek may be enough for nolibc, if a target > application really require, they can add the alias themselves. > >> Are there any examples of functions where we actually want mulitple >> versions? >> > > For example, the following ones are related to the syscalls being added, > all of them have similar library routines in current sys.h: > > * waitid, https://linux.die.net/man/2/waitid > * ppoll, https://linux.die.net/man/2/ppoll > * pselect, https://linux.die.net/man/2/pselect6 > * clock_gettime, https://linux.die.net/man/2/clock_gettime > > The similar routines are put in right side: > > * waitid --> waitpid, wait, wait4 > * ppoll --> poll > * pselect --> select > * clock_gettime --> gettimeofday Ok, I think these are all useful to have in both versions. All four of these examples are old enough that I think it's sufficient just expose them to userspace as the bare system calls, and have the older library calls be implemented using them without a fallback to the native syscalls of the same name on architectures that have both, newer architectures would only have the latest version anyway. > For the clock_gettime, it may also let us think about if we need to add > its friends (clock_getres, clock_settime) together. Yes, I think that makes sense. We also need clock_settime() to implement settimeofday() on rv32. Ideally, I'd love to extend the tooling around system calls in the kernel so we can automatically generate the low-level wrapper functions from syscall.tbl, but this needs a lot of other work that you should not need to depend on for what you are doing right now. Arnd