Lines Matching defs:pollfds
96 struct pollfd pollfds[2];
98 memset(pollfds, 0, 2*sizeof(struct pollfd));
99 pollfds[0].events = pollfds[1].events = POLLIN;
108 if (TT.filename) pollfds[0].fd = xopen(TT.filename, O_RDWR);
136 pollfds[0].fd = sockfd;
163 pollfds[0].fd = accept(sockfd, (struct sockaddr *)&address, &len);
164 if (pollfds[0].fd<0) perror_exit("accept");
169 child = forkpty(&(pollfds[1].fd), NULL, NULL, NULL);
179 int fd = pollfds[0].fd;
190 close(pollfds[0].fd);
206 if (0>poll(pollfds, pollcount, -1)) perror_exit("poll");
209 if (pollfds[i].revents & POLLIN) {
210 int len = read(pollfds[i].fd, toybuf, sizeof(toybuf));
212 xwrite(i ? pollfds[0].fd : 1, toybuf, len);
213 } else if (pollfds[i].revents & POLLHUP) {
218 shutdown(pollfds[0].fd, SHUT_WR);
227 close(pollfds[0].fd);