3 /* File: pipes.c - created by Marty Leisner */
4 /* Leisner.Henr 1-Dec-87 8:55:04 */
6 /* Copyright (C) 1987 by Martin Leisner. All rights reserved. */
7 /* Used by permission. */
15 #define BLOCK_SIZE 1000
16 #define NUM_BLOCKS 1000
19 char buffer
[BLOCK_SIZE
];
21 _PROTOTYPE(int main
, (void));
22 _PROTOTYPE(void quit
, (void));
26 int stat_loc
, pipefd
[2];
31 fflush(stdout
); /* have to flush for child's benefit */
33 system("rm -rf DIR_13; mkdir DIR_13");
41 for (i
= 0; i
< NUM_BLOCKS
; i
++)
42 if (read(pipefd
[0], buffer
, BLOCK_SIZE
) != BLOCK_SIZE
) break;
51 for (i
= 0; i
< NUM_BLOCKS
; i
++) write(pipefd
[1], buffer
, BLOCK_SIZE
);
56 return(-1); /* impossible */
63 system("rm -rf DIR*");
69 printf("%d errors\n", errct
);