From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D065C43603 for ; Sat, 14 Dec 2019 09:38:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53C8920724 for ; Sat, 14 Dec 2019 09:38:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xa16LZ9b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53C8920724 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:References:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dSqeSPZ+o27FK/huikzuptDwV7pjC/Nn3dQ7ClyIfRg=; b=Xa16LZ9b16KvED lMuTMQDKjBl58/hd8h4a9/qEDSWnyPUeFr08Gy1m6X15UJLjvyMef9wmq4mNzYoSG5+ru2QqFKtKV ltpyViu3BrQfqnPfTswVZ7Jms229B1z/iFmRZUQgrS7B/zIfBxIaEKTfabZs9eLwcIxm37afMN8ZW EHJgrZzCNBjxYG3aY/dRmgfPRyasQTsB2UboFJE5+XncyGbI15mlMQ62CXeTfsP39hb8DFWe47/sY xqmC9SM3o94yR4OgBd541rEU449r9kRPKcxFAxmMSvwoD1bFuZQdQ8owBPEuLhgm+MXuSXjOKRnE/ rijS26A1y2Bj1/M3n7TA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ig3sA-0003Fn-Gl; Sat, 14 Dec 2019 09:38:02 +0000 Received: from albireo.enyo.de ([37.24.231.21]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ig3s7-0003EU-Qi for linux-snps-arc@lists.infradead.org; Sat, 14 Dec 2019 09:38:01 +0000 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1ig3s0-0007G4-6H; Sat, 14 Dec 2019 09:37:52 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1ig3rI-0007i0-Kr; Sat, 14 Dec 2019 10:37:08 +0100 From: Florian Weimer To: Vineet Gupta Subject: Re: [uclibc-ng-devel] stdio fudging errno ? References: <77f8a379-f3dc-6d15-4d8a-20be0346e9f6@synopsys.com> Date: Sat, 14 Dec 2019 10:37:08 +0100 In-Reply-To: <77f8a379-f3dc-6d15-4d8a-20be0346e9f6@synopsys.com> (Vineet Gupta's message of "Thu, 12 Dec 2019 23:54:36 +0000") Message-ID: <87k16zdz97.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191214_013800_029861_8E0BBECF X-CRM114-Status: UNSURE ( 4.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devel@uclibc-ng.org" , "jan.vangorp_ext@softathome.com" , arcml Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org * Vineet Gupta: > Here's a simple test case which shows the problem: > > #define _GNU_SOURCE > #include > #include > #include > > void main(void) > { > const char *this_func = "finite"; > char *test_name; > > errno = 0; > if (asprintf (&test_name, "%s (%s)", this_func, "my-str") == -1) > abort (); > > printf("%d\n", errno); // <-- prints 11 > } > > The errno unconditionally being set to EAGAIN seems to have been > introduced in commit 568ceebf6adfc58c64a95133311268db6 ("Fix > infinite loop when fopencookie custom write returns 0 on error") > bakc in 2016. For functions specified by standards, successful calls can alter errno unless specified otherwise. asprintf is not a standardized function, but it is reasonable to expect that a similar rule applies. _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc