1 ?RCS: $Id: d_eofpipe.U,v 3.0.1.1 1994/10/29 16:12:40 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, 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 3.0.
11 ?RCS: $Log: d_eofpipe.U,v $
12 ?RCS: Revision 3.0.1.1 1994/10/29 16:12:40 ram
13 ?RCS: patch36: call ./bsd explicitly instead of relying on PATH
15 ?RCS: Revision 3.0 1993/08/18 12:05:57 ram
16 ?RCS: Baseline for dist 3.0 netwide release.
18 ?MAKE:d_eofpipe: Compile cat rm Oldconfig Guess echo n c
19 ?MAKE: -pick add $@ %<
21 ?S: This variable conditionally defines the EOFPIPE symbol, which
22 ?S: indicates to the C program that select will correctly detect the EOF
23 ?S: condition when pipe is closed from the other end.
26 ?C: This symbol, if defined, indicates that EOF condition will be detected
27 ?C: by the reader of the pipe when it is closed by the writing process.
28 ?C: That is, a select() call on that file descriptor will not block when
29 ?C: only an EOF remains (typical behaviour for BSD systems).
31 ?H:#$d_eofpipe EOFPIPE /**/
34 : see if pipe correctly gives the EOF condition
38 echo "Let's see if your pipes return EOF to select() upon closing..." >&4
55 select(32, &mask, (int *) 0, (int *) 0, (char *) 0);
56 if (0 == read(pd[0], &mask, 1))
63 if eval $compile_ok; then
64 ?X: Use a script to avoid the possible 'alarm call' message
65 echo "./pipe || exit 1" > mpipe
67 ./mpipe >/dev/null 2>&1
69 0) d_eofpipe="$define";;
70 *) d_eofpipe="$undef";;
73 echo "(The test program did not compile correctly -- Guessing.)"
81 "$define") echo "Yes, they do.";;
82 *) echo "No, they don't! (sigh)";;
86 $echo $n "Your pipes $c"
88 "$define") echo "allow select() to see EOF upon closing.";;
89 *) echo "won't let select() see EOF on closing.";;