Lines Matching refs:i
51 int i; in _hurd_select() local
153 for (i = 0; i < nfds; ++i) in _hurd_select()
154 if (pollfds[i].fd >= 0) in _hurd_select()
157 if (pollfds[i].events & POLLIN) in _hurd_select()
159 if (pollfds[i].events & POLLOUT) in _hurd_select()
161 if (pollfds[i].events & POLLPRI) in _hurd_select()
164 d[i].io_port = pollfds[i].fd; in _hurd_select()
165 d[i].type = type; in _hurd_select()
168 d[i].type = 0; in _hurd_select()
173 for (i = 0; i < nfds; ++i) in _hurd_select()
174 if (d[i].type != 0) in _hurd_select()
176 const int fd = (int) d[i].io_port; in _hurd_select()
180 d[i].cell = _hurd_dtable[fd]; in _hurd_select()
181 if (d[i].cell != NULL) in _hurd_select()
183 d[i].io_port = _hurd_port_get (&d[i].cell->port, in _hurd_select()
184 &d[i].ulink); in _hurd_select()
185 if (d[i].io_port != MACH_PORT_NULL) in _hurd_select()
191 d[i].error = EBADF; in _hurd_select()
192 d[i].type = SELECT_ERROR; in _hurd_select()
209 while (i-- > 0) in _hurd_select()
210 if (d[i].type & ~SELECT_ERROR != 0) in _hurd_select()
211 _hurd_port_free (&d[i].cell->port, &d[i].ulink, in _hurd_select()
212 d[i].io_port); in _hurd_select()
223 lastfd = i - 1; in _hurd_select()
224 firstfd = i == 0 ? lastfd : 0; in _hurd_select()
249 for (i = 0; i < nfds; ++i) in _hurd_select()
252 if (readfds != NULL && FD_ISSET (i, &rfds)) in _hurd_select()
254 if (writefds != NULL && FD_ISSET (i, &wfds)) in _hurd_select()
256 if (exceptfds != NULL && FD_ISSET (i, &xfds)) in _hurd_select()
258 d[i].type = type; in _hurd_select()
261 if (i < _hurd_dtablesize) in _hurd_select()
263 d[i].cell = _hurd_dtable[i]; in _hurd_select()
264 if (d[i].cell != NULL) in _hurd_select()
265 d[i].io_port = _hurd_port_get (&d[i].cell->port, in _hurd_select()
266 &d[i].ulink); in _hurd_select()
268 if (i >= _hurd_dtablesize || d[i].cell == NULL || in _hurd_select()
269 d[i].io_port == MACH_PORT_NULL) in _hurd_select()
272 while (i-- > 0) in _hurd_select()
273 if (d[i].type != 0) in _hurd_select()
274 _hurd_port_free (&d[i].cell->port, &d[i].ulink, in _hurd_select()
275 d[i].io_port); in _hurd_select()
278 lastfd = i; in _hurd_select()
280 firstfd = i; in _hurd_select()
287 if (i < nfds) in _hurd_select()
318 for (i = firstfd; i <= lastfd; ++i) in _hurd_select()
319 if (!(d[i].type & ~SELECT_ERROR)) in _hurd_select()
320 d[i].reply_port = MACH_PORT_NULL; in _hurd_select()
323 int type = d[i].type; in _hurd_select()
324 d[i].reply_port = __mach_reply_port (); in _hurd_select()
326 err = __io_select_request (d[i].io_port, d[i].reply_port, type); in _hurd_select()
328 err = __io_select_timeout_request (d[i].io_port, d[i].reply_port, in _hurd_select()
336 portset = d[i].reply_port; in _hurd_select()
350 d[i].reply_port, portset); in _hurd_select()
357 d[i].error = err; in _hurd_select()
358 d[i].type |= SELECT_ERROR; in _hurd_select()
361 _hurd_port_free (&d[i].cell->port, &d[i].ulink, d[i].io_port); in _hurd_select()
498 for (i = firstfd; i <= lastfd; ++i) in _hurd_select()
499 if (d[i].type in _hurd_select()
500 && d[i].reply_port == msg.head.msgh_local_port) in _hurd_select()
504 d[i].error = msg.error.err; in _hurd_select()
505 d[i].type = SELECT_ERROR; in _hurd_select()
510 d[i].type &= msg.success.result; in _hurd_select()
511 if (d[i].type) in _hurd_select()
515 d[i].type |= SELECT_RETURNED; in _hurd_select()
547 for (i = firstfd; i <= lastfd; ++i) in _hurd_select()
548 if (d[i].reply_port != MACH_PORT_NULL) in _hurd_select()
549 __mach_port_destroy (__mach_task_self (), d[i].reply_port); in _hurd_select()
575 for (i = 0; i < nfds; ++i) in _hurd_select()
577 int type = d[i].type; in _hurd_select()
581 switch (d[i].error) in _hurd_select()
604 pollfds[i].revents = revents; in _hurd_select()
615 for (i = firstfd; i <= lastfd; ++i) in _hurd_select()
617 int type = d[i].type; in _hurd_select()
628 if (readfds != NULL && FD_ISSET (i, readfds)) in _hurd_select()
630 if (writefds != NULL && FD_ISSET (i, writefds)) in _hurd_select()
632 if (exceptfds != NULL && FD_ISSET (i, exceptfds)) in _hurd_select()
639 FD_CLR (i, readfds); in _hurd_select()
643 FD_CLR (i, writefds); in _hurd_select()
647 FD_CLR (i, exceptfds); in _hurd_select()