Lines Matching refs:ufds
15 static struct pollfd *ufds; variable
57 new_ufds = realloc(ufds, sizeof(ufds[0]) * (nfds + 1)); in open_device()
62 ufds = new_ufds; in open_device()
69 ufds[nfds].fd = fd; in open_device()
70 ufds[nfds].events = POLLIN; in open_device()
85 memmove(ufds + i, ufds + i + 1, sizeof(ufds[0]) * count); in close_device()
165 ufds = calloc(1, sizeof(ufds[0])); in init_getevent()
166 ufds[0].fd = inotify_init(); in init_getevent()
167 ufds[0].events = POLLIN; in init_getevent()
169 res = inotify_add_watch(ufds[0].fd, device_path, IN_DELETE | IN_CREATE); in init_getevent()
184 close(ufds[i].fd); in uninit_getevent()
186 free(ufds); in uninit_getevent()
187 ufds = 0; in uninit_getevent()
198 pollres = poll(ufds, nfds, timeout); in get_event()
202 if(ufds[0].revents & POLLIN) { in get_event()
203 read_notify(device_path, ufds[0].fd); in get_event()
206 if(ufds[i].revents) { in get_event()
207 if(ufds[i].revents & POLLIN) { in get_event()
208 res = read(ufds[i].fd, event, sizeof(*event)); in get_event()