Lines Matching defs:fd
35 int fd;
41 ret->fd = eventfd(value, EFD_SEMAPHORE);
42 if (ret->fd == -1) {
52 if (semaphore->fd != -1)
53 close(semaphore->fd);
59 assert(semaphore->fd != -1);
62 if (eventfd_read(semaphore->fd, &value) == -1)
68 assert(semaphore->fd != -1);
70 int flags = fcntl(semaphore->fd, F_GETFL);
72 ALOGE("%s unable to get flags for semaphore fd: %s", __func__, strerror(errno));
75 if (fcntl(semaphore->fd, F_SETFL, flags | O_NONBLOCK) == -1) {
76 ALOGE("%s unable to set O_NONBLOCK for semaphore fd: %s", __func__, strerror(errno));
81 if (eventfd_read(semaphore->fd, &value) == -1)
84 if (fcntl(semaphore->fd, F_SETFL, flags) == -1)
85 ALOGE("%s unable to resetore flags for semaphore fd: %s", __func__, strerror(errno));
91 assert(semaphore->fd != -1);
93 if (eventfd_write(semaphore->fd, 1ULL) == -1)
99 assert(semaphore->fd != -1);
100 return semaphore->fd;