reactos/reactos/lib/crt/io/lseek.c
Gunnar Dalsnes 55fb40a502 ntdll:
-critical.c: catch (more) invalid use
-impl. sscanf (stolen from wine)
crt:
-use native mingw headers and not private copies of them
-converted some routines to using tchar == impl. many missing unicode routines
-impl. sscanf and friends correctly (stolen from wine)
tchar.h:
-added lotsa missin stuff

svn path=/trunk/; revision=13608
2005-02-16 22:29:48 +00:00

20 lines
418 B
C

#include "precomp.h"
#include <io.h>
#include <internal/file.h>
/*
* @implemented
*/
long _lseek(int _fildes, long _offset, int _whence)
{
DWORD newpos = SetFilePointer((HANDLE)fdinfo(_fildes)->hFile, _offset, NULL, _whence);
if (newpos == INVALID_SET_FILE_POINTER) {
DWORD oserror = GetLastError();
if (oserror != 0) {
_dosmaperr(oserror);
return -1L;
}
}
return newpos;
}