I'm current supporting some legacy software written aeon ago, compiled in gcc 2.95.3. The program is ran in an SBC, occasionally I had to telnet into it to fix things. I notice that when the SBC is running on its own, it display some unexpected behavior e.g. missed executions.
When I do telnet in, slay the process and execute it manually, it stays fine that way. I'm suspecting that this has to do with per开发者_如何学JAVAforming printf
without a proper terminal/console for it to print on.
If printf
are not handled, what would be the effect of it?
Could it be that the system is trying to print to a hardware serial port (which are really slow) and when you telnet in its replaced by a TCP port instead?
It depends on the stdio library you use, most will attempt to write to console anyway, so...
You should redirecting your STDOUT and STDERR to NULL or to a file, this should be quiet easy. gcc 2.95 was very stable so we can pretty much rule out any problems there.
精彩评论