1 ?RCS: $Id: d_nolnbuf.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: d_nolnbuf.U,v $
12 ?RCS: Revision 3.0.1.1 1994/05/06 14:46:07 ram
13 ?RCS: patch23: avoid looping in the "see that again?" prompt (WED)
15 ?RCS: Revision 3.0 1993/08/18 12:06:43 ram
16 ?RCS: Baseline for dist 3.0 netwide release.
18 ?MAKE:d_nolnbuf: test +cc cat rm Setvar Myread
19 ?MAKE: -pick add $@ %<
21 ?S: This variable conditionally defines the NOLINEBUF symbol, which
22 ?S: indicates to the C program that stdout is not buffered, so that
23 ?S: the program can call setbuf() or setlinebuf() for efficiency.
26 ?C: This symbol, if defined, indicates that stdout is not buffered, so that
27 ?C: the program can call setbuf() or setlinebuf() for efficiency.
29 ?H:#$d_nolnbuf NOLINEBUF /**/
34 : check for buffering of stdout
38 $cat <<'EOT' >blurfl.c
44 for (i = 0; i < 5; i++) {
51 $cc -o blurfl blurfl.c >/dev/null 2>&1;
54 Checking for buffering of stdout to terminal.
56 Observe the following characters as they are printed out, to see whether they
57 print out all at once, or with a 1 second pause between each of them. If they
58 print out one by one, you don't have buffering. If they print together (after
59 about a 5 second pause), you do have buffering.
62 dflt='Type return to start printing the test characters'
66 while $test "$xxx" = 'y'; do
69 rp='Would you like to see that again?'
77 rp="Do you have buffering (printed all at once)?"
89 rp="Do you have buffering on stdout to terminals?"