2 #define _LARGEFILE64_SOURCE
8 #include <msp/core/systemerror.h>
10 #include "handle_private.h"
17 using namespace Msp::IO;
19 int sys_seek_type(SeekType st)
37 throw invalid_argument("sys_seek_type");
46 SeekOffset sys_seek(Handle &handle, SeekOffset offset, SeekType type)
49 LONG high = offset>>32;
50 DWORD ret = SetFilePointer(*handle, offset, &high, sys_seek_type(type));
51 if(ret==INVALID_SET_FILE_POINTER)
53 DWORD err = GetLastError();
55 throw system_error("SetFilePointer");
58 return (SeekOffset(high)<<32) | ret;
60 off64_t ret = lseek64(*handle, offset, sys_seek_type(type));
62 throw system_error("lseek64");