From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 7F6EF3858404 for ; Wed, 10 Nov 2021 01:37:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F6EF3858404 Received: by mail-oi1-x229.google.com with SMTP id u74so2175316oie.8 for ; Tue, 09 Nov 2021 17:37:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=p9GkL4vDezQB/Zv3Gd7Tdakam/0IYuEosB6/NKahqoU=; b=rfhFBLezdRRAgmpsiqTkiJboRvYQulobpljbT3WFQPHu2gTcdOWHRthYUZ/Lt9l1Lf WuBDmzx9rn6LER8aJxeXfh7HkFpDWgkopgr6GY+fEXFDkXIqwKIdrwhrnVfX50XZxlxp /QmBS3fVY+VYlYirj5xpAFs/0rKUPSA962m97xL9wsq6ExJpNZIiupU0quFSvL8EzfVQ gN8Ysi+b0i6AN8Mj/vRCFkoJPoXQTkDKsJ4ZoveXTVOzz078JxoyKhIeuqzzY/pP15i5 Owd+dYtuMwWS/akR739c9E0IMyn7I2lLWJB3SRGjhK6ouLt6vttdrGgMb0FY/TnxxXIo X6Ew== X-Gm-Message-State: AOAM5302eR9UWR7FMckxwChqzuLs2SUGuMHcbW9bO9mDKC946i90n7fX 9OS8MaSfxyKP4h3WK5G9XF72hzBcifBLxg== X-Google-Smtp-Source: ABdhPJxHDTyYoAbi3pfE0+deUFxsLpxx4w3Kty2M2l4wF+pk+RCJsRV9Dmg8OGyNrqWaGRcm01cWkw== X-Received: by 2002:a05:6808:14c3:: with SMTP id f3mr2463641oiw.162.1636508248900; Tue, 09 Nov 2021 17:37:28 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:55a:94d0:2630:9b29:e621? ([2804:431:c7cb:55a:94d0:2630:9b29:e621]) by smtp.gmail.com with ESMTPSA id 187sm7680724oig.19.2021.11.09.17.37.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Nov 2021 17:37:28 -0800 (PST) Message-ID: <2fb103f7-8c65-ea9f-65bb-92ce14839fe1@linaro.org> Date: Tue, 9 Nov 2021 22:37:26 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: glibc strerrorname_np Content-Language: en-US To: Jonny Grant , libc-alpha@sourceware.org References: <98556e3e-2869-64f0-574e-7a64503185c2@linaro.org> <9613b21a-3ab0-3303-9321-7bf4e36ce7ed@jguk.org> <77e058e8-2f54-46a5-2180-9784f23040e7@linaro.org> <4f5422c1-d6ea-1ea5-eeea-db61f8b95bc8@jguk.org> <66a2e472-d4e2-96bb-d1a5-8bafa795083f@linaro.org> <4c43eab7-2ca8-1b90-5fb9-c84e26a96ef0@linaro.org> <18f35159-daa5-a247-86ff-6a77eca49a2b@jguk.org> <00c5d718-eaca-886c-ac02-73879c745a56@jguk.org> From: Adhemerval Zanella In-Reply-To: <00c5d718-eaca-886c-ac02-73879c745a56@jguk.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 01:37:31 -0000 On 09/11/2021 20:01, Jonny Grant wrote: > Ok I see. > It's also tricky as I'd prefer to not define _GNU_SOURCE > > What do you think of the possiblity of adding something like strerrorname() directly without _GNU_SOURCE, and always returning a valid string, or empty string? > > With a consistent return for an errnum of 0. > strerror_r(0, &b, 0); already returns "". > strerror(0) returns "Success" > > So there is some inconsistency in the POSIX functions. The problem of exporting it without being a GNU extension (within _GNU_SOURCE namespace) is that it might clash with a future POSIX interface. I need to check where exactly POSIX defines it, but if I recall correctly it defines specific namespace rules for the POSIX defined headers.