修复 #8293 问题 (#8307)

This commit is contained in:
rcitachi 2023-11-29 14:08:47 +08:00 committed by GitHub
parent 74925f43ed
commit 1e6b2a81d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 21 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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);