Fully emulate MDIOCLIST for compat32.

MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2011-03-25 11:43:49 +00:00
parent f991044ba4
commit bc13c742fa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219988

View file

@ -64,7 +64,7 @@ freebsd32_ioctl_md(struct thread *td, struct freebsd32_ioctl_args *uap,
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, struct freebsd32_ioctl_args *uap,
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;