Lines Matching defs:count
153 bool full_read(struct filedes *file, void *buf, size_t count)
155 while (count) {
156 int n = read(file->fd, buf, min(count, INT_MAX));
167 count -= n;
172 bool full_write(struct filedes *file, const void *buf, size_t count)
174 while (count) {
175 int n = write(file->fd, buf, min(count, INT_MAX));
182 count -= n;
187 static int raw_pwrite(int fd, const void *buf, int count, u64 offset)
195 if (!WriteFile(h, buf, count, &written, &pos)) {
201 return pwrite(fd, buf, count, offset);
205 bool full_pwrite(struct filedes *file, const void *buf, size_t count,
208 while (count) {
209 int n = raw_pwrite(file->fd, buf, min(count, INT_MAX), offset);
216 count -= n;
237 int read_callback(void *file, void *buf, size_t count)
240 if (!full_read(file, buf, count))