From 5e3b39d3f666cb43ee00315df41d0d609d943715 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 18 May 2000 16:51:05 +0000 Subject: [PATCH] Set buffer size implemented. --- hadaq/hwtape.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hadaq/hwtape.c b/hadaq/hwtape.c index 23c923c..8243e41 100644 --- a/hadaq/hwtape.c +++ b/hadaq/hwtape.c @@ -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) { -- 2.43.0