diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2004-08-15 11:28:09 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2004-08-15 11:28:09 +0000 |
commit | 48a27980be4152b88225d9e5696c4e0a6df1defd (patch) | |
tree | 2f29ee868eef0bda46bc5948df73161702c98bc2 /winsup/mingw/mingwex/stdio/fseeko64.c | |
parent | 40929746ba2ca3515d3a1de0c911078a816f92d5 (diff) | |
download | cygnal-48a27980be4152b88225d9e5696c4e0a6df1defd.tar.gz cygnal-48a27980be4152b88225d9e5696c4e0a6df1defd.tar.bz2 cygnal-48a27980be4152b88225d9e5696c4e0a6df1defd.zip |
* 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
Diffstat (limited to 'winsup/mingw/mingwex/stdio/fseeko64.c')
-rwxr-xr-x | winsup/mingw/mingwex/stdio/fseeko64.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/stdio/fseeko64.c b/winsup/mingw/mingwex/stdio/fseeko64.c new file mode 100755 index 000000000..94e17e929 --- /dev/null +++ b/winsup/mingw/mingwex/stdio/fseeko64.c @@ -0,0 +1,27 @@ +#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); +} + |