From nobody Wed Nov 17 20:22:34 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9491518550EC; Wed, 17 Nov 2021 20:22:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HvZ9T0qSQz4r18; Wed, 17 Nov 2021 20:22:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F1E027A0E; Wed, 17 Nov 2021 20:22:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AHKMYpu059889; Wed, 17 Nov 2021 20:22:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AHKMYCL059888; Wed, 17 Nov 2021 20:22:34 GMT (envelope-from git) Date: Wed, 17 Nov 2021 20:22:34 GMT Message-Id: <202111172022.1AHKMYCL059888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: dbb47e9264da - main - freebsd32: remove freebsd32_recvfrom List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbb47e9264da2e11d60cea466a77cf008a387428 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=dbb47e9264da2e11d60cea466a77cf008a387428 commit dbb47e9264da2e11d60cea466a77cf008a387428 Author: Brooks Davis AuthorDate: 2021-11-17 20:12:24 +0000 Commit: Brooks Davis CommitDate: 2021-11-17 20:12:24 +0000 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 --- sys/compat/freebsd32/freebsd32_misc.c | 31 -------------------------- sys/compat/freebsd32/freebsd32_proto.h | 10 --------- sys/compat/freebsd32/freebsd32_syscall.h | 2 +- sys/compat/freebsd32/freebsd32_syscalls.c | 2 +- sys/compat/freebsd32/freebsd32_sysent.c | 2 +- sys/compat/freebsd32/freebsd32_systrace_args.c | 12 +++++----- sys/compat/freebsd32/syscalls.master | 4 ++-- 7 files changed, 11 insertions(+), 52 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index a0a7f1936fc9..08abd7ac26c8 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -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) diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h index 02a199acf1df..74410d1d0698 100644 --- a/sys/compat/freebsd32/freebsd32_proto.h +++ b/sys/compat/freebsd32/freebsd32_proto.h @@ -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 diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index a52565f6803d..316d3bfd5857 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -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 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index 4a7fa66babb0..cd990811c0da 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -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 */ diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index 1eff33290dbb..20c6d7a3e8a7 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -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 */ diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 7544c55bd499..e06efa75b025 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -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"; diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 88aad1d180a5..f3c506e856b5 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -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, \