From 6abe3c1e8a9e3a58d50d098a6211632d02d9a250 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 17 Dec 2008 23:38:33 +0100 Subject: hurd/debugging/translator/capturing_stdout_and_stderr: Note about line-buffering. --- hurd/debugging/translator/capturing_stdout_and_stderr.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hurd/debugging/translator') diff --git a/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn b/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn index 8430287a..e95d6e12 100644 --- a/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn +++ b/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn @@ -24,3 +24,10 @@ Sometimes it may already be helpful to capture a translator's `stdout` and (Trying to run [[GDB]] in this case was of no help -- due to a bug in GDB (supposedly) it wouldn't catch the fault.) + +Be made aware that both `stdout` and `stderr` will be block bufferend and no +longer line buffered when doing such a redirection, so you'll have to arrange +for appropriate `fflush`es on these, or force them to be line buffered again +using the appropriate glibc magic (`setvbuf`). Otherwise you'll see text in +the output files only if either glibc herself decides to flush (after some KiB +of text) the after translator exits. -- cgit v1.2.3