return 0;
}
-int vtape_ioctl(int fd, unsigned long int request, ...)
+int vtape_ioctl(int fd, ioctl_req_t request, ...)
{
va_list argp;
- int result=0;
+ int result = 0;
vtape *t = get_tape(fd);
if (!t) {
current_file++;
}
}
- off_t l;
+ boffset_t l;
while (::read(fd, &l, sizeof(l)) > 0) {
if (l) {
lseek(fd, l, SEEK_CUR);
current_file = 0;
current_block = -1;
- max_block = 2*1024*2048; /* 2GB */
+ max_block = VTAPE_MAX_BLOCK;
}
vtape::~vtape()
cur_FM = lseek(fd, 0, SEEK_CUR); // current position
/* update previous next_FM */
- lseek(fd, last_FM + sizeof(uint32_t)+sizeof(off_t), SEEK_SET);
- ::write(fd, &cur_FM, sizeof(off_t));
+ lseek(fd, last_FM + sizeof(uint32_t)+sizeof(boffset_t), SEEK_SET);
+ ::write(fd, &cur_FM, sizeof(boffset_t));
lseek(fd, cur_FM, SEEK_SET);
next_FM = 0;
ASSERT(fd >= 0);
int i,nb, ret=0;
- off_t where=0;
+ boffset_t where=0;
uint32_t s;
Dmsg4(dbglevel, "fsr %i:%i EOF=%i c=%i\n",
current_file,current_block,atEOF,count);
int last_f=0;
int last_b=0;
- off_t last=-1, last2=-1;
- off_t orig = lseek(fd, 0, SEEK_CUR);
+ boffset_t last=-1, last2=-1;
+ boffset_t orig = lseek(fd, 0, SEEK_CUR);
int orig_f = current_file;
int orig_b = current_block;
Dmsg2(dbglevel, "bsr %i:%i\n", current_file, current_block);
errno=0;
atEOT = atEOF = atEOD = false;
- atBOT = (lseek(fd, 0, SEEK_CUR) - (sizeof(uint32_t)+2*sizeof(off_t))) == 0;
+ atBOT = (lseek(fd, 0, SEEK_CUR) - (sizeof(uint32_t)+2*sizeof(boffset_t))) == 0;
if (orig_b == -1) {
current_block = orig_b;
/* If the vtape is empty, start by writing a EOF */
if (online && !read_fm(VT_READ_EOF)) {
- weof();
+ lseek(fd, 0, SEEK_SET); /* rewind */
+ cur_FM = next_FM = last_FM = 0; /* reset */
+ weof(); /* write the first EOF */
last_file = current_file=0;
}
#else /* USE_VTAPE */
-int vtape_ioctl(int fd, unsigned long int request, ...)
+int vtape_ioctl(int fd, ioctl_req_t request, ...)
{
return -1;
}