4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-15 02:09:19 +08:00
Danny Smith 48a27980be * mingwex/fopen64.c: Move.
* mingwex/fseeko64.c: Move.
        * mingwex/ftello64.c: Move.
        * mingwex/lseek64.c: Move.
        * mingwex/stdio/fopen64.c: To here.
        * mingwex/stdio/fseeko64.c: To here.
        * mingwex/stdio/ftello64.c: To here.
        * mingwex/stdio/lseek64.c: To here.

	White space cleanup in ChangeLog
2004-08-15 11:28:09 +00:00

28 lines
562 B
C
Executable File

#include <stdio.h>
#include <io.h>
#include <errno.h>
int __cdecl
fseeko64 (FILE* stream, off64_t offset, int whence)
{
fpos_t pos;
if (whence == SEEK_CUR)
{
/* If stream is invalid, fgetpos sets errno. */
if (fgetpos (stream, &pos))
return (-1);
pos += (fpos_t) offset;
}
else if (whence == SEEK_END)
pos = (fpos_t) (_filelengthi64 (_fileno (stream)) + offset);
else if (whence == SEEK_SET)
pos = (fpos_t) offset;
else
{
errno = EINVAL;
return (-1);
}
return fsetpos (stream, &pos);
}