summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorrcitachi <[email protected]>2023-11-29 14:08:47 +0800
committerGitHub <[email protected]>2023-11-29 14:08:47 +0800
commit1e6b2a81d026e737dcaa7ab5de591afe04ac3ff1 (patch)
tree88dfa5800e28099e7d1653ff31974c84ff47634c /components
parent74925f43eda4b09bfd26c38beaf366481d784505 (diff)
修复 #8293 问题 (#8307)
Diffstat (limited to 'components')
-rw-r--r--components/lwp/lwp_syscall.c7
-rw-r--r--components/net/sal/include/sal_socket.h24
-rw-r--r--components/net/sal/src/sal_socket.c4
3 files changed, 14 insertions, 21 deletions
diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c
index d2177539df..73cff9577e 100644
--- a/components/lwp/lwp_syscall.c
+++ b/components/lwp/lwp_syscall.c
@@ -3953,7 +3953,7 @@ out:
}
sysret_t sys_socketpair(int domain, int type, int protocol, int fd[2])
-{
+{
#ifdef RT_USING_SAL
int ret = 0;
int k_fd[2];
@@ -7045,8 +7045,13 @@ const static struct rt_syscall_def func_table[] =
SYSCALL_SIGN(sys_ftruncate),
SYSCALL_SIGN(sys_setitimer),
SYSCALL_SIGN(sys_utimensat),
+#ifdef RT_USING_POSIX_SOCKET
SYSCALL_SIGN(sys_notimpl),
SYSCALL_SIGN(sys_socketpair), /* 205 */
+#else
+ SYSCALL_SIGN(sys_notimpl),
+ SYSCALL_SIGN(sys_notimpl),
+#endif
};
const void *lwp_get_sys_api(rt_uint32_t number)
diff --git a/components/net/sal/include/sal_socket.h b/components/net/sal/include/sal_socket.h
index 52767ece67..524ce86985 100644
--- a/components/net/sal/include/sal_socket.h
+++ b/components/net/sal/include/sal_socket.h
@@ -186,11 +186,11 @@ struct sockaddr
/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */
struct sockaddr_un
{
- unsigned short sa_family;
+ uint8_t sa_len;
+ sa_family_t sa_family;
char sun_path[108]; /* Path name. */
};
-
#if NETDEV_IPV4
/* members are in network byte order */
struct sockaddr_in
@@ -227,16 +227,6 @@ struct sockaddr_storage
#endif /* NETDEV_IPV6 */
};
-/* LWIPPTP_SWREQ_0036 */
-#ifndef __DEFINED_struct_iovec
-struct iovec
-{
- void *iov_base;
- size_t iov_len;
-};
-#endif
-
-/* LWIPPTP_SWREQ_0036 */
struct msghdr
{
void *msg_name;
@@ -248,7 +238,6 @@ struct msghdr
int msg_flags;
};
-/* LWIPPTP_SWREQ_0036 */
/* RFC 3542, Section 20: Ancillary Data */
struct cmsghdr
{
@@ -257,7 +246,6 @@ struct cmsghdr
int cmsg_type; /* protocol-specific type */
};
-/* LWIPPTP_SWREQ_0036 */
#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
#define CMSG_ALIGN(len) (((len) + sizeof(long) - 1) & ~(sizeof(long)-1))
@@ -297,7 +285,7 @@ static inline struct cmsghdr *cmsg_nxthdr(struct msghdr *_msg, struct cmsghdr *_
}
#define IFNAMSIZ 16
-struct sal_ifmap
+struct sal_ifmap
{
unsigned long int mem_start;
unsigned long int mem_end;
@@ -307,13 +295,13 @@ struct sal_ifmap
unsigned char port;
};
-struct sal_ifreq
+struct sal_ifreq
{
- union
+ union
{
char ifrn_name[IFNAMSIZ];
} ifr_ifrn;
- union
+ union
{
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
diff --git a/components/net/sal/src/sal_socket.c b/components/net/sal/src/sal_socket.c
index 782710edcf..4733ffebaa 100644
--- a/components/net/sal/src/sal_socket.c
+++ b/components/net/sal/src/sal_socket.c
@@ -445,7 +445,7 @@ static int socket_init(int family, int type, int protocol, struct sal_socket **r
rt_bool_t flag = RT_FALSE;
if (family == AF_UNIX)
- {
+ {
netdv_def = netdev_lo;
}
@@ -685,7 +685,7 @@ int sal_bind(int socket, const struct sockaddr *name, socklen_t namelen)
addr_un = (struct sockaddr_un *)name;
if (addr_un->sa_family != AF_UNIX)
- {
+ {
/* bind network interface by ip address */
sal_sockaddr_to_ipaddr(name, &input_ipaddr);