1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

64-bit paltforms, like x86_64, do not use multiplexing on

socketcall system calls.

Differential Revision:	https://reviews.freebsd.org/D1065
Reviewed by:	trasz
This commit is contained in:
Dmitry Chagin 2015-05-24 15:41:27 +00:00
parent 297f61cc01
commit a12b9b3d96
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283413
2 changed files with 146 additions and 122 deletions

View File

@ -585,15 +585,6 @@ linux_check_hdrincl(struct thread *td, int s)
return (optval == 0);
}
struct linux_sendto_args {
int s;
l_uintptr_t msg;
int len;
int flags;
l_uintptr_t to;
int tolen;
};
/*
* Updated sendto() when IP_HDRINCL is set:
* tweak endian-dependent fields in the IP packet.
@ -645,13 +636,7 @@ linux_sendto_hdrincl(struct thread *td, struct linux_sendto_args *linux_args)
return (error);
}
struct linux_socket_args {
int domain;
int type;
int protocol;
};
static int
int
linux_socket(struct thread *td, struct linux_socket_args *args)
{
struct socket_args /* {
@ -715,13 +700,7 @@ linux_socket(struct thread *td, struct linux_socket_args *args)
return (retval_socket);
}
struct linux_bind_args {
int s;
l_uintptr_t name;
int namelen;
};
static int
int
linux_bind(struct thread *td, struct linux_bind_args *args)
{
struct sockaddr *sa;
@ -739,13 +718,6 @@ linux_bind(struct thread *td, struct linux_bind_args *args)
return (error);
}
struct linux_connect_args {
int s;
l_uintptr_t name;
int namelen;
};
int linux_connect(struct thread *, struct linux_connect_args *);
int
linux_connect(struct thread *td, struct linux_connect_args *args)
{
@ -790,12 +762,7 @@ linux_connect(struct thread *td, struct linux_connect_args *args)
return (error);
}
struct linux_listen_args {
int s;
int backlog;
};
static int
int
linux_listen(struct thread *td, struct linux_listen_args *args)
{
struct listen_args /* {
@ -856,13 +823,7 @@ linux_accept_common(struct thread *td, int s, l_uintptr_t addr,
return (error);
}
struct linux_accept_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
static int
int
linux_accept(struct thread *td, struct linux_accept_args *args)
{
@ -870,14 +831,7 @@ linux_accept(struct thread *td, struct linux_accept_args *args)
args->namelen, 0));
}
struct linux_accept4_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
int flags;
};
static int
int
linux_accept4(struct thread *td, struct linux_accept4_args *args)
{
@ -885,13 +839,7 @@ linux_accept4(struct thread *td, struct linux_accept4_args *args)
args->namelen, args->flags));
}
struct linux_getsockname_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
static int
int
linux_getsockname(struct thread *td, struct linux_getsockname_args *args)
{
struct getsockname_args /* {
@ -915,13 +863,7 @@ linux_getsockname(struct thread *td, struct linux_getsockname_args *args)
return (0);
}
struct linux_getpeername_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
static int
int
linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
{
struct getpeername_args /* {
@ -944,14 +886,7 @@ linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
return (0);
}
struct linux_socketpair_args {
int domain;
int type;
int protocol;
l_uintptr_t rsv;
};
static int
int
linux_socketpair(struct thread *td, struct linux_socketpair_args *args)
{
struct socketpair_args /* {
@ -1007,6 +942,7 @@ linux_socketpair(struct thread *td, struct linux_socketpair_args *args)
return (error);
}
#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
struct linux_send_args {
int s;
l_uintptr_t msg;
@ -1062,8 +998,9 @@ linux_recv(struct thread *td, struct linux_recv_args *args)
bsd_args.fromlenaddr = 0;
return (sys_recvfrom(td, &bsd_args));
}
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
static int
int
linux_sendto(struct thread *td, struct linux_sendto_args *args)
{
struct msghdr msg;
@ -1087,16 +1024,7 @@ linux_sendto(struct thread *td, struct linux_sendto_args *args)
return (error);
}
struct linux_recvfrom_args {
int s;
l_uintptr_t buf;
int len;
int flags;
l_uintptr_t from;
l_uintptr_t fromlen;
};
static int
int
linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
{
struct recvfrom_args /* {
@ -1136,13 +1064,7 @@ linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
return (0);
}
struct linux_sendmsg_args {
int s;
l_uintptr_t msg;
int flags;
};
static int
int
linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
{
struct cmsghdr *cmsg;
@ -1279,13 +1201,7 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
return (error);
}
struct linux_recvmsg_args {
int s;
l_uintptr_t msg;
int flags;
};
static int
int
linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
{
struct cmsghdr *cm;
@ -1452,12 +1368,7 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
return (error);
}
struct linux_shutdown_args {
int s;
int how;
};
static int
int
linux_shutdown(struct thread *td, struct linux_shutdown_args *args)
{
struct shutdown_args /* {
@ -1470,15 +1381,7 @@ linux_shutdown(struct thread *td, struct linux_shutdown_args *args)
return (sys_shutdown(td, &bsd_args));
}
struct linux_setsockopt_args {
int s;
int level;
int optname;
l_uintptr_t optval;
int optlen;
};
static int
int
linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args)
{
struct setsockopt_args /* {
@ -1543,15 +1446,7 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args)
return (error);
}
struct linux_getsockopt_args {
int s;
int level;
int optname;
l_uintptr_t optval;
l_uintptr_t optlen;
};
static int
int
linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args)
{
struct getsockopt_args /* {
@ -1654,6 +1549,7 @@ static const unsigned char lxs_args[] = {
#define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1
#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_socketcall(struct thread *td, struct linux_socketcall_args *args)
{
@ -1710,3 +1606,4 @@ linux_socketcall(struct thread *td, struct linux_socketcall_args *args)
uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what);
return (ENOSYS);
}
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */

View File

@ -116,6 +116,133 @@ struct l_ucred {
uint32_t gid;
};
#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
struct linux_sendto_args {
int s;
l_uintptr_t msg;
int len;
int flags;
l_uintptr_t to;
int tolen;
};
struct linux_socket_args {
int domain;
int type;
int protocol;
};
struct linux_bind_args {
int s;
l_uintptr_t name;
int namelen;
};
struct linux_connect_args {
int s;
l_uintptr_t name;
int namelen;
};
struct linux_listen_args {
int s;
int backlog;
};
struct linux_accept_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
struct linux_accept4_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
int flags;
};
struct linux_getsockname_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
struct linux_getpeername_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
struct linux_socketpair_args {
int domain;
int type;
int protocol;
l_uintptr_t rsv;
};
struct linux_recvfrom_args {
int s;
l_uintptr_t buf;
int len;
int flags;
l_uintptr_t from;
l_uintptr_t fromlen;
};
struct linux_sendmsg_args {
int s;
l_uintptr_t msg;
int flags;
};
struct linux_recvmsg_args {
int s;
l_uintptr_t msg;
int flags;
};
struct linux_shutdown_args {
int s;
int how;
};
struct linux_setsockopt_args {
int s;
int level;
int optname;
l_uintptr_t optval;
int optlen;
};
struct linux_getsockopt_args {
int s;
int level;
int optname;
l_uintptr_t optval;
l_uintptr_t optlen;
};
int linux_socket(struct thread *td, struct linux_socket_args *args);
int linux_bind(struct thread *td, struct linux_bind_args *args);
int linux_connect(struct thread *, struct linux_connect_args *);
int linux_listen(struct thread *td, struct linux_listen_args *args);
int linux_accept(struct thread *td, struct linux_accept_args *args);
int linux_accept4(struct thread *td, struct linux_accept4_args *args);
int linux_getsockname(struct thread *td, struct linux_getsockname_args *args);
int linux_getpeername(struct thread *td, struct linux_getpeername_args *args);
int linux_socketpair(struct thread *td, struct linux_socketpair_args *args);
int linux_sendto(struct thread *td, struct linux_sendto_args *args);
int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args);
int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args);
int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args);
int linux_shutdown(struct thread *td, struct linux_shutdown_args *args);
int linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args);
int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args);
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
/* Operations for socketcall */
#define LINUX_SOCKET 1