Lines Matching defs:fd

319 			 * the ??Next and ??Last fd sets), so there's no
405 int fd, eventmask;
417 * the number of fd's that have some bit set,
433 fd = fid->fd;
435 if (FD_ISSET(fd, &ctx->rdLast))
437 if (FD_ISSET(fd, &ctx->wrLast))
439 if (FD_ISSET(fd, &ctx->exLast))
444 FD_CLR(fd, &ctx->rdLast);
448 FD_CLR(fd, &ctx->wrLast);
452 FD_CLR(fd, &ctx->exLast);
496 "Dispatch.Accept: fd %d -> %d, func %p, uap %p\n",
497 this->conn->fd, this->fd,
500 (this->conn->func)(opaqueCtx, this->conn->uap, this->fd,
513 "Dispatch.File: fd %d, mask 0x%x, func %p, uap %p\n",
514 this->fd, this->eventmask, this->func, this->uap);
515 (this->func)(opaqueCtx, this->uap, this->fd, eventmask);
525 "Dispatch.Stream: fd %d, func %p, uap %p\n",
526 this->fd, this->func, this->uap);
528 (this->func)(opaqueCtx, this->uap, this->fd, this->ioDone);
791 if (ctx->pollfds[i].fd < 0)
813 evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd) {
818 if (fd < ctx->maxnfds)
825 maxnfds = (1 + (fd/pollfd_chunk_size)) * pollfd_chunk_size;
841 ctx->pollfds[i].fd = -1;
853 __fd_eventfield(int fd, __evEmulMask *maskp) {
858 return (&(ctx->pollfds[fd].events));
860 return (&(ctx->pollfds[fd].revents));
883 * the events mask empty (apart from the POLLHUP bit), set the fd field
884 * to -1 so that poll(2) will ignore this fd.
887 __fd_clr(int fd, __evEmulMask *maskp) {
891 *__fd_eventfield(fd, maskp) &= ~__poll_event(maskp);
892 if ((ctx->pollfds[fd].events & ~POLLHUP) == 0) {
893 ctx->pollfds[fd].fd = -1;
894 if (fd == ctx->fdMax)
896 ctx->pollfds[ctx->fdMax].fd < 0)
898 if (fd == ctx->firstfd)
900 ctx->pollfds[ctx->firstfd].fd < 0)
914 * field has any other bits than POLLHUP set, also set the fd field so that
915 * poll(2) will watch this fd.
918 __fd_set(int fd, __evEmulMask *maskp) {
922 *__fd_eventfield(fd, maskp) |= __poll_event(maskp);
923 if ((ctx->pollfds[fd].events & ~POLLHUP) != 0) {
924 ctx->pollfds[fd].fd = fd;
925 if (fd < ctx->firstfd || ctx->fdMax == -1)
926 ctx->firstfd = fd;
927 if (fd > ctx->fdMax)
928 ctx->fdMax = fd;