This is the mail archive of the newlib@sourceware.org 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]

Buffered I/O issues (stdout, stdin)


Hi everyone,

I'm having some trouble with a port of Newlib 1.15.0 to my operating
system in the printf function. It seems that the streams are all using
buffered I/O and if the last string printed does not have a newline it
simply is not printed at all.

I also notice strange behavior with this sort of code:

printf( "testing 123: %s\n", "hello\nworld" );

The output will be "testing 123: hello\n", which doesn't seem to be
correct. The write system call is only called for the characters
actually printed, not for the ones after, and including, the newline
(ie, "\nworld").

There's also a problem with getchar, which requires me to hit enter
before it actually returns (could this be a side effect of the read
system call - what is the standard behavior when dealing with newlines
and the like within my console I/O functions?).

Some help on this would be greatly appreciated. Thanks in advance.


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