Lines Matching refs:fds
21 int poll(struct pollfd *fds, nfds_t nfds, int timeout) in poll() argument
35 if (fds == NULL) { in poll()
45 fds[i].revents = 0; in poll()
47 if (fds[i].fd < 0) { in poll()
52 if (fds[i].fd >= FD_SETSIZE) { in poll()
53 fds[i].revents |= POLLNVAL; in poll()
58 if (fds[i].events & (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI)) { in poll()
59 FD_SET(fds[i].fd, &readfds); in poll()
60 FD_SET(fds[i].fd, &errorfds); in poll()
61 max_fd = MAX(max_fd, fds[i].fd); in poll()
64 if (fds[i].events & (POLLOUT | POLLWRNORM | POLLWRBAND)) { in poll()
65 FD_SET(fds[i].fd, &writefds); in poll()
66 FD_SET(fds[i].fd, &errorfds); in poll()
67 max_fd = MAX(max_fd, fds[i].fd); in poll()
77 if (FD_ISSET(fds[i].fd, &readfds)) { in poll()
78 fds[i].revents |= POLLIN; in poll()
81 if (FD_ISSET(fds[i].fd, &writefds)) { in poll()
82 fds[i].revents |= POLLOUT; in poll()
85 if (FD_ISSET(fds[i].fd, &errorfds)) { in poll()
86 fds[i].revents |= POLLERR; in poll()