Lines Matching refs:read
111 nbytes = read(fd, buf, sizeof(buf) - 1); in mtd_scan_partitions()
302 if (lseek64(fd, pos, SEEK_SET) != pos || read(fd, data, size) != size) { in read_block()
331 size_t read = 0; in mtd_read_data() local
332 while (read < len) { in mtd_read_data()
335 size_t copy = len - read < avail ? len - read : avail; in mtd_read_data()
336 memcpy(data + read, ctx->buffer + ctx->consumed, copy); in mtd_read_data()
338 read += copy; in mtd_read_data()
343 len - read >= ctx->partition->erase_size) { in mtd_read_data()
344 if (read_block(ctx->partition, ctx->fd, data + read)) return -1; in mtd_read_data()
345 read += ctx->partition->erase_size; in mtd_read_data()
348 if (read >= len) { in mtd_read_data()
349 return read; in mtd_read_data()
353 if (ctx->consumed == ctx->partition->erase_size && read < len) { in mtd_read_data()
359 return read; in mtd_read_data()
446 read(fd, verify, size) != size) { in write_block()