GNU bug report logs -
#8961
stdbuf has no effect on some programs
Previous Next
Reported by: Bruno Haible <bruno <at> clisp.org>
Date: Wed, 29 Jun 2011 21:00:03 UTC
Severity: normal
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
Message #43 received at 8961 <at> debbugs.gnu.org (full text, mbox):
Pádraig Brady wrote:
> +Disabling buffering for input will not influence the responsiveness
> +or blocking behavior of the stream input functions.
OK, but then what is the effect of "-i0"?
It has only an effect on programs that use stdio. On these programs, it has no
effect on the interface between the program and the FILE buffers, only an effect
on the interface between the FILE buffers and the kernel. More precisely:
- Without -i0, for refilling the buffers, the stdio makes a call to
read(0,buf,N) and receives the available n bytes (n <= N).
- With -i0, the stdio makes repeated calls to read(0,..,1) and
receives the available n bytes one after the other.
The only change in behaviour that I can see in such programs is that its
throughput is reduced, from 35 MB/sec to 2 MB/sec in my tests.
So, "-i0" has no useful effect on any program. I therefore suggest that you
remove this option. Likewise for "-o0". Because if you keep it, other users will
- like me - spend time, trying to make use of this option. When in fact they
are always useless.
Bruno
--
In memoriam Yuri Shchekochikhin <http://en.wikipedia.org/wiki/Yuri_Shchekochikhin>
This bug report was last modified 13 years and 326 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.