freebsd32: remove freebsd32_recvfrom
The freebsd32_recvfrom() serves no purpose as no arguments require translation. The prototype was mis-declared and the implementation contained (relatively harmless) errors. Reviewed by: kevans
This commit is contained in:
parent
ad58266704
commit
dbb47e9264
@ -1603,37 +1603,6 @@ out:
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
freebsd32_recvfrom(struct thread *td,
|
||||
struct freebsd32_recvfrom_args *uap)
|
||||
{
|
||||
struct msghdr msg;
|
||||
struct iovec aiov;
|
||||
int error;
|
||||
|
||||
if (uap->fromlenaddr) {
|
||||
error = copyin(PTRIN(uap->fromlenaddr), &msg.msg_namelen,
|
||||
sizeof(msg.msg_namelen));
|
||||
if (error)
|
||||
return (error);
|
||||
} else {
|
||||
msg.msg_namelen = 0;
|
||||
}
|
||||
|
||||
msg.msg_name = PTRIN(uap->from);
|
||||
msg.msg_iov = &aiov;
|
||||
msg.msg_iovlen = 1;
|
||||
aiov.iov_base = PTRIN(uap->buf);
|
||||
aiov.iov_len = uap->len;
|
||||
msg.msg_control = NULL;
|
||||
msg.msg_flags = uap->flags;
|
||||
error = kern_recvit(td, uap->s, &msg, UIO_USERSPACE, NULL);
|
||||
if (error == 0 && uap->fromlenaddr)
|
||||
error = copyout(&msg.msg_namelen, PTRIN(uap->fromlenaddr),
|
||||
sizeof (msg.msg_namelen));
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
freebsd32_settimeofday(struct thread *td,
|
||||
struct freebsd32_settimeofday_args *uap)
|
||||
|
@ -59,14 +59,6 @@ struct freebsd32_sendmsg_args {
|
||||
char msg_l_[PADL_(const struct msghdr32 *)]; const struct msghdr32 * msg; char msg_r_[PADR_(const struct msghdr32 *)];
|
||||
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
|
||||
};
|
||||
struct freebsd32_recvfrom_args {
|
||||
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
|
||||
char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
|
||||
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
|
||||
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
|
||||
char from_l_[PADL_(struct sockaddr *)]; struct sockaddr * from; char from_r_[PADR_(struct sockaddr *)];
|
||||
char fromlenaddr_l_[PADL_(uint32_t)]; uint32_t fromlenaddr; char fromlenaddr_r_[PADR_(uint32_t)];
|
||||
};
|
||||
struct freebsd32_sigaltstack_args {
|
||||
char ss_l_[PADL_(const struct sigaltstack32 *)]; const struct sigaltstack32 * ss; char ss_r_[PADR_(const struct sigaltstack32 *)];
|
||||
char oss_l_[PADL_(struct sigaltstack32 *)]; struct sigaltstack32 * oss; char oss_r_[PADR_(struct sigaltstack32 *)];
|
||||
@ -759,7 +751,6 @@ int freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *);
|
||||
int freebsd32_ptrace(struct thread *, struct freebsd32_ptrace_args *);
|
||||
int freebsd32_recvmsg(struct thread *, struct freebsd32_recvmsg_args *);
|
||||
int freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *);
|
||||
int freebsd32_recvfrom(struct thread *, struct freebsd32_recvfrom_args *);
|
||||
int freebsd32_sigaltstack(struct thread *, struct freebsd32_sigaltstack_args *);
|
||||
int freebsd32_ioctl(struct thread *, struct freebsd32_ioctl_args *);
|
||||
int freebsd32_execve(struct thread *, struct freebsd32_execve_args *);
|
||||
@ -1328,7 +1319,6 @@ int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fsta
|
||||
#define FREEBSD32_SYS_AUE_freebsd32_ptrace AUE_PTRACE
|
||||
#define FREEBSD32_SYS_AUE_freebsd32_recvmsg AUE_RECVMSG
|
||||
#define FREEBSD32_SYS_AUE_freebsd32_sendmsg AUE_SENDMSG
|
||||
#define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM
|
||||
#define FREEBSD32_SYS_AUE_ofreebsd32_stat AUE_STAT
|
||||
#define FREEBSD32_SYS_AUE_ofreebsd32_lstat AUE_LSTAT
|
||||
#define FREEBSD32_SYS_AUE_ofreebsd32_sigaction AUE_SIGACTION
|
||||
|
@ -34,7 +34,7 @@
|
||||
#define FREEBSD32_SYS_freebsd32_ptrace 26
|
||||
#define FREEBSD32_SYS_freebsd32_recvmsg 27
|
||||
#define FREEBSD32_SYS_freebsd32_sendmsg 28
|
||||
#define FREEBSD32_SYS_freebsd32_recvfrom 29
|
||||
#define FREEBSD32_SYS_recvfrom 29
|
||||
#define FREEBSD32_SYS_accept 30
|
||||
#define FREEBSD32_SYS_getpeername 31
|
||||
#define FREEBSD32_SYS_getsockname 32
|
||||
|
@ -38,7 +38,7 @@ const char *freebsd32_syscallnames[] = {
|
||||
"freebsd32_ptrace", /* 26 = freebsd32_ptrace */
|
||||
"freebsd32_recvmsg", /* 27 = freebsd32_recvmsg */
|
||||
"freebsd32_sendmsg", /* 28 = freebsd32_sendmsg */
|
||||
"freebsd32_recvfrom", /* 29 = freebsd32_recvfrom */
|
||||
"recvfrom", /* 29 = recvfrom */
|
||||
"accept", /* 30 = accept */
|
||||
"getpeername", /* 31 = getpeername */
|
||||
"getsockname", /* 32 = getsockname */
|
||||
|
@ -91,7 +91,7 @@ struct sysent freebsd32_sysent[] = {
|
||||
{ .sy_narg = AS(freebsd32_ptrace_args), .sy_call = (sy_call_t *)freebsd32_ptrace, .sy_auevent = AUE_PTRACE, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 26 = freebsd32_ptrace */
|
||||
{ .sy_narg = AS(freebsd32_recvmsg_args), .sy_call = (sy_call_t *)freebsd32_recvmsg, .sy_auevent = AUE_RECVMSG, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 27 = freebsd32_recvmsg */
|
||||
{ .sy_narg = AS(freebsd32_sendmsg_args), .sy_call = (sy_call_t *)freebsd32_sendmsg, .sy_auevent = AUE_SENDMSG, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 28 = freebsd32_sendmsg */
|
||||
{ .sy_narg = AS(freebsd32_recvfrom_args), .sy_call = (sy_call_t *)freebsd32_recvfrom, .sy_auevent = AUE_RECVFROM, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 29 = freebsd32_recvfrom */
|
||||
{ .sy_narg = AS(recvfrom_args), .sy_call = (sy_call_t *)sys_recvfrom, .sy_auevent = AUE_RECVFROM, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 29 = recvfrom */
|
||||
{ .sy_narg = AS(accept_args), .sy_call = (sy_call_t *)sys_accept, .sy_auevent = AUE_ACCEPT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 30 = accept */
|
||||
{ .sy_narg = AS(getpeername_args), .sy_call = (sy_call_t *)sys_getpeername, .sy_auevent = AUE_GETPEERNAME, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 31 = getpeername */
|
||||
{ .sy_narg = AS(getsockname_args), .sy_call = (sy_call_t *)sys_getsockname, .sy_auevent = AUE_GETSOCKNAME, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 32 = getsockname */
|
||||
|
@ -196,15 +196,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
|
||||
*n_args = 3;
|
||||
break;
|
||||
}
|
||||
/* freebsd32_recvfrom */
|
||||
/* recvfrom */
|
||||
case 29: {
|
||||
struct freebsd32_recvfrom_args *p = params;
|
||||
struct recvfrom_args *p = params;
|
||||
iarg[0] = p->s; /* int */
|
||||
uarg[1] = (intptr_t)p->buf; /* void * */
|
||||
uarg[2] = p->len; /* size_t */
|
||||
iarg[3] = p->flags; /* int */
|
||||
uarg[4] = (intptr_t)p->from; /* struct sockaddr * */
|
||||
uarg[5] = p->fromlenaddr; /* uint32_t */
|
||||
uarg[5] = (intptr_t)p->fromlenaddr; /* __socklen_t * */
|
||||
*n_args = 6;
|
||||
break;
|
||||
}
|
||||
@ -3720,7 +3720,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* freebsd32_recvfrom */
|
||||
/* recvfrom */
|
||||
case 29:
|
||||
switch (ndx) {
|
||||
case 0:
|
||||
@ -3739,7 +3739,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
p = "userland struct sockaddr *";
|
||||
break;
|
||||
case 5:
|
||||
p = "uint32_t";
|
||||
p = "userland __socklen_t *";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -9360,7 +9360,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* freebsd32_recvfrom */
|
||||
/* recvfrom */
|
||||
case 29:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
|
@ -109,10 +109,10 @@
|
||||
int flags); }
|
||||
28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, \
|
||||
const struct msghdr32 *msg, int flags); }
|
||||
29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, void *buf, \
|
||||
29 AUE_RECVFROM NOPROTO { int recvfrom(int s, void *buf, \
|
||||
size_t len, int flags, \
|
||||
struct sockaddr *from, \
|
||||
uint32_t fromlenaddr); }
|
||||
__socklen_t *fromlenaddr); }
|
||||
30 AUE_ACCEPT NOPROTO { int accept(int s, struct sockaddr *name, \
|
||||
int *anamelen); }
|
||||
31 AUE_GETPEERNAME NOPROTO { int getpeername(int fdes, \
|
||||
|
Loading…
x
Reference in New Issue
Block a user