mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-09 21:26:21 +00:00
Fix NuttX build error after dev/socket was merged (#1517)
This commit is contained in:
parent
3693cbe54d
commit
3d56c8133c
|
@ -426,7 +426,7 @@ os_socket_getbooloption(bh_socket_t socket, int level, int optname,
|
||||||
assert(is_enabled);
|
assert(is_enabled);
|
||||||
|
|
||||||
int optval;
|
int optval;
|
||||||
int optval_size = sizeof(optval);
|
socklen_t optval_size = sizeof(optval);
|
||||||
if (getsockopt(socket, level, optname, &optval, &optval_size) != 0) {
|
if (getsockopt(socket, level, optname, &optval, &optval_size) != 0) {
|
||||||
return BHT_ERROR;
|
return BHT_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -523,15 +523,25 @@ os_socket_get_reuse_addr(bh_socket_t socket, bool *is_enabled)
|
||||||
int
|
int
|
||||||
os_socket_set_reuse_port(bh_socket_t socket, bool is_enabled)
|
os_socket_set_reuse_port(bh_socket_t socket, bool is_enabled)
|
||||||
{
|
{
|
||||||
|
#if defined(SO_REUSEPORT) /* NuttX doesn't have SO_REUSEPORT */
|
||||||
return os_socket_setbooloption(socket, SOL_SOCKET, SO_REUSEPORT,
|
return os_socket_setbooloption(socket, SOL_SOCKET, SO_REUSEPORT,
|
||||||
is_enabled);
|
is_enabled);
|
||||||
|
#else
|
||||||
|
errno = ENOTSUP;
|
||||||
|
return BHT_ERROR;
|
||||||
|
#endif /* defined(SO_REUSEPORT) */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
os_socket_get_reuse_port(bh_socket_t socket, bool *is_enabled)
|
os_socket_get_reuse_port(bh_socket_t socket, bool *is_enabled)
|
||||||
{
|
{
|
||||||
|
#if defined(SO_REUSEPORT) /* NuttX doesn't have SO_REUSEPORT */
|
||||||
return os_socket_getbooloption(socket, SOL_SOCKET, SO_REUSEPORT,
|
return os_socket_getbooloption(socket, SOL_SOCKET, SO_REUSEPORT,
|
||||||
is_enabled);
|
is_enabled);
|
||||||
|
#else
|
||||||
|
errno = ENOTSUP;
|
||||||
|
return BHT_ERROR;
|
||||||
|
#endif /* defined(SO_REUSEPORT) */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user