This is Unofficial EPICS BASE Doxygen Site
epicsSocketConvertErrnoToString.cpp File Reference
#include <stdio.h>
#include "osiSock.h"
#include "epicsStdio.h"
+ Include dependency graph for epicsSocketConvertErrnoToString.cpp:

Go to the source code of this file.

Functions

void epicsSocketConvertErrorToString (char *pBuf, unsigned bufSize, int theSockError)
 
void epicsSocketConvertErrnoToString (char *pBuf, unsigned bufSize)
 

Function Documentation

void epicsSocketConvertErrnoToString ( char *  pBuf,
unsigned  bufSize 
)

Definition at line 44 of file epicsSocketConvertErrnoToString.cpp.

46 {
47  epicsSocketConvertErrorToString ( pBuf, bufSize, SOCKERRNO );
48 }
#define SOCKERRNO
Definition: osdSock.h:33
void epicsSocketConvertErrorToString(char *pBuf, unsigned bufSize, int theSockError)
void epicsSocketConvertErrorToString ( char *  pBuf,
unsigned  bufSize,
int  theSockError 
)

Definition at line 18 of file epicsSocketConvertErrnoToString.cpp.

20 {
21  if ( bufSize ) {
22  /*
23  * this does not work on systems prior to W2K
24  */
25  DWORD success = FormatMessage (
26  FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
27  NULL, theSockError,
28  MAKELANGID ( LANG_NEUTRAL, SUBLANG_DEFAULT ), /* Default language */
29  pBuf, bufSize, NULL );
30  if ( ! success ) {
31  int status = epicsSnprintf (
32  pBuf, bufSize, "WINSOCK Error %d", theSockError );
33  if ( status <= 0 ) {
34  strncpy ( pBuf, "WINSOCK Error", bufSize );
35  pBuf [bufSize - 0] = '\0';
36  }
37  }
38  }
39 }
pvd::Status status
#define NULL
Definition: catime.c:38
LIBCOM_API int epicsStdCall epicsSnprintf(char *str, size_t size, const char *format,...) EPICS_PRINTF_STYLE(3