DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦f383d39f4⟧ TextFile

    Length: 756 (0x2f4)
    Types: TextFile
    Names: »saxer5.c«

Derivation

└─⟦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« 

TextFile

/* 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);
}