code: public long position() throws IOException {
          ensureOpen();
          synchronized (positionLock) {
              long p = -1;
              int ti = -1;
              try {
                  begin();
                  ti = threads.add();
                  if (!isOpen())
                      return 0;
                  if (append) {
                      BlockGuard.getThreadPolicy().onWriteToDisk();
                  }
                  do {
                      // in append-mode then position is advanced to end before writing
                      p = (append) ? nd.size(fd) : position0(fd, -1);
                  } while ((p == IOStatus.INTERRUPTED) && isOpen());
                  return IOStatus.normalize(p);
              } finally {
                  threads.remove(ti);
                  end(p > -1);
                  assert IOStatus.check(p);
              }
          }
      }
docs: -- Other operations --