Lines Matching refs:fd

146  * /dev/poll fd. However, we prevent writes from being starved by giving
150 * content of poll fd a cache set. If writes happens so often that they
243 * NOTE: Upon closing an fd, automatic poll cache cleanup is done for
252 int fdcnt, fd;
268 * No Need to search because no poll fd
305 fd = bt_getlowbit(pcp->pc_bitmap, start, end);
306 ASSERT(fd <= end);
307 if (fd >= 0) {
308 if (fd == end) {
317 start = fd + 1;
319 pdp = pcache_lookup_fd(pcp, fd);
322 ASSERT(pdp->pd_fd == fd);
325 * The fd is POLLREMOVed. This fd is
331 if ((fp = getf(fd)) == NULL) {
333 * The fd has been closed, but user has not
334 * done a POLLREMOVE on this fd yet. Instead
337 * polling a closed fd. Hope this will remind
341 pfdp[fdcnt].fd = fd;
362 BT_CLEAR(pcp->pc_bitmap, fd);
369 * user is polling on a cached fd which was
373 * may not be able to detect the fd reuse
380 * XXX - perhaps log the detection of fd
400 releasef(fd);
418 ASSERT(BT_TEST(pcp->pc_bitmap, fd));
424 pfdp[fdcnt].fd = fd;
474 * during VOP_POLL, skip over the fd
497 BT_CLEAR(pcp->pc_bitmap, fd);
513 BT_CLEAR(pcp->pc_bitmap, fd);
519 * We clear a bit or cache a poll fd if
530 BT_CLEAR(pcp->pc_bitmap, fd);
629 * Write to dev/poll add/remove fd's to/from a cached poll fd set,
630 * or change poll events for a watched fd.
648 int fd;
698 * each polled fd to the cached set.
770 fd = pfdp->fd;
771 if ((uint_t)fd >= P_FINFO(curproc)->fi_nfiles) {
774 * specified fd is invalid.
784 pdp = pcache_lookup_fd(pcp, fd);
792 * that the fd is valid before allocating
794 * we return EBADF if our specified fd is
798 if ((fp = getf(fd)) == NULL) {
805 pdp->pd_fd = fd;
834 (fp = getf(fd)) != NULL &&
838 releasef(fd);
860 ASSERT(pdp->pd_fd == fd);
862 if (fd >= pcp->pc_mapsize) {
864 pcache_grow_map(pcp, fd);
867 if (fd > pcp->pc_mapend) {
868 pcp->pc_mapend = fd;
870 if (fp == NULL && (fp = getf(fd)) == NULL) {
872 * The fd is not valid. Since we can't pass
877 BT_SET(pcp->pc_bitmap, fd);
891 * Don't do VOP_POLL for an already cached fd with
899 releasef(fd);
904 * do VOP_POLL and cache this poll fd.
922 * We always set the bit when this fd is cached;
923 * this forces the first DP_POLL to poll this fd.
928 BT_SET(pcp->pc_bitmap, fd);
930 releasef(fd);
949 releasef(fd);
964 ASSERT(pdp->pd_fd == fd);
972 BT_CLEAR(pcp->pc_bitmap, fd);
1332 * No Need to search because no poll fd
1339 if (pollfd.fd < 0) {
1343 pdp = pcache_lookup_fd(pcp, pollfd.fd);
1344 if ((pdp != NULL) && (pdp->pd_fd == pollfd.fd) &&
1381 * fd events are present without consuming them or altering the pollcache
1385 * which corresponds to the child /dev/poll fd. This means that child
1496 * reference of this /dev/poll fd can close.
1520 * /dev/poll fd. This pollcache is going away, so do the clean