|
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: 554 (0x22a) Types: TextFile Names: »pipedis.c«
└─⟦db229ac7e⟧ Bits:30007240 EUUGD20: SSBA 1.2 / AFW Benchmarks └─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21E/bsd/pipedis.c« └─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21F/bsd/pipedis.c«
main(argc,argv) char *argv[]; { char buf[512]; int fd[2], msgsize; register int i, iter; if (argc < 3){ printf("usage: %s iterations message-size\n",argv[0]); exit(1); } argc--,argv++; iter = atoi(*argv); argc--, argv++; msgsize = atoi(*argv); if (msgsize > sizeof(buf) || msgsize <= 0){ printf("%s: Bad message size.\n", *argv); exit(2); } if (pipe(fd) < 0) { perror("pipe"); exit(3); } if(fork() == 0) for(i=0; i < iter; i++) read(fd[0], buf, msgsize); else for(i=0; i < iter; i++) write(fd[1], buf, msgsize); }