Lines Matching refs:fd
39 int fd;
44 fd = open(partition, O_RDONLY);
45 if (fd == -1) {
53 if (ioctl(fd, BLKGETSIZE64, &partition_size) != 0) {
61 where = lseek(fd, offset, SEEK_SET);
72 num_read = read(fd, buffer, num_bytes);
84 if (fd != -1) {
85 if (close(fd) != 0) {
99 int fd;
104 fd = open(partition, O_WRONLY);
105 if (fd == -1) {
111 where = lseek(fd, offset, SEEK_SET);
123 num_written = write(fd, buffer, num_bytes);
131 if (fd != -1) {
132 if (close(fd) != 0) {
174 int fd;
177 fd = open(partition, O_WRONLY);
178 if (fd == -1) {
185 if (ioctl(fd, BLKGETSIZE64, out_size_in_bytes) != 0) {
193 if (fd != -1) {
194 if (close(fd) != 0) {