Lines Matching refs:fd

82 	int	fd;  in hpet_open_close()  local
89 fd = open(argv[0], O_RDONLY); in hpet_open_close()
90 if (fd < 0) in hpet_open_close()
93 close(fd); in hpet_open_close()
102 int fd; in hpet_info() local
109 fd = open(argv[0], O_RDONLY); in hpet_info()
110 if (fd < 0) { in hpet_info()
115 if (ioctl(fd, HPET_INFO, &info) < 0) { in hpet_info()
126 close(fd); in hpet_info()
134 int iterations, i, fd; in hpet_poll() local
149 fd = open(argv[0], O_RDONLY); in hpet_poll()
151 if (fd < 0) { in hpet_poll()
156 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { in hpet_poll()
161 if (ioctl(fd, HPET_INFO, &info) < 0) { in hpet_poll()
168 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { in hpet_poll()
173 if (ioctl(fd, HPET_IE_ON, 0) < 0) { in hpet_poll()
178 pfd.fd = fd; in hpet_poll()
199 if (read(fd, &data, sizeof(data)) != sizeof(data)) { in hpet_poll()
209 close(fd); in hpet_poll()
226 int iterations, i, fd, value; in hpet_fasync() local
231 fd = -1; in hpet_fasync()
243 fd = open(argv[0], O_RDONLY); in hpet_fasync()
245 if (fd < 0) { in hpet_fasync()
251 if ((fcntl(fd, F_SETOWN, getpid()) == 1) || in hpet_fasync()
252 ((value = fcntl(fd, F_GETFL)) == 1) || in hpet_fasync()
253 (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) { in hpet_fasync()
261 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { in hpet_fasync()
266 if (ioctl(fd, HPET_INFO, &info) < 0) { in hpet_fasync()
273 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { in hpet_fasync()
278 if (ioctl(fd, HPET_IE_ON, 0) < 0) { in hpet_fasync()
291 if (fd >= 0) in hpet_fasync()
292 close(fd); in hpet_fasync()