From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id B55732B6B1 for ; Sun, 10 Mar 2024 07:01:37 +0100 (CET) Received: (qmail 26030 invoked by uid 550); 10 Mar 2024 05:57:30 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 26008 invoked from network); 10 Mar 2024 05:57:29 -0000 X-Virus-Scanned: SPAM Filter at disroot.org Date: Sun, 10 Mar 2024 06:01:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1710050483; bh=0yotJgv8Qbuy5I7r/fjmnD8L/o9e4+4iJ9wqjRdaybQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=T+4YQ6G4ZBT2lrdfXSIirKkFBZY1x3iMy42H3hD2r0QaS5w5vC8h2p3eu08FAjyok YG2Le/2NZ5cMeay7ZtxgHy6K5UrQ0SJUOQ6tkcRGRrORDsTSgOp6MeVk+pz+yDsDNl EustCwc8aIrZV4BrEqGLQHGmUUsYzQAgKOVnjR+W+XyhUllHPbJ7Qkc6RRriZpOYgL vvDB4GuM/6KO6aRu4BPRwW6TtogmNr29rc6s0uuGfdJUMh8ihXmlZkWd7VM33Apapb JlQHL3RD5mdkYftOc0SNBnl1Uac4wHEZwkImzLnS+qDGkmuUZkHy02Wp8sWxR+JEAd wYw5sOEOigeMg== From: NRK To: Alejandro Colomar Cc: Rich Felker , Guillem Jover , libc-alpha@sourceware.org, musl@lists.openwall.com, libbsd@lists.freedesktop.org, "Serge E. Hallyn" , "Skyler Ferrante (RIT Student)" , Iker Pedrosa , Christian Brauner Message-ID: References: <20240309150258.GS4163@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [musl] Re: Tweaking the program name for functions > What do you offer to use instead? snprintf(3) + perror(3) + exit(3)? No need to have an intermediate buffer with snprintf when you can just use vfprintf directly. > I suggest you remove err.h from libc, and let a standalone library to > implement them separately, allowing to configure them. These are not mutually exclusive. You can have err.h in libc while also having them as separate library. And besides, these are not good interfaces anyways. Aside from what Rich already said, you'll realize this soon when you need to use various posix_* or pthread_* functions which don't set the errno and instead return an error code. Also, I don't think your fear of "NIH bug" is well grounded. This is not some highly complicated error-prone code, it's just simple logging facility. I am aware that there exists certain programming cultures [*] where having to write code instead of "import leftpad" is seen as taboo of the highest order. But in this case you don't even *have to* write anything when you can just copy err.c from musl and customize it. (* Counterculture to this also exists, such as Go's "A little copying is better than a little dependency" proverb for example.) - NRK