summaryrefslogtreecommitdiffstats
path: root/sys/compat/freebsd32
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-07-10 21:38:17 +0000
committerjhb <jhb@FreeBSD.org>2006-07-10 21:38:17 +0000
commitcfc179a934e59efac00bc180f5be3a2b057380e2 (patch)
tree72fc2b0a9892ae5c4b123960773ce52272dcdbf6 /sys/compat/freebsd32
parentee41eea4035fade747b35dc78c1a1c3458abbf66 (diff)
downloadFreeBSD-src-cfc179a934e59efac00bc180f5be3a2b057380e2.zip
FreeBSD-src-cfc179a934e59efac00bc180f5be3a2b057380e2.tar.gz
- Split out kern_accept(), kern_getpeername(), and kern_getsockname() for
use by ABI emulators. - Alter the interface of kern_recvit() somewhat. Specifically, go ahead and hard code UIO_USERSPACE in the uio as that's what all the callers specify. In place, add a new uioseg to indicate what type of pointer is in mp->msg_name. Previously it was always a userland address, but ABI emulators may pass in kernel-side sockaddrs. Also, remove the namelenp field and instead require the two places that used it to explicitly copy mp->msg_namelen out to userland. - Use the patched kern_recvit() to replace svr4_recvit() and the stock kern_sendit() to replace svr4_sendit(). - Use kern_bind() instead of stackgap use in ti_bind(). - Use kern_getpeername() and kern_getsockname() instead of stackgap in svr4_stream_ti_ioctl(). - Use kern_connect() instead of stackgap in svr4_do_putmsg(). - Use kern_getpeername() and kern_accept() instead of stackgap in svr4_do_getmsg(). - Retire the stackgap from SVR4 compat as it is no longer used.
Diffstat (limited to 'sys/compat/freebsd32')
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index e219c73..2515fe9 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -1009,7 +1009,7 @@ freebsd32_recvmsg(td, uap)
msg.msg_iov = iov;
controlp = (msg.msg_control != NULL) ? &control : NULL;
- error = kern_recvit(td, uap->s, &msg, NULL, UIO_USERSPACE, controlp);
+ error = kern_recvit(td, uap->s, &msg, UIO_USERSPACE, controlp);
if (error == 0) {
msg.msg_iov = uiov;
@@ -1149,8 +1149,10 @@ freebsd32_recvfrom(struct thread *td,
aiov.iov_len = uap->len;
msg.msg_control = NULL;
msg.msg_flags = uap->flags;
- error = kern_recvit(td, uap->s, &msg, PTRIN(uap->fromlenaddr),
- UIO_USERSPACE, NULL);
+ 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);
}
OpenPOWER on IntegriCloud