From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 129923858D35 for ; Mon, 6 Jul 2020 12:43:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 129923858D35 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-506-da8bOGEMMr-uZGHEDwBPdg-1; Mon, 06 Jul 2020 08:43:47 -0400 X-MC-Unique: da8bOGEMMr-uZGHEDwBPdg-1 Received: by mail-qt1-f200.google.com with SMTP id c26so28194652qtq.6 for ; Mon, 06 Jul 2020 05:43:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=mfHZv/TEbprGzXKZO367BlSU9q3bpo1iGLEmpUZ6Aks=; b=e2V2xU169Onzd65DLGfR5cOE7UfAuh275mUQJhDNVBOvWnB6vdL3hd5ycGUmnNGbOl YKeZ1UewZDXsSsOo57eaS6UL1yUvtXlmYFkRDG29EqbisgaAXWTfUtt8HqLoOzwpkHqZ xHuhybbkUSheChxoIiOXdVdwifQ1EjOB2xY4V8VaCpJ4suq1QPcgOKkBeuLYp0O2y7iP cARwnBSqX+mM07KMIGfGXGVoSALYLQuFWNRlQGVr2xYjY8KK0SjrRJ6Kx8k9PbguPjPv exFLx0UpIW09hap95FSoIuWIgE48po1jRXOfRM9oV0/QoCW313+k7J3DHppSR1yNxg5s I8yg== X-Gm-Message-State: AOAM531pAZEawpHOY6+EHjF+KO7HhI+uzFKS1r3PPdGdxo6k6ezrpNUA eXeUEEz7kOvwEZ/Ds0sNzPE6ArtiqxDe/vsIj81Sy7aIhNclm8goIO2VNht+6TstMANEMV5rxa/ gGHyy1sL/mP1sr1FIEom1 X-Received: by 2002:a0c:f281:: with SMTP id k1mr41801806qvl.219.1594039426603; Mon, 06 Jul 2020 05:43:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzm+/JpvNhik7+j4UE2pTR/VSQ+SlACzORC3zgEJ4QFPTNmw+gQJDhz0CWRQFpbyZ1Mf0JExQ== X-Received: by 2002:a0c:f281:: with SMTP id k1mr41801791qvl.219.1594039426332; Mon, 06 Jul 2020 05:43:46 -0700 (PDT) Received: from [192.168.1.4] (198-84-170-103.cpe.teksavvy.com. [198.84.170.103]) by smtp.gmail.com with ESMTPSA id i10sm24250327qkn.126.2020.07.06.05.43.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2020 05:43:45 -0700 (PDT) Subject: Re: [PATCH v5 13/13] string: Add strerrorname and strerrordesc To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20200619134352.297146-1-adhemerval.zanella@linaro.org> <20200619134352.297146-13-adhemerval.zanella@linaro.org> <1a3b968c-0d58-8703-c317-58b32d22501c@redhat.com> <18d14c40-5cac-0732-0bbb-9f1ba24d989b@linaro.org> From: Carlos O'Donell Organization: Red Hat Message-ID: <409d375e-0496-ad73-e46e-d1b026340e02@redhat.com> Date: Mon, 6 Jul 2020 08:43:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <18d14c40-5cac-0732-0bbb-9f1ba24d989b@linaro.org> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 06 Jul 2020 12:43:50 -0000 On 7/3/20 6:34 PM, Adhemerval Zanella wrote: > > > On 03/07/2020 18:19, Carlos O'Donell wrote: >> On 7/3/20 5:01 PM, Adhemerval Zanella wrote: >>> >>> >>> On 02/07/2020 18:43, Carlos O'Donell wrote: >>>> On 6/19/20 9:43 AM, Adhemerval Zanella wrote: >>>>> The strerrorname returns error number name (i.g. "EINVAL" for EINVAL) >>>>> while strerrordesc returns string describing error number (i.g >>>>> "Invalid argument" for EINVAL). Different than strerror, strerrordesc >>>>> does not attempt to translate the return description and both functions >>>>> return NULL for an invalid error number. >>>>> >>>>> They should be used instead of sys_errlist and sys_nerr and both are >>>> >>>> s/and both/, both/g >>> >>> Ack. >>> >>>> >>>>> thread and async-signal safe. These functions are GNU extensions. >>>>> >>>>> Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, >>>>> and s390x-linux-gnu. >>>> >>>> Why not strerrorname_np or strerrordesc_np? We don't have to use *_np, >>>> but these functions are fiarly close in name to 'strerror' and so it >>>> might be beneficial to use _np at the end, like you did for sigabbrev_np >>>> and sigdescr_np. Thoughts? >>> >>> I don't have a strong preference here, on a patch iteration I used >>> the the _np suffix and Florian has pointed out the str* namespace >>> is reserved for libc implementations. >>> >>> But I think the _np is slight better to indicate it is an extension. >>> If it is eventually adopted by other system without the _np suffix >>> we can easily create an alias. >>> >>> So I have added the _np suffix. >>> >>>> >>>> No regression on x86_64 and i686. >>>> >>>> Tested-by: Carlos O'Donell >>> >>> Should I add the Reviewed-by as well? >> >> No. I want to review the final patch and I'll give Reviewed-by there. >> > > Alright, should I re-send it with the _np changes? Yes please. I think the _np APIs are very clearly intended to be APIs within a known namespace e.g. str* which are non-portable and then we can try to get POSIX to standardize on existing practice. -- Cheers, Carlos.