public synchronized long tell(ThreadContext context) { flushBeforeSeek(context); return posix.lseek(fd, 0, PosixShim.SEEK_CUR); }
public synchronized long tell(ThreadContext context) { flushBeforeSeek(context); return posix.lseek(fd, 0, PosixShim.SEEK_CUR); }
public long seek(ThreadContext context, long offset, int whence) { boolean locked = lock(); try { flushBeforeSeek(context); return posix.lseek(fd, offset, whence); } finally { if (locked) unlock(); } }
public long seek(ThreadContext context, long offset, int whence) { boolean locked = lock(); try { flushBeforeSeek(context); return posix.lseek(fd, offset, whence); } finally { if (locked) unlock(); } }
public int remainSize() { int siz = READ_DATA_PENDING_COUNT(); long size; long pos; if ((size = posix.size(fd)) >= 0 && (pos = posix.lseek(fd, 0, PosixShim.SEEK_CUR)) != -1 && size > pos) { if (siz + (size - pos) > Integer.MAX_VALUE) { throw runtime.newIOError("file too big for single read"); } siz += size - pos; } else { siz += BUFSIZ; } return siz; }
public int remainSize() { int siz = READ_DATA_PENDING_COUNT(); long size; long pos; if ((size = posix.size(fd)) >= 0 && (pos = posix.lseek(fd, 0, PosixShim.SEEK_CUR)) != -1 && size > pos) { if (siz + (size - pos) > Integer.MAX_VALUE) { throw runtime.newIOError("file too big for single read"); } siz += size - pos; } else { siz += BUFSIZ; } return siz; }
private void unreadPosix() { long r; boolean locked = lock(); try { checkClosed(); if (rbuf.len == 0 || (mode & DUPLEX) != 0) return; /* xxx: target position may be negative if buffer is filled by ungetc */ posix.errno = null; r = posix.lseek(fd, -rbuf.len, PosixShim.SEEK_CUR); if (r == -1 && posix.errno != null) { if (posix.errno == Errno.ESPIPE) mode |= DUPLEX; return; } rbuf.off = 0; rbuf.len = 0; } finally { if (locked) unlock(); } }
private void unreadPosix() { long r; boolean locked = lock(); try { checkClosed(); if (rbuf.len == 0 || (mode & DUPLEX) != 0) return; /* xxx: target position may be negative if buffer is filled by ungetc */ posix.errno = null; r = posix.lseek(fd, -rbuf.len, PosixShim.SEEK_CUR); if (r == -1 && posix.errno != null) { if (posix.errno == Errno.ESPIPE) mode |= DUPLEX; return; } rbuf.off = 0; rbuf.len = 0; } finally { if (locked) unlock(); } }
pos = fptr.posix.lseek(fptr.fd(), pos, whence); if (pos == -1 && fptr.errno() != null) throw runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath()); } finally {
pos = fptr.posix.lseek(fptr.fd(), pos, whence); if (pos == -1 && fptr.errno() != null) throw runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath()); } finally {