4 * $DragonFly: src/test/sysperf/pipe1.c,v 1.1 2003/08/12 02:29:44 dillon Exp $
10 main(int ac, char **av)
19 printf("tests full duplex pipe 1write,2read,2write,1read loop\n");
29 while (read(fds[1], c, sizeof(c)) == sizeof(c)) {
30 write(fds[1], c, sizeof(c));
38 write(fds[0], c, sizeof(c)); /* prime the caches */
39 read(fds[0], c, sizeof(c));
43 write(fds[0], c, sizeof(c));
44 if (read(fds[0], c, sizeof(c)) != sizeof(c)) {
45 fprintf(stderr, "broken pipe during test\n");
48 if ((j & 31) == 0 && stop_timing(0, NULL))
54 for (j = 0; j < loops; ++j) {
55 write(fds[0], c, sizeof(c));
56 if (read(fds[0], c, sizeof(c)) != sizeof(c)) {
57 fprintf(stderr, "broken pipe during test\n");
61 stop_timing(j, "full duplex pipe / 1char:");
63 while(wait(NULL) >= 0);