if (offset < 0) { __set_errno (EINVAL); return EOF; }
_IO_file_seekoff_mmap (fp, offset, dir, mode)     _IO_FILE *fp;     _IO_off64_t offset;     int dir;     int mode;{  _IO_off64_t result;  /* If we are only interested in the current position, calculate it and     return right now.  This calculation does the right thing when we are     using a pushback buffer, but in the usual case has the same value as     (fp->_IO_read_ptr - fp->_IO_buf_base).  */  if (mode == 0)    return fp->_offset - (fp->_IO_read_end - fp->_IO_read_ptr);  switch (dir)    {    case _IO_seek_cur:      /* Adjust for read-ahead (bytes is buffer). */      offset += fp->_IO_read_ptr - fp->_IO_read_base;      break;    case _IO_seek_set:      break;    case _IO_seek_end:      offset += fp->_IO_buf_end - fp->_IO_buf_base;      break;    }  /* At this point, dir==_IO_seek_set. */  if (offset < 0)    /* No negative offsets are valid.  */    return EOF;  result = _IO_SYSSEEK (fp, offset, 0);  if (result < 0)    return EOF;  _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + offset,	    fp->_IO_buf_base + offset);  _IO_mask_flags (fp, 0, _IO_EOF_SEEN);  return offset;}