Lines Matching refs:fd
55 status_t FdBuffer::read(int fd, int64_t timeout) { in read() argument
56 struct pollfd pfds = {.fd = fd, .events = POLLIN}; in read()
59 fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); in read()
93 ::read(fd, mBuffer->writeBuffer(), mBuffer->currentToWrite())); in read()
98 VLOG("Fail to read %d: %s", fd, strerror(errno)); in read()
102 VLOG("Reached EOF of fd=%d", fd); in read()
113 status_t FdBuffer::readFully(int fd) { in readFully() argument
129 TEMP_FAILURE_RETRY(::read(fd, mBuffer->writeBuffer(), mBuffer->currentToWrite())); in readFully()
131 VLOG("Fail to read %d: %s", fd, strerror(errno)); in readFully()
145 status_t FdBuffer::readProcessedDataInStream(int fd, unique_fd toFd, unique_fd fromFd, in readProcessedDataInStream() argument
148 {.fd = fd, .events = POLLIN}, in readProcessedDataInStream()
149 {.fd = toFd.get(), .events = POLLOUT}, in readProcessedDataInStream()
150 {.fd = fromFd.get(), .events = POLLIN}, in readProcessedDataInStream()
156 fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); in readProcessedDataInStream()
199 VLOG("fd %d is sysfs, ignore its POLLERR return value", fd); in readProcessedDataInStream()
202 VLOG("fd[%d]=%d returns error events: %s", i, fd, strerror(errno)); in readProcessedDataInStream()
208 if (cirSize != BUFFER_SIZE && pfds[0].fd != -1) { in readProcessedDataInStream()
211 amt = TEMP_FAILURE_RETRY(::read(fd, cirBuf + rpos, BUFFER_SIZE - rpos)); in readProcessedDataInStream()
213 amt = TEMP_FAILURE_RETRY(::read(fd, cirBuf + rpos, wpos - rpos)); in readProcessedDataInStream()
217 VLOG("Fail to read fd %d: %s", fd, strerror(errno)); in readProcessedDataInStream()
221 VLOG("Reached EOF of input file %d", fd); in readProcessedDataInStream()
222 pfds[0].fd = -1; // reach EOF so don't have to poll pfds[0]. in readProcessedDataInStream()
230 if (cirSize > 0 && pfds[1].fd != -1) { in readProcessedDataInStream()
249 if (cirSize == 0 && pfds[0].fd == -1 && pfds[1].fd != -1) { in readProcessedDataInStream()
252 pfds[1].fd = -1; in readProcessedDataInStream()