From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84453C83F18 for ; Tue, 29 Aug 2023 06:30:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233254AbjH2GaH (ORCPT ); Tue, 29 Aug 2023 02:30:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233817AbjH2G37 (ORCPT ); Tue, 29 Aug 2023 02:29:59 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 130B319A; Mon, 28 Aug 2023 23:29:55 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 37T6TiAt011699; Tue, 29 Aug 2023 08:29:44 +0200 Date: Tue, 29 Aug 2023 08:29:44 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Zhangjin Wu , arnd@arndb.de, david.laight@aculab.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tanyuan@tinylab.org Subject: Re: [RFC] tools/nolibc: replace duplicated -ENOSYS return with single -ENOSYS return Message-ID: References: <20230827083225.7534-1-falcon@tinylab.org> <1ffa33a8-dd97-480f-b8f4-2ce49c60cabb@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1ffa33a8-dd97-480f-b8f4-2ce49c60cabb@t-8ch.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, On Sun, Aug 27, 2023 at 11:17:19AM +0200, Thomas Weißschuh wrote: > To be honest I don't see a problem with the current aproach. > It is very obvious what is going on, the same pattern is used by other > projects and the "overhead" is very small. > > > It seems the macros will only work for simple cases which only test the > availability of a single syscall number. > > Of these we currently only have: > gettimeofday(), lseek(), statx(), wait4() > > So in it's current form we save 4 * 4 = 16 lines of code. > The proposed solution introduces 14 + 2 (empty) = 16 lines of new code, > and a bunch of mental overhead. > > In case multiple underlying syscalls can be used these take different > arguments which a simple macro won't be able to encode sanely. I totally agree, I would prefer all this to be manageable by humans with no preprocessor brain implant as much as possible as well. Thanks, Willy