if (mode & _IOS_OUTPUT) { switch (dir)
if (mode & _IOS_OUTPUT)
_IO_str_seekoff (fp, offset, dir, mode)     _IO_FILE *fp;     _IO_off64_t offset;     int dir;     int mode;{  _IO_ssize_t cur_size = _IO_str_count (fp);  _IO_fpos64_t new_pos = EOF;  if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET))    mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT);  /* Move the get pointer, if requested. */  if (mode & _IOS_INPUT)    {      switch (dir)	{	case _IO_seek_end:	  offset += cur_size;	  break;	case _IO_seek_cur:	  offset += fp->_IO_read_ptr - fp->_IO_read_base;	  break;	default: /* case _IO_seek_set: */	  break;	}      if (offset < 0 || (_IO_ssize_t) offset > cur_size)	return EOF;      fp->_IO_read_ptr = fp->_IO_read_base + offset;      fp->_IO_read_end = fp->_IO_read_base + cur_size;      new_pos = offset;    }  /* Move the put pointer, if requested. */  if (mode & _IOS_OUTPUT)    {      switch (dir)	{	case _IO_seek_end:	  offset += cur_size;	  break;	case _IO_seek_cur:	  offset += fp->_IO_write_ptr - fp->_IO_write_base;	  break;	default: /* case _IO_seek_set: */	  break;	}      if (offset < 0 || (_IO_ssize_t) offset > cur_size)	return EOF;      fp->_IO_write_ptr = fp->_IO_write_base + offset;      new_pos = offset;    }  return new_pos;}