4 * $DragonFly: src/test/sysperf/pipe1.c,v 1.1 2003/08/12 02:29:44 dillon Exp $
12 main(int ac
, char **av
)
21 printf("tests full duplex pipe 1write,2read,2write,1read loop\n");
31 while (read(fds
[1], c
, sizeof(c
)) == sizeof(c
)) {
32 write(fds
[1], c
, sizeof(c
));
40 write(fds
[0], c
, sizeof(c
)); /* prime the caches */
41 read(fds
[0], c
, sizeof(c
));
45 write(fds
[0], c
, sizeof(c
));
46 if (read(fds
[0], c
, sizeof(c
)) != sizeof(c
)) {
47 fprintf(stderr
, "broken pipe during test\n");
50 if ((j
& 31) == 0 && stop_timing(0, NULL
))
56 for (j
= 0; j
< loops
; ++j
) {
57 write(fds
[0], c
, sizeof(c
));
58 if (read(fds
[0], c
, sizeof(c
)) != sizeof(c
)) {
59 fprintf(stderr
, "broken pipe during test\n");
63 stop_timing(j
, "full duplex pipe / 1char:");
65 while(wait(NULL
) >= 0);