Lines Matching refs:pos
122 restricted_file_restrict_io(int fd, fssh_off_t& pos, fssh_off_t size)
128 if (pos < 0) {
129 pos = lseek(fd, 0, SEEK_CUR);
130 if (pos < 0)
133 pos += restriction->startOffset;
135 if (pos < restriction->startOffset || pos > restriction->endOffset) {
140 fssh_off_t maxSize = restriction->endOffset - pos;
185 fssh_off_t pos;
190 pos = lseek(fd, 0, SEEK_CUR);
191 if (pos < 0)
192 return pos;
193 pos += offset;
197 pos = restriction->endOffset + offset;
201 pos = restriction->startOffset + offset;
205 if (pos < restriction->startOffset) {
210 pos = lseek(fd, pos, SEEK_SET);
211 if (pos >= 0)
212 pos -= restriction->startOffset;
214 return pos;