From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37960 invoked by alias); 8 Aug 2018 13:19:40 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 37951 invoked by uid 89); 8 Aug 2018 13:19:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=erm, fch X-HELO: smtpo89.poczta.onet.pl Received: from smtpo90.poczta.onet.pl (HELO smtpo89.poczta.onet.pl) (213.180.149.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 13:19:37 +0000 Received: from INFERNUS (ac61.itcomp.pl [109.196.82.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: freddie_chopin@op.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 41lsRm0k3Jzr5pMv; Wed, 8 Aug 2018 15:19:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=op.pl; s=2011; t=1533734372; bh=TiGRcAqnfsdkKz02uZMjlQNyVlsWXb4yYGJOY9TEk+Y=; h=Subject:From:To:Date:In-Reply-To:References:From; b=D+qxVTjzLLwDGS2LBS2t+r0hazsEdwhFknvc+it0mUA53ij7NYwr5M3nk8tDXmc6j Xo9Q2/S5RlWqE04iQAcMeCZfKqhcoDOgyiO1WLGahsxW+W5HfX/kAbxtOJdjZ/sKfm DchslArbWCjhiYNSMge1cKg7skRkl+6tr62aAF+U= Message-ID: Subject: Re: [PATCH v3 3/5] Introduce _REENT_GLOBAL_STDIO_STREAMS From: Freddie Chopin To: Sebastian Huber , newlib@sourceware.org Date: Wed, 08 Aug 2018 14:10:00 -0000 In-Reply-To: <1068535433.14282.1498813082840.JavaMail.zimbra@embedded-brains.de> References: <20170629122002.25614-1-sebastian.huber@embedded-brains.de> <20170629122002.25614-3-sebastian.huber@embedded-brains.de> <20170629183138.GY6201@calimero.vinschen.de> <20170630081306.GA6201@calimero.vinschen.de> <1068535433.14282.1498813082840.JavaMail.zimbra@embedded-brains.de> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018/txt/msg00624.txt.bz2 On Fri, 2017-06-30 at 10:58 +0200, Sebastian Huber wrote: > > ----- Am 30. Jun 2017 um 10:13 schrieb Corinna Vinschen > vinschen@redhat.com: > > > On Jun 30 07:43, Sebastian Huber wrote: > > > On 29/06/17 20:31, Corinna Vinschen wrote: > > > > > > > And, JFYI, Cygwin will start to use it too after the next > > > > release:) > > > > > > There are some new problems with this change. We have no > > > reference counting > > > in the FILE objects, so a freopen(..., stdin), closes the global > > > stdin FILE > > > object (__sf[0]), etc. What works is a stdin = fopen(). I guess > > > this could > > > break existing applications. > > > > Erm... isn't that expected behaviour? stdin/stdout/stderr are > > global > > objects, after all. They were never thread-local per POSIX. > > The stdin/stdout/stderr pointers are still thread-local with this > option. Only the FILE objects itself are now global. If you do a > stdin = fopen() you get a completely thread-local stdin. I have > absolutely no idea why this stuff is thread-local in Newlib by > default. Would that be possible, to make stdin/stdout/stderr completely global (remove them from _reent, use global objects) when _REENT_GLOBAL_STDIO_STREAMS is enabled? Regards, FCh