]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
Set buffer size implemented.
authorhades <hades>
Thu, 18 May 2000 16:51:05 +0000 (16:51 +0000)
committerhades <hades>
Thu, 18 May 2000 16:51:05 +0000 (16:51 +0000)
hadaq/hwtape.c

index 23c923c262e746506317582cc3a5997cda50efbb..8243e415d75b48e86a19036a596144a9e513ad89 100644 (file)
@@ -35,7 +35,7 @@ static FILE *openTape(const char* filename) {
 
        FILE *outFile;
 
-       struct mtop *eom, *sbm, *rewind;
+       struct mtop *eom, *sbm, *rewind, *setblck;
 
        tape = open(filename, O_RDWR);
        if(tape == -1) {
@@ -89,7 +89,16 @@ static FILE *openTape(const char* filename) {
 
        writeHeader(tape, fileSeqNum, filename);
 
+       setblck->mt_op = MTSETBLK;
+       setblck->mt_count = BLOCKSIZE;
+       stat = ioctl(tape, MTIOCTOP, &setblck);
+       if (stat == -1) {
+                       msglog(LOG_ERR, "Could not go to the eon of the tape!\n");
+               exit(-2);
+       }
+
        outFile = fdopen(tape, "wb");
+       setvbuf(outFile, 0, _IOFBF, BLOCKSIZE);
 }
 
 int closeTape(FILE *openTape, int tape, int numBlocks, const char *filename) {