Implemented _doserrno().

svn path=/trunk/; revision=2265
This commit is contained in:
Eric Kohl 2001-10-03 02:15:55 +00:00
parent 9df4133568
commit 0f0199f381
4 changed files with 35 additions and 14 deletions

View file

@ -41,6 +41,8 @@ extern "C" {
char __validfp (FILE *f);
int __set_errno(int err);
int __set_doserrno (int error);
void *filehnd(int fn);
char __is_text_file(FILE *p);

View file

@ -10,8 +10,8 @@ static unsigned long TlsIndex = (unsigned long)-1;
static void InitThreadData(PTHREADDATA ThreadData)
{
// ThreadData->terrno = 0;
// ThreadData->tdoserrno = 0;
ThreadData->terrno = 0;
ThreadData->tdoserrno = 0;
ThreadData->fpecode = 0;

View file

@ -1,4 +1,4 @@
; $Id: msvcrt.def,v 1.14 2001/07/18 09:23:02 ekohl Exp $
; $Id: msvcrt.def,v 1.15 2001/10/03 02:15:55 ekohl Exp $
;
; ReactOS MSVCRT Compatibility Library
;
@ -96,7 +96,7 @@ __argv DATA
; __crtGetLocaleInfoW
; __crtLCMapStringA
__dllonexit
; __doserrno
__doserrno
__fpecode
__getmainargs
__initenv DATA

View file

@ -1,23 +1,42 @@
/* $Id: errno.c,v 1.3 2001/01/18 13:23:26 jean Exp $
/* $Id: errno.c,v 1.4 2001/10/03 02:15:34 ekohl Exp $
*
*/
#include <msvcrt/internal/tls.h>
int *_errno (void)
#include <msvcrt/errno.h>
#include <msvcrt/internal/tls.h>
#include <msvcrt/internal/file.h>
int *__doserrno(void)
{
return (&GetThreadData()->terrno);
return(&GetThreadData()->tdoserrno);
}
int *_errno(void)
{
return(&GetThreadData()->terrno);
}
int __set_errno (int error)
int __set_doserrno(int error)
{
PTHREADDATA ThreadData;
PTHREADDATA ThreadData;
ThreadData = GetThreadData();
if (ThreadData)
ThreadData->terrno = error;
ThreadData = GetThreadData();
if (ThreadData)
ThreadData->tdoserrno = error;
return error;
return(error);
}
int __set_errno(int error)
{
PTHREADDATA ThreadData;
ThreadData = GetThreadData();
if (ThreadData)
ThreadData->terrno = error;
return(error);
}
/* EOF */