public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Freddie Chopin <freddie_chopin@op.pl>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>,
		newlib@sourceware.org
Subject: Re: [PATCH v3 3/5] Introduce _REENT_GLOBAL_STDIO_STREAMS
Date: Wed, 08 Aug 2018 14:10:00 -0000	[thread overview]
Message-ID: <e8e34624c126bcba3858fffaf26cb669dc305cea.camel@op.pl> (raw)
In-Reply-To: <1068535433.14282.1498813082840.JavaMail.zimbra@embedded-brains.de>

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

  parent reply	other threads:[~2018-08-08 13:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 12:25 [PATCH v3 1/5] Remove superfluous parameter from std() Sebastian Huber
2017-06-29 12:25 ` [PATCH v3 2/5] Add stdin_init(), stdout_init() and stderr_init() Sebastian Huber
2017-06-29 12:25 ` [PATCH v3 4/5] Enable _REENT_GLOBAL_STDIO_STREAMS for RTEMS Sebastian Huber
2017-06-29 12:25 ` [PATCH v3 3/5] Introduce _REENT_GLOBAL_STDIO_STREAMS Sebastian Huber
2017-06-29 18:31   ` Corinna Vinschen
2017-06-30  5:43     ` Sebastian Huber
2017-06-30  8:13       ` Corinna Vinschen
2017-06-30  8:58         ` Sebastian Huber
2017-06-30 10:35           ` Corinna Vinschen
2018-08-08 14:10           ` Freddie Chopin [this message]
2018-08-08 15:20             ` Sebastian Huber
2018-08-09  4:59               ` Freddie Chopin
2018-08-09  6:09                 ` Sebastian Huber
2017-06-29 12:25 ` [PATCH v3 5/5] Add --enable-newlib-global-stdio-streams Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8e34624c126bcba3858fffaf26cb669dc305cea.camel@op.pl \
    --to=freddie_chopin@op.pl \
    --cc=newlib@sourceware.org \
    --cc=sebastian.huber@embedded-brains.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).