|
From: Earnie B. <ea...@us...> - 2004-07-13 10:59:21
|
Update of /cvsroot/mingw/runtime/mingwex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809 Added Files: fopen64.c fseeko64.c ftello64.c ftruncate.c lseek64.c Log Message: Import winsup changes --- NEW FILE: fseeko64.c --- #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); } --- NEW FILE: fopen64.c --- #include <stdio.h> FILE* __cdecl fopen64 (const char* filename, const char* mode) { return fopen (filename, mode); } --- NEW FILE: lseek64.c --- #include <io.h> off64_t lseek64 (int fd, off64_t offset, int whence) { return _lseeki64(fd, (__int64) offset, whence); } --- NEW FILE: ftruncate.c --- #include <unistd.h> int ftruncate(int __fd, off_t __length) { return _chsize (__fd, __length); } --- NEW FILE: ftello64.c --- #include <stdio.h> off64_t __cdecl ftello64 (FILE * stream) { fpos_t pos; if (fgetpos(stream, &pos)) return -1LL; else return ((off64_t) pos); } |