Commit 78f92898 authored by Waldek Hebisch's avatar Waldek Hebisch Committed by Alexandre Julliard

Implemented _read and _lseek.

parent 7be99b01
...@@ -181,7 +181,7 @@ init CRTDLL_Init ...@@ -181,7 +181,7 @@ init CRTDLL_Init
@ cdecl _lrotl (long long) CRTDLL__lrotl @ cdecl _lrotl (long long) CRTDLL__lrotl
@ stub _lrotr @ stub _lrotr
@ stub _lsearch @ stub _lsearch
@ stub _lseek @ cdecl _lseek(long long long) CRTDLL__lseek
@ cdecl _ltoa(long str long) CRTDLL__ltoa @ cdecl _ltoa(long str long) CRTDLL__ltoa
@ stub _ltow @ stub _ltow
@ cdecl _makepath (ptr str str str str) CRTDLL__makepath @ cdecl _makepath (ptr str str str str) CRTDLL__makepath
......
...@@ -332,18 +332,6 @@ INT __cdecl CRTDLL__setjmp(LPDWORD *jmpbuf) ...@@ -332,18 +332,6 @@ INT __cdecl CRTDLL__setjmp(LPDWORD *jmpbuf)
FIXME(":(%p): stub\n",jmpbuf); FIXME(":(%p): stub\n",jmpbuf);
return 0; return 0;
} }
/*********************************************************************
* _read (CRTDLL.256)
*
* BUGS
* Unimplemented
*/
INT __cdecl CRTDLL__read(INT fd, LPVOID buf, UINT count)
{
FIXME(":(%d,%p,%d): stub\n",fd,buf,count);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/********************************************************************* /*********************************************************************
* fopen (CRTDLL.372) * fopen (CRTDLL.372)
...@@ -477,6 +465,18 @@ INT __cdecl CRTDLL_fscanf( CRTDLL_FILE *stream, LPSTR format, ... ) ...@@ -477,6 +465,18 @@ INT __cdecl CRTDLL_fscanf( CRTDLL_FILE *stream, LPSTR format, ... )
} }
/********************************************************************* /*********************************************************************
* _lseek (CRTDLL.179)
*/
LONG __cdecl CRTDLL__lseek( INT fd, LONG offset, INT whence)
{
TRACE("fd %d to 0x%08lx pos %s\n",
fd,offset,(whence==SEEK_SET)?"SEEK_SET":
(whence==SEEK_CUR)?"SEEK_CUR":
(whence==SEEK_END)?"SEEK_END":"UNKNOWN");
return SetFilePointer( fd, offset, NULL, whence );
}
/*********************************************************************
* fseek (CRTDLL.382) * fseek (CRTDLL.382)
*/ */
LONG __cdecl CRTDLL_fseek( CRTDLL_FILE *file, LONG offset, INT whence) LONG __cdecl CRTDLL_fseek( CRTDLL_FILE *file, LONG offset, INT whence)
...@@ -641,6 +641,17 @@ BOOL __cdecl CRTDLL__isatty(DWORD x) ...@@ -641,6 +641,17 @@ BOOL __cdecl CRTDLL__isatty(DWORD x)
} }
/********************************************************************* /*********************************************************************
* _read (CRTDLL.256)
*
*/
INT __cdecl CRTDLL__read(INT fd, LPVOID buf, UINT count)
{
TRACE("0x%08x bytes fd %d to %p\n", count,fd,buf);
if (!fd) fd = GetStdHandle( STD_INPUT_HANDLE );
return _lread( fd, buf, count );
}
/*********************************************************************
* _write (CRTDLL.332) * _write (CRTDLL.332)
*/ */
INT __cdecl CRTDLL__write(INT fd,LPCVOID buf,UINT count) INT __cdecl CRTDLL__write(INT fd,LPCVOID buf,UINT count)
...@@ -1219,6 +1230,8 @@ HFILE __cdecl CRTDLL__open(LPCSTR path,INT flags) ...@@ -1219,6 +1230,8 @@ HFILE __cdecl CRTDLL__open(LPCSTR path,INT flags)
} }
if (flags & 0x0008) /* O_APPEND */ if (flags & 0x0008) /* O_APPEND */
FIXME("O_APPEND not supported\n" ); FIXME("O_APPEND not supported\n" );
if (!(flags & 0x8000 /* O_BINARY */ ) || (flags & 0x4000 /* O_TEXT */))
FIXME(":text mode not supported\n");
if (flags & 0xf0f4) if (flags & 0xf0f4)
TRACE("CRTDLL_open file unsupported flags 0x%04x\n",flags); TRACE("CRTDLL_open file unsupported flags 0x%04x\n",flags);
/* End Fixme */ /* End Fixme */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment