This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix stdin,-out and -err for multithreaded apps


On Thu, Sep 18, 2003 at 09:05:26PM +0200, Thomas Pfaff wrote:
>Attached is a patch that should fix the bug reported at
>
>http://sources.redhat.com/ml/newlib/2003/msg00544.html.
>
>which is another __DYNAMIC_REENT related problem.
>
>It will change stdin, -out and -err locations to use _GLOBAL_REENT 
>instead of _REENT where appropriate, and it includes a change for the 
>stdin, stdout and stderr defines that i suggested some time ago (see 
>http://sources.redhat.com/ml/newlib/2003/msg00363.html).
>This will allow to change stdin, stdout and stderr without recompiling 
>all user apps in the future.
>
>If speed is an issue the former defines can be used by defining 
>_INLINE_STDFP.
>
>After applying this patch Makefile.in must be regenerated.
>
>Comments are welcome.

You really can't redefine stdin, stdout, and stderr as functions.
That will break static initialization.

Can't you just change the initializers in REENT_INIT and REENT_INIT_PTR
to point the reent _std* variables at _impure_ptr->_std* instead?

That means there is some wasted storage in _reent but that's not a
big deal.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]