ReactOS 0.4.16-dev-122-g325d74c
errno.c File Reference
#include <precomp.h>
#include "doserrmap.h"
#include <errno.h>
#include <internal/wine/msvcrt.h>
Include dependency graph for errno.c:

Go to the source code of this file.

Functions

int *CDECL _errno (void)
 
unsigned long *CDECL __doserrno (void)
 
errno_t CDECL _get_errno (int *pValue)
 
errno_t CDECL _get_doserrno (unsigned long *pValue)
 
errno_t CDECL _set_errno (int value)
 
errno_t CDECL _set_doserrno (unsigned long value)
 
void CDECL _dosmaperr (unsigned long oserror)
 
int CDECL _set_error_mode (int mode)
 
void CDECL _seterrormode (int mode)
 

Variables

int msvcrt_error_mode = MSVCRT__OUT_TO_DEFAULT
 

Function Documentation

◆ __doserrno()

unsigned long *CDECL __doserrno ( void  )

Definition at line 25 of file errno.c.

26{
27 return &(msvcrt_get_thread_data()->thread_doserrno);
28}
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31

Referenced by _cwait(), _get_doserrno(), _set_doserrno(), and msvcrt_init_fp().

◆ _dosmaperr()

void CDECL _dosmaperr ( unsigned long  oserror)

Definition at line 79 of file errno.c.

80{
81 int pos, base, lim;
82
83 _set_doserrno(oserror);
84
85 /* Use binary chop to find the corresponding errno code */
86 for (base=0, lim=sizeof(doserrmap)/sizeof(doserrmap[0]); lim; lim >>= 1) {
87 pos = base+(lim >> 1);
88 if (doserrmap[pos].winerr == oserror) {
90 return;
91 } else if (doserrmap[pos].winerr < oserror) {
92 base = pos + 1;
93 --lim;
94 }
95 }
96 /* EINVAL appears to be the default */
98}
#define EINVAL
Definition: acclib.h:90
unsigned long winerr
Definition: doserrmap.h:7
struct @4310 doserrmap[]
int en
Definition: doserrmap.h:8
errno_t CDECL _set_doserrno(unsigned long value)
Definition: errno.c:66
errno_t CDECL _set_errno(int value)
Definition: errno.c:57

Referenced by _access(), _beginthreadex(), _chdrive(), _chmod(), _chsize_s(), _close(), _commit(), _cwait(), _dup2(), _findclose(), _fstat64(), _futime(), _lseeki64(), _open_osfhandle(), _pclose(), _pipe(), _tchdir(), _tfindfirst(), _tfindnext(), _tfullpath(), _tgetcwd(), _tmkdir(), _trmdir(), _tsearchenv_s(), _unlink(), _waccess(), _wchmod(), _wfreopen(), _wremove(), _wrename(), _write(), _wsopen_s(), _wsystem(), _wunlink(), access_dirT(), do_spawnT(), read_utf8(), remove(), rename(), and system().

◆ _errno()

◆ _get_doserrno()

errno_t CDECL _get_doserrno ( unsigned long pValue)

Definition at line 45 of file errno.c.

46{
47 if (!pValue)
48 return EINVAL;
49
50 *pValue = *__doserrno();
51 return 0;
52}
PWCHAR pValue
unsigned long *CDECL __doserrno(void)
Definition: errno.c:25

◆ _get_errno()

errno_t CDECL _get_errno ( int pValue)

Definition at line 33 of file errno.c.

34{
35 if (!pValue)
36 return EINVAL;
37
38 *pValue = *_errno();
39 return 0;
40}
int *CDECL _errno(void)
Definition: errno.c:17

◆ _set_doserrno()

errno_t CDECL _set_doserrno ( unsigned long  value)

Definition at line 66 of file errno.c.

67{
68 *__doserrno() = value;
69 return 0;
70}
Definition: pdh_main.c:94

Referenced by _dosmaperr().

◆ _set_errno()

errno_t CDECL _set_errno ( int  value)

Definition at line 57 of file errno.c.

58{
59 *_errno() = value;
60 return 0;
61}

Referenced by _dosmaperr().

◆ _set_error_mode()

int CDECL _set_error_mode ( int  mode)

Definition at line 115 of file errno.c.

116{
117 const int old = msvcrt_error_mode;
118 if ( MSVCRT__REPORT_ERRMODE != mode ) {
120 }
121 return old;
122}
GLenum mode
Definition: glext.h:6217
#define MSVCRT__REPORT_ERRMODE
Definition: msvcrt.h:672
int msvcrt_error_mode
Definition: errno.c:113

◆ _seterrormode()

void CDECL _seterrormode ( int  mode)

Definition at line 127 of file errno.c.

128{
130}
UINT WINAPI SetErrorMode(IN UINT uMode)
Definition: except.c:751

Variable Documentation

◆ msvcrt_error_mode

int msvcrt_error_mode = MSVCRT__OUT_TO_DEFAULT

Definition at line 113 of file errno.c.

Referenced by _assert(), _set_error_mode(), and abort().