Lines Matching refs:pfd
20 struct pollfd *pfd = p;
21 for (int i=0; pfd[i].fd >= -1; i++)
22 if (pfd[i].fd >= 0) __syscall(SYS_close, pfd[i].fd);
34 static int start_tcp(struct pollfd *pfd, int family, const void *sa,
59 pfd->fd = fd;
60 pfd->events = POLLOUT;
64 if (r == ql+2) pfd->events = POLLIN;
71 pfd->fd = -1;
116 struct pollfd pfd[nqueries+2];
206 for (i=0; i<nqueries; i++) pfd[i].fd = -1;
207 pfd[nqueries].fd = fd;
208 pfd[nqueries].events = POLLIN;
209 pfd[nqueries+1].fd = -2;
211 pthread_cleanup_push(cleanup, pfd);
246 if (poll(pfd, nqueries+1, t1+retry_interval-t2) <= 0) continue;
336 if (next == nqueries) pfd[nqueries].events = 0;
346 r = start_tcp(pfd+i, family, ns+j, sl, queries[i], qlens[i], netid);
356 for (i=0; i<nqueries; i++) if (pfd[i].revents & POLLOUT) {
364 r = sendmsg(pfd[i].fd, &mh, MSG_NOSIGNAL);
368 pfd[i].events = POLLIN;
371 for (i=0; i<nqueries; i++) if (pfd[i].revents & POLLIN) {
379 r = recvmsg(pfd[i].fd, &mh, 0);
395 __syscall(SYS_close, pfd[i].fd);
396 pfd[i].fd = -1;