Lines Matching defs:offset

46  * about a file write.  Examples include the file name, offset, length,
169 * control where the record will be written. If offset is < 0, the
171 * record which exists at the indicated offset will be overlayed. This
175 * offset is >= 0, only the fixed length portion of the record is
179 * The return value of the function is the byte offset in the logfile
182 * Note: It is the callers responsibility to make sure that the offset
194 long offset)
200 * If offset is -1, we append the record at the end of file
202 * Otherwise, we overlay wrec at the file offset indicated and assume
203 * that the caller passed us the correct offset. We do not record the
207 reclen = wlog_rec_pack(wrec, wbuf, (offset < 0));
209 if (offset < 0) {
226 offset = lseek(wfile->w_afd, 0, SEEK_CUR) - reclen;
227 if (offset == -1) {
235 if ((lseek(wfile->w_rfd, offset, SEEK_SET)) == -1) {
238 wfile->w_file, offset, strerror(errno));
251 return offset;
265 int fd, leftover, nbytes, offset, recnum, reclen, rval;
273 * Move to EOF. offset will always hold the current file offset
282 offset = lseek(fd, 0, SEEK_CUR);
283 if ((offset == -1)) {
295 while ((!nrecs || recnum < nrecs) && offset > 0) {
301 if ((unsigned int)offset + leftover < sizeof(buf)) {
302 bufstart = bufend - (offset + leftover);
303 offset = 0;
305 offset -= sizeof(buf) - leftover;
309 * Move to the proper file offset, and read into buf
311 if ((lseek(fd, offset, SEEK_SET)) == -1) {
314 wfile->w_file, offset, strerror(errno));
322 "Could not read history file at offset %d - read(%d, %p, %d) failed: %s\n",
323 offset, fd, bufstart,