Changeset 58898d1d in mainline for uspace/lib/bithenge/src/file.c
- Timestamp:
- 2017-03-24T20:31:54Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8e9b2534
- Parents:
- c9e3692
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/bithenge/src/file.c
rc9e3692 r58898d1d 78 78 if (offset > blob->size) 79 79 return ELIMIT; 80 if (lseek(blob->fd, offset, SEEK_SET) < 0)81 return errno == EINVAL ? EIO : errno;82 80 83 ssize_t amount_read; 84 aoff64_t remaining_size = *size; 85 *size = 0; 86 do { 87 amount_read = read(blob->fd, buffer, remaining_size); 88 if (amount_read < 0) 89 return errno; 90 buffer += amount_read; 91 *size += amount_read; 92 remaining_size -= amount_read; 93 } while (remaining_size && amount_read); 81 ssize_t amount_read = read(blob->fd, &offset, buffer, *size); 82 if (amount_read < 0) 83 return errno; 84 *size += amount_read; 94 85 return EOK; 95 86 }
Note:
See TracChangeset
for help on using the changeset viewer.