mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-16 21:26:43 +08:00
Add errno support to if_indextoname()
This commit adds support in if_indextoname() to return ENXIO when no interface is found. This conforms to the Open Group/RFC 3493 specification In order to leverage errno set support, the set_errno macro from sockets.c was moved to sockets_priv.h
This commit is contained in:
@@ -48,6 +48,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if LWIP_SOCKET_SET_ERRNO
|
||||
#ifndef set_errno
|
||||
#define set_errno(err) do { if (err) { errno = (err); } } while(0)
|
||||
#endif
|
||||
#else /* LWIP_SOCKET_SET_ERRNO */
|
||||
#define set_errno(err)
|
||||
#endif /* LWIP_SOCKET_SET_ERRNO */
|
||||
|
||||
#if !LWIP_TCPIP_CORE_LOCKING
|
||||
/** Maximum optlen used by setsockopt/getsockopt */
|
||||
#define LWIP_SETGETSOCKOPT_MAXOPTLEN 16
|
||||
|
||||
Reference in New Issue
Block a user