ReactOS 0.4.15-dev-7934-g1dc8d80
SError.c File Reference
#include "syshdrs.h"
Include dependency graph for SError.c:

Go to the source code of this file.

Functions

const charSError (int e)
 

Function Documentation

◆ SError()

const char * SError ( int  e)

Definition at line 141 of file SError.c.

142{
143#if defined(WIN32) || defined(_WINDOWS)
144 const char *cp;
145 static char estr[32];
146
147 if (e == 0)
148 e = WSAGetLastError();
149
150 if ((e >= WSABASEERR) && (e < (WSABASEERR + (sizeof(wsaerrlist) / sizeof(const char *))))) {
151 return wsaerrlist[e - WSABASEERR];
152 }
153
154 cp = strerror(e);
155 if ((cp == NULL) || (cp[0] == '\0') || (strcmp(cp, "Unknown error") == 0)) {
156 wsprintf(estr, "Error #%d", e);
157 cp = estr;
158 }
159 return cp;
160#elif defined(HAVE_STRERROR)
161 if (e == 0)
162 e = errno;
163 return strerror(e);
164#else
165 static char estr[32];
166 if (e == 0)
167 e = errno;
168 sprintf(estr, "Error #%d", e);
169 return (estr);
170#endif
171} /* SError */
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define NULL
Definition: types.h:112
#define e
Definition: ke_i.h:82
POINT cp
Definition: magnifier.c:59
#define sprintf(buf, format,...)
Definition: sprintf.c:55
const char * strerror(int err)
Definition: compat_str.c:23
#define errno
Definition: errno.h:18
#define WSABASEERR
Definition: winerror.h:1941
int PASCAL FAR WSAGetLastError(void)
Definition: dllmain.c:112
#define wsprintf
Definition: winuser.h:5865

Referenced by UniataAhciStart(), UniataAhciStatus(), UniataAhciWaitCommandReady(), and UniataSataClearErr().