Lines Matching refs:fd
81 int fd; in hpet_open_close() local
88 fd = open(argv[0], O_RDONLY); in hpet_open_close()
89 if (fd < 0) in hpet_open_close()
92 close(fd); in hpet_open_close()
101 int fd; in hpet_info() local
108 fd = open(argv[0], O_RDONLY); in hpet_info()
109 if (fd < 0) { in hpet_info()
114 if (ioctl(fd, HPET_INFO, &info) < 0) { in hpet_info()
125 close(fd); in hpet_info()
133 int iterations, i, fd; in hpet_poll() local
148 fd = open(argv[0], O_RDONLY); in hpet_poll()
150 if (fd < 0) { in hpet_poll()
155 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { in hpet_poll()
160 if (ioctl(fd, HPET_INFO, &info) < 0) { in hpet_poll()
167 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { in hpet_poll()
172 if (ioctl(fd, HPET_IE_ON, 0) < 0) { in hpet_poll()
177 pfd.fd = fd; in hpet_poll()
198 if (read(fd, &data, sizeof(data)) != sizeof(data)) { in hpet_poll()
208 close(fd); in hpet_poll()
225 int iterations, i, fd, value; in hpet_fasync() local
230 fd = -1; in hpet_fasync()
242 fd = open(argv[0], O_RDONLY); in hpet_fasync()
244 if (fd < 0) { in hpet_fasync()
250 if ((fcntl(fd, F_SETOWN, getpid()) == 1) || in hpet_fasync()
251 ((value = fcntl(fd, F_GETFL)) == 1) || in hpet_fasync()
252 (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) { in hpet_fasync()
260 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { in hpet_fasync()
265 if (ioctl(fd, HPET_INFO, &info) < 0) { in hpet_fasync()
272 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { in hpet_fasync()
277 if (ioctl(fd, HPET_IE_ON, 0) < 0) { in hpet_fasync()
290 if (fd >= 0) in hpet_fasync()
291 close(fd); in hpet_fasync()