Lines Matching refs:pfd

974 	struct pollfd pfd;  in timeout_connect()  local
980 pfd.fd = s; in timeout_connect()
981 pfd.events = POLLOUT; in timeout_connect()
982 if ((ret = poll(&pfd, 1, timeout)) == 1) { in timeout_connect()
1062 struct pollfd pfd[4]; in readwrite() local
1077 pfd[POLL_STDIN].fd = stdin_fd; in readwrite()
1078 pfd[POLL_STDIN].events = POLLIN; in readwrite()
1081 pfd[POLL_NETOUT].fd = net_fd; in readwrite()
1082 pfd[POLL_NETOUT].events = 0; in readwrite()
1085 pfd[POLL_NETIN].fd = net_fd; in readwrite()
1086 pfd[POLL_NETIN].events = POLLIN; in readwrite()
1089 pfd[POLL_STDOUT].fd = stdout_fd; in readwrite()
1090 pfd[POLL_STDOUT].events = 0; in readwrite()
1094 if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 && in readwrite()
1100 if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) { in readwrite()
1105 if (lflag && pfd[POLL_NETIN].fd == -1 && in readwrite()
1118 num_fds = poll(pfd, 4, timeout); in readwrite()
1132 if (pfd[n].revents & (POLLERR|POLLNVAL)) { in readwrite()
1133 pfd[n].fd = -1; in readwrite()
1137 if (pfd[POLL_STDIN].events & POLLIN && in readwrite()
1138 pfd[POLL_STDIN].revents & POLLHUP && in readwrite()
1139 !(pfd[POLL_STDIN].revents & POLLIN)) in readwrite()
1140 pfd[POLL_STDIN].fd = -1; in readwrite()
1142 if (pfd[POLL_NETIN].events & POLLIN && in readwrite()
1143 pfd[POLL_NETIN].revents & POLLHUP && in readwrite()
1144 !(pfd[POLL_NETIN].revents & POLLIN)) in readwrite()
1145 pfd[POLL_NETIN].fd = -1; in readwrite()
1147 if (pfd[POLL_NETOUT].revents & POLLHUP) { in readwrite()
1149 shutdown(pfd[POLL_NETOUT].fd, SHUT_WR); in readwrite()
1150 pfd[POLL_NETOUT].fd = -1; in readwrite()
1153 if (pfd[POLL_STDOUT].revents & POLLHUP) in readwrite()
1154 pfd[POLL_STDOUT].fd = -1; in readwrite()
1156 if (pfd[POLL_NETOUT].fd == -1) in readwrite()
1157 pfd[POLL_STDIN].fd = -1; in readwrite()
1159 if (pfd[POLL_STDOUT].fd == -1) { in readwrite()
1160 if (pfd[POLL_NETIN].fd != -1) in readwrite()
1161 shutdown(pfd[POLL_NETIN].fd, SHUT_RD); in readwrite()
1162 pfd[POLL_NETIN].fd = -1; in readwrite()
1166 if (pfd[POLL_STDIN].revents & POLLIN && stdinbufpos < BUFSIZE) { in readwrite()
1167 ret = fillbuf(pfd[POLL_STDIN].fd, stdinbuf, in readwrite()
1170 pfd[POLL_STDIN].events = POLLIN; in readwrite()
1172 pfd[POLL_STDIN].events = POLLOUT; in readwrite()
1174 pfd[POLL_STDIN].fd = -1; in readwrite()
1177 pfd[POLL_NETOUT].events = POLLOUT; in readwrite()
1180 pfd[POLL_STDIN].events = 0; in readwrite()
1183 if (pfd[POLL_NETOUT].revents & POLLOUT && stdinbufpos > 0) { in readwrite()
1184 ret = drainbuf(pfd[POLL_NETOUT].fd, stdinbuf, in readwrite()
1187 pfd[POLL_NETOUT].events = POLLIN; in readwrite()
1189 pfd[POLL_NETOUT].events = POLLOUT; in readwrite()
1191 pfd[POLL_NETOUT].fd = -1; in readwrite()
1194 pfd[POLL_NETOUT].events = 0; in readwrite()
1197 pfd[POLL_STDIN].events = POLLIN; in readwrite()
1200 if (pfd[POLL_NETIN].revents & POLLIN && netinbufpos < BUFSIZE) { in readwrite()
1201 ret = fillbuf(pfd[POLL_NETIN].fd, netinbuf, in readwrite()
1204 pfd[POLL_NETIN].events = POLLIN; in readwrite()
1206 pfd[POLL_NETIN].events = POLLOUT; in readwrite()
1208 pfd[POLL_NETIN].fd = -1; in readwrite()
1211 shutdown(pfd[POLL_NETIN].fd, SHUT_RD); in readwrite()
1212 pfd[POLL_NETIN].fd = -1; in readwrite()
1216 pfd[POLL_STDOUT].events = POLLOUT; in readwrite()
1219 pfd[POLL_NETIN].events = 0; in readwrite()
1222 atelnet(pfd[POLL_NETIN].fd, netinbuf, in readwrite()
1226 if (pfd[POLL_STDOUT].revents & POLLOUT && netinbufpos > 0) { in readwrite()
1227 ret = drainbuf(pfd[POLL_STDOUT].fd, netinbuf, in readwrite()
1230 pfd[POLL_STDOUT].events = POLLIN; in readwrite()
1232 pfd[POLL_STDOUT].events = POLLOUT; in readwrite()
1234 pfd[POLL_STDOUT].fd = -1; in readwrite()
1237 pfd[POLL_STDOUT].events = 0; in readwrite()
1240 pfd[POLL_NETIN].events = POLLIN; in readwrite()
1244 if (pfd[POLL_STDIN].fd == -1 && stdinbufpos == 0) { in readwrite()
1245 if (pfd[POLL_NETOUT].fd != -1 && Nflag) in readwrite()
1246 shutdown(pfd[POLL_NETOUT].fd, SHUT_WR); in readwrite()
1247 pfd[POLL_NETOUT].fd = -1; in readwrite()
1250 if (pfd[POLL_NETIN].fd == -1 && netinbufpos == 0) { in readwrite()
1251 pfd[POLL_STDOUT].fd = -1; in readwrite()
1323 struct pollfd pfd; in fdpass() local
1346 bzero(&pfd, sizeof(pfd)); in fdpass()
1347 pfd.fd = STDOUT_FILENO; in fdpass()
1348 pfd.events = POLLOUT; in fdpass()
1353 if (poll(&pfd, 1, -1) == -1) in fdpass()