|
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 s
Length: 756 (0x2f4) Types: TextFile Names: »saxer5.c«
└─⟦db229ac7e⟧ Bits:30007240 EUUGD20: SSBA 1.2 / AFW Benchmarks └─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21E/saxer/saxer5.c« └─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21F/saxer/saxer5.c«
/* Program #5 John Saxer random access */ #include <stdio.h> #ifndef BSIZE # define BSIZE BUFSIZ #endif #ifndef NBLOCKS # define NBLOCKS 2000 #endif main() { register int fd, i; register long offset, rnd; char buf[BSIZE]; if ( ( fd=open("saxer.dat",0) ) == -1 ) { perror("saxer.dat"); exit(1); } for ( i=0; i<NBLOCKS; i++ ) { rnd=rand(); #ifdef LONG rnd &= 0x7fff; #endif offset = ((rnd * (long)NBLOCKS) / (long)0x7fff * (long)BSIZE); lseek(fd,offset,0); read(fd,buf,BSIZE); } close(fd); }