Lines Matching refs:mip
68 * Print `len' bytes from the file associated with `mip', starting at
72 mapprint(struct mapinfo *mip, off_t startoff, off_t len)
77 if (startoff < mip->mapoff || startoff >= mip->mapoff +
78 (off_t)mip->maplen) {
79 if (maparound(mip, startoff) != 0)
82 n = (mip->mapoff + mip->maplen) - startoff;
85 WR(mip->start + (startoff - mip->mapoff), n);
98 maparound(struct mapinfo *mip, off_t offset)
101 if (mip->start != NULL && munmap(mip->start, mip->maplen) != 0)
104 mip->mapoff = offset & ~((off_t)TAILMAPLEN - 1);
105 mip->maplen = TAILMAPLEN;
106 if ((off_t)mip->maplen > mip->maxoff - mip->mapoff)
107 mip->maplen = mip->maxoff - mip->mapoff;
108 if (mip->maplen <= 0)
110 if ((mip->start = mmap(NULL, mip->maplen, PROT_READ, MAP_SHARED,
111 mip->fd, mip->mapoff)) == MAP_FAILED)