Lines Matching refs:nfds
177 int nfds = 0;
243 fds[nfds].fd = fd;
244 fds[nfds].events = POLLIN;
245 fds[nfds].revents = 0;
246 nfds++;
249 fds[nfds].fd = sock;
250 fds[nfds].events = POLLIN;
251 fds[nfds].revents = 0;
252 nfds++;
255 int i, n = poll(fds, nfds, -1);
259 for (i = 0; i < nfds; i++) {
747 int err, opt, datagram, nfds = 0;
766 fds[nfds].fd = datagram;
767 fds[nfds].events = POLLIN;
768 nfds++;
771 while (runp != NULL && nfds < sizeof(fds) / sizeof(fds[0])) {
772 fds[nfds].fd = socket(runp->ai_family, runp->ai_socktype,
774 if (fds[nfds].fd < 0) {
779 fds[nfds].events = POLLIN;
782 setsockopt(fds[nfds].fd, SOL_SOCKET, SO_REUSEADDR,
786 setsockopt(fds[nfds].fd, SOL_SOCKET, SO_KEEPALIVE,
789 if (bind(fds[nfds].fd, runp->ai_addr, runp->ai_addrlen) < 0) {
795 close(fds[nfds].fd);
797 if (listen(fds[nfds].fd, SOMAXCONN) < 0) {
810 nfds++;
819 int i, n = poll(fds, nfds, -1);
823 for (i = 0; i < nfds; i++) {
848 for (n = 0; n < nfds; n++)