Lines Matching refs:fd
126 static int uhid_write(struct __test_metadata *_metadata, int fd, const struct uhid_event *ev)
130 ret = write(fd, ev, sizeof(*ev));
143 static int uhid_create(struct __test_metadata *_metadata, int fd, int rand_nb)
164 return uhid_write(_metadata, fd, &ev);
167 static void uhid_destroy(struct __test_metadata *_metadata, int fd)
174 uhid_write(_metadata, fd, &ev);
177 static int uhid_event(struct __test_metadata *_metadata, int fd)
183 ret = read(fd, &ev, sizeof(ev));
234 uhid_write(_metadata, fd, &answer);
248 int fd;
256 int fd = args->fd;
259 pfds[0].fd = fd;
271 ret = uhid_event(_metadata, fd);
283 .fd = uhid_fd,
302 static int uhid_send_event(struct __test_metadata *_metadata, int fd, __u8 *buf, size_t size)
315 return uhid_write(_metadata, fd, &ev);
320 int fd;
324 fd = open(path, O_RDWR | O_CLOEXEC);
325 ASSERT_GE(fd, 0) TH_LOG("open uhid-cdev failed; %d", fd);
327 ret = uhid_create(_metadata, fd, rand_nb);
330 close(fd);
333 return fd;
342 int fd, nread;
351 fd = open(uevent, O_RDONLY | O_NONBLOCK);
352 if (fd < 0)
357 nread = read(fd, temp, ARRAY_SIZE(temp));
361 close(fd);