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]

_IONBF drops all newlines


Hi all,

newlib-1.12.0, gcc 3.4 for arm-elf, custom OS.

I'm new to newlib and am trying to embed it on an ARM946. I have my code
booting nicely now with stdin/out as default settings (line buffered??).
However, my code is interactive (i.e. command line editing) and I need
stdio to be unbuffered so I can use getchar for real time char input and
putchar/printf output to control a VT100 cursor. So I added...

    setvbuf(stdin, NULL, _IONBF, 0);
    setvbuf(stdout, NULL, _IONBF, 0);

...early in my code (no output so far), but this seem to make puts not
output a \n and printf also seems to ignore any \n in the format string.
putchar('\n') works fine and my serial driver does the conversion to
CR/LR for the terminal.

I don't use crt0 and have a custom boot sequence, that sets .data and
.bss correctly. It doesn't call any kind of newlib init routines, as
there don't seem to be any (stdio initialised on the fly for example).
Have I missed something obvious?

Thanks in advance,
Nick.



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