This commit is contained in:
pvvx 2017-04-22 16:44:33 +03:00
parent cf7a2d9683
commit f7b901aa27
76 changed files with 3753 additions and 3990 deletions

View file

@ -41,22 +41,22 @@
#ifdef LWIP_DEBUG
static const char *err_strerr[] = {
"Ok.", /* ERR_OK 0 */
"Out of memory error.", /* ERR_MEM -1 */
"Buffer error.", /* ERR_BUF -2 */
"Timeout.", /* ERR_TIMEOUT -3 */
"Routing problem.", /* ERR_RTE -4 */
"Operation in progress.", /* ERR_INPROGRESS -5 */
"Illegal value.", /* ERR_VAL -6 */
"Operation would block.", /* ERR_WOULDBLOCK -7 */
"Address in use.", /* ERR_USE -8 */
"Already connected.", /* ERR_ISCONN -9 */
"Connection aborted.", /* ERR_ABRT -10 */
"Connection reset.", /* ERR_RST -11 */
"Connection closed.", /* ERR_CLSD -12 */
"Not connected.", /* ERR_CONN -13 */
"Illegal argument.", /* ERR_ARG -14 */
"Low-level netif error.", /* ERR_IF -15 */
"Ok", /* ERR_OK 0 */
"Out of memory error", /* ERR_MEM -1 */
"Buffer error", /* ERR_BUF -2 */
"Timeout", /* ERR_TIMEOUT -3 */
"Routing problem", /* ERR_RTE -4 */
"Operation in progress", /* ERR_INPROGRESS -5 */
"Illegal value", /* ERR_VAL -6 */
"Operation would block", /* ERR_WOULDBLOCK -7 */
"Address in use", /* ERR_USE -8 */
"Already connected", /* ERR_ISCONN -9 */
"Connection aborted", /* ERR_ABRT -10 */
"Connection reset", /* ERR_RST -11 */
"Connection closed", /* ERR_CLSD -12 */
"Not connected", /* ERR_CONN -13 */
"Illegal argument", /* ERR_ARG -14 */
"Low-level netif error", /* ERR_IF -15 */
};
/**

View file

@ -184,7 +184,6 @@ void
lwip_socket_init(void)
{
}
/**
* Map a externally used socket index to the internal socket representation.
*
@ -213,6 +212,14 @@ get_socket(int s)
return sock;
}
/*
* pvvx: errno
*/
int lwip_last_err_socket(int s) {
struct lwip_sock * sc = get_socket(s);
if(sc) return sc->err;
else return EBADF;
}
/**
* Same as get_socket but doesn't set errno
*

View file

@ -342,6 +342,8 @@ int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptse
int lwip_ioctl(int s, long cmd, void *argp);
int lwip_fcntl(int s, int cmd, int val);
int lwip_last_err_socket(int s); // errno
#if LWIP_COMPAT_SOCKETS
#define accept(a,b,c) lwip_accept(a,b,c)
#define bind(a,b,c) lwip_bind(a,b,c)
@ -361,6 +363,7 @@ int lwip_fcntl(int s, int cmd, int val);
#define select(a,b,c,d,e) lwip_select(a,b,c,d,e)
#define ioctlsocket(a,b,c) lwip_ioctl(a,b,c)
#if LWIP_POSIX_SOCKETS_IO_NAMES
#define read(a,b,c) lwip_read(a,b,c)
#define write(a,b,c) lwip_write(a,b,c)