|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 566 (0x236)
Types: TextFile
Names: »pipe.c«
└─⟦db229ac7e⟧ Bits:30007240 EUUGD20: SSBA 1.2 / AFW Benchmarks
└─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21E/musbus/pipe.c«
└─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21F/musbus/pipe.c«
/*
* pipe -- test single process pipe throughput (no context switching)
*
* $Header: pipe.c,v 5.2 87/12/09 15:35:32 kenj Exp $
*/
main(argc, argv)
int argc;
char *argv[];
{
char buf[512];
int iter = 2048; /* 1M byte */
int pvec[2];
if (argc > 1)
iter = atoi(argv[1]);
pipe(pvec);
close(0); dup(pvec[0]); close(pvec[0]);
close(1); dup(pvec[1]); close(pvec[1]);
while (iter-- > 0) {
if (write(1, buf, sizeof(buf)) != sizeof(buf))
perror("write failed");
if (read(0, buf, sizeof(buf)) != sizeof(buf))
perror("read failed");
}
exit(0);
}