From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.formilux.org (mta1.formilux.org [51.159.59.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B56C253340 for ; Sat, 7 Mar 2026 17:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.159.59.229 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772903857; cv=none; b=hOmZX7h3B8YW06aj7BIwxj1wFDi1qdkzfAxe5nZTg3MJbW8QhLFk8xw5q+vYYspIG0CeQH5gnqmeXD7+6TVb+sIuRLJ8kadYQuvR0TtZyuPI5yLdxQkkgBhVRkJTuRyJsAGV/CJqHMsS7YBcwXRiwAotwrig2XEGkT6htI485Hg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772903857; c=relaxed/simple; bh=FyWAWBxn/unnBeKYMv9GBNJtjiawYTdf3rPAfvLGkxQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RFwfwGUjyJE9wBgQvXlTqOeDbsZoQWt16Ah183hVVY/s6Zb21hpl8jTmsZh2EQXA26h0wVv5FtoI0xwb+N+JrkvJZyXwJacm7N6jGtSUgNbbgplg1BMkiNH7+QNLMeJRt12H/Vx4WEFmHII/76z3O5ULjW6edonwA+QRiHmArYg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b=CGUyN3jV; arc=none smtp.client-ip=51.159.59.229 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b="CGUyN3jV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1wt.eu; s=mail; t=1772903853; bh=aQG9QuzXvsnGU5Hp723eSBKc3oi7T40reuihINxd08M=; h=From:Message-ID:From; b=CGUyN3jVbGJbKBkH/XDOW4eUqbPV+llckuB8273b05YAThv/YIEzFaHyeszkrTJ07 txMiuEb/rnGuHpZ7/DDyOKZy8yIcVtaa1D78+DpMfGMOF3GfvBhR65ILTwbMbDrBpD 0F19zyLtacFHkvAdA6OIEYOR0W2KeE03lSxCLeBU= Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by mta1.formilux.org (Postfix) with ESMTP id 2F0BEC09DD; Sat, 07 Mar 2026 18:17:33 +0100 (CET) Date: Sat, 7 Mar 2026 18:17:32 +0100 From: Willy Tarreau To: David Laight Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH v4 next 09/23] tools/nolibc: Implement strerror() in terms of strerror_r() Message-ID: References: <20260302101815.3043-1-david.laight.linux@gmail.com> <20260302101815.3043-10-david.laight.linux@gmail.com> <20260307113105.76fb7fe9@pumpkin> <20260307165506.4fcd86bc@pumpkin> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260307165506.4fcd86bc@pumpkin> On Sat, Mar 07, 2026 at 04:55:06PM +0000, David Laight wrote: > On Sat, 7 Mar 2026 12:37:35 +0100 > Willy Tarreau wrote: > > ... > > > > > +static __attribute__((unused,)) > > > > > +int strerror_r(int errnum, char *buf, size_t buflen __attribute__((unused))) > > > > > +{ > > > > > > > > Here I think we can simply do this to comply with the man page: > > > > > > > > if (buflen < 18) { > > > > errno = ERANGE; > > > > return -1; > > > > > > Looks like it should 'return ERANGE' (matching glibc 2.13+). > > > > Ah you're right, I initially misunderstood the man page as "a positive > > number with errno set". But yes, returning ERANGE is fine! > > Which also means I got the return value wrong when I made it > return the length. > > Might be easiest to apply these patches and then fix it up? Better only redo this one. It's always bad to purposely merge a patch that we know has an issue, it can complicate some bisect later. Willy