mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-25 07:33:11 +00:00
Support for 32bit errno codes
This commit is contained in:
parent
ff3fe1f489
commit
703a22fae5
@ -216,8 +216,8 @@ struct lwip_sock {
|
|||||||
u16_t sendevent;
|
u16_t sendevent;
|
||||||
/** error happened for this socket, set by event_callback(), tested by select */
|
/** error happened for this socket, set by event_callback(), tested by select */
|
||||||
u16_t errevent;
|
u16_t errevent;
|
||||||
/** last error that occurred on this socket (in fact, all our errnos fit into an u8_t) */
|
/** last error that occurred on this socket */
|
||||||
u8_t err;
|
int err;
|
||||||
/** counter of how many threads are waiting for this socket using select */
|
/** counter of how many threads are waiting for this socket using select */
|
||||||
SELWAIT_T select_waiting;
|
SELWAIT_T select_waiting;
|
||||||
};
|
};
|
||||||
@ -295,7 +295,7 @@ static volatile int select_cb_ctr;
|
|||||||
|
|
||||||
#define sock_set_errno(sk, e) do { \
|
#define sock_set_errno(sk, e) do { \
|
||||||
const int sockerr = (e); \
|
const int sockerr = (e); \
|
||||||
sk->err = (u8_t)sockerr; \
|
sk->err = sockerr; \
|
||||||
set_errno(sockerr); \
|
set_errno(sockerr); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@ -305,8 +305,8 @@ static void event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len
|
|||||||
static void lwip_getsockopt_callback(void *arg);
|
static void lwip_getsockopt_callback(void *arg);
|
||||||
static void lwip_setsockopt_callback(void *arg);
|
static void lwip_setsockopt_callback(void *arg);
|
||||||
#endif
|
#endif
|
||||||
static u8_t lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *optlen);
|
static int lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *optlen);
|
||||||
static u8_t lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_t optlen);
|
static int lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_t optlen);
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
#if LWIP_IPV4 && LWIP_IPV6
|
||||||
static void
|
static void
|
||||||
@ -1780,7 +1780,7 @@ lwip_getsockname(int s, struct sockaddr *name, socklen_t *namelen)
|
|||||||
int
|
int
|
||||||
lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
|
lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
|
||||||
{
|
{
|
||||||
u8_t err;
|
int err;
|
||||||
struct lwip_sock *sock = get_socket(s);
|
struct lwip_sock *sock = get_socket(s);
|
||||||
#if !LWIP_TCPIP_CORE_LOCKING
|
#if !LWIP_TCPIP_CORE_LOCKING
|
||||||
LWIP_SETGETSOCKOPT_DATA_VAR_DECLARE(data);
|
LWIP_SETGETSOCKOPT_DATA_VAR_DECLARE(data);
|
||||||
@ -1875,10 +1875,10 @@ lwip_getsockopt_callback(void *arg)
|
|||||||
/** lwip_getsockopt_impl: the actual implementation of getsockopt:
|
/** lwip_getsockopt_impl: the actual implementation of getsockopt:
|
||||||
* same argument as lwip_getsockopt, either called directly or through callback
|
* same argument as lwip_getsockopt, either called directly or through callback
|
||||||
*/
|
*/
|
||||||
static u8_t
|
static int
|
||||||
lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *optlen)
|
lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *optlen)
|
||||||
{
|
{
|
||||||
u8_t err = 0;
|
int err = 0;
|
||||||
struct lwip_sock *sock = tryget_socket(s);
|
struct lwip_sock *sock = tryget_socket(s);
|
||||||
if (!sock) {
|
if (!sock) {
|
||||||
return EBADF;
|
return EBADF;
|
||||||
@ -2186,7 +2186,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt
|
|||||||
int
|
int
|
||||||
lwip_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen)
|
lwip_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen)
|
||||||
{
|
{
|
||||||
u8_t err = 0;
|
int err = 0;
|
||||||
struct lwip_sock *sock = get_socket(s);
|
struct lwip_sock *sock = get_socket(s);
|
||||||
#if !LWIP_TCPIP_CORE_LOCKING
|
#if !LWIP_TCPIP_CORE_LOCKING
|
||||||
LWIP_SETGETSOCKOPT_DATA_VAR_DECLARE(data);
|
LWIP_SETGETSOCKOPT_DATA_VAR_DECLARE(data);
|
||||||
@ -2276,10 +2276,10 @@ lwip_setsockopt_callback(void *arg)
|
|||||||
/** lwip_setsockopt_impl: the actual implementation of setsockopt:
|
/** lwip_setsockopt_impl: the actual implementation of setsockopt:
|
||||||
* same argument as lwip_setsockopt, either called directly or through callback
|
* same argument as lwip_setsockopt, either called directly or through callback
|
||||||
*/
|
*/
|
||||||
static u8_t
|
static int
|
||||||
lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_t optlen)
|
lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_t optlen)
|
||||||
{
|
{
|
||||||
u8_t err = 0;
|
int err = 0;
|
||||||
struct lwip_sock *sock = tryget_socket(s);
|
struct lwip_sock *sock = tryget_socket(s);
|
||||||
if (!sock) {
|
if (!sock) {
|
||||||
return EBADF;
|
return EBADF;
|
||||||
|
Loading…
Reference in New Issue
Block a user