Lines Matching refs:mip
72 * Print `len' bytes from the file associated with `mip', starting at
76 mapprint(struct mapinfo *mip, off_t startoff, off_t len)
81 if (startoff < mip->mapoff || startoff >= mip->mapoff +
82 (off_t)mip->maplen) {
83 if (maparound(mip, startoff) != 0)
86 n = (mip->mapoff + mip->maplen) - startoff;
89 WR(mip->start + (startoff - mip->mapoff), n);
102 maparound(struct mapinfo *mip, off_t offset)
105 if (mip->start != NULL && munmap(mip->start, mip->maplen) != 0)
108 mip->mapoff = offset & ~((off_t)TAILMAPLEN - 1);
109 mip->maplen = TAILMAPLEN;
110 if ((off_t)mip->maplen > mip->maxoff - mip->mapoff)
111 mip->maplen = mip->maxoff - mip->mapoff;
112 if (mip->maplen <= 0)
114 if ((mip->start = mmap(NULL, mip->maplen, PROT_READ, MAP_SHARED,
115 mip->fd, mip->mapoff)) == MAP_FAILED)