ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size, off_t offset) { #ifdef USE_UBLIO return ublio_pread(dev->ufh, buffer, size, offset); #else return pread(dev->fd, buffer, size, offset); #endif }
ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size, off64_t offset) { #ifdef USE_UBLIO return ublio_pread(dev->ufh, buffer, size, offset); #elif defined(USE_TRANSITIONAL_LFS) && USE_TRANSITIONAL_LFS return pread64(dev->fd, buffer, size, offset); #else return pread(dev->fd, buffer, size, offset); #endif }
ssize_t exfat_read(struct exfat_dev* dev, void* buffer, size_t size) { #ifdef USE_UBLIO ssize_t result = ublio_pread(dev->ufh, buffer, size, dev->pos); if (result >= 0) dev->pos += size; return result; #else return read(dev->fd, buffer, size); #endif }
void exfat_pread(struct exfat_dev* dev, void* buffer, size_t size, off_t offset) { #ifdef USE_UBLIO if (ublio_pread(dev->ufh, buffer, size, offset) != size) #else if (pread(dev->fd, buffer, size, offset) != size) #endif exfat_bug("failed to read %zu bytes from file at %"PRIu64, size, (uint64_t) offset); }