Lines Matching refs:fds
3124 rb_fd_init(rb_fdset_t *fds)
3126 fds->maxfd = 0;
3127 fds->fdset = ALLOC(fd_set);
3128 FD_ZERO(fds->fdset);
3144 rb_fd_term(rb_fdset_t *fds)
3146 if (fds->fdset) xfree(fds->fdset);
3147 fds->maxfd = 0;
3148 fds->fdset = 0;
3152 rb_fd_zero(rb_fdset_t *fds)
3154 if (fds->fdset)
3155 MEMZERO(fds->fdset, fd_mask, howmany(fds->maxfd, NFDBITS));
3159 rb_fd_resize(int n, rb_fdset_t *fds)
3162 size_t o = howmany(fds->maxfd, NFDBITS) * sizeof(fd_mask);
3168 fds->fdset = xrealloc(fds->fdset, m);
3169 memset((char *)fds->fdset + o, 0, m - o);
3171 if (n >= fds->maxfd) fds->maxfd = n + 1;
3175 rb_fd_set(int n, rb_fdset_t *fds)
3177 rb_fd_resize(n, fds);
3178 FD_SET(n, fds->fdset);
3182 rb_fd_clr(int n, rb_fdset_t *fds)
3184 if (n >= fds->maxfd) return;
3185 FD_CLR(n, fds->fdset);
3189 rb_fd_isset(int n, const rb_fdset_t *fds)
3191 if (n >= fds->maxfd) return 0;
3192 return FD_ISSET(n, fds->fdset) != 0; /* "!= 0" avoids FreeBSD PR 91421 */
3533 ppoll(struct pollfd *fds, nfds_t nfds,
3555 return poll(fds, nfds, timeout_ms);
3565 struct pollfd fds;
3580 fds.fd = fd;
3581 fds.events = (short)events;
3586 result = ppoll(&fds, 1, timeout, NULL);
3614 if (fds.revents & POLLNVAL) {
3624 if (fds.revents & POLLIN_SET)
3626 if (fds.revents & POLLOUT_SET)
3628 if (fds.revents & POLLEX_SET)
3635 init_set_fd(int fd, rb_fdset_t *fds)
3637 rb_fd_init(fds);
3638 rb_fd_set(fd, fds);
3640 return fds;