svn commit: r219988 - head/sys/compat/freebsd32
Konstantin Belousov
kib at FreeBSD.org
Fri Mar 25 11:43:50 UTC 2011
Author: kib
Date: Fri Mar 25 11:43:49 2011
New Revision: 219988
URL: http://svn.freebsd.org/changeset/base/219988
Log:
Fully emulate MDIOCLIST for compat32.
MFC after: 1 week
Modified:
head/sys/compat/freebsd32/freebsd32_ioctl.c
Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_ioctl.c Fri Mar 25 11:05:28 2011 (r219987)
+++ head/sys/compat/freebsd32/freebsd32_ioctl.c Fri Mar 25 11:43:49 2011 (r219988)
@@ -64,7 +64,7 @@ freebsd32_ioctl_md(struct thread *td, st
struct md_ioctl mdv;
struct md_ioctl32 md32;
u_long com = 0;
- int error;
+ int i, error;
if (uap->com & IOC_IN) {
if ((error = copyin(uap->data, &md32, sizeof(md32)))) {
@@ -116,6 +116,14 @@ freebsd32_ioctl_md(struct thread *td, st
CP(mdv, md32, md_base);
CP(mdv, md32, md_fwheads);
CP(mdv, md32, md_fwsectors);
+ if (com == MDIOCLIST) {
+ /*
+ * Use MDNPAD, and not MDNPAD32. Padding is
+ * allocated and used by compat32 ABI.
+ */
+ for (i = 0; i < MDNPAD; i++)
+ CP(mdv, md32, md_pad[i]);
+ }
error = copyout(&md32, uap->data, sizeof(md32));
}
return error;
More information about the svn-src-head
mailing list