aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index ebdcdee26..23ca5d3dd 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -1030,3 +1030,17 @@ DIR *mingw_opendir(const char *path)
1030 1030
1031 return opendir(path); 1031 return opendir(path);
1032} 1032}
1033
1034off_t mingw_lseek(int fd, off_t offset, int whence)
1035{
1036 HANDLE h = (HANDLE)_get_osfhandle(fd);
1037 if (h == INVALID_HANDLE_VALUE) {
1038 errno = EBADF;
1039 return -1;
1040 }
1041 if (GetFileType(h) != FILE_TYPE_DISK) {
1042 errno = ESPIPE;
1043 return -1;
1044 }
1045 return _lseeki64(fd, offset, whence);
1046}