Lines Matching defs:fd
37 int fd;
45 fd = open(device, O_RDWR);
46 if (fd < 0) {
50 if (ioctl(fd, EVIOCGVERSION, &version)) {
53 if (ioctl(fd, EVIOCGID, &id)) {
59 if (ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name) < 1) {
62 if (ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) {
65 if (ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) {
82 ufds[nfds].fd = fd;
171 ufds[0].fd = inotify_init();
174 res = inotify_add_watch(ufds[0].fd, device_path, IN_DELETE | IN_CREATE);
188 close(ufds[i].fd);
206 read_notify(device_path, ufds[0].fd);
211 res = read(ufds[i].fd, event, sizeof(*event));