[PATCH] getty: Wait until all output written to stdout has beentransmitted

Peter Korsgaard jacmet at sunsite.dk
Mon Jan 24 20:44:35 UTC 2011


>>>>> "Jim" == Cathey, Jim <jcathey at ciena.com> writes:

Hi,

 >> This thread started by Michal, who's trying to use a very slow
 >> serial-over-jtag setup on microblaze, and had issues with characters
 >> getting lost when getty started up (because of the tcflush), so we
 >> wanted to add a tcdrain() instead.

 Jim> A design problem?  Why even issue the tcflush(stdout) (in essence)
 Jim> if you _don't_ want to discard pending output?

The tcflush() is only to workaround the issue with SW flow control like
noted earlier. If tcdrain() works correctly (E.G. finishes before the
alarm fires), then the tcflush is a noop.

If we can ignore that error situation or only need to flush input, then
sure - Let's just do that.

 Jim> If the flush problem is from stuff sent by a process that
 Jim> preceded getty, rather than getty's own early output, then
 Jim> the lack of the flush is _its_ problem, not getty's, given
 Jim> that getty's charter is to program the serial port (if only
 Jim> partially) in the first place!  Perhaps the parent shouldn't
 Jim> even be calling getty, but rather login instead?

True, but this is typically not done. The parent of getty is most likely
init, and the unsent output is from other init scripts. Our very own
examples/inittab calls getty as well.

-- 
Bye, Peter Korsgaard


More information about the busybox mailing list