int sparse_end(int f)
{
if (last_sparse) {
- lseek(f,-1,SEEK_CUR);
+ do_lseek(f,-1,SEEK_CUR);
return (write(f,&last_byte,1) == 1 ? 0 : -1);
}
last_sparse = 0;
last_sparse=1;
if (l1 > 0)
- lseek(f,l1,SEEK_CUR);
+ do_lseek(f,l1,SEEK_CUR);
if (l1 == len)
return len;
}
if (l2 > 0)
- lseek(f,l2,SEEK_CUR);
+ do_lseek(f,l2,SEEK_CUR);
return len;
}
next;
}
-!/^off_t|^pid_t|^unsigned|^mode_t|^DIR|^user|^int|^char|^uint|^struct|^BOOL|^void|^time/ {
+!/^OFF_T|^off_t|^pid_t|^unsigned|^mode_t|^DIR|^user|^int|^char|^uint|^struct|^BOOL|^void|^time/ {
next;
}
return fstat(fd, st);
#endif
}
+
+OFF_T do_lseek(int fd, OFF_T offset, int whence)
+{
+#if HAVE_OFF64_T
+ return lseek64(fd, offset, whence);
+#else
+ return lseek(fd, offset, whence);
+#endif
+}
map->p_size = len;
}
- if (lseek(map->fd,offset,SEEK_SET) != offset ||
+ if (do_lseek(map->fd,offset,SEEK_SET) != offset ||
(nread=read(map->fd,map->p,len)) != len) {
fprintf(FERROR,"EOF in map_ptr! (offset=%d len=%d nread=%d errno=%d)\n",
(int)offset, len, nread, errno);