DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 52P95PKk2598300 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 52P95PKk2598300 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=tWyxfzo3 X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7D6F385771D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1742893523; bh=qddf2Re7GqUS1oDHCjihlXsgHs3RK5YfPbtcK+iobAo=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=tWyxfzo36MuqBBpa4VUIhF16zZAttlsI6LhxK2zfxqHMW6JmCkrBJYJ81Grv4iAFs p3pwzJEPT/QuwBu1ZX+wwXl8T7aSpUZzhgnHAxa0WFxcAx2v9pXLDhnLOLJrAmAXrV kUc7Vn+9VD0prILTQSLqKWiEFF5Kc2ayyJ0CZBN8= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A19043857820 Date: Tue, 25 Mar 2025 10:04:20 +0100 To: cygwin AT cygwin DOT com Subject: Re: two bugs in getlocalename_l Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com, Bruno Haible References: <4134860 DOT iTQEcLzFEP AT nimes> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen , Bruno Haible Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Hi Bruno, On Mar 24 18:12, Corinna Vinschen via Cygwin wrote: > On Mar 24 14:12, Bruno Haible via Cygwin wrote: > > Hi, > > > > It's good to see the addition of getlocalename_l from POSIX [1] in Cygwin 3.6.0. > > > > [1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/getlocalename_l.html > > > > However, there are two bugs: > > > > > > - "If > > the value is LC_ALL or is not a supported locale category value (see > > <>), <> shall fail." > > No, that's now how it is specified. > > specified it this > > way, but added the > > LC_ALL support. > > Drat. I implemented this prior to id=1741. This is unfortunate. > > Without LC_ALL, only a single per-thread buffer of size ENCODING_LEN+1 > was required to allow LC_GLOBAL_LOCALE. > > With LC_ALL and with the extra requirement that only a call to > getlocalename_l(LC_GLOBAL_LOCALE) overwrites the per-thread > LC_GLOBAL_LOCALE string buffer, we now need 2 per-thread buffers > of size _LC_LAST * (ENCODING_LEN+1). > > > - "<> is POSIX-1.2008 since Base Specification Issue 8" > > No, it was introduced in POSIX-1.2024. > > Yeah, that was temporary because the nameof the new standard wasn't > known at the time I added this. I fixed the comment and the invalid return value when specifying LC_GLOBAL_LOCALE, as well as adding LC_ALL handling per the POSIX specs. The changes will be in test release cygwin-3.7.0-0.14.ga0fe984953dd and in 3.6.1. Thanks, Corinna -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple