Lines Matching refs:fd
28 int fd;
32 fd = open(msr_file_name, O_RDONLY);
33 if (fd < 0)
35 if (lseek(fd, idx, SEEK_CUR) == -1)
37 if (read(fd, val, sizeof *val) != sizeof *val)
39 close(fd);
42 close(fd);
57 int fd;
61 fd = open(msr_file_name, O_WRONLY);
62 if (fd < 0)
64 if (lseek(fd, idx, SEEK_CUR) == -1)
66 if (write(fd, &val, sizeof val) != sizeof val)
68 close(fd);
71 close(fd);