Back to index

glibc  2.9
Functions
iofsetpos64.c File Reference
#include <libioP.h>
#include <errno.h>
#include <shlib-compat.h>

Go to the source code of this file.

Functions

int _IO_new_fsetpos64 (_IO_FILE *fp, const _IO_fpos64_t *posp)

Function Documentation

Definition at line 34 of file iofsetpos64.c.

{
#ifdef _G_LSEEK64
  int result;
  CHECK_FILE (fp, EOF);
  _IO_acquire_lock (fp);
  if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
      == _IO_pos_BAD)
    {
      /* ANSI explicitly requires setting errno to a positive value on
        failure.  */
#ifdef EIO
      if (errno == 0)
       __set_errno (EIO);
#endif
      result = EOF;
    }
  else
    {
      result = 0;
      if (fp->_mode > 0
         && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
       /* This is a stateful encoding, safe the state.  */
       fp->_wide_data->_IO_state = posp->__state;
    }
  _IO_release_lock (fp);
  return result;
#else
  __set_errno (ENOSYS);
  return EOF;
#endif
}

Here is the call graph for this function: