Corinna Vinschen
2018-06-27 12:55:03 UTC
Hi Takashi,
again, please send patches related to newlib to the newlib mailing list.
Newlib patches affect more targets than just Cygwin. I redirected this
mail to the newlib list and attached your original attachments. Thank
you.
if the original stderr stream is buffered as well.
What about duplicating the non-_FVWRITE_IN_STREAMIO part of _fputs_r,
just without calling ORIENT?
Another solution might be what glibc does; if the stream has no
orientation yet, it duplicates the stderr FILE handle and uses that to
print the string.
Checking FreeBSD, it seems it actually calls writev, without actually
checking if the entire string has been written, see
https://github.com/freebsd/freebsd/blob/master/lib/libc/stdio/perror.c
Thanks,
Corinna
again, please send patches related to newlib to the newlib mailing list.
Newlib patches affect more targets than just Cygwin. I redirected this
mail to the newlib list and attached your original attachments. Thank
you.
The perror() function shall not change the orientation of the standard
error stream.
However, cygwin perror() function changes the orientation of stderr to
byte-oriented mode if stderr is not oriented yet.
That's newlib's perror actually.error stream.
However, cygwin perror() function changes the orientation of stderr to
byte-oriented mode if stderr is not oriented yet.
[...]
I have made a patch to solve this problem, attached. However, I am not
sure that calling _write_r() here is correct manner. I will appreciate
if anyone familiar with libc code comment or make suggestions.
I'm not sure exactly. It may be nice to keep the writes bufferedI have made a patch to solve this problem, attached. However, I am not
sure that calling _write_r() here is correct manner. I will appreciate
if anyone familiar with libc code comment or make suggestions.
if the original stderr stream is buffered as well.
What about duplicating the non-_FVWRITE_IN_STREAMIO part of _fputs_r,
just without calling ORIENT?
Another solution might be what glibc does; if the stream has no
orientation yet, it duplicates the stderr FILE handle and uses that to
print the string.
Checking FreeBSD, it seems it actually calls writev, without actually
checking if the entire string has been written, see
https://github.com/freebsd/freebsd/blob/master/lib/libc/stdio/perror.c
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat