Lines Matching refs:fd
70 static ssize_t do_read(int fd, void *buf, off64_t start, size_t count)
75 lseek64(fd, start, SEEK_SET);
78 ret = read(fd, (char *)buf + bytes_read, count - bytes_read);
92 static ssize_t do_write(int fd, const void *buf, off64_t start, size_t count)
97 lseek64(fd, start, SEEK_SET);
100 ret = write(fd, (char *)buf + bytes_out, count - bytes_out);
173 int fd;
187 fd = open(path, O_RDWR | O_DIRECT | O_LARGEFILE);
188 if (fd == -1) {
192 if (fstat(fd, &stat) == -1) {
200 if (ioctl(fd, BLKSSZGET, &blk_size) == -1) {
204 if (ioctl(fd, BLKGETSIZE64, &num_blks) == -1) {
240 if (do_write(fd, write_buf, cur_blk * blk_size, test_size) !=
245 if (do_read(fd, read_buf, cur_blk * blk_size, test_size) !=
270 close(fd);