Lines Matching defs:nfds
321 poll_common(pollfd_t *fds, nfds_t nfds, timespec_t *tsp, k_sigset_t *ksetp)
376 if (nfds == 0) {
393 if (nfds > p->p_fno_ctl) {
416 * buffers when nfds changes. There is no hysteresis control,
421 if (nfds != old_nfds) {
424 pollfdp = kmem_alloc(nfds * sizeof (pollfd_t), KM_SLEEP);
426 ps->ps_nfds = nfds;
430 if (copyin(fds, pollfdp, nfds * sizeof (pollfd_t))) {
459 pcache_create(pcp, nfds);
491 error = pcacheset_resolve(ps, nfds, &fdcnt,
504 * the special timeout case when nfds is 0 or it returns
530 error = pcacheset_resolve(ps, nfds, &fdcnt, cacheindex);
551 error = pcache_poll(pollfdp, ps, nfds, &fdcnt, cacheindex);
619 if (nfds != 0 &&
620 copyout(pollfdp, fds, nfds * sizeof (pollfd_t)))
630 for (i = 0; i < nfds; i++) {
641 for (i = 0; i < nfds; i++) {
656 pollsys(pollfd_t *fds, nfds_t nfds, timespec_t *timeoutp, sigset_t *setp)
693 return (poll_common(fds, nfds, tsp, ksetp));
1075 pcache_insert_fd(pollcache_t *pcp, polldat_t *pdp, nfds_t nfds)
1081 (nfds > pcp->pc_hashsize * POLLHASHTHRESHOLD)) {
1082 pcache_grow_hashtbl(pcp, nfds);
1109 pcache_grow_hashtbl(pollcache_t *pcp, nfds_t nfds)
1122 if (nfds > pcp->pc_hashsize * POLLHASHINC) {
1123 pcp->pc_hashsize = (nfds + POLLHASHCHUNKSZ - 1) &
1138 pcache_insert_fd(pcp, pdp, nfds);
1507 pollchecksanity(pollstate_t *ps, nfds_t nfds)
1517 for (i = 0; i < nfds; i++) {
1545 pcacheset_resolve(pollstate_t *ps, nfds_t nfds, int *fdcntp, int which)
1571 common = (nfds > old_nfds) ? old_nfds : nfds;
1572 if (nfds != old_nfds) {
1577 newlist = kmem_alloc(nfds * sizeof (pollfd_t), KM_SLEEP);
1578 bcopy(current, newlist, sizeof (pollfd_t) * nfds);
1708 nfds *
1747 if (nfds > old_nfds) {
1749 for (i = old_nfds; i < nfds; i++) {
1786 kmem_free(newlist, nfds * sizeof (pollfd_t));
1791 if (old_nfds > nfds) {
1795 pcacheset_remove_list(ps, pcsp->pcs_pollfd, nfds, old_nfds,
1799 * set difference resolved. update nfds and cachedlist
1809 pcsp->pcs_nfds = nfds;
1822 ASSERT(pollchecksanity(ps, nfds));
1840 pollscanrevents(pollcache_t *pcp, pollfd_t *pollfdp, nfds_t nfds)
1845 for (i = 0; i < nfds; i++) {
1866 pcache_poll(pollfd_t *pollfdp, pollstate_t *ps, nfds_t nfds, int *fdcntp,
1889 while ((fdcnt < nfds) && !done) {
1919 ASSERT((entry >= 0) && (entry < nfds));
1938 for (i = entry + 1; i < nfds; i++) {
1962 for (i = entry + 1; i < nfds; i++) {
2103 ASSERT(*fdcntp + fdcnt == pollscanrevents(pcp, pollfdp, nfds));
2907 pcache_create(pollcache_t *pcp, nfds_t nfds)
2914 if ((mapsize = POLLMAPCHUNK) <= nfds) {
2915 mapsize = (nfds + POLLMAPCHUNK - 1) & ~(POLLMAPCHUNK - 1);
2926 if (nfds < POLLHASHCHUNKSZ) {
2929 pcp->pc_hashsize = (nfds + POLLHASHCHUNKSZ - 1) &
3005 nfds_t nfds = psp->ps_nfds;
3008 for (i = entry + 1; i < nfds; i++) {