perror() changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet.

Takashi Yano takashi.yano@nifty.ne.jp
Thu Jul 5 15:58:00 GMT 2018


On Thu, 5 Jul 2018 14:49:00 +0200
Corinna Vinschen wrote:
> ...I noticed that FreeBSD handles psignal differently.  It writes the
> output immediately to STDERR_FILENO, rather than to stderr or
> fileno(stderr).  It does also not call fflush or reset the _SOFF flag.
...
> Thoughts?

Since _newlib_flockfile_start()/end() are defined in stdio/local.h, using
_newlib_flockfile_start()/end() from psignal.c is a bit painful. Moreover
there are several reports that they can not build newlib on bare metal.
Therefore, I imitated FreeBSD in a hurry just because it seems the easiest
way.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-newlib-functions-perror-psignal-not-to-use-write.patch
Type: application/octet-stream
Size: 3623 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20180705/367b1c68/attachment.obj>


More information about the Newlib mailing list