esp-idf: Add socket support for esp-idf platform (#1364)
Support to get/set recv_buf_size/send_buf_size/reuse_port/reuse_addr for wasm app Add socket APIs for esp-idf platform Add setsockopt for linux-sgx platform
This commit is contained in:
@ -370,6 +370,24 @@ getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
setsockopt(int sockfd, int level, int optname, const void *optval,
|
||||
socklen_t optlen)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (ocall_setsockopt(&ret, sockfd, level, optname, (void *)optval, optlen)
|
||||
!= SGX_SUCCESS) {
|
||||
TRACE_OCALL_FAIL();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ret == -1)
|
||||
errno = get_errno();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
ssize_t
|
||||
sendmsg(int sockfd, const struct msghdr *msg, int flags)
|
||||
{
|
||||
|
||||
@ -312,6 +312,10 @@ socket(int domain, int type, int protocol);
|
||||
int
|
||||
getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen);
|
||||
|
||||
int
|
||||
setsockopt(int sockfd, int level, int optname, const void *optval,
|
||||
socklen_t optlen);
|
||||
|
||||
ssize_t
|
||||
sendmsg(int sockfd, const struct msghdr *msg, int flags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user